Ejemplo n.º 1
0
def effect127(model, skin, position, angle, velocity, flags, effects):
    """
    est_effect_27 <player filter> <delay> <model> <subtype/skin> <position x y z> <angle p y r> <velocity x y z> <flags> <effects>
    """
    if not isinstance(model, Model):
        model = Model(model)

    if not isinstance(position, Vector):
        position = Vector(*position)

    if not isinstance(angle, QAngle):
        angle = QAngle(*angle)

    if not isinstance(velocity, Vector):
        velocity = Vector(*velocity)

    te = TempEntity('physicsprop')
    te.model = model
    te.skin = skin
    te.origin = position
    te.angles = angle
    te.velocity = velocity
    te.flags = flags
    te.effects = effects

    return te
Ejemplo n.º 2
0
def effect110(model, origin, direction, red, green, blue, alpha, size):
    """
    est_effect_10 <player filter> <delay> <model> <origin x y z> <direction x y z> <red> <green> <blue> <alpha> <size>
    """
    if not isinstance(model, Model):
        model = Model(model)

    if not isinstance(origin, Vector):
        origin = Vector(*origin)

    if not isinstance(direction, Vector):
        direction = Vector(*direction)

    te = TempEntity('Blood Sprite')
    te.drop_model = model
    te.spray_model = model
    te.origin = origin
    te.direction = direction
    te.red = red
    te.green = green
    te.blue = blue
    te.alpha = alpha
    te.size = size

    return te
Ejemplo n.º 3
0
 def update_trail(self):
     """Create the smoke trail for the given entity."""
     entity = TempEntity('Smoke')
     entity.origin = self.entity.origin
     entity.model = _model
     entity.scale = 1
     self.create_temp_entity(entity)
Ejemplo n.º 4
0
def effect112(model, origin, angle, size, velocity, randomization, count, time,
              flags):
    """
    est_effect_12 <player filter> <delay> <model> <origin x y z> <angle p y r> <Size x y z> <velocity x y z> <randomization> <count> <time> <flags>

    """
    if not isinstance(model, Model):
        model = Model(model)

    if not isinstance(origin, Vector):
        origin = Vector(*origin)

    if not isinstance(angle, QAngle):
        angle = QAngle(*angle)

    if not isinstance(size, Vector):
        size = Vector(*size)

    if not isinstance(velocity, Vector):
        velocity = Vector(*velocity)

    te = TempEntity('Break Model')
    te.model = model
    te.origin = origin
    te.rotation = angle
    te.size = size
    te.velocity = velocity
    te.randomization = randomization
    te.count = count
    te.life_time = time
    te.flags = flags

    return te
Ejemplo n.º 5
0
 def update_trail(self):
     """Create the sparks trail for the given entity."""
     entity = TempEntity('Sparks')
     entity.origin = self.entity.origin
     direction = self.entity.base_velocity
     direction.negate()
     entity.direction = direction
     entity.trail_length = 3
     entity.magnitude = 1
     self.create_temp_entity(entity)
Ejemplo n.º 6
0
def bullet_impact(event):
    """Called whenever a bullet hits something."""
    entity = TempEntity('World Decal')

    # Create the decal at the impact location
    entity.origin = Vector(*tuple(event.get_float(key) for key in 'xyz'))

    # Choose a random paintball material and precache it. It will return an
    # index.
    entity.decal_index = engine_server.precache_decal(random.choice(materials))

    entity.create()
Ejemplo n.º 7
0
def effect6(model, x, y, z, reversed_):
    """
    est_effect 6 <player filter> <delay> <model> <x> <y> <z> <reversed>
    """
    if not isinstance(model, Model):
        model = Model(model)

    te = TempEntity('Large Funnel')
    te.model = model
    te.origin = Vector(x, y, z)
    te.reversed = reversed_

    return te
Ejemplo n.º 8
0
def effect128(position, player_index, entity_index):
    """
    est_effect_28 <player filter> <delay> <position x y z> <playerindex> <entity>
    """
    if not isinstance(position, Vector):
        position = Vector(*position)

    te = TempEntity('Player Decal')
    te.origin = position
    te.player_index = player_index
    te.entity_index = entity_index

    return te
Ejemplo n.º 9
0
def effect9(model, x, y, z, dx, dy, dz, type_):
    """
    est_effect 9 <player filter> <delay> <model> <x> <y> <z> (towards <x> <y> <z>) <type>
    """
    if not isinstance(model, Model):
        model = Model(model)

    te = TempEntity('GaussExplosion')
    te.origin = Vector(x, y, z)
    te.direction = Vector(dx, dy, dz)
    te.type = type_

    return te
Ejemplo n.º 10
0
def effect7(model, x, y, z, scale, frame_rate):
    """
    est_effect 7 <player filter> <delay> <model> <x> <y> <z> <scale> <framerate>
    """
    if not isinstance(model, Model):
        model = Model(model)

    te = TempEntity('Smoke')
    te.model = model
    te.origin = Vector(x, y, z)
    te.scale = scale
    te.frame_rate = frame_rate

    return te
Ejemplo n.º 11
0
def effect11(model, x, y, z, life_time, scale, brightness):
    """
    est_effect 11 <player filter> <delay> <model> <x> <y> <z> <life> <size> <brightness>
    """
    if not isinstance(model, Model):
        model = Model(model)

    te = TempEntity('GlowSprite')
    te.model = model
    te.origin = Vector(x, y, z)
    te.life_time = life_time
    te.scale = scale
    te.brightness = brightness

    return te
Ejemplo n.º 12
0
def effect124(model, origin, reversed_):
    """
    est_effect_24 <player filter> <delay> <model> <position x y z> <reversed>
    """
    if not isinstance(model, Model):
        model = Model(model)

    if not isinstance(origin, Vector):
        origin = Vector(*origin)

    te = TempEntity('Large Funnel')
    te.model = model
    te.origin = origin
    te.reversed = reversed_

    return te
Ejemplo n.º 13
0
def effect113(decal, origin, index):
    """
    est_effect_13 <player filter> <delay> <decal> <origin x y z> <target entity index>
    """
    if not isinstance(decal, Decal):
        decal = Decal(decal)

    if not isinstance(origin, Vector):
        origin = Vector(*origin)

    te = TempEntity('BSP Decal')
    te.decal = decal
    te.origin = origin
    te.entity_index = index

    return te
Ejemplo n.º 14
0
def effect126(position, angle, scale, type_):
    """
    est_effect_26 <player filter> <delay> <position x y z> <angle p y r> <scale> <type>
    """
    if not isinstance(position, Vector):
        position = Vector(*position)

    if not isinstance(angle, QAngle):
        angle = QAngle(*angle)

    te = TempEntity('Metal Sparks')
    te.origin = position
    te.angles = angle
    te.scale = scale
    te.type = type_

    return te
Ejemplo n.º 15
0
def effect117(position, direction, size, speed):
    """
    est_effect_17 <player filter> <delay> <position x y z> <direction x y z> <size> <speed>
    """
    if not isinstance(position, Vector):
        position = Vector(*position)

    if not isinstance(direction, Vector):
        direction = Vector(*direction)

    te = TempEntity('Dust')
    te.origin = position
    te.direction = direction
    te.size = size
    te.speed = speed

    return te
Ejemplo n.º 16
0
def effect118(origin, red, green, blue, exponent, radius, life_time, decay):
    """
    est_effect_18 <player filter> <delay> <position x y z> <red> <green> <blue> <exponent> <radius> <time> <decay>
    """
    if not isinstance(origin, Vector):
        origin = Vector(*origin)

    te = TempEntity('Dynamic Light')
    te.origin = origin
    te.red = red
    te.green = green
    te.blue = blue
    te.exponent = exponent
    te.radius = radius
    te.life_time = life_time
    te.decay = decay

    return te
Ejemplo n.º 17
0
def effect129(decal, position, angle, distance):
    """
    est_effect_29 <player filter> <delay> <decal> <position x y z> <angle p y r> <distance>
    """
    if not isinstance(decal, Decal):
        decal = Decal(*decal)

    if not isinstance(position, Vector):
        position = Vector(*position)

    if not isinstance(angle, QAngle):
        angle = QAngle(*angle)

    te = TempEntity('Player Decal')
    te.decal = decal
    te.origin = position
    te.rotation = angle
    te.distance = distance

    return te
Ejemplo n.º 18
0
def effect116(decal, position, start, index, hitbox):
    """
    est_effect_16 <player filter> <delay> <model> <position x y z> <start x y z> <entity index> <hitbox>
    """
    if not isinstance(decal, Decal):
        decal = Decal(decal)

    if not isinstance(position, Vector):
        position = Vector(*position)

    if not isinstance(start, Vector):
        start = Vector(*start)

    te = TempEntity('Entity Decal')
    te.decal = decal
    te.origin = position
    te.start = start
    te.entity_index = index
    te.hitbox = hitbox

    return te
Ejemplo n.º 19
0
def effect111(model, origin, direction, red, green, blue, alpha, amount):
    """
    est_effect_11 <player filter> <delay> <model> <origin x y z> <direction x y z> <red> <green> <blue> <alpha> <amount>
    """
    if not isinstance(model, Model):
        model = Model(model)

    if not isinstance(origin, Vector):
        origin = Vector(*origin)

    if not isinstance(direction, Vector):
        direction = Vector(*direction)

    te = TempEntity('Blood Stream')
    te.origin = origin
    te.direction = direction
    te.red = red
    te.green = green
    te.blue = blue
    te.alpha = alpha
    te.amount = amount

    return te
Ejemplo n.º 20
0
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()
Ejemplo n.º 21
0
 def update_trail(self):
     """Create the smoke trail for the given entity."""
     entity = TempEntity('Dust')
     entity.origin = self.entity.origin
     entity.size = 20
     self.create_temp_entity(entity)