private void BreakIfOff(TDCWeapon mWeapon) { var cSwitch = Entity.GetComponent<TDCSwitch>(); if (cSwitch.IsOff) return; Entity.Destroy(); TDLSounds.Play("SoundBrokenWall"); }
public void Struck(TDCWeapon mWeapon) { if (_isBroken) { TDLSounds.Play("SoundBrokenWall"); _health--; if (_health < 2) _renderComponent.GetSprite(1).TextureRect = Assets.GetTileset("brokenoverlaytiles").GetTextureRect(1, 0); } if (_health == 0) { Entity.Destroy(); return; } TDLSounds.Play("SoundOrbHit"); _struckTime = 10; _idCallerComponent.SendCalls(); }
public static Entity WoodenSword() { var result = new Entity(Tile) {Layer = TDLLayers.Weapon}; var cRender = TDLComponentFactory.Render(@"weapon\woodensword", "dirtiles", "n", true); var cDirection = new TDCDirection(0); var cWeapon = new TDCWeapon(); var cRenderDirectionAI = new TDCRenderDirectionAI(cRender, cDirection, "dirtiles"); result.AddTags(TDLTags.Solid, TDLTags.Weapon, TDLTags.DoesNotTriggerPlate); result.AddComponents(cRender, cDirection, cWeapon, cRenderDirectionAI); Instance.AddEntity(result); return result; }
// WEAPONS public static Entity ReallyBigSword() { var result = new Entity(Tile) {Layer = TDLLayers.Weapon}; var cRender = TDLComponentFactory.Render(@"weapon\reallybigsword", "dirtiles", "n", true); var cDirection = new TDCDirection(0); var cWeapon = new TDCWeapon(); var cRenderDirectionAI = new TDCRenderDirectionAI(cRender, cDirection, "dirtiles"); cWeapon.OnEquip += mWielder => mWielder.Entity.AddTags(TDLTags.WeightHigh); cWeapon.OnUnEquip += mWielder => mWielder.Entity.RemoveTags(TDLTags.WeightHigh); result.AddTags(TDLTags.Solid, TDLTags.Weapon, TDLTags.DoesNotTriggerPlate, TDLTags.AffectedByOremites); result.AddComponents(cRender, cDirection, cWeapon, cRenderDirectionAI); Instance.AddEntity(result); return result; }
private void KillBrain(TDCWeapon mWeapon) { Entity.Destroy(); TDLSounds.Play("SoundKill1"); TDLMethods.CheckForBrains(Field, true); }
private void Kill(TDCWeapon mWeapon) { Entity.Destroy(); TDLSounds.Play("SoundKill1"); }
private void Break(TDCWeapon mWeapon) { Entity.Destroy(); TDLSounds.Play("SoundBrokenWall"); }