def perform(self): self._performed = True global _entities_spawned_this_approach, _entities_spawned_this_tick _entities_spawned_this_approach += 1 _entities_spawned_this_tick += 1 global _total_entities _total_entities += 1 entity = Entity.create(BLOCK_ENTITY) entity.model = self._prototype.model entity.health = self._prototype.health entity.set_property_int('m_Material', self._prototype.material) entity.teleport(self._origin) entity.spawn() if self._sound_effects: Sound( choice(_level_properties['block_restore_sounds']), index=SOUND_FROM_WORLD, volume=0.25, attenuation=Attenuation.NORMAL, origin=self._origin ).play() self._callback(entity)
class DisposableProp(BaseItemInstance): manual_activation = True def try_activate(self, player, amount, async=True): reason = super().try_activate(player, amount, async) if reason is not None: return reason global props_disposed if props_disposed >= MAX_DISPOSED_PROPS_PER_ROUND: return strings_module['fail too_many'] coords = player.get_view_coordinates() if coords is None: return strings_module['fail wrong_place'] if coords.get_distance(player.origin) > MAX_TARGET_DISTANCE: return strings_module['fail too_far'] # TODO: Add game area check props_disposed += 1 entity = Entity.create(self['entity_classname']) entity.model = Model(self['model_path']) entity.skin = randint(self.get('skin_min', 0), self.get('skin_max', 0)) origin = coords + Vector(0, 0, self.get('z_offset', 0)) entity.teleport(origin, None, None) entity.spawn() Sound(SPAWN_SOUND_PATH, index=entity.index, attenuation=Attenuation.STATIC).play() return None
from warcraft.race import Race from warcraft.registration import events, clientcommands from warcraft.skill import Skill from warcraft.utility import classproperty, CooldownDict ## warcraft.skills imports from .skills.self_add_speed import AddSpeedSkill ## __all__ declaration __all__ = ("Molecule", ) ## panorama declaration zoom_in_sound = Sound("items/nvg_on.wav") zoom_out_sound = Sound("items/nvg_off.wav") class Panorama(Race): @classproperty def description(cls): return '' @classproperty def max_level(cls): return 99 @classproperty def requirement_sort_key(cls): return 16
player_class_size / team_size * 100 <= limit), 'absolute': lambda player_class_size, team_size, limit: (player_class_size <= limit) } logger = LogManager(info.name, cvar_logging_level, cvar_logging_areas) limits = None last_loaded_limits_file = None reload_limits_file() msg_not_allowed = TextMsg(common_strings['not_allowed']) msg_you_were_switched = SayText2( insert_chat_tag(common_strings['you_were_switched'])) snd_not_allowed = Sound("common/wpn_denyselect.wav") # ============================================================================= # >> CLASSES # ============================================================================= class BalancedPlayer: def __init__(self, index): self.player = Player(index) def get_player_class(self): return self.player.get_property_uchar("m_PlayerClass.m_iClass") def set_player_class(self, player_class): self.player.set_property_uchar("m_PlayerClass.m_iClass", player_class)
def playgamesound(userid, _sound): player = Player.from_userid(userid) Play_sound = Sound('%s' % (_sound)) Play_sound.play(player.index)
def __missing__(self, item): self[item] = Sound(None, 0, item.replace('sound', '*')) downloadables.add(item) return self[item]
from warcraft.race import Race from warcraft.registration import events, clientcommands from warcraft.skill import Skill from warcraft.utility import classproperty, CooldownDict ## warcraft.skills imports from .skills.self_add_speed import AddSpeedSkill ## __all__ declaration __all__ = ("Molecule", ) ## molecule declaration electric_sound = Sound("ambient/energy/electric_loop.wav") class Molecule(Race): @classproperty def description(cls): return '' @classproperty def max_level(cls): return 99 @classproperty def requirement_sort_key(cls): return 15