コード例 #1
0
ファイル: Combat_Data.cs プロジェクト: Nagraal/Tactile-Engine
        private void add_attacks(
            Game_Unit battler_1, Combat_Map_Object battler_2,
            int i, Data_Weapon weapon)
        {
#if DEBUG
            System.Diagnostics.Debug.Assert(i == 1 || i == 2);
#endif
            Game_Unit         attacker = i == 2 ? battler_2 as Game_Unit : battler_1;
            Combat_Map_Object target   = i == 2 ? battler_1 : battler_2;

            int num_hits = 1;
            if (!attacker.is_brave_blocked())
            {
                // If only single hits against terrain
                if (!(target != null && !target.is_unit() &&
                      Constants.Combat.BRAVE_BLOCKED_AGAINST_DESTROYABLE))
                {
                    num_hits = weapon.HitsPerAttack;
                }
            }
            for (int j = 0; j < num_hits; j++)
            {
                add_attacks(battler_1, battler_2, i);
            }
        }
コード例 #2
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);
        }