def attempt_wildcraft(self,camp):
     pc = camp.make_skill_roll(gears.stats.Perception,gears.stats.Wildcraft,self.rank)
     if pc:
         if pc.get_pilot() is camp.pc:
             mymenu = ghcutscene.PromptMenu("You find tracks belonging to enemy mecha. It would be a simple matter to find an alternate route around them.")
         else:
             mymenu = ghcutscene.SimpleMonologueMenu("[THERE_ARE_ENEMY_TRACKS] [WE_CAN_AVOID_COMBAT]",pc,camp)
         mymenu.add_item("Avoid them",self.cancel_the_adventure)
         mymenu.add_item("Engage them",None)
         go = mymenu.query()
         if go:
             go(camp)
 def attempt_stealth(self,camp):
     pc = camp.make_skill_roll(gears.stats.Perception,gears.stats.Stealth,self.rank)
     if pc:
         if pc.get_pilot() is camp.pc:
             mymenu = ghcutscene.PromptMenu("You encounter a group of hostile mecha, but manage to remain unseen.")
         else:
             mymenu = ghcutscene.SimpleMonologueMenu("[ENEMIES_HAVE_NOT_DETECTED_US] [WE_CAN_AVOID_COMBAT]",pc,camp)
         mymenu.add_item("Avoid them",self.cancel_the_adventure)
         mymenu.add_item("Engage them",None)
         go = mymenu.query()
         if go:
             go(camp)
 def attempt_scouting(self,camp):
     pc = camp.make_skill_roll(gears.stats.Perception,gears.stats.Scouting,self.rank)
     if pc:
         if pc.get_pilot() is camp.pc:
             mymenu = ghcutscene.PromptMenu("You detect hostile mecha on the road ahead. They are still far enough away that you can avoid them if you want to.")
         else:
             mymenu = ghcutscene.SimpleMonologueMenu("[I_HAVE_DETECTED_ENEMIES] [WE_CAN_AVOID_COMBAT]",pc,camp)
         mymenu.add_item("Avoid them",self.cancel_the_adventure)
         mymenu.add_item("Engage them",None)
         go = mymenu.query()
         if go:
             go(camp)
Esempio n. 4
0
 def attempt_stealth(self, camp):
     pc = camp.make_skill_roll(gears.stats.Perception, gears.stats.Stealth,
                               self.rank)
     if pc:
         if pc.get_pilot() is camp.pc:
             mymenu = pbge.rpgmenu.AlertMenu(
                 "You encounter a group of hostile mecha, but manage to remain unseen."
             )
         else:
             mymenu = ghcutscene.SimpleMonologueMenu(
                 "[ENEMIES_HAVE_NOT_DETECTED_US] If you're interested in finding their base, we can tail them all the way back.",
                 pc, camp)
         mymenu.add_item("Follow them to their base", self.find_the_base)
         mymenu.add_item("Engage them", None)
         go = mymenu.query()
         if go:
             go(camp)
Esempio n. 5
0
 def attempt_scouting(self, camp):
     pc = camp.make_skill_roll(gears.stats.Perception, gears.stats.Scouting,
                               self.rank)
     if pc:
         if pc.get_pilot() is camp.pc:
             mymenu = pbge.rpgmenu.AlertMenu(
                 "As you approach {ENEMY_FACTION}, you realize you could probably follow them back to their base."
                 .format(**self.elements))
         else:
             mymenu = ghcutscene.SimpleMonologueMenu(
                 "[I_HAVE_DETECTED_ENEMIES] If we want to know where their base is, our best bet would be to stand back and follow them at a distance.",
                 pc, camp)
         mymenu.add_item("Follow them to their base", self.find_the_base)
         mymenu.add_item("Engage them", None)
         go = mymenu.query()
         if go:
             go(camp)
Esempio n. 6
0
    def go(self, explo):
        """Perform this combat."""
        pbge.my_state.view.overlays.clear()

        while self.still_fighting():
            if self.n >= len(self.active):
                # It's the end of the round.
                self.n = 0
                explo.update_npcs()
                self.end_round()
                self.camp.check_trigger("COMBATROUND")
            if self.active[self.n] in self.camp.scene.contents and self.active[self.n].is_operational():
                chara = self.active[self.n]
                self.do_combat_turn(chara)
                # After action, renew attacks of opportunity
                self.cstat[chara].aoo_readied = True
                self.cstat[chara].attacks_this_round = 0
                chara.renew_power()
            if self.no_quit and not pbge.my_state.got_quit:
                # Only advance to the next character if we are not quitting. If we are quitting,
                # the game will be saved and the player will probably want any APs they have left.
                self.n += 1
            self.camp.check_trigger("COMBATLOOP")

        if self.no_quit and not pbge.my_state.got_quit:
            # Combat is over. Deal with things.
            # explo.check_trigger( "COMBATOVER" )
            # if self.camp.num_pcs() > 0:
            #    # Combat has ended because we ran out of enemies. Dole experience.
            #    self.give_xp_and_treasure( explo )
            #    # Provide some end-of-combat first aid.
            #    #self.do_first_aid(explo)
            #    self.recover_fainted(explo)
            treasure = pbge.container.ContainerList()
            for m in self.active:
                if m in self.scene.contents and self.scene.is_an_actor(m):
                    if not m.is_operational():
                        self.camp.check_trigger("FAINT", m)
                        n = m.get_pilot()
                        if n and m is not n and not n.is_operational():
                            self.camp.check_trigger("FAINT", n)
                        mteam = self.scene.local_teams.get(m)
                        if mteam and self.scene.player_team.is_enemy(mteam) and hasattr(m, "treasure_type") and m.treasure_type:
                            maybe_treasure = m.treasure_type.generate_treasure(self.camp, m, gears.selector.get_design_by_full_name)
                            if maybe_treasure:
                                treasure.append(maybe_treasure)

            # Deal with m-kills now; if someone is immobilized and can't be repaired, they get left behind.
            # I am well aware this might mean the entire party gets taken out of combat.
            myparty = self.camp.get_active_party()
            for pc in myparty:
                pc.hidden = False
                if isinstance(pc, gears.base.Mecha) and (pc.get_current_speed() < 10 or not self.scene.can_use_movemode_here(pc.mmode, *pc.pos)):
                    pc.gear_up(self.scene)
                    if pc.get_current_speed() < 10:
                        # Looks like we have a genuine Mobility Kill.
                        if pc.get_pilot() is self.camp.pc:
                            mymenu = pbge.rpgmenu.AlertMenu("Your {} has been immobilized. You can either try to repair the damage, or let the mission continue without you.".format(pc.get_full_name()))
                        else:
                            mymenu = ghcutscene.SimpleMonologueMenu("[I_HAVE_BEEN_IMMOBILIZED] [HELP_WITH_MOBILITY_KILL]", pc, self.camp)
                        if any([m.get_current_mental() > 0 for m in myparty]):
                            mymenu.add_item("Attempt to repair the damage.", self._try_to_fix_mkill)
                        mymenu.add_item("Leave {} behind.".format(pc), self._abandon_mkill)
                        choice = mymenu.query()
                        if choice:
                            choice(myparty, pc)
                        else:
                            self._abandon_mkill(myparty, pc)

            if myparty and treasure:
                pbge.alert("You acquired some valuables from the battle.")
                fieldhq.backpack.ItemExchangeWidget.create_and_invoke(self.camp, self.camp.first_active_pc(), treasure)

            self.scene.tidy_enchantments(gears.enchantments.END_COMBAT)