Button&door sounds, sound looping bugfixes, positional sound bugfixes + low pass filter on distant sounds, submarine collision improvements, controller trigger bugfix, humans walk/run more slowly in water
This commit is contained in:
@@ -209,7 +209,7 @@ namespace Subsurface.Items.Components
|
||||
|
||||
if (inventory.TryPutItem(item))
|
||||
{
|
||||
isActive = true;
|
||||
IsActive = true;
|
||||
if (hideItems || (item.body!=null && !item.body.Enabled)) item.body.Enabled = false;
|
||||
|
||||
item.container = this.item;
|
||||
|
||||
@@ -148,7 +148,7 @@ namespace Subsurface.Items.Components
|
||||
|
||||
UpdateConvexHulls();
|
||||
|
||||
isActive = true;
|
||||
IsActive = true;
|
||||
}
|
||||
|
||||
private void UpdateConvexHulls()
|
||||
@@ -240,7 +240,7 @@ namespace Subsurface.Items.Components
|
||||
{
|
||||
if (!isStuck)
|
||||
{
|
||||
OpenState += deltaTime * ((isOpen) ? 3.0f : -3.0f);
|
||||
OpenState += deltaTime * ((isOpen) ? 2.0f : -1.0f);
|
||||
LinkedGap.Open = openState;
|
||||
}
|
||||
|
||||
@@ -327,10 +327,13 @@ namespace Subsurface.Items.Components
|
||||
if (connection.Name=="toggle")
|
||||
{
|
||||
isOpen = !isOpen;
|
||||
PlaySound(ActionType.OnUse, item.Position);
|
||||
}
|
||||
else if (connection.Name == "set_state")
|
||||
{
|
||||
isOpen = (signal!="0");
|
||||
bool newState = (signal!="0");
|
||||
if (isOpen!=newState) PlaySound(ActionType.OnUse, item.Position);
|
||||
isOpen = newState;
|
||||
}
|
||||
|
||||
//opening a partially stuck door makes it less stuck
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace Subsurface.Items.Components
|
||||
if (picker.Inventory == null) return;
|
||||
|
||||
item.body.Enabled = true;
|
||||
isActive = false;
|
||||
IsActive = false;
|
||||
|
||||
//item.Unequip();
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace Subsurface.Items.Components
|
||||
if (picker.TrySelectItem(item))
|
||||
{
|
||||
item.body.Enabled = true;
|
||||
isActive = true;
|
||||
IsActive = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ namespace Subsurface.Items.Components
|
||||
picker.DeselectItem(item);
|
||||
|
||||
item.body.Enabled = false;
|
||||
isActive = false;
|
||||
IsActive = false;
|
||||
}
|
||||
|
||||
public override bool Pick(Character picker)
|
||||
@@ -213,7 +213,7 @@ namespace Subsurface.Items.Components
|
||||
public override void Update(float deltaTime, Camera cam)
|
||||
{
|
||||
if (!item.body.Enabled) return;
|
||||
if (!picker.HasSelectedItem(item)) isActive = false;
|
||||
if (!picker.HasSelectedItem(item)) IsActive = false;
|
||||
|
||||
ApplyStatusEffects(ActionType.OnActive, deltaTime, picker);
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace Subsurface.Items.Components
|
||||
|
||||
hitting = true;
|
||||
|
||||
isActive = true;
|
||||
IsActive = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace Subsurface.Items.Components
|
||||
public override void Update(float deltaTime, Camera cam)
|
||||
{
|
||||
if (!item.body.Enabled) return;
|
||||
if (!picker.HasSelectedItem(item)) isActive = false;
|
||||
if (!picker.HasSelectedItem(item)) IsActive = false;
|
||||
|
||||
if (!picker.GetInputState(InputType.SecondaryHeld) && !hitting) hitPos = 0.0f;
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace Subsurface.Items.Components
|
||||
if (reload < 0.0f)
|
||||
{
|
||||
reload = 0.0f;
|
||||
isActive = false;
|
||||
IsActive = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace Subsurface.Items.Components
|
||||
{
|
||||
if (character == null) return false;
|
||||
if (!character.GetInputState(InputType.SecondaryHeld) || reload > 0.0f) return false;
|
||||
isActive = true;
|
||||
IsActive = true;
|
||||
reload = 1.0f;
|
||||
|
||||
List<Body> limbBodies = new List<Body>();
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace Subsurface.Items.Components
|
||||
|
||||
//if (DoesUseFail(character)) return false;
|
||||
|
||||
isActive = true;
|
||||
IsActive = true;
|
||||
|
||||
Vector2 targetPosition = item.body.SimPosition;
|
||||
//targetPosition = targetPosition.X, -targetPosition.Y);
|
||||
@@ -200,7 +200,7 @@ namespace Subsurface.Items.Components
|
||||
|
||||
public override void Draw(SpriteBatch spriteBatch, bool editing)
|
||||
{
|
||||
if (!isActive) return;
|
||||
if (!IsActive) return;
|
||||
|
||||
//Vector2 particleSpeed = new Vector2(
|
||||
// (float)Math.Cos(item.body.Rotation),
|
||||
@@ -219,7 +219,7 @@ namespace Subsurface.Items.Components
|
||||
|
||||
//GUI.DrawLine(spriteBatch, startPos, endPos, Color.Orange, 0.0f);
|
||||
|
||||
isActive = false;
|
||||
IsActive = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace Subsurface.Items.Components
|
||||
|
||||
throwing = true;
|
||||
|
||||
isActive = true;
|
||||
IsActive = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace Subsurface.Items.Components
|
||||
public override void Update(float deltaTime, Camera cam)
|
||||
{
|
||||
if (!item.body.Enabled) return;
|
||||
if (!picker.HasSelectedItem(item)) isActive = false;
|
||||
if (!picker.HasSelectedItem(item)) IsActive = false;
|
||||
|
||||
if (!picker.GetInputState(InputType.SecondaryHeld) && !throwing) throwPos = 0.0f;
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Subsurface.Items.Components
|
||||
|
||||
public readonly bool Loop;
|
||||
|
||||
public ItemSound(Sound sound, ActionType type, float range, bool loop = true)
|
||||
public ItemSound(Sound sound, ActionType type, float range, bool loop = false)
|
||||
{
|
||||
this.Sound = sound;
|
||||
this.Type = type;
|
||||
@@ -45,7 +45,7 @@ namespace Subsurface.Items.Components
|
||||
|
||||
protected string name;
|
||||
|
||||
protected bool isActive;
|
||||
private bool isActive;
|
||||
|
||||
protected bool characterUsable;
|
||||
|
||||
@@ -255,7 +255,8 @@ namespace Subsurface.Items.Components
|
||||
Sound sound = Sound.Load(filePath);
|
||||
|
||||
float range = ToolBox.GetAttributeFloat(subElement, "range", 800.0f);
|
||||
ItemSound itemSound = new ItemSound(sound, type, range);
|
||||
bool loop = ToolBox.GetAttributeBool(subElement, "loop", false);
|
||||
ItemSound itemSound = new ItemSound(sound, type, range, loop);
|
||||
itemSound.VolumeProperty = ToolBox.GetAttributeString(subElement, "volume", "");
|
||||
itemSound.VolumeMultiplier = ToolBox.GetAttributeFloat(subElement, "volumemultiplier", 1.0f);
|
||||
sounds.Add(itemSound);
|
||||
@@ -299,7 +300,9 @@ namespace Subsurface.Items.Components
|
||||
}
|
||||
else
|
||||
{
|
||||
itemSound.Sound.Play(GetSoundVolume(itemSound), itemSound.Range, position);
|
||||
float volume = GetSoundVolume(itemSound);
|
||||
if (volume == 0.0f) return;
|
||||
itemSound.Sound.Play(volume, itemSound.Range, position);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -322,14 +325,21 @@ namespace Subsurface.Items.Components
|
||||
|
||||
private float GetSoundVolume(ItemSound sound)
|
||||
{
|
||||
if (sound == null) return 0.0f;
|
||||
if (sound.VolumeProperty == "") return 1.0f;
|
||||
|
||||
ObjectProperty op = null;
|
||||
if (properties.TryGetValue(sound.VolumeProperty.ToLower(), out op))
|
||||
{
|
||||
float newVolume = 0.0f;
|
||||
float.TryParse(op.GetValue().ToString(), NumberStyles.Any, CultureInfo.InvariantCulture, out newVolume);
|
||||
|
||||
try
|
||||
{
|
||||
newVolume = (float)op.GetValue();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
newVolume *= sound.VolumeMultiplier;
|
||||
|
||||
return MathHelper.Clamp(newVolume, 0.0f, 1.0f);
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace Subsurface.Items.Components
|
||||
limbPositions.Add(lp);
|
||||
}
|
||||
|
||||
isActive = true;
|
||||
IsActive = true;
|
||||
}
|
||||
|
||||
public override void Update(float deltaTime, Camera cam)
|
||||
@@ -76,7 +76,7 @@ namespace Subsurface.Items.Components
|
||||
character.AnimController.Anim = AnimController.Animation.None;
|
||||
character = null;
|
||||
}
|
||||
isActive = false;
|
||||
IsActive = false;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -131,9 +131,9 @@ namespace Subsurface.Items.Components
|
||||
|
||||
public override bool Use(float deltaTime, Character activator = null)
|
||||
{
|
||||
if (activator.SelectedConstruction != item)
|
||||
if (character==null || activator!=character || character.SelectedConstruction != item)
|
||||
{
|
||||
activator = null;
|
||||
character = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -146,8 +146,7 @@ namespace Subsurface.Items.Components
|
||||
|
||||
public override void SecondaryUse(float deltaTime, Character character = null)
|
||||
{
|
||||
if (character == null) return;
|
||||
if (character.SelectedConstruction!=item)
|
||||
if (this.character == null || this.character!=character || this.character.SelectedConstruction!=item)
|
||||
{
|
||||
character = null;
|
||||
return;
|
||||
@@ -186,6 +185,9 @@ namespace Subsurface.Items.Components
|
||||
public override bool Pick(Character picker)
|
||||
{
|
||||
item.SendSignal("1", "signal_out");
|
||||
|
||||
PlaySound(ActionType.OnUse, item.Position);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -194,7 +196,7 @@ namespace Subsurface.Items.Components
|
||||
if (character!=null && character.SelectedConstruction == item)
|
||||
{
|
||||
character = null;
|
||||
isActive = false;
|
||||
IsActive = false;
|
||||
if (activator != null) activator.AnimController.Anim = AnimController.Animation.None;
|
||||
|
||||
return false;
|
||||
@@ -204,7 +206,7 @@ namespace Subsurface.Items.Components
|
||||
character = activator;
|
||||
if (activator == null) return false;
|
||||
|
||||
isActive = true;
|
||||
IsActive = true;
|
||||
}
|
||||
|
||||
item.SendSignal("1", "signal_out");
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace Subsurface.Items.Components
|
||||
public Engine(Item item, XElement element)
|
||||
: base(item, element)
|
||||
{
|
||||
isActive = true;
|
||||
IsActive = true;
|
||||
}
|
||||
|
||||
public float CurrentVolume
|
||||
|
||||
@@ -157,7 +157,7 @@ namespace Subsurface.Items.Components
|
||||
itemList.Enabled = false;
|
||||
|
||||
fabricatedItem = obj as FabricableItem;
|
||||
isActive = true;
|
||||
IsActive = true;
|
||||
|
||||
timeUntilReady = fabricatedItem.RequiredTime;
|
||||
|
||||
@@ -179,7 +179,7 @@ namespace Subsurface.Items.Components
|
||||
|
||||
new Item(fabricatedItem.TargetItem, item.Position);
|
||||
|
||||
isActive = false;
|
||||
IsActive = false;
|
||||
fabricatedItem = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Subsurface.Items.Components
|
||||
public MiniMap(Item item, XElement element)
|
||||
: base(item, element)
|
||||
{
|
||||
isActive = true;
|
||||
IsActive = true;
|
||||
}
|
||||
|
||||
public override void Update(float deltaTime, Camera cam)
|
||||
|
||||
@@ -19,10 +19,16 @@ namespace Subsurface.Items.Components
|
||||
return (running && item.Condition>0.0f);
|
||||
}
|
||||
|
||||
public float CurrFlow
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public OxygenGenerator(Item item, XElement element)
|
||||
: base(item, element)
|
||||
{
|
||||
isActive = true;
|
||||
IsActive = true;
|
||||
|
||||
ventList = new List<Vent>();
|
||||
|
||||
@@ -34,6 +40,7 @@ namespace Subsurface.Items.Components
|
||||
{
|
||||
base.Update(deltaTime, cam);
|
||||
|
||||
CurrFlow = 0.0f;
|
||||
currPowerConsumption = powerConsumption;
|
||||
|
||||
if (item.CurrentHull == null) return;
|
||||
@@ -54,11 +61,11 @@ namespace Subsurface.Items.Components
|
||||
}
|
||||
|
||||
running = true;
|
||||
|
||||
float deltaOxygen = Math.Min(voltage, 1.0f) * 50000.0f;
|
||||
item.CurrentHull.Oxygen += deltaOxygen * deltaTime;
|
||||
|
||||
UpdateVents(deltaOxygen);
|
||||
CurrFlow = Math.Min(voltage, 1.0f) * 50000.0f;
|
||||
item.CurrentHull.Oxygen += CurrFlow * deltaTime;
|
||||
|
||||
UpdateVents(CurrFlow);
|
||||
|
||||
|
||||
voltage = 0.0f;
|
||||
|
||||
@@ -35,6 +35,16 @@ namespace Subsurface.Items.Components
|
||||
set { maxFlow = value; }
|
||||
}
|
||||
|
||||
float currFlow;
|
||||
public float CurrFlow
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!IsActive) return 0.0f;
|
||||
return Math.Abs(currFlow);
|
||||
}
|
||||
}
|
||||
|
||||
public Pump(Item item, XElement element)
|
||||
: base(item, element)
|
||||
{
|
||||
@@ -55,6 +65,8 @@ namespace Subsurface.Items.Components
|
||||
|
||||
public override void Update(float deltaTime, Camera cam)
|
||||
{
|
||||
currFlow = 0.0f;
|
||||
|
||||
if (targetLevel != null)
|
||||
{
|
||||
float hullPercentage = 0.0f;
|
||||
@@ -71,14 +83,14 @@ namespace Subsurface.Items.Components
|
||||
float powerFactor = (currPowerConsumption==0.0f) ? 1.0f : voltage;
|
||||
//flowPercentage = maxFlow * powerFactor;
|
||||
|
||||
float deltaVolume = (flowPercentage/100.0f) * maxFlow * powerFactor;
|
||||
|
||||
hull1.Volume += deltaVolume;
|
||||
currFlow = (flowPercentage / 100.0f) * maxFlow * powerFactor;
|
||||
|
||||
hull1.Volume += currFlow;
|
||||
if (hull1.Volume > hull1.FullVolume) hull1.Pressure += 0.5f;
|
||||
|
||||
if (hull2 != null)
|
||||
{
|
||||
hull2.Volume -= deltaVolume;
|
||||
hull2.Volume -= currFlow;
|
||||
if (hull2.Volume > hull1.FullVolume) hull2.Pressure += 0.5f;
|
||||
}
|
||||
|
||||
@@ -90,28 +102,6 @@ namespace Subsurface.Items.Components
|
||||
hull1 = Hull.FindHull(item.Position, item.CurrentHull);
|
||||
}
|
||||
|
||||
//private void GetHulls()
|
||||
//{
|
||||
// hull1 = null;
|
||||
// hull2 = null;
|
||||
|
||||
// foreach (MapEntity e in item.linkedTo)
|
||||
// {
|
||||
// Hull hull = e as Hull;
|
||||
// if (hull == null) continue;
|
||||
|
||||
// if (hull1 == null)
|
||||
// {
|
||||
// hull1 = hull;
|
||||
// }
|
||||
// else if (hull2 == null && hull != hull1)
|
||||
// {
|
||||
// hull2 = hull;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
public override void DrawHUD(SpriteBatch spriteBatch, Character character)
|
||||
{
|
||||
int width = GuiFrame.Rect.Width, height = GuiFrame.Rect.Height;
|
||||
@@ -120,11 +110,11 @@ namespace Subsurface.Items.Components
|
||||
|
||||
GuiFrame.Draw(spriteBatch);
|
||||
|
||||
if (GUI.DrawButton(spriteBatch, new Rectangle(x + 20, y + 20, 100, 40), ((isActive) ? "TURN OFF" : "TURN ON")))
|
||||
if (GUI.DrawButton(spriteBatch, new Rectangle(x + 20, y + 20, 100, 40), ((IsActive) ? "TURN OFF" : "TURN ON")))
|
||||
{
|
||||
targetLevel = null;
|
||||
isActive = !isActive;
|
||||
if (!isActive) currPowerConsumption = 0.0f;
|
||||
IsActive = !IsActive;
|
||||
if (!IsActive) currPowerConsumption = 0.0f;
|
||||
item.NewComponentEvent(this, true);
|
||||
}
|
||||
|
||||
@@ -148,11 +138,11 @@ namespace Subsurface.Items.Components
|
||||
|
||||
if (connection.Name == "toggle")
|
||||
{
|
||||
isActive = !isActive;
|
||||
IsActive = !IsActive;
|
||||
}
|
||||
else if (connection.Name == "set_active")
|
||||
{
|
||||
isActive = (signal != "0");
|
||||
IsActive = (signal != "0");
|
||||
}
|
||||
else if (connection.Name == "set_speed")
|
||||
{
|
||||
@@ -171,13 +161,13 @@ namespace Subsurface.Items.Components
|
||||
}
|
||||
}
|
||||
|
||||
if (!isActive) currPowerConsumption = 0.0f;
|
||||
if (!IsActive) currPowerConsumption = 0.0f;
|
||||
}
|
||||
|
||||
public override void FillNetworkData(Networking.NetworkEventType type, Lidgren.Network.NetOutgoingMessage message)
|
||||
{
|
||||
message.Write(Convert.ToByte(flowPercentage+100));
|
||||
message.Write(isActive);
|
||||
message.Write(IsActive);
|
||||
}
|
||||
|
||||
public override void ReadNetworkData(Networking.NetworkEventType type, Lidgren.Network.NetIncomingMessage message)
|
||||
@@ -200,7 +190,7 @@ namespace Subsurface.Items.Components
|
||||
}
|
||||
|
||||
FlowPercentage = newFlow;
|
||||
isActive = newActive;
|
||||
IsActive = newActive;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace Subsurface.Items.Components
|
||||
|
||||
if (voltage < minVoltage) return;
|
||||
|
||||
if (GUI.DrawButton(spriteBatch, new Rectangle(x+20, y+20, 200, 30), "Activate Radar")) isActive = !isActive;
|
||||
if (GUI.DrawButton(spriteBatch, new Rectangle(x+20, y+20, 200, 30), "Activate Radar")) IsActive = !IsActive;
|
||||
|
||||
int radius = GuiFrame.Rect.Height / 2 - 10;
|
||||
DrawRadar(spriteBatch, new Rectangle((int)GuiFrame.Center.X - radius, (int)GuiFrame.Center.Y - radius, radius * 2, radius * 2));
|
||||
@@ -92,7 +92,7 @@ namespace Subsurface.Items.Components
|
||||
//lineEnd += new Vector2((float)Math.Cos(angle), (float)Math.Sin(angle)) * Math.Min(width, height) / 2.0f;
|
||||
//GUI.DrawLine(spriteBatch, GuiFrame.Center, lineEnd, Color.Green);
|
||||
|
||||
if (!isActive) return;
|
||||
if (!IsActive) return;
|
||||
|
||||
if (pingCircle!=null)
|
||||
{
|
||||
|
||||
@@ -132,7 +132,7 @@ namespace Subsurface.Items.Components
|
||||
|
||||
powerPerTemp = 1.0f;
|
||||
|
||||
isActive = true;
|
||||
IsActive = true;
|
||||
}
|
||||
|
||||
public override void Update(float deltaTime, Camera cam)
|
||||
@@ -288,7 +288,7 @@ namespace Subsurface.Items.Components
|
||||
bool valueChanged = false;
|
||||
public override void DrawHUD(SpriteBatch spriteBatch, Character character)
|
||||
{
|
||||
isActive = true;
|
||||
IsActive = true;
|
||||
|
||||
|
||||
int width = GuiFrame.Rect.Width, height = GuiFrame.Rect.Height;
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace Subsurface.Items.Components
|
||||
public Steering(Item item, XElement element)
|
||||
: base(item, element)
|
||||
{
|
||||
isActive = true;
|
||||
IsActive = true;
|
||||
}
|
||||
|
||||
public override void Update(float deltaTime, Camera cam)
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace Subsurface.Items.Components
|
||||
//maxRechargeSpeed = ToolBox.GetAttributeFloat(element, "maxinput", 10.0f);
|
||||
//maxOutput = ToolBox.GetAttributeFloat(element, "maxoutput", 10.0f);
|
||||
|
||||
isActive = true;
|
||||
IsActive = true;
|
||||
}
|
||||
|
||||
public override bool Pick(Character picker)
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Subsurface.Items.Components
|
||||
public PowerTransfer(Item item, XElement element)
|
||||
: base(item, element)
|
||||
{
|
||||
isActive = true;
|
||||
IsActive = true;
|
||||
}
|
||||
|
||||
public override void Update(float deltaTime, Camera cam)
|
||||
|
||||
@@ -45,11 +45,11 @@ namespace Subsurface.Items.Components
|
||||
[HasDefaultValue(false,true)]
|
||||
public override bool IsActive
|
||||
{
|
||||
get { return isActive; }
|
||||
get { return base.IsActive; }
|
||||
set
|
||||
{
|
||||
isActive = value;
|
||||
if (!isActive) currPowerConsumption = 0.0f;
|
||||
base.IsActive = value;
|
||||
if (!value) currPowerConsumption = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +101,6 @@ namespace Subsurface.Items.Components
|
||||
powerOnSound.Play(1.0f, 600.0f, item.Position);
|
||||
powerOnSoundPlayed = true;
|
||||
}
|
||||
ApplyStatusEffects(ActionType.OnActive, deltaTime);
|
||||
}
|
||||
else if (voltage < 0.1f)
|
||||
{
|
||||
|
||||
@@ -123,12 +123,12 @@ namespace Subsurface.Items.Components
|
||||
GameMain.World.RemoveJoint(stickJoint);
|
||||
stickJoint = null;
|
||||
|
||||
isActive = false;
|
||||
IsActive = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
isActive = false;
|
||||
IsActive = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ namespace Subsurface.Items.Components
|
||||
stickTarget = targetBody;
|
||||
GameMain.World.AddJoint(stickJoint);
|
||||
|
||||
isActive = true;
|
||||
IsActive = true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ namespace Subsurface.Items.Components
|
||||
{
|
||||
item.Combine(projectile);
|
||||
ropeBodies[ropeBodies.Length - 1].Enabled = false;
|
||||
isActive = false;
|
||||
IsActive = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ namespace Subsurface.Items.Components
|
||||
{
|
||||
if (joint != null) joint.Enabled = false;
|
||||
}
|
||||
isActive = false;
|
||||
IsActive = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -243,7 +243,7 @@ namespace Subsurface.Items.Components
|
||||
{
|
||||
base.Draw(spriteBatch);
|
||||
|
||||
if (!isActive) return;
|
||||
if (!IsActive) return;
|
||||
|
||||
RevoluteJoint firstJoint = null;
|
||||
|
||||
@@ -279,7 +279,7 @@ namespace Subsurface.Items.Components
|
||||
public void Attach(Item projectile)
|
||||
{
|
||||
reload = 0.5f;
|
||||
isActive = true;
|
||||
IsActive = true;
|
||||
|
||||
this.projectile = projectile;
|
||||
//Projectile projectileComponent = projectile.GetComponent<Projectile>();
|
||||
|
||||
@@ -60,12 +60,12 @@ namespace Subsurface.Items.Components
|
||||
case "signal_in1":
|
||||
if (signal == "0") return;
|
||||
timeSinceReceived[0] = 0.0f;
|
||||
isActive = true;
|
||||
IsActive = true;
|
||||
break;
|
||||
case "signal_in2":
|
||||
if (signal == "0") return;
|
||||
timeSinceReceived[1] = 0.0f;
|
||||
isActive = true;
|
||||
IsActive = true;
|
||||
break;
|
||||
case "set_output":
|
||||
output = signal;
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Subsurface.Items.Components
|
||||
}
|
||||
}
|
||||
|
||||
isActive = true;
|
||||
IsActive = true;
|
||||
}
|
||||
|
||||
public override void DrawHUD(SpriteBatch spriteBatch, Character character)
|
||||
@@ -67,7 +67,7 @@ namespace Subsurface.Items.Components
|
||||
public override bool Select(Character picker)
|
||||
{
|
||||
user = picker;
|
||||
isActive = true;
|
||||
IsActive = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace Subsurface.Items.Components
|
||||
|
||||
light = new LightSource(item.Position, 100.0f, Color.White);
|
||||
|
||||
isActive = true;
|
||||
IsActive = true;
|
||||
|
||||
//lightColor = new Color(ToolBox.GetAttributeVector4(element, "color", Vector4.One));
|
||||
}
|
||||
@@ -124,7 +124,7 @@ namespace Subsurface.Items.Components
|
||||
|
||||
public override void Draw(SpriteBatch spriteBatch, bool editing)
|
||||
{
|
||||
if (!isActive)
|
||||
if (!IsActive)
|
||||
{
|
||||
light.Color = Color.Transparent;
|
||||
}
|
||||
@@ -144,10 +144,10 @@ namespace Subsurface.Items.Components
|
||||
switch (connection.Name)
|
||||
{
|
||||
case "toggle":
|
||||
isActive = !isActive;
|
||||
IsActive = !IsActive;
|
||||
break;
|
||||
case "set_state":
|
||||
isActive = (signal != "0");
|
||||
IsActive = (signal != "0");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Subsurface.Items.Components
|
||||
{
|
||||
hull = Hull.FindHull(item.Position);
|
||||
|
||||
isActive = true;
|
||||
IsActive = true;
|
||||
}
|
||||
|
||||
public override void OnMapLoaded()
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace Subsurface.Items.Components
|
||||
public RegExFindComponent(Item item, XElement element)
|
||||
: base(item, element)
|
||||
{
|
||||
isActive = true;
|
||||
IsActive = true;
|
||||
}
|
||||
|
||||
public override void Update(float deltaTime, Camera cam)
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace Subsurface.Items.Components
|
||||
|
||||
item.body.Enabled = false;
|
||||
|
||||
isActive = false;
|
||||
IsActive = false;
|
||||
|
||||
//Nodes = prevNodes;
|
||||
CleanNodes();
|
||||
@@ -128,21 +128,21 @@ namespace Subsurface.Items.Components
|
||||
{
|
||||
ClearConnections();
|
||||
|
||||
isActive = true;
|
||||
IsActive = true;
|
||||
}
|
||||
|
||||
public override void Unequip(Character character)
|
||||
{
|
||||
ClearConnections();
|
||||
|
||||
isActive = false;
|
||||
IsActive = false;
|
||||
}
|
||||
|
||||
public override void Drop(Character dropper)
|
||||
{
|
||||
ClearConnections();
|
||||
|
||||
isActive = false;
|
||||
IsActive = false;
|
||||
}
|
||||
|
||||
public override void Update(float deltaTime, Camera cam)
|
||||
@@ -289,7 +289,7 @@ namespace Subsurface.Items.Components
|
||||
DrawSection(spriteBatch, Nodes[i], Nodes[i - 1], item.Color);
|
||||
}
|
||||
|
||||
if (isActive && Vector2.Distance(newNodePos, Nodes[Nodes.Count - 1]) > nodeDistance)
|
||||
if (IsActive && Vector2.Distance(newNodePos, Nodes[Nodes.Count - 1]) > nodeDistance)
|
||||
{
|
||||
DrawSection(spriteBatch, Nodes[Nodes.Count - 1], newNodePos, item.Color * 0.5f);
|
||||
//nodes.Add(newNodePos);
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace Subsurface.Items.Components
|
||||
public Turret(Item item, XElement element)
|
||||
: base(item, element)
|
||||
{
|
||||
isActive = true;
|
||||
IsActive = true;
|
||||
|
||||
barrelSprite = new Sprite(Path.GetDirectoryName(item.Prefab.ConfigFile) + "/" +element.Attribute("barrelsprite").Value,
|
||||
ToolBox.GetAttributeVector2(element, "origin", Vector2.Zero));
|
||||
@@ -81,7 +81,10 @@ namespace Subsurface.Items.Components
|
||||
|
||||
public override void Draw(SpriteBatch spriteBatch, bool editing)
|
||||
{
|
||||
barrelSprite.Draw(spriteBatch, new Vector2(item.Rect.X, -item.Rect.Y) + barrelPos, rotation + MathHelper.PiOver2, 1.0f);
|
||||
barrelSprite.Draw(spriteBatch,
|
||||
new Vector2(item.Rect.X, -item.Rect.Y) + barrelPos, Color.White,
|
||||
rotation + MathHelper.PiOver2, 1.0f,
|
||||
SpriteEffects.None, item.Sprite.Depth+0.01f);
|
||||
}
|
||||
|
||||
public override void Update(float deltaTime, Camera cam)
|
||||
@@ -198,7 +201,7 @@ namespace Subsurface.Items.Components
|
||||
|
||||
targetRotation = MathUtils.WrapAngleTwoPi(MathUtils.VectorToAngle(offset));
|
||||
|
||||
isActive = true;
|
||||
IsActive = true;
|
||||
|
||||
break;
|
||||
case "trigger_in":
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace Subsurface.Items.Components
|
||||
|
||||
item.body.Enabled = false;
|
||||
|
||||
isActive = true;
|
||||
IsActive = true;
|
||||
|
||||
limb[i] = equipLimb;
|
||||
equipLimb.WearingItem = this;
|
||||
@@ -129,7 +129,7 @@ namespace Subsurface.Items.Components
|
||||
base.Drop(dropper);
|
||||
|
||||
picker = null;
|
||||
isActive = false;
|
||||
IsActive = false;
|
||||
}
|
||||
|
||||
public override void Unequip(Character character)
|
||||
@@ -147,7 +147,7 @@ namespace Subsurface.Items.Components
|
||||
equipLimb.WearingItemSprite = null;
|
||||
}
|
||||
|
||||
isActive = false;
|
||||
IsActive = false;
|
||||
}
|
||||
|
||||
public override void UpdateBroken(float deltaTime, Camera cam)
|
||||
|
||||
Reference in New Issue
Block a user