Exemplo 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
Exemplo n.º 2
0
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
Exemplo n.º 3
0
def effect108(model, center, start_radius, end_radius, frame_rate, life_time,
              width, fade_length, amplitude, red, green, blue, alpha, speed,
              flags):
    """
    est_effect_08 <player filter> <delay> <model> <middle x y z> <start radius> <end radius> <framerate> <life> <width> <spread> <amplitude> <red> <green> <blue> <alpha> <speed> <flags>
    """
    if not isinstance(model, Model):
        model = Model(model)

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

    te = TempEntity('BeamRingPoint')
    te.model = model
    te.halo = model
    te.center = center
    te.start_radius = start_radius
    te.end_radius = end_radius
    te.frame_rate = frame_rate
    te.life_time = life_time
    te.start_width = width
    te.end_width = width
    te.fade_length = fade_length
    te.amplitude = amplitude
    te.red = red
    te.green = green
    te.blue = blue
    te.alpha = alpha
    te.speed = speed
    te.flags = flags

    return te
Exemplo 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
Exemplo n.º 5
0
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