Example #1
0
 private void BreakIfOff(TDCWeapon mWeapon)
 {
     var cSwitch = Entity.GetComponent<TDCSwitch>();
     if (cSwitch.IsOff) return;
     Entity.Destroy();
     TDLSounds.Play("SoundBrokenWall");
 }
Example #2
0
        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();
        }
Example #3
0
        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;
        }
Example #4
0
        // 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;
        }
Example #5
0
 private void KillBrain(TDCWeapon mWeapon)
 {
     Entity.Destroy();
     TDLSounds.Play("SoundKill1");
     TDLMethods.CheckForBrains(Field, true);
 }
Example #6
0
 private void Kill(TDCWeapon mWeapon)
 {
     Entity.Destroy();
     TDLSounds.Play("SoundKill1");
 }
Example #7
0
 private void Break(TDCWeapon mWeapon)
 {
     Entity.Destroy();
     TDLSounds.Play("SoundBrokenWall");
 }