예제 #1
0
 protected virtual void exp_gain_test(
     Game_Unit battler_1, Game_Unit battler_2,
     int attacker,
     KeyValuePair <Combat_Round_Data, List <Combat_Action_Data> > data)
 {
     if (attacker == 1)
     {
         Exp_Gain1 = Math.Max(0, Exp_Gain1);
         int uses = battler_1.weapon_use_count(data.Key.Result.hit);
         add_weapon_uses(ref Weapon_1_Uses, uses, this.weapon1);
         Wexp1 += data.Key.Result.wexp;
         if (data.Key.is_successful_hit(this.weapon1))
         {
             Full_Exp1 = true;
         }
     }
     else
     {
         Exp_Gain2 = Math.Max(0, Exp_Gain2);
         int uses = battler_2.weapon_use_count(data.Key.Result.hit);
         add_weapon_uses(ref Weapon_2_Uses, uses, this.weapon2);
         Wexp2 += data.Key.Result.wexp;
         if (data.Key.is_successful_hit(this.weapon2))
         {
             Full_Exp2 = true;
         }
     }
 }
예제 #2
0
        protected void add_solo_attack(Game_Unit battler_1, int attacker)
        {
            battler_1.start_attack(Data.Count(x => x.Key.Attacker == attacker), null);
            add_data(battler_1);
            Data[Data.Count - 1].Key.Attacker = attacker;
            // Checks if this is the first attack of this unit
            for (int i = 0; i < Data.Count - 1; i++)
            {
                if (Data[i].Key.Attacker == Data[Data.Count - 1].Key.Attacker)
                {
                    Data[Data.Count - 1].Key.First_Attack = false;
                    break;
                }
            }
            if (attacker == 1)
            {
                Attacked_1 = true;
            }
            else
            {
                Attacked_2 = true;
            }
            Data[Data.Count - 1].Key.set_attack(Distance, Data[Data.Count - 1].Value);
            // Add Attacks
            if (battler_1.actor.added_attacks.Count > 0)
            {
                foreach (int attack in battler_1.actor.added_attacks)
                {
                    Add_Attack.Add(attack == 1 ? 1 : 2);
                }
            }
            battler_1.actor.clear_added_attacks();

            Exp_Gain1 = Math.Max(0, Exp_Gain1);
            Full_Exp1 = true;
            int uses = battler_1.weapon_use_count(Data[Data.Count - 1].Key.Result.hit);

            add_weapon_uses(ref Weapon_1_Uses, uses, this.weapon1);
            Wexp1 += Data[Data.Count - 1].Key.Result.wexp;
            Data[Data.Count - 1].Key.cause_damage();
        }