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

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

src/g/e/ges-python-HEAD/Ai/bot_deathmatch.py   ges-python(Download)
            dist_to_enemy = self.GetEnemy().GetAbsOrigin().DistTo( self.GetAbsOrigin() )
            if dist_to_enemy > 800:
                self.SetCondition( Cond.GES_ENEMY_FAR )
            elif dist_to_enemy < 150:
                self.SetCondition( Cond.GES_ENEMY_CLOSE )
                enemy_weapon = self.GetEnemy().GetActiveWeapon()
                if enemy_weapon and enemy_weapon.GetWeight() > max( Weapons.Weight.MEDIUM, self._max_weap_weight - 1 ):
                    self.SetCondition( Cond.GES_ENEMY_DANGEROUS )
                elif enemy_weapon and enemy_weapon.IsMeleeWeapon():
                    self.SetCondition( Cond.GES_ENEMY_UNARMED )
            if currWeap.GetAmmoCount() <= currWeap.GetMaxAmmoCount() / 100:
                # We have very little ammo left for this weapon
                self.SetCondition( Cond.NO_PRIMARY_AMMO )
            elif currWeap.GetClip() < ( currWeap.GetMaxClip() / 8.0 ):
                # We are running out of our clip