Exemple #1
0
 def available_actions(self):
     if self.enemy.is_alive():
         #UNUSED CODE, KEPT FOR REFERENCE
         #return [actions.Flee(tile=self), actions.Attack(enemy=self.enemy)]
         return [actions.Flee(tile=self), actions.Attack()]
     else:
         return self.adjacent_moves()# actions.Heal() DOES NOT WORK, MUST CHANGE TO OTHER METHOD OF USER INPUT
Exemple #2
0
    def get_actions(self, ent: LivingEntity):

        if self.enemy.is_alive():
            # return [actions.Flee(ent), actions.Attack(ent, enemy=self.enemy)]
            return [actions.Flee(ent)]
        else:
            return []
Exemple #3
0
 def available_actions(self):
     if self.enemy.is_alive():
         return [actions.Flee(tile=self), actions.Attack(enemy=self.enemy)]
     else:
         moves = self.adjacent_moves()
         moves.append(actions.ViewInventory())
         moves.append(actions.Heal())
         return moves
Exemple #4
0
 def available_actions(self):
     if self.enemy.is_alive():
         return [
             actions.Flee(tile=self),
             actions.Kick(enemy=self.enemy),
             actions.Jump(enemy=self.enemy)
         ]
     else:
         return self.adjacent_moves()
 def avaliable_actions(self):
     if self.enemy.is_alive():
         return [
             actions.Flee(tile=self),
             actions.Attack(enemy=self.enemy),
             actions.ViewEnemy()
         ]
     else:
         return self.adjacent_moves()
Exemple #6
0
 def available_actions(self):
     if self.enemy.is_alive():
         return [
             actions.Flee(tile=self),
             actions.Attack(enemy=self.enemy),
             actions.DrinkRhum()
         ]
     else:
         return super().available_actions()
Exemple #7
0
 def available_actions(self):
     if old_pirate.is_alive() and self.is_here and not old_pirate.is_drunk:
         return [
             actions.Attack(enemy=old_pirate),
             actions.Negociate(tile=self),
             actions.Flee(tile=self)
         ]
     else:
         old_pirate.is_drunk = False
         return super().available_actions()
Exemple #8
0
 def available_actions(self):
     if self.enemy.is_alive():
         return [
             actions.Flee(tile=self),
             actions.Attack(enemy=self.enemy),
             actions.ViewInventory(),
             actions.CheckStats(),
             actions.CheckMap(),
             actions.Heal()
         ]
     else:
         return self.adjacent_moves()
Exemple #9
0
 def available_actions(self, player):
     if self.enemy.is_alive():
         moves = [actions.Flee(tile=self), actions.Attack(enemy=self.enemy)]
         if player.has_potion():
             moves.append(actions.UsePotion())
         return moves
     else:
         moves = self.adjacent_moves()
         moves.append(actions.ViewInventory())
         moves.append(actions.ViewCurrency())
         if player.has_potion():
             moves.append(actions.UsePotion())
         return moves
Exemple #10
0
    def available_actions(self, player):
        """Returns all of the available actions in a room containing an enemy"""
        moves, avail_actions, descriptors = self.generic_moves(player)
        movements = ["west", "east", "north", "south"]

        if self.enemy.is_alive():
            for direction in movements:
                if direction in moves:
                    moves.pop(direction)

            moves, avail_actions = self.update(moves, avail_actions,
                actions.Flee(noun=player.prev_tile, enemy=self.enemy, direction=player.prev_tile))

            moves, avail_actions = self.update(moves, avail_actions,
                actions.Flee(noun=None, enemy=self.enemy, direction=player.prev_tile))

            moves, avail_actions = self.update(moves, avail_actions,
                actions.Flee(noun=self.enemy.name, enemy=self.enemy, direction=player.prev_tile))

            moves, avail_actions = self.update(moves, avail_actions, actions.ViewOrbs())

            for potion in player.available_potions():
                moves, avail_actions = self.update(moves, avail_actions, actions.UsePotion(potion=potion, tile=self, enemy=self.enemy))

            for orb in items.Orb.orb_types():
                moves, avail_actions = self.update(moves, avail_actions, actions.Cast(orb=orb))

            moves, avail_actions = self.update(moves, avail_actions,
                        actions.Attack(enemy=self.enemy, tile=self, weapon=None))

            a = actions.Attack(enemy=self.enemy, tile=self, weapon=None)
            noun, verbs = a.add_actions()

            weapons = player.available_weapons()
            for weapon in weapons:
                moves[weapon.name] = verbs

        return moves, avail_actions, descriptors
Exemple #11
0
 def available_actions(self,player):
     if self.enemy.is_alive() and player.is_alive():
         moves = [actions.Flee(tile=self), actions.Attack(enemy=self.enemy)]
         if player.HealingPotions > 0:
             moves.append(actions.Heal())
         return moves
     else:
         moves = self.adjacent_moves()
         moves.append(actions.ViewInventory())
         moves.append(actions.CheckHP())
         moves.append(actions.EquipWep())
         if self.item and not self.enemy.is_alive():
             moves.append(actions.PickUpItem())
         if player.Potion_Of_Life:
             moves.append(actions.Undead())
         if player.HealingPotions > 0:
             moves.append(actions.Heal())
         if player.beer > 0:
             moves.append(actions.Drink())
         return moves
Exemple #12
0
    def available_actions(self, the_player):
        if self.enemy.is_alive() and self.enemy.aggro:
            moves = []
            moves.append(actions.ViewInventory())
            moves.append(actions.Use(tile=self))
            moves.append(actions.Flee(tile=self))
            moves.append(actions.Attack(enemy=self.enemy))
            moves.append(actions.Talk(tile=self, enemy=self.enemy))
            moves.append(actions.Quit())
            if the_player.fsm:
                moves.extend(self.devcommands(the_player))

            return moves

        elif self.enemy.is_alive() and not self.enemy.aggro:
            moves = self.adjacent_moves()
            moves.append(actions.ViewInventory())
            moves.append(actions.Use(tile=self))
            moves.append(actions.Quit())
            moves.append(actions.Attack(enemy=self.enemy))
            moves.append(actions.Talk(tile=self, enemy=self.enemy))
            if the_player.fsm:
                moves.extend(self.devcommands(the_player))

            return moves
        else:
            moves = self.adjacent_moves()
            moves.append(actions.ViewInventory())
            moves.append(actions.Use(tile=self))
            moves.append(actions.Quit())
            if len(self.item) != 0:
                moves.append(actions.Grab(tile=self))

            if the_player.fsm:
                moves.extend(self.devcommands(the_player))

            return moves
Exemple #13
0
 def available_actions(self):  #make non-default actions available
     if self.enemy.is_alive():
         return [actions.Flee(tile=self), actions.Attack(enemy=self.enemy)]
     else:
         return self.adjacent_moves()
Exemple #14
0
 def available_actions(self):
     if self.enemy.is_alive():
         return [actions.Flee(tile=self), actions.Attack(enemy=self.enemy)]
     else:
         moves = self.adjacent_moves()
         return moves
Exemple #15
0
 def available_actions(self):
     if self.enemy.is_alive():
         return [actions.Flee(self), actions.Attack(self.enemy)]
     else:
         return self.adjacent_moves()
Exemple #16
0
 def available_actions(self): # The player gets some new actions here. They can either attack or flee 
     if self.enemy.is_alive():
         return [actions.Flee(tile=self), actions.Attack(enemy=self.enemy)]
     else:
         return self.adjacent_moves()
Exemple #17
0
 def availableActions(self):
     if self.enemy.isAlive():
         return [actions.Flee(tile=self), actions.Attack(enemy=self.enemy)]
     else:
         return self.adjacentMoves()
 def available_actions(self):
     """Determines the available actions when facing an enemy"""
     if self._enemy.is_alive():
         return [actions.Flee(tile=self), actions.Attack(enemy=self._enemy)]
     else:
         return self.adjacent_moves()
Exemple #19
0
 def available_actions(self):
     if self.enemy.is_alive():
         return [actions.Flee(), actions.Attack(enemy=self.enemy)]
     else:
         return [actions.Flee(), actions.Attack(self.revive())]