Esempio n. 1
0
 protected override Attack_Result calculate_attack(int distance, int dmg, bool hit, bool crt,
                                                   TactileLibrary.Data_Weapon weapon)
 {
     // Healing, Status Healing, Barrier, Positive Status
     if (StaffMode == Staff_Modes.Heal)
     {
         return(Combat.set_heal(this.AttackerUnit, this.TargetUnit, distance, weapon));
     }
     // Status infliction
     else if (StaffMode == Staff_Modes.Status_Inflict)
     {
         return(Combat.set_status_staff(this.AttackerUnit, this.TargetUnit, distance, hit, weapon));
     }
     // Flare
     else if (StaffMode == Staff_Modes.Torch)
     {
         return(Combat.set_torch(this.AttackerUnit, weapon));
     }
     else
     {
         return new Attack_Result {
                    state_change = new List <KeyValuePair <int, bool> >()
         }
     };                                                                                   // Additional results add on after here //Yeti
 }
        public Animation_Setup_Data_Processor(BattlerSpriteData battler, int distance)
        {
            Key = string.Format("{0}-{1}", battler.ClassNameFull,
                                battler.UsedWeaponType);
            Distance = distance;
            Class_Id = battler.ClassId;
            Gender   = battler.ActualGender;

            TactileLibrary.Data_Weapon weapon = battler.Weapon;
            Equipped = weapon != null;
            if (Equipped)
            {
                Weapon_Main_Type = weapon.Main_Type;
                Weapon_Thrown    = weapon.Thrown(); // Factor out to actor or something to make weapons throwable by skills??? //Debug
                Weapon_Is_Staff  = weapon.is_staff();
                MWeapon          = (distance >= 2 && weapon.is_ranged_magic()) || weapon.is_always_magic();
            }
            Skill = battler.SkillEffect;

            // Skills
            Astra_Activated = battler.Unit.actor.astra_activated;
            Astra_Missed    = battler.Unit.actor.astra_missed;
            Astra_Count     = battler.Unit.actor.astra_count;
            Swoop_Activated = battler.Unit.swoop_activated;
        }
Esempio n. 3
0
 protected override int exp_gain(Game_Unit battler_1, Game_Unit battler_2, TactileLibrary.Data_Weapon weapon, bool kill)
 {
     //return Math.Max(Exp_Gain1, base.exp_gain(battler_1, battler_2, weapon, kill) / 2);
     return(Math.Min(
                Math.Max(
                    Exp_Gain1,
                    base.exp_gain(battler_1, battler_2, weapon, kill)),
                Constants.Combat.AOE_EXP_GAIN)); //Debug
 }
Esempio n. 4
0
 public override bool is_successful_hit(TactileLibrary.Data_Weapon weapon)
 {
     if (weapon.Barrier())
     {
         return(true);
     }
     // If the attacker didn't hit themself (how does this happen with staves),
     // returns true when damage or status effects happened
     return(!Result.backfire && (Result.dmg != 0 || Result.state_change.Count > 0));
 }
Esempio n. 5
0
 public static void SetWeaponTriangle(
     Weapon_Triangle_Arrow wta,
     Game_Unit attacker,
     Combat_Map_Object target,
     TactileLibrary.Data_Weapon weapon1,
     TactileLibrary.Data_Weapon weapon2,
     int distance)
 {
     SetWeaponTriangle(
         wta, null,
         attacker, target,
         weapon1, weapon2,
         distance);
 }
Esempio n. 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();
                }
            }
        }
Esempio n. 7
0
        public int get_multi(Game_Unit unit, Combat_Map_Object target, TactileLibrary.Data_Weapon weapon, int distance)
        {
            int multi = 0;

            if (!target.is_unit())
            {
                return(0);
            }
            if (weapon.Brave() && !unit.is_brave_blocked())
            {
                multi += 4;
            }
            if (unit.can_double_attack(target, distance))
            {
                multi += 2;
            }
            return(multi / 2);
        }
Esempio n. 8
0
        public static void SetWeaponTriangle(
            Weapon_Triangle_Arrow wta1,
            Weapon_Triangle_Arrow wta2,
            Game_Unit attacker,
            Combat_Map_Object target,
            TactileLibrary.Data_Weapon weapon1,
            TactileLibrary.Data_Weapon weapon2,
            int distance)
        {
            //@Yeti: use in all the places weapon triangle arrow is used
            Game_Unit targetUnit = null;

            if (target.is_unit())
            {
                targetUnit = target as Game_Unit;
            }

            ResetWeaponTriangle(wta1, wta2);
            WeaponTriangle tri = WeaponTriangle.Nothing;

            if (targetUnit != null)
            {
                tri = Combat.weapon_triangle(attacker, targetUnit, weapon1, weapon2, distance);
            }
            if (tri != WeaponTriangle.Nothing)
            {
                wta1.value = tri;
                if (wta2 != null && weapon2 != null)
                {
                    wta2.value = Combat.reverse_wta(tri);
                }
            }

            float effectiveness = weapon1.effective_multiplier(attacker, targetUnit, false);

            wta1.set_effectiveness((int)effectiveness,
                                   targetUnit != null && targetUnit.halve_effectiveness());

            if (wta2 != null && weapon2 != null)
            {
                effectiveness = weapon2.effective_multiplier(targetUnit, attacker, false);
                wta2.set_effectiveness((int)effectiveness, attacker.halve_effectiveness());
            }
        }
Esempio n. 9
0
        public virtual bool is_successful_hit(TactileLibrary.Data_Weapon weapon)
        {
            // If the attacker didn't hit themself, returns true when damage was successfully caused/the opponent was slain
            return(!Result.backfire && (Result.dmg > 0 || Result.kill));

            if (!Result.backfire) //Debug
            {
                // Technically checks if attacks miss, since missed attacks do no damage
                return(Result.dmg > 0 || Result.kill);  //Debug

                if (Attacker == 1 && Stats[1] > 0)
                {
                    return(true);
                }
                else if (Attacker == 2 && Stats[5] > 0)
                {
                    return(true);
                }
            }
            return(false);
        }
Esempio n. 10
0
        public void set_attack(int distance, List <Combat_Action_Data> action_data)
        {
            TactileLibrary.Data_Weapon weapon = Battler1.actor.weapon;
            // Hit test
            //bool[] hit_success = new bool[] { true, false }; //Debug
            //if (Stats[Attacker == 1 ? 0 : 4] != null) // Why even bother to roll RNs for this //Debug
            //    hit_success = Combat.test_hit(battler, target, distance);

            //bool hit = hit_success[0]; //Debug
            //bool crt = hit_success[1];
            List <int?> combat_stats = this.combat_stats(distance);
            int         dmg          = (int)combat_stats[1];
            bool        hit          = true;
            bool        crt          = false;

            Battler1.hit_skill_update();
            // Calculate attack
            Result = calculate_attack(distance, dmg, hit, crt, weapon);
            // Reset skills
            Battler1.reset_skills();
        }
Esempio n. 11
0
        internal static Staff_Modes get_staff_mode(int weaponId)
        {
            TactileLibrary.Data_Weapon weapon = Global.data_weapons[weaponId];

            // Healing
            if (weapon.Heals())
            {
                return(Staff_Modes.Heal);
            }
            // Status healing
            else if (!weapon.is_attack_staff() && weapon.Status_Remove.Count > 0)
            {
                return(Staff_Modes.Heal);
            }
            // Status infliction
            else if (weapon.is_attack_staff())
            {
                return(Staff_Modes.Status_Inflict);
            }
            // Barrier
            else if (weapon.Barrier())
            {
                return(Staff_Modes.Heal);
            }
            // Positive Status
            else if (weapon.Status_Inflict.Count > 0)
            {
                return(Staff_Modes.Heal);
            }
            // Flare
            else if (weapon.Torch())
            {
                return(Staff_Modes.Torch);
            }
            else
            {
                return(Staff_Modes.Other);
            }
        }
 public static Staff_Target_Mode target_mode(TactileLibrary.Data_Weapon staff)
 {
     if (staff.is_attack_staff())
     {
         return(Staff_Target_Mode.Status_Inflict);
     }
     else if (staff.Torch())
     {
         return(Staff_Target_Mode.Torch);
     }
     else if (staff.Heals())
     {
         return(Staff_Target_Mode.Heal);
     }
     else if (staff.Barrier())
     {
         return(Staff_Target_Mode.Barrier);
     }
     else
     {
         return(Staff_Target_Mode.Heal);
     }
 }
        protected override void set_images()
        {
            Game_Unit  unit   = get_unit();
            Game_Actor actor1 = unit.actor;
            Game_Unit  target = Global.game_map.units[this.target];
            Game_Actor actor2 = target.actor;

            // Get weapon data // This is dancing, why do we need weapons? //Yeti
            TactileLibrary.Data_Weapon weapon1 = actor1.weapon, weapon2 = actor2.weapon;
            // Map Sprite //
            Target_Sprite.texture = Scene_Map.get_team_map_sprite(target.team, target.map_sprite_name);
            Target_Sprite.offset  = new Vector2(
                (Target_Sprite.texture.Width / Target_Sprite.frame_count) / 2,
                (Target_Sprite.texture.Height / Target_Sprite.facing_count) - 8);
            Target_Sprite.mirrored = target.has_flipped_map_sprite;
            // Sets Name //
            Name.offset = new Vector2(-(32), -(8));
            Name.text   = actor2.name;

            Stats = new List <TextSprite>();
            for (int i = 0; i < 3; i++)
            {
                Stats.Add(i % 2 == 0 ? new RightAdjustedText() : new TextSprite());
                Stats[i].offset = new Vector2(-24 - ((i / 2) * 24), -24);
                Stats[i].SetFont(Config.UI_FONT, Global.Content, (i % 2 == 0 ? "Blue" : "White"));
            }
            Stats[1].text   = "/";
            Stats[0].offset = new Vector2(-48, -24);
            Stats[1].offset = new Vector2(-48, -24);
            Stats[2].offset = new Vector2(-72, -24);
            // Hp
            Stats[0].text = actor2.hp.ToString();
            // Max Hp
            Stats[2].text = actor2.maxhp.ToString();

            refresh();
        }
Esempio n. 14
0
 protected override bool can_counter(Game_Unit unit, Game_Unit target, TactileLibrary.Data_Weapon weapon, int distance)
 {
     return(true);
 }
Esempio n. 15
0
        protected void refresh_battle_stats(bool just_stats)
        {
            if (!just_stats)
            {
                foreach (Item_Icon_Sprite icon in Weapon_Icons)
                {
                    icon.texture = null;
                }
                foreach (TextSprite name in Weapon_Names)
                {
                    name.text = "";
                }

                TactileLibrary.Data_Weapon weapon1 = null;
                TactileLibrary.Data_Weapon weapon2 = null;
                WTAs[0].value = 0;
                if (Global.scene.scene_type == "Scene_Dance" || Global.scene.scene_type == "Scene_Promotion")
                {
                    int item_index = -1;
                    if (Global.scene.scene_type == "Scene_Dance")
                    {
                        item_index = Global.game_state.dance_item;
                    }
                    else if (Global.scene.scene_type == "Scene_Promotion")
                    {
                        item_index = Global.game_state.item_used;
                    }
                    if (item_index > -1)
                    {
                        TactileLibrary.Item_Data      item_data = battler_1.actor.items[item_index];
                        TactileLibrary.Data_Equipment item1     = item_data.to_equipment;
                        Weapon_Icons[0].texture  = Global.Content.Load <Texture2D>(@"Graphics/Icons/" + item1.Image_Name);
                        Weapon_Icons[0].index    = item1.Image_Index;
                        Weapon_Names[0].offset.X = Font_Data.text_width(item1.full_name()) / 2;
                        Weapon_Names[0].text     = item1.full_name();
                    }

                    if (battler_2 != null)
                    {
                        WTAs[1].value = 0;
                        weapon2       = battler_2.actor.weapon;
                        if (weapon2 != null)
                        {
                            Weapon_Icons[1].texture  = Global.Content.Load <Texture2D>(@"Graphics/Icons/" + weapon2.Image_Name);
                            Weapon_Icons[1].index    = weapon2.Image_Index;
                            Weapon_Names[1].offset.X = Font_Data.text_width(weapon2.full_name()) / 2;
                            Weapon_Names[1].text     = weapon2.full_name();
                        }
                    }
                }
                else
                {
                    weapon1 = battler_1.actor.weapon;
                    Weapon_Icons[0].texture = Global.Content.Load <Texture2D>(@"Graphics/Icons/" + weapon1.Image_Name);
                    Weapon_Icons[0].index   = weapon1.Image_Index;
                    if (!(Data is Staff_Data) || ((Staff_Data)Data).attack_staff)
                    {
                        Weapon_Icons[0].flash = weapon1.effective_multiplier(battler_1, battler_2) > 1;
                    }
                    Weapon_Names[0].offset.X = Font_Data.text_width(weapon1.full_name()) / 2;
                    Weapon_Names[0].text     = weapon1.full_name();


                    if (battler_2 != null)
                    {
                        WTAs[1].value = 0;
                        weapon2       = battler_2.actor.weapon;
                        if (weapon2 != null)
                        {
                            Weapon_Icons[1].texture = Global.Content.Load <Texture2D>(@"Graphics/Icons/" + weapon2.Image_Name);
                            Weapon_Icons[1].index   = weapon2.Image_Index;
                            if (!(Data is Staff_Data) || ((Staff_Data)Data).attack_staff)
                            {
                                Weapon_Icons[1].flash = weapon2.effective_multiplier(battler_2, battler_1) > 1;
                            }
                            Weapon_Names[1].offset.X = Font_Data.text_width(weapon2.full_name()) / 2;
                            Weapon_Names[1].text     = weapon2.full_name();
                            // Attack Multiplier
                            if (!weapon1.is_staff())
                            {
                            }  // Mults[1].value = Mults[1].get_multi(battler_2, battler_1, weapon2); //Debug
                        }
                        if (!weapon1.is_staff())
                        {
                            // Weapon triangle arrows
                            WeaponTriangle tri = Combat.weapon_triangle(battler_1, battler_2, weapon1, weapon2, Data.Distance);
                            if (tri != WeaponTriangle.Nothing)
                            {
                                WTAs[0].value = tri;
                                if (weapon2 != null)
                                {
                                    WTAs[1].value = Combat.reverse_wta(tri);
                                }
                            }
                            // Attack Multiplier
                            //Mults[0].value = Mults[0].get_multi(battler_1, battler_2, weapon1); //Debug
                        }
                    }
                }
            }
            for (int i = 0; i < Stat_Imgs.Count; i++)
            {
                if (Stats[i] == null)
                {
                    Stat_Imgs[i].text = "--";
                }
                else if (Stats[i] < 0)
                {
                    Stat_Imgs[i].text = "--";
                }
                else
                {
                    Stat_Imgs[i].text = Stats[i].ToString();
                }
            }
        }
Esempio n. 16
0
 protected override int exp_gain(Game_Unit battler_1, Game_Unit battler_2, TactileLibrary.Data_Weapon weapon, bool kill)
 {
     return(Combat.staff_exp(battler_1.actor, weapon));
 }
Esempio n. 17
0
 protected override Attack_Result calculate_attack(int distance, int dmg, bool hit, bool crt,
                                                   TactileLibrary.Data_Weapon weapon)
 {
     return(Combat.set_attack(this.AttackerUnit, TargetTerrain, distance, dmg, hit, crt, weapon));
 }
Esempio n. 18
0
        internal static List <int> correct_animation_value(int anim_id, BattlerSpriteData battler)
        {
            int terrain;

            // Pirate Crit Dust
            if (anim_id == Global.animation_group("Pirate-Axe") + 22)
            {
                terrain = Global.scene.scene_type == "Class_Reel" ? ((Scene_Class_Reel)Global.scene).terrain_tag :
                          Global.game_map.terrain_id(battler.Unit.loc);
                if (Global.data_terrains.ContainsKey(terrain) && Global.data_terrains[terrain].Dust_Type == 1)
                {
                    return new List <int> {
                               anim_id + 1
                    }
                }
                ;
                return(new List <int> {
                    anim_id
                });
            }
            // Dust
            if (anim_id == Global.animation_group("Effects") + 1)
            {
                terrain = Global.scene.scene_type == "Class_Reel" ? ((Scene_Class_Reel)Global.scene).terrain_tag :
                          Global.game_map.terrain_id(battler.Unit.loc);
                if (Global.data_terrains.ContainsKey(terrain) && Global.data_terrains[terrain].Dust_Type == 1)
                {
                    return new List <int> {
                               anim_id + 1
                    }
                }
                ;
                return(new List <int> {
                    anim_id
                });
            }
            // Spiral Dive
            if (anim_id == Global.animation_group("Skills") + 4)
            {
                TactileLibrary.Data_Weapon weapon = battler.Weapon;
                if (weapon.main_type().Name == "Sword")
                {
                    return new List <int> {
                               anim_id + 1
                    }
                }
                ;
                return(new List <int> {
                    anim_id
                });
            }
            return(new List <int> {
                anim_id
            });
        }
    }

    /*struct Battler_Sprite_Data
     * {
     *  public string filename;
     *  public int y;
     *  public Texture2D texture;
     * }*/
}
        protected override void set_images()
        {
            if (Mode != Staff_Target_Mode.Torch)
            {
                Game_Unit  unit     = get_unit();
                Game_Actor actor1   = unit.actor;
                Game_Unit  target   = Global.game_map.units[this.target];
                Game_Actor actor2   = target.actor;
                int        distance = Global.game_map.combat_distance(unit.id, target.id);
                // Get weapon data
                TactileLibrary.Data_Weapon weapon1 = actor1.weapon, weapon2 = actor2.weapon;
                // Map Sprite //
                Target_Sprite.texture = Scene_Map.get_team_map_sprite(target.team, target.map_sprite_name);
                Target_Sprite.offset  = new Vector2(
                    (Target_Sprite.texture.Width / Target_Sprite.frame_count) / 2,
                    (Target_Sprite.texture.Height / Target_Sprite.facing_count) - 8);
                Target_Sprite.mirrored = target.has_flipped_map_sprite;
                // Sets Name //
                Name.offset = new Vector2(-(32), -(8));
                Name.text   = actor2.name;

                var stats = new Calculations.Stats.CombatStats(
                    unit.id, target.id, distance: distance);
                var target_stats = new Calculations.Stats.CombatStats(
                    target.id, unit.id, distance: distance);
                Stats = new List <TextSprite>();
                // Healing
                if (Mode == Staff_Target_Mode.Heal)
                {
                    List <int> status_heal = unit.actor.weapon.healable_statuses(target);
                    Window.height = status_heal.Count > 0 ? 64 : 48;
                    for (int i = 0; i < 5; i++)
                    {
                        Stats.Add(i % 2 == 0 ? new RightAdjustedText() : new TextSprite());
                        Stats[i].offset = new Vector2(-(48 + ((i / 2) * 24)), -24);
                        Stats[i].SetFont(Config.UI_FONT, Global.Content, (i % 2 == 0 ? "Blue" : "White"));
                    }
                    bool hp_restore = unit.actor.weapon.Heals();
                    if (hp_restore)
                    {
                        Stats[1].text = "-";
                    }
                    Stats[3].text = "/";
                    if (hp_restore)
                    {
                        // Hp
                        Stats[0].text = actor2.hp.ToString();
                        // New Hp
                        Stats[2].text = Math.Min(actor2.hp + stats.dmg(), actor2.maxhp).ToString();
                    }
                    else
                    {
                        // Hp
                        Stats[2].text = actor2.hp.ToString();
                    }
                    // Max Hp
                    Stats[4].text = actor2.maxhp.ToString();
                    // Status
                    Status_Icons.Clear();
                    StatLabels[1].text = "";
                    if (status_heal.Count > 0)
                    {
                        StatLabels[1].SetFont(Config.UI_FONT);
                        StatLabels[1].text = "Cond";
                        for (int i = 0; i < status_heal.Count; i++)
                        {
                            Status_Icons.Add(new Status_Icon_Sprite());
                            Status_Icons[Status_Icons.Count - 1].texture = Global.Content.Load <Texture2D>(@"Graphics/Icons/Statuses");
                            Status_Icons[Status_Icons.Count - 1].size    = new Vector2(16, 16);
                            Status_Icons[Status_Icons.Count - 1].offset  = new Vector2(-(32 + (i * 16)), -40);
                            Status_Icons[Status_Icons.Count - 1].index   = Global.data_statuses[status_heal[i]].Image_Index;
                            Status_Icons[Status_Icons.Count - 1].counter = actor2.state_turns_left(status_heal[i]);
                        }
                    }
                }
                // Status Inflict
                else if (Mode == Staff_Target_Mode.Status_Inflict)
                {
                    for (int i = 0; i < 2; i++)
                    {
                        Stats.Add(new RightAdjustedText());
                        Stats[i].offset = new Vector2(-88, -(24 + i * 16));
                        Stats[i].SetFont(Config.UI_FONT, Global.Content, "Blue");
                    }
                    // Hp
                    Stats[0].text = target_stats.res().ToString();
                    // New Hp
                    Stats[1].text = Math.Min(100, stats.hit()).ToString();
                }
                // Barrier
                if (Mode == Staff_Target_Mode.Barrier)
                {
                    for (int i = 0; i < 3; i++)
                    {
                        Stats.Add(i % 2 == 0 ? new RightAdjustedText() : new TextSprite());
                        Stats[i].offset = new Vector2(-(48 + ((i / 2) * 24)), -24);
                        Stats[i].SetFont(Config.UI_FONT, Global.Content, (i % 2 == 0 ? "Blue" : "Yellow"));
                    }
                    Stats[1].text = "-";
                    // Res
                    Stats[0].text = (actor2.stat(Stat_Labels.Res) +
                                     target.temporary_stat_buff(TactileLibrary.Buffs.Res)).ToString();
                    // New Res
                    Stats[2].text = (actor2.stat(Stat_Labels.Res) +
                                     Constants.Combat.BARRIER_BONUS).ToString();
                }
                refresh();
            }
        }
Esempio n. 20
0
        internal void set_attack(int distance, List <Combat_Action_Data> action_data)
        {
            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;
            }

            List <int?> combat_stats;
            int         hit = 100, dmg = 0;
            bool        hit_skill_changed = false;

            if (target != null)
            {
                combat_stats = Combat.combat_stats(battler.id, target.id, distance);
                if (combat_stats[0] != null)
                {
                    hit = (int)combat_stats[0];
                }
                if (combat_stats[1] != null)
                {
                    dmg = (int)combat_stats[1];
                }
                hit_skill_changed = 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);
            // Pre hit skill check, Attcker (Spiral Dive?)
            prehit_skill_check(distance, action_data, hit, ref hit_skill_changed);

            bool is_hit = true, is_crt = false;

            if (target != null)
            {
                combat_stats = Combat.combat_stats(battler.id, target.id, distance);
                // Hit hasn't changed
                hit = attack_hit(hit, combat_stats[0] ?? hit, hit_skill_changed);
                int crt = combat_stats[2] ?? -1;
                // Hit test
                is_hit = true;
                is_crt = false;

                if (Stats[Attacker == 1 ? 0 : 4] != null)
                {
                    Combat.test_hit(hit, crt, distance, out is_hit, out is_crt);
                }
            }
            // Post hit skill activation (Astra)
            hit_skill_check(distance, action_data, is_hit, is_crt);

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

            // Calculate attack
            if (target != null)
            {
                combat_stats = Combat.combat_stats(battler.id, target.id, distance);
                if (combat_stats[1] != null)
                {
                    dmg = attack_dmg(dmg, (int)combat_stats[1]);
                }
            }

            Result = calculate_attack(distance, dmg, is_hit, is_crt, weapon);

            if (Battler2 != null)
            {
                cause_damage(true);
            }
            // Attack end skill activation (Adept) //Yeti
            posthit_skill_check(distance, action_data);
            // Reset skills
            if (!skip_skill_update())
            {
                battler.reset_skills();
                if (target != null)
                {
                    target.reset_skills();
                }
            }
        }
Esempio n. 21
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));
 }