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

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

src/g/e/ges-python-HEAD/Ai/bot_deathmatch.py   ges-python(Download)
    def SelectSchedule( self ):
        # Run away from explosions!
        if self.HasCondition( Cond.HEAR_DANGER ):
            return Sched.TAKE_COVER_FROM_BEST_SOUND
 
 
        if self.GetState() == State.COMBAT:
            if self.HasCondition( Cond.GES_ENEMY_FAR ):
                action_prob = 0.6
 
            # Low health condition, attempt to find armor or run away
            if self.GetHealth() <= ( self.GetMaxHealth() / 2.0 ) and self.GetArmor() < ( self.GetMaxArmor() / 2.0 ):
                if self.GetHealth() <= 20 or self.HasCondition( Cond.GES_CLOSE_TO_ARMOR ):
                    action_prob = 0.8
 
                if self.HasCondition( Cond.GES_CAN_SEEK_ARMOR ) and dice_roll < action_prob:
                    return Sched.BOT_SEEK_ARMOR
                elif self.GetHealth() <= 20 and self.HasCondition( Cond.GES_ENEMY_DANGEROUS ):