Exemplo n.º 1
0
        public void Kill(Battle battle)
        {
            if (BattleEntity != null)
            {
                BattleEntity.Kill();
            }

            battle.GetPartyBattleLayoutForPartyMember(this).Try(pbl => pbl.RemovePartyMember(this));
            battle.GetPartyForPartyMember(this).Try(pbl => pbl.RemovePartyMember(this));
        }
Exemplo n.º 2
0
        private void _createTrap(object[] args)
        { // createTrap(string actorPartyMemberSelector, string targetPartyMemberSelector, string spriteName)
            string actorPartyMemberSelector  = (string)args[0];
            string targetPartyMemberSelector = (string)args[1];
            string spriteName = (string)args[2];

            PartyMember actorPartyMember = getPartyMemberFromSelector(actorPartyMemberSelector);
            PartyMember frontPartyMember = getPartyMemberFromSelector(targetPartyMemberSelector + ">list>front");
            float       nudgeMultiplierX = battle.GetPartyForPartyMember(actorPartyMember) == battle.PlayerParty ? 1.0f : -1.0f;
            Rectangle   boundingBox      = frontPartyMember.BattleEntity.GetBoundingBox();
            Vector2     position         = new Vector2(boundingBox.X + (boundingBox.Width / 2.0f) + (boundingBox.Width * nudgeMultiplierX), boundingBox.Bottom);

            Trap trap = new Trap(ResourceManager.GetNewSprite(spriteName), position, actorPartyMember.EquippedWeapon.Attributes, actorPartyMember.EquippedWeapon.Data, actorPartyMember, battle);

            battle.GetPartyBattleLayoutForPartyMember(frontPartyMember).PlaceTrapInFrontOfPartyMember(frontPartyMember, trap);
        }
        public void Kill(Battle battle)
        {
            if (BattleEntity != null)
                BattleEntity.Kill();

            battle.GetPartyBattleLayoutForPartyMember(this).Try(pbl => pbl.RemovePartyMember(this));
            battle.GetPartyForPartyMember(this).Try(pbl => pbl.RemovePartyMember(this));
        }