Exemple #1
0
 def available_actions(self):
     if self.ailment.is_suffering():
         result = self.adjacent_moves()
         result.append(actions.ViewInventory())
         result.append(actions.Attack(ailment=self.ailment))
         return result
     else:
         result = self.adjacent_moves()
         result.append(actions.ViewInventory())
         return result
    def available_actions(self):
        moves = self.adjacent_moves()
        moves.append(actions.ViewInventory())
        moves.append(actions.UsePP())


        return moves
Exemple #3
0
    def battle(self, player):
        while self.fight:
            self.displayBattle(self.wildPokemon)
            self.displayBattle(self.currentPokemon)
            input()
            util.getActions(
                [
                    actions.Run(tile=self),
                    actions.Attack(wildPokemon=self.wildPokemon),
                    actions.ViewInventory(),
                ],
                ["Leave battle", "Select Attacks", "View Inventory"],
                player,
            )
            input()
            enemyAttack = self.wildPokemon.getHighestAttack()
            self.currentPokemon.hp -= enemyAttack.damage
            print(f"\n{self.wildPokemon.name} used {enemyAttack.name}!")

            if self.wildPokemon.hp <= 0:
                print(f"Enemy {self.wildPokemon.name} fainted!")
                self.fight = False
            elif self.currentPokemon.hp <= 0:
                print(f"oh no {self.currentPokemon.name} fainted!")
                player.hp = 0
                self.fight = False
    def available_actions(self):
        """Returns all of the available actions in this room."""
        """The standardly used moves are the movement keys and looking at the player's inventory"""
        moves = self.adjacent_moves()
        moves.append(actions.ViewInventory())

        return moves
Exemple #5
0
 def available_actions(self):
     moves = self.adjacent_moves()
     moves.append(actions.ViewInventory())
     moves.append(actions.Heal())
     if self.item.available: 
         moves.append(actions.Search(item = self.item, text = self.itemText))
     return moves
Exemple #6
0
 def available_actions(self):
     moves = self.adjacent_moves()
     moves.append(actions.ViewInventory())
     moves.append(actions.Heal())
     if (len(self.inventory) > 0):
         moves.append(actions.Buy(inventory=self.inventory))
     return moves
Exemple #7
0
    def available_actions(self):
        """Returns all of the available actions in this room."""
        moves = self.adjacent_moves()
        moves.append(actions.ViewInventory())
        moves.append(actions.SaveAndExit())

        return moves
 def available_actions(self):
     if self.enemy.is_alive():
         return [actions.Attack(enemy=self.enemy)]
     else:
         moves = self.adjacent_moves()
         moves.append(actions.ViewInventory())
         return moves
    def available_actions(self):
        """ Returns all of the available actions on current tile """
        moves = self.adjacent_moves()
        moves.append(actions.ViewInventory())
        moves.append(actions.QuitGame())

        return moves
Exemple #10
0
    def available_actions(self):
        """Returns all of the available actions in this room."""
        pos_actions = self.adjacent_moves()
        pos_actions.append(actions.DrinkRhum())
        pos_actions.append(actions.ViewInventory())
        # pos_actions.append(actions.ViewMap(world.world_map))

        return pos_actions
Exemple #11
0
 def available_actions(self, player):
     #Returns all of the available actions in this room
     moves = self.adjacent_moves()
     moves.append(actions.ViewInventory())
     moves.append(actions.ViewCurrency())
     if player.has_potion():
         moves.append(actions.UsePotion())
     return moves
Exemple #12
0
 def other_moves(self):
     """Returns all other moves"""
     moves = []
     moves.append(actions.Look(self))
     moves.append(actions.ViewInventory())
     moves.append(actions.ViewStats())
     moves.append(actions.GodMode())
     return moves
Exemple #13
0
    def available_actions(self):
        """Returns all of the available actions in this room."""
        moves = self.adjacent_moves()
        moves.append(actions.ViewInventory())
        moves.append(actions.DescribeItem())
        #        moves.append(actions.DescribeAnItem(item=item))

        return moves
Exemple #14
0
    def available_actions(self):
        """
        Returns all available actions in the room.
        """
        moves = self.possible_moves()
        moves.append(actions.ViewInventory())

        return moves
Exemple #15
0
 def available_actions(self):
     """Returns all of the available actions in this room."""
     moves = self.adjacent_moves()
     moves.append(actions.Heal())
     moves.append(actions.CheckStats())
     moves.append(actions.ViewInventory())
     moves.append(actions.CheckMap())
     return moves
 def available_actions(self):
     moves = self.adjacent_moves()
     moves.append(actions.ViewInventory())
     moves.append(actions.Heal())
     moves.append(actions.LookAround())
     moves.append(actions.Status())
     moves.append(actions.CraftMenu())
     return moves
Exemple #17
0
 def available_actions(self, player):
     moves = self.adjacent_moves()
     moves.append(actions.ViewInventory())
     moves.append(actions.ViewCurrency())
     if player.has_potion():
         moves.append(actions.UsePotion())
     moves.append(actions.EnterShop())
     return moves
Exemple #18
0
    def available_actions(self, the_player):
        moves = self.adjacent_moves()
        moves.append(actions.ViewInventory())
        moves.append(actions.Use(tile=self))
        moves.append(actions.Quit())
        if the_player.fsm:
            moves.extend(self.devcommands(the_player))

        return moves
Exemple #19
0
 def available_actions(self, player):
     moves = self.adjacent_moves()
     moves.append(actions.ViewInventory())
     moves.append(actions.ViewCurrency())
     if player.has_potion():
         moves.append(actions.UsePotion())
     if self.item.takeable:
         moves.append(actions.Take(item=self.item))
     return moves
Exemple #20
0
	def available_actions(self, player):
		"""Returns all of the available actions in this room."""
		moves = self.adjacent_moves()
		if player.has_state("first_note"):
			moves.append(actions.ViewFirstNote())
		if player.has_state("second_note"):
			moves.append(actions.ViewSecondNote())
		if player.has_state("third_note"):
			moves.append(actions.ViewThirdNote())
		moves.append(actions.ViewInventory())
		return moves
Exemple #21
0
 def available_actions(self):
     if self.enemy.is_alive():
         return [actions.Flee(tile=self), actions.Attack(enemy=self.enemy), actions.Rest(), actions.Save()]
     else:
         moves = self.adjacent_moves()
         moves.append(actions.ViewInventory())
         moves.append(actions.Rest())
         moves.append(actions.RestFull())
         moves.append(actions.ViewStats())
         moves.append(actions.Save())
         return moves
Exemple #22
0
    def available_actions(self):
        """Returns all of the available actions in this room."""
        
        moves = [actions.MoveSouth()]#Can always go back south
        if self.gotBox: # Door unlocked
            moves.append(actions.MoveNorth())#North to boss

        moves.append(actions.ViewInventory())
        moves.append(actions.Equip())
        

        return moves
Exemple #23
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 #24
0
 def availableActions(self):
     moves = self.adjacentMoves()
     list = [
         actions.ViewInventory(),
         actions.CallHelp(),
         actions.ViewSanity(),
         actions.UseItem(None),
         actions.UseItemTarget(None, None),
         actions.PickupItem(None)
     ]
     moves.extend(list)
     return moves
Exemple #25
0
 def available_actions(self,player):
     moves = self.adjacent_moves()
     moves.append(actions.ViewInventory())
     moves.append(actions.CheckHP())
     moves.append(actions.EquipWep())
     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 #26
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 #27
0
 def availableActions(self):
     moves = self.adjacentMoves()
     #list the possible extra moves aside from movement
     list = [
         actions.ViewInventory(),
         actions.CallHelp(),
         actions.ViewSanity(),
         actions.UseItem(None),
         actions.UseItemTarget(None, None),
         actions.PickupItem(None)
     ]
     moves.extend(list)
     return moves
Exemple #28
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 #29
0
    def generic_moves(self, player):
        """Returns the standard moves that are available in every room.
        These include: -movement options
                       -choosing weapons
                       -viewing inventory
                       -using potions
                       -looking around at objects in room
        Args:
            player: an instance of the player class

        Returns:
            moves: dictionary mapping nouns to the verbs that can be applied to them.
            avail_actions: a list of actions from actions.py
            descriptors: dictionary mapping nouns to their respective descriptors
                        allow adjectives in commands
        """
        moves = dict() # the verbs associated with each noun
        descriptors = dict() # the adjectives associated with each noun
        avail_actions = [] # the availble actions from actions.py

        # determine the possible moves to other tiles (ie, move west)
        if world.tile_exists(self.x + 1, self.y):
            moves, avail_actions = self.update(moves, avail_actions, actions.MoveEast())

        if world.tile_exists(self.x - 1, self.y):
            moves, avail_actions = self.update(moves, avail_actions, actions.MoveWest())

        if world.tile_exists(self.x, self.y - 1):
            moves, avail_actions = self.update(moves, avail_actions, actions.MoveNorth())

        if world.tile_exists(self.x, self.y + 1):
            moves, avail_actions = self.update(moves, avail_actions, actions.MoveSouth())

        # look at inventory
        moves, avail_actions = self.update(moves, avail_actions, actions.ViewInventory())

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

        # choose or change weapon
        moves, avail_actions = self.update(moves, avail_actions, actions.ChangeWeapon())

        moves, avail_actions = self.update(moves, avail_actions, actions.Look(noun=None, tile=self))

        for item in self.look_at:
            moves, avail_actions = self.update(moves, avail_actions, actions.Look(noun=item, tile=self))
            descriptors[item] = self.look_at[item]

        return moves, avail_actions, descriptors
Exemple #30
0
 def available_actions(self):
     """Returns all of the available actions in this room."""
     moves = self.adjacent_moves()
     moves.append(actions.ListCommands())
     moves.append(actions.ViewInventory())
     moves.append(actions.Look())
     moves.append(actions.View())
     moves.append(actions.Equip())
     moves.append(actions.Take())
     moves.append(actions.Use())
     moves.append(actions.Search())
     moves.append(actions.Menu())
     moves.append(actions.Save())
     moves.append(actions.ViewMap())
     return moves