示例#1
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;
            }
        }
示例#2
0
        public void UnitMenuTalk(Game_Unit unit, int targetId, Canto_Records canto)
        {
            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.activate_talk(unit.id, targetId);
            Global.game_temp.menuing = false;
            close_unit_menu(true);

            unit.cantoing = false;
            // Lock in unit movement
            unit.moved();
            bool cantoMovement = unit.has_canto() && !unit.full_move();

            if (Constants.Gameplay.TALKING_IS_FREE_ACTION)
            {
                Global.game_system.Menu_Canto = canto | Canto_Records.Talk |
                                                (cantoMovement ? Canto_Records.Horse : Canto_Records.None);
                unit.cantoing = true;
            }
            else if (cantoMovement)
            {
                unit.cantoing = true;
            }
            Global.player.facing = 6;
            Global.player.frame  = 1;
        }
示例#3
0
        public void UnitMenuUseItem(Game_Unit unit, int itemIndex, Maybe <Vector2> targetLoc, Maybe <int> promotionId)
        {
            Global.game_map.clear_move_range();
            unit.cantoing = false;
            // Lock in unit movement
            unit.moved();

            if (promotionId.IsSomething)
            {
                Global.game_state.call_item(
                    unit.id, itemIndex, promotionId);
            }
            else if (targetLoc.IsSomething)
            {
                Global.game_state.call_item(
                    unit.id, itemIndex, targetLoc);
            }
            else
            {
                Global.game_state.call_item(unit.id, itemIndex);
            }

            Global.game_temp.menuing = false;
            close_unit_menu(false);
        }
示例#4
0
        public void UnitMenuDrop(Game_Unit unit, Vector2 targetLoc)
        {
            Global.game_map.clear_move_range();
            // Lock in unit movement
            unit.moved();

            unit.drop_ally(targetLoc);

            Global.game_temp.menuing = false;
            close_unit_menu(true);
        }
示例#5
0
        public void UnitMenuRefuge(Game_Unit unit, int targetId)
        {
            Global.game_map.clear_move_range();
            // Lock in unit movement
            unit.moved();

            unit.take_refuge(targetId);
            unit.rescue_support_gain_display(targetId);

            Global.game_temp.menuing = false;
            close_unit_menu(true);
        }
示例#6
0
        public void UnitMenuGive(Game_Unit unit, int targetId, Canto_Records canto)
        {
            Global.game_map.clear_move_range();
            // Lock in unit movement
            unit.moved();

            unit.give_ally(targetId);
            Global.game_system.Menu_Canto = canto | Canto_Records.Give;

            Global.game_temp.menuing = false;
            close_unit_menu(true);
        }
示例#7
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);
        }
示例#8
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);
        }
示例#9
0
        // Skills: Sacrifice
        public void UnitMenuSacrifice(Game_Unit unit, int targetId)
        {
            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_sacrifice(unit.id, targetId);
            Global.game_temp.menuing = false;
            close_unit_menu(true);

            unit.cantoing = false;
            // Lock in unit movement
            unit.moved();
            if (unit.has_attack_canto() && !unit.full_move())
            {
                unit.cantoing = true;
            }
        }
示例#10
0
        public void UnitMenuDoor(Game_Unit unit, Vector2 targetLoc)
        {
            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_visit(Tactile.State.Visit_Modes.Door, unit.id, targetLoc);
            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;
            }
        }
示例#11
0
        private void EndConstruct(Game_Unit unit)
        {
            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;
            }



            // Simplified wait @Debug
            unit.start_wait();
            suspend();
        }
示例#12
0
        public void UnitMenuEscape(Game_Unit unit)
        {
            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_visit(Tactile.State.Visit_Modes.Escape, unit.id, unit.loc);
            Global.game_temp.menuing = false;
            close_unit_menu(true);
            Global.game_system.Selected_Unit_Id = -1;

            unit.cantoing = false;
            // Lock in unit movement
            unit.moved();
            if (unit.has_canto() && !unit.full_move())
            {
                unit.cantoing = true;
            }
        }
示例#13
0
        public void UnitMenuSupport(Game_Unit unit, int targetId)
        {
            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_support(unit.id, targetId);
            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;
            }
            Global.player.facing = 6;
            Global.player.frame  = 1;
        }