def effect120(model, position, scale, frame_rate, flags, radius, magnitude, normal=None, material=None): """ est_effect_20 <player filter> <delay> <model> <position x y z> <scale> <framerate> <flags> <radius> <magnitude> [normal x y z] [material type] """ if not isinstance(position, Vector): position = Vector(*position) te = TempEntity('Explosion') te.position = position te.scale = scale te.frame_rate = frame_rate te.flags = flags te.radius = radius te.magnitude = magnitude if normal is not None: if not isinstance(normal, Vector): normal = Vector(*normal) te.normal = normal if material is not None: te.material_type = material return te
def effect8(model, x, y, z, dx, dy, dz): """ est_effect 8 <player filter> <delay> <model> <x> <y> <z> (towards <x> <y> <z>) """ if not isinstance(model, Model): model = Model(model) te = TempEntity('Metal Sparks') te.position = Vector(x, y, z) te.direction = Vector(dx, dy, dz) return te
def effect1(model, x, y, z, dx, dy, dz): """ est_effect 1 <player filter> <delay> <model> (position <x> <y> <z>) (direction <x> <y> <z>) """ if not isinstance(model, Model): model = Model(model) te = TempEntity('Armor Ricochet') te.position = Vector(x, y, z) te.direction = Vector(dx, dy, dz) return te
def effect120(model, position, scale, frame_rate, flags, radius, magnitude, normal=None, material=None): """ est_effect_20 <player filter> <delay> <model> <position x y z> <scale> <framerate> <flags> <radius> <magnitude> [normal x y z] [material type] """ if not isinstance(position, Vector): position = Vector(*position) te = TempEntity('Explosion') te.position = position te.scale = scale te.frame_rate = frame_rate te.flags = flags te.radius = radius te.magnitude = magnitude if normal is not None: if not isinstance(normal, Vector): normal = Vector(*normal) te.normal = normal if material is not None: if isinstance(material, str): # /game/server/func_break.h # typedef enum { matGlass = 0, matWood, matMetal, matFlesh, matCinderBlock, matCeilingTile, matComputer, matUnbreakableGlass, matRocks, matWeb, matNone, matLastMaterial } Materials; material = { 'glass': 0, 'wood': 1, 'metal': 2, 'flesh': 3, 'cinderblock': 4, 'ceilingtile': 5, 'computer': 6, 'unbreakableglass': 7, 'rocks': 8, 'web': 9 }.get(material.lower(), 0) te.material_type = material return te
def effect135(decal, position): """ est_effect_35 <player filter> <delay> <Decal> <Position x y z> """ if not isinstance(decal, Decal): decal = Decal(decal) if not isinstance(position, Vector): position = Vector(*position) te = TempEntity('World Decal') te.decal = decal te.position = position return te
def effect125(position, direction): """ est_effect_25 <player filter> <delay> <position x y z> <direction x y z> """ if not isinstance(position, Vector): position = Vector(*position) if not isinstance(direction, Vector): direction = Vector(*direction) te = TempEntity('Metal Sparks') te.position = position te.direction = direction return te
def effect122(position, direction, type_): """ est_effect_22 <player filter> <delay> <position x y z> <direction x y z> <type> """ if not isinstance(position, Vector): position = Vector(*position) if not isinstance(direction, Vector): direction = Vector(*direction) te = TempEntity('GaussExplosion') te.position = position te.direction = direction te.type = type_ return te
def effect119(position, direction, explosive): """ est_effect_19 <player filter> <delay> <position x y z> <direction x y z> <explosive> """ if not isinstance(position, Vector): position = Vector(*position) if not isinstance(direction, Vector): direction = Vector(*direction) te = TempEntity('Energy Splash') te.position = position te.direction = direction te.explosive = explosive return te
def effect133(model, position, size, brightness): """ est_effect_33 <player filter> <delay> <model> <position x y z> <size> <brightness> """ if not isinstance(model, Model): model = Model(model) if not isinstance(position, Vector): position = Vector(*position) te = TempEntity('Sprite') te.model = model te.position = position te.size = size te.brightness = brightness return te
def effect132(position, magnitude, trail_length, direction): """ est_effect_32 <player filter> <delay> <position x y z> <magnitude> <trail length> <direction x y z> """ if not isinstance(position, Vector): position = Vector(*position) if not isinstance(direction, Vector): direction = Vector(*direction) te = TempEntity('Smoke') te.position = position te.magnitude = magnitude te.trail_length = trail_length te.direction = direction return te
def effect131(model, position, scale, frame_rate): """ est_effect_31 <player filter> <delay> <model> <position x y z> <scale> <framerate> """ if not isinstance(model, Model): model = Model(model) if not isinstance(position, Vector): position = Vector(*position) te = TempEntity('Smoke') te.model = model te.position = position te.scale = scale te.frame_rate = frame_rate return te
def effect123(model, position, life_time, size, brightness): """ est_effect_23 <player filter> <delay> <model> <position x y z> <life> <size> <brightness> """ if not isinstance(model, Model): model = Model(model) if not isinstance(position, Vector): position = Vector(*position) te = TempEntity('GaussExplosion') te.model = model te.position = position te.life_time = life_time te.scale = size te.brightness = brightness return te
def effect101(model, position, direction): """ est_effect_01 <player filter> <delay> <model> <position x y z> <direction x y z> """ if not isinstance(model, Model): model = Model(model) if not isinstance(position, Vector): position = Vector(*position) if not isinstance(direction, Vector): direction = Vector(*direction) te = TempEntity('Armor Ricochet') te.position = position te.direction = direction return te
def effect134(model, position, direction, speed, noise, count): """ est_effect_34 <player filter> <delay> <model> <position x y z> <direction x y z> <speed> <noise> <count> """ if not isinstance(model, Model): model = Model(model) if not isinstance(position, Vector): position = Vector(*position) if not isinstance(direction, Vector): direction = Vector(*direction) te = TempEntity('Sprite Spray') te.model = model te.position = position te.direction = direction te.speed = speed te.noise = noise te.count = count return te
def _est_effect(command): todo = str(command[1]) filter = str(command[2]) delay = float(command[3]) if todo == "1": te = TempEntity('Armor Ricochet') te.position = Vector(float(command[4]), float(command[5]), float(command[6])) te.direction = Vector(float(command[7]), float(command[8]), float(command[9])) te.create() if todo == "2": te = TempEntity('BeamEntPoint') te.alpha = int(command[13]) te.blue = int(command[12]) te.green = int(command[11]) te.end_width = float(command[9]) te.life_time = float(command[7]) te.start_width = float(command[8]) te.end_entity_index = Player.from_userid(int(command[6])).index te.halo_index = Model(str(command[4])).index te.model_index = Model(str(command[4])).index te.start_entity_index = Player.from_userid(int(command[5])).index te.red = int(command[11]) te.create() if todo == "3": te = TempEntity('BeamPoints') model = Model(str(command[4])) x1 = float(command[5]) y1 = float(command[6]) z1 = float(command[7]) x2 = float(command[8]) y2 = float(command[9]) z2 = float(command[10]) life = float(command[11]) width = int(command[12]) end_width = int(command[13]) red = int(command[14]) green = int(command[15]) blue = int(command[16]) alpha = int(command[17]) te.alpha = alpha te.green = green te.blue = blue te.red = red te.end_width = end_width te.life_time = life te.start_width = width te.halo_index = model.index te.model_index = model.index te.end_point = Vector(x1, y1, z1) te.start_point = Vector(x2, y2, z2) te.create() if todo == "4": te = TempEntity('BeamFollow') te.alpha = int(command[13]) te.blue = int(command[12]) te.green = int(command[11]) te.end_width = int(command[8]) te.life_time = float(command[6]) te.start_width = int(command[7]) te.entity_index = Player.from_userid(int(command[5])).index te.fade_length = int(command[9]) te.halo_index = Model(str(command[4])).index te.model_index = Model(str(command[4])).index te.red = int(command[10]) te.create() if todo == "5": te = TempEntity('BeamRing') te.alpha = int(command[14]) te.blue = int(command[13]) te.green = int(command[12]) te.amplitude = float(command[10]) te.end_width = int(command[8]) te.life_time = float(command[7]) te.start_width = int(command[8]) te.end_entity_index = int(command[6]) te.halo_index = Model(str(command[4])).index te.model_index = Model(str(command[4])).index te.speed = int(command[15]) te.start_entity_index = Player.from_userid(int(command[5])).index te.red = int(command[11]) #est_effect [BeamRing] <player Filter> <delay> <model> <userid> <end index> <life> <width> <spread> <amplitude> <Red> <Green> <Blue> <Alpha> <speed> if todo == "6": te = TempEntity('Large Funnel') te.model_index = Model(str(command[4])).index te.reversed = int(command[8]) te.origin = Vector(float(command[5]), float(command[6]), float(command[7])) te.create() #est_effect [LargeFunnel] <player Filter> <delay> <model> <x> <y> <z> <reversed> if todo == "7": te = TempEntity('Smoke') te.scale = float(command[8]) te.frame_rate = int(command[9]) te.model_index = Model(str(command[4])).index te.model = Model(str(command[4])) te.origin = Vector(float(command[5]), float(command[6]), float(command[7])) te.create() if todo == "8": te = TempEntity('Metal Sparks') te.direction = Vector(float(command[8]), float(command[9]), float(command[10])) te.position = Vector(float(command[5]), float(command[6]), float(command[7])) te.create() #est_effect [MetalSparks] <player Filter> <delay> <model> <x> <y> <z> (towards <x> <y> <z>) + if todo == "9": te = TempEntity('GaussExplosion') te.type = int(command[11]) te.direction = Vector(float(command[8]), float(command[9]), float(command[10])) te.origin = Vector(float(command[5]), float(command[6]), float(command[7])) te.create() #est_effect [GaussExplosion] <player Filter> <delay> <model> <x> <y> <z> (towards <x> <y> <z>) <type> if todo == "10": te = TempEntity('BeamRingPoint') te.alpha = int(command[17]) te.blue = int(command[16]) te.green = int(command[15]) te.amplitude = float(command[13]) te.end_width = float(command[11]) te.life_time = float(command[10]) te.start_width = float(command[11]) te.end_radius = float(command[9]) te.start_radius = float(command[8]) te.fade_length = int(command[12]) te.halo_index = Model(str(command[4])).index te.model_index = Model(str(command[4])).index te.speed = int(command[18]) te.center = Vector(float(command[5]), float(command[6]), float(command[7])) te.red = int(command[14]) te.create() if todo == "11": te = TempEntity('GlowSprite') te.life_time = float(command[8]) te.scale = float(command[9]) te.brightness = int(command[10]) te.model_index = Model(str(command[4])).index te.origin = Vector(float(command[5]), float(command[6]), float(command[7])) te.create()