コード例 #1
0
        public void Trigger(PartyMember partyMember, PartyBattleLayout partyBattleLayout)
        {
            int damage = partyMember.CalculateDamageTaken(this);
            if (damage > 0)
                partyMember.DoDamage(damage, true, false);
            if (partyMember.Alive)
                partyMember.ApplyStatusEffectsFromAttributes(setter, Attributes, battle);

            if (Attributes.Enhancement == Enhancement.Explosive)
            {
                ParticleEffect.AddExplosion(entity.GetCenter(), battle);
                List<PartyMember> partyMemberList = partyBattleLayout.GetListBehindTrap(this);
                if (partyMemberList != null && partyMemberList.Count > 0)
                {
                    PartyMember frontPartyMember = partyMemberList[0];
                    damage = frontPartyMember.CalculateDamageTaken(this);
                    frontPartyMember.DoDamage(damage, false);
                    if (frontPartyMember.Alive)
                        frontPartyMember.ApplyStatusEffectsFromAttributes(setter, Attributes, battle);
                }
            }
            else
                ParticleEffect.AddSmokePuff(entity.GetCenter(), battle);

            partyBattleLayout.RemoveTrap(this);
            Kill();
        }
コード例 #2
0
        private void _addHealth(object[] args)
        { // addHealth(string partyMemberSelector, int amount)
            string partyMemberSelector = (string)args[0];
            int    amount = (int)args[1];

            PartyMember partyMember = getPartyMemberFromSelector(partyMemberSelector);

            partyMember.DoDamage(-amount, true);
        }
コード例 #3
0
        public void Trigger(PartyMember partyMember, PartyBattleLayout partyBattleLayout)
        {
            int damage = partyMember.CalculateDamageTaken(this);

            if (damage > 0)
            {
                partyMember.DoDamage(damage, true, false);
            }
            if (partyMember.Alive)
            {
                partyMember.ApplyStatusEffectsFromAttributes(setter, Attributes, battle);
            }

            if (Attributes.Enhancement == Enhancement.Explosive)
            {
                ParticleEffect.AddExplosion(entity.GetCenter(), battle);
                List <PartyMember> partyMemberList = partyBattleLayout.GetListBehindTrap(this);
                if (partyMemberList != null && partyMemberList.Count > 0)
                {
                    PartyMember frontPartyMember = partyMemberList[0];
                    damage = frontPartyMember.CalculateDamageTaken(this);
                    frontPartyMember.DoDamage(damage, false);
                    if (frontPartyMember.Alive)
                    {
                        frontPartyMember.ApplyStatusEffectsFromAttributes(setter, Attributes, battle);
                    }
                }
            }
            else
            {
                ParticleEffect.AddSmokePuff(entity.GetCenter(), battle);
            }

            partyBattleLayout.RemoveTrap(this);
            Kill();
        }
コード例 #4
0
        private void _doDamage(object[] args)
        { // doDamage(string actorPartyMemberSelector, string targetPartyMemberSelector)
            string actorPartyMemberSelector  = (string)args[0];
            string targetPartyMemberSelector = (string)args[1];

            PartyMember actor          = getPartyMemberFromSelector(actorPartyMemberSelector);
            PartyMember selectedTarget = getPartyMemberFromSelector(targetPartyMemberSelector);

            List <PartyMember> targets;

            if (actor.EquippedWeapon == null)
            {
                targets = new List <PartyMember>(1);
                targets.Add(selectedTarget);
            }
            else
            {
                targets = getTargetsFromEnhancement(selectedTarget, actor.EquippedWeapon.Attributes.Enhancement);
                if (actor.EquippedWeapon.Attributes.Enhancement == Enhancement.Explosive)
                {
                    ParticleEffect.AddExplosion(selectedTarget.BattleEntity.GetCenter(), battle);
                }
            }

            int damage = -1;

            foreach (PartyMember target in targets)
            {
                bool breakNow = false;
                if (actor.EquippedWeapon.Attributes.Enhancement == Enhancement.Relentless)
                {
                    if (damage < 0)
                    {
                        damage = target.CalculateDamageTaken(actor);
                    }
                    int damageDealt = Math.Min(damage, target.Health);
                    target.DoDamage(damage, false);
                    damage -= damageDealt;
                    if (damage <= 0)
                    {
                        breakNow = true;
                    }
                }
                else
                {
                    damage = target.CalculateDamageTaken(actor);
                    target.DoDamage(damage, false);
                }

                if (actor.EquippedWeapon != null && target.Alive)
                {
                    target.ApplyStatusEffectsFromAttributes(actor, actor.EquippedWeapon.Attributes, battle);
                }

                if (target.EquippedShield != null)
                {
                    if (actor.EquippedWeapon.Data.WeaponType == WeaponType.Melee)
                    {
                        if (target.EquippedShield.Attributes.Enhancement == Enhancement.Spiky)
                        {
                            actor.DoDamage(Math.Max(damage / 10, 1), true, false);
                        }
                        actor.ApplyStatusEffectsFromAttributes(target, target.EquippedShield.Attributes, battle);
                    }

                    if (target.EquippedShield.Data.Script != null)
                    {
                        addNestedScriptRunner(target.EquippedShield.Data.Script, 0.0f);
                    }
                }

                if (breakNow)
                {
                    break;
                }
            }

            if (actor.EquippedWeapon != null && actor.EquippedWeapon.Attributes.Handling == Handling.Uncomfortable)
            {
                actor.DoDamage(Math.Max(actor.CalculateDamageTaken(actor) / 10, 1), true);
            }
        }