Ejemplo n.º 1
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
Ejemplo n.º 2
0
def effect105(model, start_entity_index, end_entity_index, frame_rate,
              life_time, start_width, end_width, fade_length, amplitude, red,
              green, blue, alpha, speed):
    """
    est_effect_05 <player filter> <delay> <model> <start entity> <end entity> <framerate> <life> <start width> <end width> <fade distance> <amplitude> <red> <green> <blue> <alpha> <speed>
    """
    if not isinstance(model, Model):
        model = Model(model)

    te = TempEntity('BeamLaser')
    te.model = model
    te.halo = model
    te.start_entity_index = start_entity_index
    te.end_entity_index = end_entity_index
    te.frame_rate = frame_rate
    te.life_time = life_time
    te.start_width = start_width
    te.end_width = end_width
    te.fade_length = fade_length
    te.amplitude = amplitude
    te.red = red
    te.green = green
    te.blue = blue
    te.alpha = alpha
    te.speed = speed

    return te
Ejemplo n.º 3
0
def effect107(model, start_point, end_point, frame_rate, life_time, width,
              fade_length, amplitude, red, green, blue, alpha, speed):
    """
    est_effect_07 <player filter> <delay> <model> <start entity> <end entity> <framerate> <life> <width> <spread> <amplitude> <red> <green> <blue> <alpha> <speed>
    """
    if not isinstance(model, Model):
        model = Model(model)

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

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

    te = TempEntity('BeamPoints')
    te.model = model
    te.halo = model
    te.start_point = start_point
    te.end_point = end_point
    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

    return te
Ejemplo n.º 4
0
def effect10(model, x, y, z, start_radius, end_radius, life_time, width,
             fade_length, amplitude, red, green, blue, alpha, speed):
    """
    est_effect 10 <player filter> <delay> <model> <x> <y> <z> <start radius> <end radius> <life> <width> <spread> <amplitude> <red> <green> <blue> <alpha> <speed>
    """
    if not isinstance(model, Model):
        model = Model(model)

    te = TempEntity('BeamRingPoint')
    te.model = model
    te.halo = model
    te.center = Vector(x, y, z)
    te.start_radius = start_radius
    te.end_radius = end_radius
    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

    return te
Ejemplo n.º 5
0
def effect102(model, start_entity_index, start_point, end_entity_index,
              end_point, frame_rate, life_time, start_width, end_width,
              fade_length, amplitude, red, green, blue, alpha, speed):
    """
    est_effect_02 <player filter> <delay> <model> <start entity> <start position x y z> <end entity> <end position x y z> <framerate> <life> <start width> <end width> <fade distance> <amplitude> <red> <green> <blue> <alpha> <speed>
    """
    if not isinstance(model, Model):
        model = get_model_instance(model)

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

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

    te = TempEntity('BeamEntPoint')
    te.model = model
    te.halo = model
    te.start_entity_index = start_entity_index
    te.start_point = start_point
    te.end_entity_index = end_entity_index
    te.end_point = end_point
    te.frame_rate = frame_rate
    te.life_time = life_time
    te.start_width = start_width
    te.end_width = end_width
    te.fade_length = fade_length
    te.amplitude = amplitude
    te.red = red
    te.green = green
    te.blue = blue
    te.alpha = alpha
    te.speed = speed

    return te
Ejemplo n.º 6
0
def effect5(model, start_userid, end_entity_index, life_time, width,
            fade_length, amplitude, red, green, blue, alpha, speed):
    """
    est_effect 5 <player filter> <delay> <model> <userid> <end index> <life> <width> <spread> <amplitude> <red> <green> <blue> <alpha> <speed>
    """
    if not isinstance(model, Model):
        model = Model(model)

    te = TempEntity('BeamRing')
    te.model = model
    te.halo = model
    te.start_entity_index = index_from_userid(start_userid)
    te.end_entity_index = end_entity_index
    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

    return te
Ejemplo n.º 7
0
def _create_beam(start, end, color):
    """Create the beam from the player/weapon's origin to the victim's."""
    width = int(beam_width)
    entity = TempEntity('BeamPoints')
    entity.start_point = start
    entity.start_width = width
    entity.end_point = end
    entity.end_width = width
    entity.color = color
    entity.life_time = int(beam_time)
    entity.model = _model
    entity.halo = _model
    entity.create()
Ejemplo n.º 8
0
def _create_beam(start, end, color):
    """Create the beam from the player/weapon's origin to the victim's."""
    width = int(beam_width)
    entity = TempEntity('BeamPoints')
    entity.start_point = start
    entity.start_width = width
    entity.end_point = end
    entity.end_width = width
    entity.color = color
    entity.life_time = int(beam_time)
    entity.model = _model
    entity.halo = _model
    entity.create()
Ejemplo n.º 9
0
def give_trail(ent, team):
    if team == 2:
        color = Color(255, 0, 0)
    if team == 3:
        color = Color(0, 0, 255)
    entity = TempEntity('BeamFollow')
    entity.start_width = 3
    entity.end_width = 3
    entity.color = color
    entity.model = beam_model
    entity.halo = beam_model
    entity.entity_index = ent.index
    entity.life_time = 2
    entity.create()
Ejemplo n.º 10
0
def effect104(model, entity_index, life_time, start_width, end_width,
              fade_length, red, green, blue, alpha):
    """
    est_effect_04 <player filter> <delay> <model> <follow entity> <life> <start width> <end width> <fade distance> <red> <green> <blue> <alpha>
    """
    if not isinstance(model, Model):
        model = Model(model)

    te = TempEntity('BeamFollow')
    te.model = model
    te.halo = model
    te.entity_index = entity_index
    te.life_time = life_time
    te.start_width = start_width
    te.end_width = end_width
    te.fade_length = fade_length
    te.red = red
    te.green = green
    te.blue = blue
    te.alpha = alpha

    return te
Ejemplo n.º 11
0
def effect4(model, userid, life_time, start_width, end_width, fade_length, red,
            green, blue, alpha):
    """
    est_effect 4 <player filter> <delay> <model> <userid> <life> <width> <end width> <time to fade> <red> <green> <blue> <alpha>
    """
    if not isinstance(model, Model):
        model = Model(model)

    te = TempEntity('BeamFollow')
    te.model = model
    te.halo = model
    te.entity_index = index_from_userid(userid)
    te.life_time = life_time
    te.start_width = start_width
    te.end_width = end_width
    te.fade_length = fade_length
    te.red = red
    te.green = green
    te.blue = blue
    te.alpha = alpha

    return te
Ejemplo n.º 12
0
def effect3(model, x1, y1, z1, x2, y2, z2, life_time, start_width, end_width,
            red, green, blue, alpha):
    """
    est_effect 3 <player filter> <delay> <model> (start <x> <y> <z>) (end <x> <y> <z>) <life> <width> <end width> <red> <green> <blue> <alpha>
    """
    if not isinstance(model, Model):
        model = Model(model)

    te = TempEntity('BeamPoints')
    te.model = model
    te.halo = model
    te.start_point = Vector(x1, y1, z1)
    te.end_point = Vector(x2, y2, z2)
    te.life_time = life_time
    te.start_width = start_width
    te.end_width = end_width
    te.red = red
    te.green = green
    te.blue = blue
    te.alpha = alpha

    return te
Ejemplo n.º 13
0
def effect2(model, start_userid, end_userid, life_time, start_width, end_width,
            red, green, blue, alpha):
    """
    est_effect 2 <player filter> <delay> <model> <start userid> <end userid> <life> <width> <end width> <red> <green> <blue> <alpha>
    """
    if not isinstance(model, Model):
        model = Model(model)

    te = TempEntity('BeamEntPoint')
    te.model = model
    te.halo = model
    te.start_entity_index = index_from_userid(start_userid)
    te.end_entity_index = index_from_userid(end_userid)
    te.life_time = life_time
    te.start_width = start_width
    te.end_width = end_width
    te.red = red
    te.green = green
    te.blue = blue
    te.alpha = alpha

    return te
Ejemplo n.º 14
0
def effect115(model, mins, maxs, height, count, speed):
    """
    est_effect_15 <player filter> <delay> <model> <min x y z> <max x y z> <height> <count> <speed>
    """
    if not isinstance(model, Model):
        model = Model(model)

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

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

    te = TempEntity('Bubble Trail')
    te.model = model
    te.halo = model
    te.mins = mins
    te.maxs = maxs
    te.height = height
    te.count = count
    te.speed = speed

    return te
Ejemplo n.º 15
0
    def create_trail(self):
        """Create the beam trail for the given entity."""
        # Get the values for the beam color
        rgb = str(self.convars['beam_color'])

        # Use try/except to split the color values
        try:
            color = Color(*map(int, rgb.split(',')))

        # Otherwise, set the colors to a default value
        except ValueError:
            color = Color(127, 127, 127)

        # Create the beam effect
        entity = TempEntity('BeamFollow')
        entity.start_width = 6
        entity.end_width = 6
        entity.color = color
        entity.model = _model
        entity.halo = _model
        entity.entity_index = self.entity.index
        entity.life_time = 2
        self.create_temp_entity(entity)