def player_spawn(event_var): user_ID = int(event_var["userid"]) player = players.Player(user_ID) if player.team_ID not in (players.TERRORIST, players.COUNTER_TERRORIST): return health_level = rpg.get_level(user_ID, _health) if health_level == 0: return player.health = _health.perk_calculator(health_level)
def player_spawn(event_var): user_ID = int(event_var["userid"]) player = players.Player(user_ID) if players.Player(user_ID).team_ID not in (players.TERRORIST, players.COUNTER_TERRORIST): return stealth_level = rpg.get_level(user_ID, _stealth) if stealth_level == 0: return _set_colour(player, stealth_level)
def _regenerate(user_ID): health = rpg.PerkManager.data.get("health") if health is None or not health.enabled: max_health = 100 else: health_level = rpg.get_level(user_ID, health) if health_level == 0: max_health = 100 else: max_health = health.perk_calculator(health_level) player = players.Player(user_ID) if player.health >= max_health: return health_to_regenerate = _regeneration.perk_calculator(rpg.get_level( user_ID, _regeneration)) if max_health - player.health <= health_to_regenerate: player.health = max_health else: player.health += health_to_regenerate
def _regenerate(user_ID): health = rpg.PerkManager.data.get("health") if health is None or not health.enabled: max_health = 100 else: health_level = rpg.get_level(user_ID, health) if health_level == 0: max_health = 100 else: max_health = health.perk_calculator(health_level) player = players.Player(user_ID) if player.health >= max_health: return health_to_regenerate = _regeneration.perk_calculator( rpg.get_level(user_ID, _regeneration)) if max_health - player.health <= health_to_regenerate: player.health = max_health else: player.health += health_to_regenerate
def _repair_armor(user_ID): player = players.Player(user_ID) if player.armor >= 100: return armor_bonus = _armor_repair.perk_calculator(rpg.get_level(user_ID, _armor_repair)) if 100 - player.armor < armor_bonus: player.armor = 100 else: player.armor += armor_bonus
def _repair_armor(user_ID): player = players.Player(user_ID) if player.armor >= 100: return armor_bonus = _armor_repair.perk_calculator( rpg.get_level(user_ID, _armor_repair)) if 100 - player.armor < armor_bonus: player.armor = 100 else: player.armor += armor_bonus
def player_spawn(event_var): user_ID = int(event_var["userid"]) if players.Player(user_ID).team_ID not in (players.TERRORIST, players.COUNTER_TERRORIST): return if rpg.get_level(user_ID, _regeneration) == 0: return delay = _delays.get(user_ID) if delay is None: delay = _delays[user_ID] = delays.Delay(_regenerate, user_ID) delay.start(5, True) elif not delay.running: delay.start(5, True)
def _remove_effects(user_ID): player = players.Player(user_ID) player.speed = 1 stealth = rpg.PerkManager.data.get("stealth") if stealth is None or not stealth.enabled: max_alpha = 255 else: stealth_level = rpg.get_level(user_ID, stealth) if stealth_level == 0: max_alpha = 255 else: max_alpha = stealth.perk_calculator(stealth_level) player.colour = (255, 255, 255, max_alpha)
def player_spawn(event_var): user_ID = int(event_var["userid"]) if players.Player(user_ID).team_ID not in (players.TERRORIST, players.COUNTER_TERRORIST): return if rpg.get_level(user_ID, _armor_repair) == 0: return delay = _delays.get(user_ID) if delay is None: delay = _delays[user_ID] = delays.Delay(_repair_armor, user_ID) delay.start(5, True) elif not delay.running: delay.start(5, True)
def player_hurt(event_var): attacker_ID = int(event_var["attacker"]) if attacker_ID == players.WORLD: return vampire_level = rpg.get_level(attacker_ID, _vampire) if vampire_level == 0: return health = rpg.PerkManager.data.get("health") if health is None or not health.enabled: max_health = 100 else: health_level = rpg.get_level(attacker_ID, health) if health_level == 0: max_health = 100 else: max_health = health.perk_calculator(health_level) health_bonus = int(event_var[ "dmg_health"]) * _vampire.perk_calculator(vampire_level) player = players.Player(attacker_ID) if max_health - int(event_var["es_attackerhealth"]) <= health_bonus: player.health = max_health else: player.health += health_bonus
def player_spawn(event_var): user_ID = int(event_var["userid"]) player = players.Player(user_ID) if player.team_ID not in (players.TERRORIST, players.COUNTER_TERRORIST): return clip_replenish_level = rpg.get_level(user_ID, _clip_replenish) if clip_replenish_level == 0: return delay = _delays.get(user_ID) if delay is None: delay = _delays[user_ID] = delays.Delay(_replenish_clip, player) delay.start(_clip_replenish.perk_calculator(clip_replenish_level), True) elif not delay.running: delay.start(_clip_replenish.perk_calculator(clip_replenish_level), True)
def player_hurt(event_var): victim_ID = int(event_var["userid"]) if (int(event_var["attacker"]) == players.WORLD or int(event_var["hitgroup"]) != 1): return adrenaline_level = rpg.get_level(victim_ID, _adrenaline) if adrenaline_level == 0: return player = players.Player(victim_ID) player.speed = _adrenaline.perk_calculator(adrenaline_level) player.colour = (255, 0, 0, 255) delay = _delays.get(victim_ID) if delay is None: delay = _delays[victim_ID] = delays.Delay(_remove_effects, victim_ID) delay.start(1.2) else: if delay.running: delay.stop() delay.start(1.2)
def player_hurt(event_var): victim_ID = int(event_var["userid"]) attacker_ID = int(event_var["attacker"]) if (attacker_ID == players.WORLD or list(weapons.weapon_types_by_names( event_var["weapon"]))[0].CATEGORY != weapons.CATEGORY_MELEE): return ice_stab_level = rpg.get_level(attacker_ID, _ice_stab) if ice_stab_level == 0: return player = players.Player(victim_ID) player.speed = _ice_stab.perk_calculator(ice_stab_level) player.colour = (0, 255, 0, 255) delay = _delays.get(victim_ID) if delay is None: delay = _delays[victim_ID] = delays.Delay(_remove_effects, victim_ID) delay.start(1.5) else: if delay.running: delay.stop() delay.start(1.5)
def player_jump(event_var): user_ID = int(event_var["userid"]) long_jump_level = rpg.get_level(user_ID, _long_jump) if long_jump_level == 0: return players.Player(user_ID).push(float(long_jump_level * 0.1), 0)