Beispiel #1
0
 private void HealFriend()
 {
     //casts can't revive party members, certain items can, however
     if (CharacterParty[FriendlyTarget].CurrentHealth == 0)
     {
         //attempting to cast on a dead party member does nothing.
         //this space here is in preparation for the ITEM menu
     }
     else
     {
         if (OptionID == 2) //cast
         {
             if (CharacterParty[ActiveCharacter].Commands[CastID].CastType == CastType.Heal)
             {
                 CastCooldown(ref CharacterParty[ActiveCharacter].Commands[CastID]);
                 HealTarget(ref CharacterParty[FriendlyTarget].CurrentHealth, CharacterMaxHealth(FriendlyTarget), CharacterParty[ActiveCharacter].Commands[CastID].CastValue);
                 StatusHandler.Add(ref CharacterParty[FriendlyTarget].StatusList, CharacterParty[ActiveCharacter].Commands[CastID].Status);
                 CharacterParty[FriendlyTarget].ValueUpdate();
                 CharacterParty[ActiveCharacter].HealthLimit();
                 ModeBarUpdate();
                 AdvanceTurn();
             }
             else if (CharacterParty[ActiveCharacter].Commands[CastID].CastType == CastType.Fortify)
             {
                 CastCooldown(ref CharacterParty[ActiveCharacter].Commands[CastID]);
                 FortifyTarget(ref CharacterParty[FriendlyTarget].DefenceBuffList, new Defence(CharacterParty[ActiveCharacter].Commands[CastID].CastValue, CharacterParty[ActiveCharacter].Commands[CastID].Status.StatusDuration));
                 StatusHandler.Add(ref CharacterParty[FriendlyTarget].StatusList, CharacterParty[ActiveCharacter].Commands[CastID].Status);
                 CharacterParty[FriendlyTarget].ValueUpdate();
                 AdvanceTurn();
             }
         }
     }
 }
Beispiel #2
0
 private void Defend()
 {
     FortifyTarget(ref CharacterParty[ActiveCharacter].DefenceBuffList,
                   Defence.OneTurn(CharacterParty[ActiveCharacter].CurrentDefence));
     StatusHandler.Add(ref CharacterParty[ActiveCharacter].StatusList, new Status(StatusType.DefenceUp, 1));
     AdvanceTurn();
 }
Beispiel #3
0
    private void AttackEnemy()
    {
        int TotalDamage = 0;

        if (OptionID == 2) //cast
        {
            //casts bypass defence, but the values can't be influenced by attack.up or attack.down statuses
            CastCooldown(ref CharacterParty[ActiveCharacter].Commands[CastID]);
            StatusHandler.Add(ref EnemyParty[ActiveEnemy].StatusList, CharacterParty[ActiveCharacter].Commands[CastID].Status);
            TotalDamage = CalculateDamage(EnemyParty[ActiveEnemy].CurrentDefence, CharacterParty[ActiveCharacter].Commands[CastID].CastValue, 0);
        }
        else //ordinary attack
        {
            TotalDamage = CalculateDamage(EnemyParty[ActiveEnemy].CurrentDefence, CharacterParty[ActiveCharacter].CurrentAttack, CharacterParty[ActiveCharacter].CurrentLuck);
        }
        AttackTarget(ref EnemyParty[ActiveEnemy].CurrentHealth, TotalDamage);
        AddModeUp(ref CharacterParty[ActiveCharacter].CurrentModeUp, ref CharacterParty[ActiveCharacter].StatusList, TotalDamage);
        CharacterParty[ActiveCharacter].ModeUpCheck();
        ModeBarUpdate();
        AdvanceTurn();
    }