Quests, new sounds, explosives, bugfixes, asdfasdf
This commit is contained in:
@@ -392,11 +392,6 @@ namespace Subsurface
|
||||
|
||||
AnimController.FindHull();
|
||||
|
||||
//if (info.ID >= 0)
|
||||
//{
|
||||
// ID = info.ID;
|
||||
//}
|
||||
|
||||
CharacterList.Add(this);
|
||||
}
|
||||
|
||||
@@ -764,7 +759,7 @@ namespace Subsurface
|
||||
|
||||
if (Controlled.Inventory != null) Controlled.Inventory.Draw(spriteBatch);
|
||||
|
||||
if (closestItem!=null)
|
||||
if (closestItem != null && selectedConstruction==null)
|
||||
{
|
||||
Color color = Color.Orange;
|
||||
|
||||
@@ -882,12 +877,12 @@ namespace Subsurface
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
Particle p = Game1.particleManager.CreateParticle("waterblood",
|
||||
Particle p = Game1.ParticleManager.CreateParticle("waterblood",
|
||||
torso.SimPosition + new Vector2(Rand.Range(-0.5f, 0.5f), Rand.Range(-0.5f, 0.5f)),
|
||||
Vector2.Zero);
|
||||
if (p!=null) p.Size *= 2.0f;
|
||||
|
||||
Game1.particleManager.CreateParticle("bubbles",
|
||||
Game1.ParticleManager.CreateParticle("bubbles",
|
||||
torso.SimPosition,
|
||||
new Vector2(Rand.Range(-0.5f, 0.5f), Rand.Range(-1.0f,0.5f)));
|
||||
}
|
||||
@@ -1047,6 +1042,7 @@ namespace Subsurface
|
||||
if (Game1.Client != null && controlled == this)
|
||||
{
|
||||
Game1.Client.AddChatMessage("YOU HAVE DIED. Your chat messages will only be visible to other dead players.", ChatMessageType.Dead);
|
||||
Game1.LightManager.LosEnabled = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Subsurface
|
||||
|
||||
private float timer;
|
||||
|
||||
private Vector2 position;
|
||||
private Entity entity;
|
||||
|
||||
private List<IPropertyObject> targets;
|
||||
|
||||
@@ -27,12 +27,12 @@ namespace Subsurface
|
||||
delay = ToolBox.GetAttributeFloat(element, "delay", 1.0f);
|
||||
}
|
||||
|
||||
public override void Apply(ActionType type, float deltaTime, Vector2 position, List<IPropertyObject> targets)
|
||||
public override void Apply(ActionType type, float deltaTime, Entity entity, List<IPropertyObject> targets)
|
||||
{
|
||||
if (this.type != type) return;
|
||||
|
||||
timer = delay;
|
||||
this.position = position;
|
||||
this.entity = entity;
|
||||
|
||||
this.targets = targets;
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace Subsurface
|
||||
|
||||
if (timer > 0.0f) return;
|
||||
|
||||
base.Apply(1.0f, position, targets);
|
||||
base.Apply(1.0f, entity, targets);
|
||||
List.Remove(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -210,7 +210,6 @@ namespace Subsurface
|
||||
Limb torso = GetLimb(LimbType.Torso);
|
||||
Limb head = GetLimb(LimbType.Head);
|
||||
|
||||
|
||||
if (torso!=null)
|
||||
{
|
||||
colliderLimb = torso;
|
||||
@@ -223,7 +222,7 @@ namespace Subsurface
|
||||
colliderLimb = head;
|
||||
colliderHeight = HeadPosition;
|
||||
|
||||
colliderLimb.body.SmoothRotate(HeadAngle*Dir, 100.0f);
|
||||
if (onGround) colliderLimb.body.SmoothRotate(HeadAngle*Dir, 100.0f);
|
||||
}
|
||||
|
||||
Vector2 colliderPos = colliderLimb.SimPosition;
|
||||
@@ -269,18 +268,19 @@ namespace Subsurface
|
||||
onFloorTimer -= deltaTime;
|
||||
}
|
||||
|
||||
if (!onGround) return;
|
||||
|
||||
if (closestFraction == 1) //raycast didn't hit anything
|
||||
floorY = (currentHull == null || onGround) ? -1000.0f : ConvertUnits.ToSimUnits(currentHull.Rect.Y - currentHull.Rect.Height);
|
||||
floorY = (currentHull == null) ? -1000.0f : ConvertUnits.ToSimUnits(currentHull.Rect.Y - currentHull.Rect.Height);
|
||||
else
|
||||
floorY = rayStart.Y + (rayEnd.Y - rayStart.Y) * closestFraction;
|
||||
|
||||
if (Math.Abs(colliderPos.Y - floorY)<colliderHeight*1.2f && onGround)
|
||||
|
||||
|
||||
if (Math.Abs(colliderPos.Y - floorY) < colliderHeight * 1.2f)
|
||||
{
|
||||
colliderLimb.Move(new Vector2(colliderPos.X + movement.X * 0.2f, floorY + colliderHeight), 5.0f);
|
||||
}
|
||||
|
||||
//colliderLimb.body.SetTransform(Vector2.Zero, colliderLimb.Rotation);
|
||||
|
||||
float walkCycleSpeed = head.LinearVelocity.X * 0.05f;
|
||||
|
||||
walkPos -= walkCycleSpeed;
|
||||
|
||||
@@ -326,14 +326,14 @@ namespace Subsurface
|
||||
Vector2 particleVel = SimPosition - position;
|
||||
if (particleVel != Vector2.Zero) particleVel = Vector2.Normalize(particleVel);
|
||||
|
||||
Game1.particleManager.CreateParticle("blood",
|
||||
Game1.ParticleManager.CreateParticle("blood",
|
||||
SimPosition,
|
||||
particleVel * Rand.Range(1.0f, 3.0f));
|
||||
}
|
||||
|
||||
for (int i = 0; i < bloodAmount / 2; i++)
|
||||
{
|
||||
Game1.particleManager.CreateParticle("waterblood", SimPosition, Vector2.Zero);
|
||||
Game1.ParticleManager.CreateParticle("waterblood", SimPosition, Vector2.Zero);
|
||||
}
|
||||
|
||||
return new AttackResult(amount, bleedingAmount, hitArmor);
|
||||
|
||||
@@ -520,7 +520,7 @@ namespace Subsurface
|
||||
{
|
||||
|
||||
//create a splash particle
|
||||
Subsurface.Particles.Particle splash = Game1.particleManager.CreateParticle("watersplash",
|
||||
Subsurface.Particles.Particle splash = Game1.ParticleManager.CreateParticle("watersplash",
|
||||
new Vector2(limb.SimPosition.X, ConvertUnits.ToSimUnits(limbHull.Surface)),
|
||||
new Vector2(0.0f, Math.Abs(-limb.LinearVelocity.Y * 0.1f)),
|
||||
0.0f);
|
||||
@@ -530,7 +530,7 @@ namespace Subsurface
|
||||
limbHull.Rect.Y,
|
||||
limbHull.Rect.Y - limbHull.Rect.Height));
|
||||
|
||||
Game1.particleManager.CreateParticle("bubbles",
|
||||
Game1.ParticleManager.CreateParticle("bubbles",
|
||||
new Vector2(limb.SimPosition.X, ConvertUnits.ToSimUnits(limbHull.Surface)),
|
||||
limb.LinearVelocity*0.001f,
|
||||
0.0f);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using FarseerPhysics;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -148,26 +149,26 @@ namespace Subsurface
|
||||
// if (this.type == type) Apply(deltaTime, character, item);
|
||||
//}
|
||||
|
||||
public virtual void Apply(ActionType type, float deltaTime, Vector2 position, IPropertyObject target)
|
||||
public virtual void Apply(ActionType type, float deltaTime, Entity entity, IPropertyObject target)
|
||||
{
|
||||
if (targetNames == null && !targetNames.Contains(target.Name)) return;
|
||||
if (targetNames != null && !targetNames.Contains(target.Name)) return;
|
||||
|
||||
List<IPropertyObject> targets = new List<IPropertyObject>();
|
||||
targets.Add(target);
|
||||
|
||||
if (this.type == type) Apply(deltaTime, position, targets);
|
||||
if (this.type == type) Apply(deltaTime, entity, targets);
|
||||
}
|
||||
|
||||
public virtual void Apply(ActionType type, float deltaTime, Vector2 position, List<IPropertyObject> targets)
|
||||
public virtual void Apply(ActionType type, float deltaTime, Entity entity, List<IPropertyObject> targets)
|
||||
{
|
||||
if (this.type == type) Apply(deltaTime, position, targets);
|
||||
if (this.type == type) Apply(deltaTime, entity, targets);
|
||||
}
|
||||
|
||||
protected virtual void Apply(float deltaTime, Vector2 position, List<IPropertyObject> targets)
|
||||
{
|
||||
if (explosion != null) explosion.Explode(position);
|
||||
|
||||
if (sound != null) sound.Play(1.0f, 1000.0f, position);
|
||||
protected virtual void Apply(float deltaTime, Entity entity, List<IPropertyObject> targets)
|
||||
{
|
||||
if (explosion != null) explosion.Explode(entity.SimPosition);
|
||||
|
||||
if (sound != null) sound.Play(1.0f, 1000.0f, ConvertUnits.ToDisplayUnits(entity.SimPosition));
|
||||
|
||||
for (int i = 0; i < propertyNames.Count(); i++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user