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()
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()
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)