Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(0)  |  Derive(0)  |  Import(4)

src/c/r/crashRun-HEAD/src/Robots.py   crashRun(Download)
from string import ascii_letters
 
from .Agent import STD_ENERGY_COST
from .Agent import AgentMemory
from .Agent import AltPredator
    def perform_action(self):
        if self.attitude == 'shutdown':
            self.energy -= STD_ENERGY_COST
            return
 
    def perform_action(self):
        if self.attitude == 'shutdown':
            self.energy -= STD_ENERGY_COST
            return
 
                    self.dm.monster_fires_missile(self, _loc[0], _loc[1], 4, 3, 1)
                    self.missile_count -= 1
                    self.energy -= STD_ENERGY_COST
                    return
                elif d <= 1:
                    self.attack(_loc)
                    self.energy -= STD_ENERGY_COST

src/c/r/crashRun-HEAD/src/DungeonMaster.py   crashRun(Download)
from .Agent import BaseMonster
from .Agent import IllegalMonsterMove
from .Agent import STD_ENERGY_COST
from .Robots import BasicBot
from .Robots import Roomba
            self.__move_player(p.row, p.col, next_r, next_c, dt)
        else:
            self.player.energy -= STD_ENERGY_COST
            self.dui.display_message('The firewall repels you.')
 
    def player_moves_onto_a_special_sqr(self, row, col):
        self.player.energy -= STD_ENERGY_COST
        _sqr = self.dungeon_levels[self.player.curr_level].map[row][col]
 
        try:
                self.dui.display_message("You fly down the hole.", True)
                self.__determine_next_level('down', (self.player.row, self.player.col), _lvl)
                self.player.energy -= STD_ENERGY_COST
                return
            elif hasattr(sqr, 'previous_tile') and isinstance(sqr.previous_tile, T.DownStairs):
            if  sqr.activated:
                self.__determine_next_level('down', (self.player.row, self.player.col), _lvl)
                self.player.energy -= STD_ENERGY_COST
            else:
                self.dui.display_message('The lift is deactivated.')

src/c/r/crashRun-HEAD/src/Player.py   crashRun(Download)
from .Agent import BaseAgent
from .Agent import AgentMemory
from .Agent import STD_ENERGY_COST
from .BaseTile import BaseTile
from .Inventory import Inventory
    def stunned(self, dui):
        self.dm.alert_player(self.row, self.col, 'You are stunned.')
        self.try_to_shake_off_shock()
        self.energy -= STD_ENERGY_COST
 

src/c/r/crashRun-HEAD/src/CommandContext.py   crashRun(Download)
from random import randrange
 
from .Agent import STD_ENERGY_COST
from .FieldOfView import Shadowcaster
from . import Items
                self.dui.display_message('You open the box.')
                self.dm.empty_box_contents(box, row, col, level)
            self.dm.player.energy -= STD_ENERGY_COST
 
    def do_action(self):
        elif _sqr.get_type() in (TERMINAL, SPECIAL_TERMINAL) and _sr == _p.row and _sc == _p.col:
            _sqr.jack_in(self.dm)
            self.dm.player.energy -= STD_ENERGY_COST
        elif isinstance(_sqr, Items.Box) and _sr == _p.row and _sc == _p.col:
            self.open_box(_sqr, _sr, _sc, _lvl)
        elif _sqr.get_type() == TRAP and _sqr.revealed:
            self.attempt_to_disarm(_sqr, _sr, _sc)
            self.dm.player.energy -= STD_ENERGY_COST
        elif sqr.broken:
            self.dui.display_message('The door is broken.')
            self.dm.player.energy -= STD_ENERGY_COST
        elif not sqr.opened:
            self.dui.display_message('The door is already closed!')