示例#1
0
 protected void add_attack(Game_Unit battler_1, Game_Unit battler_2, Scripted_Combat_Stats stats)
 {
     add_data(battler_1, battler_2, stats);
     Data[Data.Count - 1].Key.Attacker = stats.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 (stats.Attacker == 1)
     {
         Attacked_1 = true;
     }
     else
     {
         Attacked_2 = true;
     }
     Data[Data.Count - 1].Key.set_attack(Distance, Data[Data.Count - 1].Value, stats);
     // Add Attacks
     battler_1.actor.clear_added_attacks();
     battler_2.actor.clear_added_attacks();
 }
示例#2
0
        internal Combat_Round_Data(Game_Unit battler_1, Game_Unit battler_2, Scripted_Combat_Stats stats)
        {
            Battler1 = battler_1;
            Battler2 = battler_2;

            Stats = new List <int?>();
            for (int i = 0; i < 4; i++)
            {
                Stats.Add(stats.Stats_1.Count < i + 1 ? null : (int?)stats.Stats_1[i]);
            }
            for (int i = 0; i < 4; i++)
            {
                Stats.Add(stats.Stats_2.Count < i + 1 ? null : (int?)stats.Stats_2[i]);
            }
        }
示例#3
0
        internal void end_battle(Scripted_Combat_Stats stats, List <Combat_Action_Data> action_data)
        {
            List <int?> list = new List <int?>();

            for (int i = 0; i < 4; i++)
            {
                list.Add(stats.Stats_1.Count < i + 1 ? null : (int?)stats.Stats_1[i]);
            }
            for (int i = 0; i < 4; i++)
            {
                list.Add(stats.Stats_2.Count < i + 1 ? null : (int?)stats.Stats_2[i]);
            }
            action_data.Add(new Combat_Action_Data
            {
                Battler_Index = 0,
                Trigger       = (int)Combat_Action_Triggers.End,
                combat_stats  = list
            });
        }
示例#4
0
 protected void add_data(Game_Unit battler_1, Game_Unit battler_2, Scripted_Combat_Stats stats)
 {
     Data.Add(new KeyValuePair <Combat_Round_Data, List <Combat_Action_Data> >(
                  new Combat_Round_Data(battler_1, battler_2, stats), new List <Combat_Action_Data>()));
 }
示例#5
0
 private Attack_Result calculate_attack(int distance,
                                        TactileLibrary.Data_Weapon weapon, Scripted_Combat_Stats stats)
 {
     return(Combat.set_attack(this.AttackerUnit, this.TargetUnit, distance, weapon, stats));
 }
示例#6
0
        internal void set_attack(int distance, List <Combat_Action_Data> action_data, Scripted_Combat_Stats stats)
        {
            Game_Unit battler = Attacker == 1 ? Battler1 : Battler2;
            Game_Unit target  = Attacker == 2 ? Battler1 : Battler2;

            // In case of skills like Astra that turn skill_activated back on at the end of reset_skills()
            battler.skill_activated = false;
            if (target != null)
            {
                target.skill_activated = false;
            }

            TactileLibrary.Data_Weapon weapon = battler.actor.weapon;
            // Pre hit skill check, Defender (Bastion)
            //prehit_def_skill_check(distance, action_data, hit, ref hit_skill_changed); //Yeti
            // Pre hit skill check, Attcker (Spiral Dive?)
            //prehit_skill_check(distance, action_data, hit, ref hit_skill_changed); //Yeti

            // Hit test
            //bool hit = stats.Result != Attack_Results.Miss; //Debug
            //bool crt = hit && stats.Result == Attack_Results.Crit;

            // Post hit skill activation (Astra)
            //hit_skill_check(distance, action_data, is_hit, is_crt); //Yeti

            battler.hit_skill_update();
            // On hit skill activation (Determination) //Yeti
            //onhit_skill_check(distance, action_data, is_hit); //Yeti

            // Calculate attack
            Result = calculate_attack(distance, weapon, stats);

            if (Battler2 != null)
            {
                cause_damage(true);
            }
            // Attack end skill activation (Adept) //Yeti
            //posthit_skill_check(distance, action_data); //Yeti
            // Reset skills
            if (!skip_skill_update())
            {
                battler.reset_skills();
                if (target != null)
                {
                    target.reset_skills();
                }
            }
        }
示例#7
0
 public void Add(Scripted_Combat_Stats stats)
 {
     Stats.Add(stats);
 }