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