コード例 #1
0
        public void UnitMenuStaff(Game_Unit unit, int targetId, Vector2 targetLoc)
        {
            Global.game_map.clear_move_range();
            // Lock in unit movement
            unit.moved();

            Global.game_state.call_staff(
                unit.id, targetId,
                targetLoc);

            Global.game_state.call_battle(unit.id, targetId);
            if (unit.actor.weapon.Hits_All_in_Range())
            {
                foreach (int id in Global.game_system.Aoe_Targets)
                {
                    if (Global.game_map.units.ContainsKey(id))
                    {
                        // Adds to list of attacked units for this turn
                        if (unit.is_attackable_team(Global.game_map.units[id]))
                        {
                            unit.add_attack_target(id);

                            unit.same_target_support_gain_display(id);
                        }
                        else
                        {
                            unit.heal_support_gain_display(id);
                        }
                    }
                }
            }
            else
            {
                if (Global.game_map.units.ContainsKey(targetId))
                {
                    // Adds to list of attacked units for this turn
                    if (unit.is_attackable_team(Global.game_map.units[targetId]))
                    {
                        unit.add_attack_target(targetId);

                        unit.same_target_support_gain_display(targetId);
                    }
                    else
                    {
                        unit.heal_support_gain_display(targetId);
                    }
                }
            }

            Global.game_temp.clear_temp_range();
            Global.game_temp.menuing = false;
            close_unit_menu(true);
        }
コード例 #2
0
        public void UnitMenuSteal(Game_Unit unit, int targetId, int itemIndex)
        {
            Global.game_map.remove_updated_move_range(unit.id);
            Global.game_map.clear_move_range();
            Global.game_map.range_start_timer = 0;

            Global.game_state.call_steal(unit.id, targetId, itemIndex);
            // Adds to list of attacked units for this turn
            if (Global.game_map.units.ContainsKey(Global.game_system.Battler_2_Id) &&
                unit.is_attackable_team(Global.game_map.units[Global.game_system.Battler_2_Id]))
            {
                unit.add_attack_target(Global.game_system.Battler_2_Id);

                unit.same_target_support_gain_display(Global.game_system.Battler_2_Id);
            }
            Global.game_temp.menuing = false;
            close_unit_menu(true);

            unit.cantoing = false;
            // Lock in unit movement
            unit.moved();
            if (unit.has_canto() && !unit.full_move())
            {
                unit.cantoing = true;
            }
        }
コード例 #3
0
        public void UnitMenuAttack(Game_Unit unit, int targetId)
        {
            Global.game_map.clear_move_range();
            // Lock in unit movement
            unit.moved();
            // Skills: Trample
            if (unit.trample_activated)
            {
                unit.set_trample_loc();
            }
            // Skills: Old Swoop //@Debug
            if (unit.old_swoop_activated)
            {
                Global.game_state.call_battle(unit.id,
                                              unit.enemies_in_old_swoop_range(unit.facing)[0]);
                sort_aoe_targets(unit.id);
                // Adds to list of attacked units for this turn
                foreach (int id in Global.game_system.Aoe_Targets)
                {
                    if (Global.game_map.units.ContainsKey(id) &&
                        unit.is_attackable_team(Global.game_map.units[id]))
                    {
                        unit.add_attack_target(id);
                    }
                }

                unit.same_target_support_gain_display(Global.game_system.Aoe_Targets);
            }
            else
            {
                Global.game_state.call_battle(unit.id, targetId);
                // Adds to list of attacked units for this turn
                if (Global.game_map.units.ContainsKey(targetId) &&
                    unit.is_attackable_team(Global.game_map.units[targetId]))
                {
                    unit.add_attack_target(targetId);

                    unit.same_target_support_gain_display(targetId);
                }
            }

            Global.game_temp.clear_temp_range();
            Global.game_temp.menuing = false;
            close_unit_menu(true);
        }