Exemplo n.º 1
0
def T_MissileTouch(*qwp_extra):
    if qc.other == qc.self.owner:
        return  #  don't explode on owner
    if qc.self.cnt:
        return
    qc.self.cnt = 1
    if engine.pointcontents(qc.self.origin) == defs.CONTENT_SKY:
        qc.self.remove()
        return

    damg = 100 + random.random() * 20
    if qc.other.health:
        combat.T_Damage(qc.other, qc.self, qc.self.owner, damg)

    #  don't do radius damage to the other, because all the damage
    #  was done in the impact
    combat.T_RadiusDamage(qc.self, qc.self.owner, 120, qc.other)
    # 	sound (self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM);
    qc.self.origin -= 8 * qc.self.velocity.normalize()
    qc.WriteByte(defs.MSG_MULTICAST, defs.SVC_TEMPENTITY)
    qc.WriteByte(defs.MSG_MULTICAST, defs.TE_EXPLOSION)
    qc.WriteCoord(defs.MSG_MULTICAST, qc.self.origin.x)
    qc.WriteCoord(defs.MSG_MULTICAST, qc.self.origin.y)
    qc.WriteCoord(defs.MSG_MULTICAST, qc.self.origin.z)
    engine.multicast(qc.self.origin, defs.MULTICAST_PHS)
    qc.self.remove()
Exemplo n.º 2
0
def Laser_Touch(*qwp_extra):
    org = Vector(0, 0, 0)
    if qc.other == qc.self.owner:
        return  #  don't explode on owner
    if engine.pointcontents(qc.self.origin) == defs.CONTENT_SKY:
        qc.self.remove()
        return

    qc.self.sound(defs.CHAN_WEAPON, 'enforcer/enfstop.wav', 1,
                  defs.ATTN_STATIC)
    org = qc.self.origin - 8 * qc.self.velocity.normalize()
    if qc.other.health:
        weapons.SpawnBlood(org, 15)
        qc.other.deathtype = 'laser'
        combat.T_Damage(qc.other, qc.self, qc.self.owner, 15)

    else:
        qc.WriteByte(defs.MSG_MULTICAST, defs.SVC_TEMPENTITY)
        qc.WriteByte(defs.MSG_MULTICAST, defs.TE_GUNSHOT)
        qc.WriteByte(defs.MSG_MULTICAST, 5)
        qc.WriteCoord(defs.MSG_MULTICAST, org.x)
        qc.WriteCoord(defs.MSG_MULTICAST, org.y)
        qc.WriteCoord(defs.MSG_MULTICAST, org.z)
        engine.multicast(org, defs.MULTICAST_PVS)

    qc.self.remove()
Exemplo n.º 3
0
def T_MissileTouch(*qwp_extra):
    if qc.other == qc.self.owner:
        return  #  don't explode on owner
    if qc.self.cnt:
        return 
    qc.self.cnt = 1
    if engine.pointcontents(qc.self.origin) == defs.CONTENT_SKY:
        qc.self.remove()
        return 
        
    damg = 100 + random.random() * 20
    if qc.other.health:
        combat.T_Damage(qc.other, qc.self, qc.self.owner, damg)
        
    #  don't do radius damage to the other, because all the damage
    #  was done in the impact
    combat.T_RadiusDamage(qc.self, qc.self.owner, 120, qc.other)
    # 	sound (self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM);
    qc.self.origin -= 8 * qc.self.velocity.normalize()
    qc.WriteByte(defs.MSG_MULTICAST, defs.SVC_TEMPENTITY)
    qc.WriteByte(defs.MSG_MULTICAST, defs.TE_EXPLOSION)
    qc.WriteCoord(defs.MSG_MULTICAST, qc.self.origin.x)
    qc.WriteCoord(defs.MSG_MULTICAST, qc.self.origin.y)
    qc.WriteCoord(defs.MSG_MULTICAST, qc.self.origin.z)
    engine.multicast(qc.self.origin, defs.MULTICAST_PHS)
    qc.self.remove()
Exemplo n.º 4
0
def superspike_touch(*qwp_extra):
    if qc.other == qc.self.owner:
        return 
    if qc.self.cnt:
        return 
    if qc.other.solid == defs.SOLID_TRIGGER:
        return  #  trigger field, do nothing
    qc.self.cnt = 1
    if engine.pointcontents(qc.self.origin) == defs.CONTENT_SKY:
        qc.self.remove()
        return 
        
    #  hit something that bleeds
    if qc.other.takedamage:
        spawn_touchblood(18)
        combat.T_Damage(qc.other, qc.self, qc.self.owner, 18)        
    else:
        qc.WriteByte(defs.MSG_MULTICAST, defs.SVC_TEMPENTITY)
        qc.WriteByte(defs.MSG_MULTICAST, defs.TE_SUPERSPIKE)
        qc.WriteCoord(defs.MSG_MULTICAST, qc.self.origin.x)
        qc.WriteCoord(defs.MSG_MULTICAST, qc.self.origin.y)
        qc.WriteCoord(defs.MSG_MULTICAST, qc.self.origin.z)
        engine.multicast(qc.self.origin, defs.MULTICAST_PHS)
        
    qc.self.remove()
Exemplo n.º 5
0
def Laser_Touch(*qwp_extra):
    org = Vector(0, 0, 0)
    if qc.other == qc.self.owner:
        return  #  don't explode on owner
    if engine.pointcontents(qc.self.origin) == defs.CONTENT_SKY:
        qc.self.remove()
        return 
        
    qc.self.sound(defs.CHAN_WEAPON, 'enforcer/enfstop.wav', 1, defs.ATTN_STATIC)
    org = qc.self.origin - 8 * qc.self.velocity.normalize()
    if qc.other.health:
        weapons.SpawnBlood(org, 15)
        qc.other.deathtype = 'laser'
        combat.T_Damage(qc.other, qc.self, qc.self.owner, 15)
        
    else:
        qc.WriteByte(defs.MSG_MULTICAST, defs.SVC_TEMPENTITY)
        qc.WriteByte(defs.MSG_MULTICAST, defs.TE_GUNSHOT)
        qc.WriteByte(defs.MSG_MULTICAST, 5)
        qc.WriteCoord(defs.MSG_MULTICAST, org.x)
        qc.WriteCoord(defs.MSG_MULTICAST, org.y)
        qc.WriteCoord(defs.MSG_MULTICAST, org.z)
        engine.multicast(org, defs.MULTICAST_PVS)
        
    qc.self.remove()
Exemplo n.º 6
0
def spike_touch(*qwp_extra):
    rand = 0
    if qc.other == qc.self.owner:
        return 
    if qc.self.voided:
        return 
        
    qc.self.voided = 1
    if qc.other.solid == defs.SOLID_TRIGGER:
        return  #  trigger field, do nothing
    if engine.pointcontents(qc.self.origin) == defs.CONTENT_SKY:
        qc.self.remove()
        return 
        
    #  hit something that bleeds
    if qc.other.takedamage:
        spawn_touchblood(9)
        qc.other.deathtype = 'nail'
        combat.T_Damage(qc.other, qc.self, qc.self.owner, 9)
        
    else:
        qc.WriteByte(defs.MSG_MULTICAST, defs.SVC_TEMPENTITY)
        if qc.self.classname == 'wizspike':
            qc.WriteByte(defs.MSG_MULTICAST, defs.TE_WIZSPIKE)
        elif qc.self.classname == 'knightspike':
            qc.WriteByte(defs.MSG_MULTICAST, defs.TE_KNIGHTSPIKE)
        else:
            qc.WriteByte(defs.MSG_MULTICAST, defs.TE_SPIKE)
        qc.WriteCoord(defs.MSG_MULTICAST, qc.self.origin.x)
        qc.WriteCoord(defs.MSG_MULTICAST, qc.self.origin.y)
        qc.WriteCoord(defs.MSG_MULTICAST, qc.self.origin.z)
        engine.multicast(qc.self.origin, defs.MULTICAST_PHS)
        
    qc.self.remove()
Exemplo n.º 7
0
def W_FireAxe(*qwp_extra):
    source = Vector(0, 0, 0)
    org = Vector(0, 0, 0)
    qc.makevectors(qc.self.v_angle)
    source = qc.self.origin + Vector(0, 0, 16)
    qc.traceline(source, source + qc.v_forward * 64, defs.FALSE, qc.self)
    if qc.trace_fraction == 1.0:
        return 
    org = qc.trace_endpos - qc.v_forward * 4
    if qc.trace_ent.takedamage:
        qc.trace_ent.axhitme = 1
        SpawnBlood(org, 20)
        if defs.deathmatch > 3:
            combat.T_Damage(qc.trace_ent, qc.self, qc.self, 75)
        else:
            combat.T_Damage(qc.trace_ent, qc.self, qc.self, 20)
        
    else:
        #  hit wall
        qc.self.sound(defs.CHAN_WEAPON, 'player/axhit2.wav', 1, defs.ATTN_NORM)
        qc.WriteByte(defs.MSG_MULTICAST, defs.SVC_TEMPENTITY)
        qc.WriteByte(defs.MSG_MULTICAST, defs.TE_GUNSHOT)
        qc.WriteByte(defs.MSG_MULTICAST, 3)
        qc.WriteCoord(defs.MSG_MULTICAST, org.x)
        qc.WriteCoord(defs.MSG_MULTICAST, org.y)
        qc.WriteCoord(defs.MSG_MULTICAST, org.z)
        engine.multicast(org, defs.MULTICAST_PVS)
Exemplo n.º 8
0
def superspike_touch(*qwp_extra):
    if qc.other == qc.self.owner:
        return
    if qc.self.cnt:
        return
    if qc.other.solid == defs.SOLID_TRIGGER:
        return  #  trigger field, do nothing
    qc.self.cnt = 1
    if engine.pointcontents(qc.self.origin) == defs.CONTENT_SKY:
        qc.self.remove()
        return

    #  hit something that bleeds
    if qc.other.takedamage:
        spawn_touchblood(18)
        combat.T_Damage(qc.other, qc.self, qc.self.owner, 18)
    else:
        qc.WriteByte(defs.MSG_MULTICAST, defs.SVC_TEMPENTITY)
        qc.WriteByte(defs.MSG_MULTICAST, defs.TE_SUPERSPIKE)
        qc.WriteCoord(defs.MSG_MULTICAST, qc.self.origin.x)
        qc.WriteCoord(defs.MSG_MULTICAST, qc.self.origin.y)
        qc.WriteCoord(defs.MSG_MULTICAST, qc.self.origin.z)
        engine.multicast(qc.self.origin, defs.MULTICAST_PHS)

    qc.self.remove()
Exemplo n.º 9
0
def W_FireLightning(*qwp_extra):
    if qc.self.ammo_cells < 1:
        qc.self.weapon = W_BestWeapon()
        W_SetCurrentAmmo()
        return

    #  explode if under water
    if qc.self.waterlevel > 1:
        cells = qc.self.ammo_cells
        qc.self.ammo_cells = 0
        W_SetCurrentAmmo()
        combat.T_RadiusDamage(qc.self, qc.self, 35 * cells, qc.world)
        return

    if qc.self.t_width < qc.time:
        qc.self.sound(defs.CHAN_WEAPON, 'weapons/lhit.wav', 1, defs.ATTN_NORM)
        qc.self.t_width = qc.time + 0.6

    qc.msg_entity = qc.self
    qc.WriteByte(defs.MSG_ONE, defs.SVC_SMALLKICK)
    qc.self.currentammo = qc.self.ammo_cells = qc.self.ammo_cells - 1
    org = qc.self.origin + Vector(0, 0, 16)
    qc.traceline(org, org + qc.v_forward * 600, defs.TRUE, qc.self)
    qc.WriteByte(defs.MSG_MULTICAST, defs.SVC_TEMPENTITY)
    qc.WriteByte(defs.MSG_MULTICAST, defs.TE_LIGHTNING2)
    qc.WriteEntity(defs.MSG_MULTICAST, qc.self)
    qc.WriteCoord(defs.MSG_MULTICAST, org.x)
    qc.WriteCoord(defs.MSG_MULTICAST, org.y)
    qc.WriteCoord(defs.MSG_MULTICAST, org.z)
    qc.WriteCoord(defs.MSG_MULTICAST, qc.trace_endpos.x)
    qc.WriteCoord(defs.MSG_MULTICAST, qc.trace_endpos.y)
    qc.WriteCoord(defs.MSG_MULTICAST, qc.trace_endpos.z)
    engine.multicast(org, defs.MULTICAST_PHS)
    LightningDamage(qc.self.origin, qc.trace_endpos + qc.v_forward * 4,
                    qc.self, 30)
Exemplo n.º 10
0
def W_FireLightning(*qwp_extra):
    if qc.self.ammo_cells < 1:
        qc.self.weapon = W_BestWeapon()
        W_SetCurrentAmmo()
        return 
        
    #  explode if under water
    if qc.self.waterlevel > 1:
        cells = qc.self.ammo_cells
        qc.self.ammo_cells = 0
        W_SetCurrentAmmo()
        combat.T_RadiusDamage(qc.self, qc.self, 35 * cells, qc.world)
        return 
        
    if qc.self.t_width < qc.time:
        qc.self.sound(defs.CHAN_WEAPON, 'weapons/lhit.wav', 1, defs.ATTN_NORM)
        qc.self.t_width = qc.time + 0.6
        
    qc.msg_entity = qc.self
    qc.WriteByte(defs.MSG_ONE, defs.SVC_SMALLKICK)
    qc.self.currentammo = qc.self.ammo_cells = qc.self.ammo_cells - 1
    org = qc.self.origin + Vector(0, 0, 16)
    qc.traceline(org, org + qc.v_forward * 600, defs.TRUE, qc.self)
    qc.WriteByte(defs.MSG_MULTICAST, defs.SVC_TEMPENTITY)
    qc.WriteByte(defs.MSG_MULTICAST, defs.TE_LIGHTNING2)
    qc.WriteEntity(defs.MSG_MULTICAST, qc.self)
    qc.WriteCoord(defs.MSG_MULTICAST, org.x)
    qc.WriteCoord(defs.MSG_MULTICAST, org.y)
    qc.WriteCoord(defs.MSG_MULTICAST, org.z)
    qc.WriteCoord(defs.MSG_MULTICAST, qc.trace_endpos.x)
    qc.WriteCoord(defs.MSG_MULTICAST, qc.trace_endpos.y)
    qc.WriteCoord(defs.MSG_MULTICAST, qc.trace_endpos.z)
    engine.multicast(org, defs.MULTICAST_PHS)
    LightningDamage(qc.self.origin, qc.trace_endpos + qc.v_forward * 4, qc.self, 30)
Exemplo n.º 11
0
def LightningHit(from0, damage, *qwp_extra):
    qc.WriteByte(defs.MSG_MULTICAST, defs.SVC_TEMPENTITY)
    qc.WriteByte(defs.MSG_MULTICAST, defs.TE_LIGHTNINGBLOOD)
    qc.WriteCoord(defs.MSG_MULTICAST, qc.trace_endpos.x)
    qc.WriteCoord(defs.MSG_MULTICAST, qc.trace_endpos.y)
    qc.WriteCoord(defs.MSG_MULTICAST, qc.trace_endpos.z)
    engine.multicast(qc.trace_endpos, defs.MULTICAST_PVS)
    combat.T_Damage(qc.trace_ent, from0, from0, damage)
Exemplo n.º 12
0
def SpawnBlood(org, damage, *qwp_extra):
    qc.WriteByte(defs.MSG_MULTICAST, defs.SVC_TEMPENTITY)
    qc.WriteByte(defs.MSG_MULTICAST, defs.TE_BLOOD)
    qc.WriteByte(defs.MSG_MULTICAST, 1)
    qc.WriteCoord(defs.MSG_MULTICAST, org.x)
    qc.WriteCoord(defs.MSG_MULTICAST, org.y)
    qc.WriteCoord(defs.MSG_MULTICAST, org.z)
    engine.multicast(org, defs.MULTICAST_PVS)
Exemplo n.º 13
0
def LightningHit(from0, damage, *qwp_extra):
    qc.WriteByte(defs.MSG_MULTICAST, defs.SVC_TEMPENTITY)
    qc.WriteByte(defs.MSG_MULTICAST, defs.TE_LIGHTNINGBLOOD)
    qc.WriteCoord(defs.MSG_MULTICAST, qc.trace_endpos.x)
    qc.WriteCoord(defs.MSG_MULTICAST, qc.trace_endpos.y)
    qc.WriteCoord(defs.MSG_MULTICAST, qc.trace_endpos.z)
    engine.multicast(qc.trace_endpos, defs.MULTICAST_PVS)
    combat.T_Damage(qc.trace_ent, from0, from0, damage)
Exemplo n.º 14
0
def SpawnBlood(org, damage, *qwp_extra):
    qc.WriteByte(defs.MSG_MULTICAST, defs.SVC_TEMPENTITY)
    qc.WriteByte(defs.MSG_MULTICAST, defs.TE_BLOOD)
    qc.WriteByte(defs.MSG_MULTICAST, 1)
    qc.WriteCoord(defs.MSG_MULTICAST, org.x)
    qc.WriteCoord(defs.MSG_MULTICAST, org.y)
    qc.WriteCoord(defs.MSG_MULTICAST, org.z)
    engine.multicast(org, defs.MULTICAST_PVS)
Exemplo n.º 15
0
def GrenadeExplode(*qwp_extra):
    combat.T_RadiusDamage(qc.self, qc.self.owner, 120, qc.world)
    qc.WriteByte(defs.MSG_MULTICAST, defs.SVC_TEMPENTITY)
    qc.WriteByte(defs.MSG_MULTICAST, defs.TE_EXPLOSION)
    qc.WriteCoord(defs.MSG_MULTICAST, qc.self.origin.x)
    qc.WriteCoord(defs.MSG_MULTICAST, qc.self.origin.y)
    qc.WriteCoord(defs.MSG_MULTICAST, qc.self.origin.z)
    engine.multicast(qc.self.origin, defs.MULTICAST_PHS)
    qc.self.remove()
Exemplo n.º 16
0
def GrenadeExplode(*qwp_extra):
    combat.T_RadiusDamage(qc.self, qc.self.owner, 120, qc.world)
    qc.WriteByte(defs.MSG_MULTICAST, defs.SVC_TEMPENTITY)
    qc.WriteByte(defs.MSG_MULTICAST, defs.TE_EXPLOSION)
    qc.WriteCoord(defs.MSG_MULTICAST, qc.self.origin.x)
    qc.WriteCoord(defs.MSG_MULTICAST, qc.self.origin.y)
    qc.WriteCoord(defs.MSG_MULTICAST, qc.self.origin.z)
    engine.multicast(qc.self.origin, defs.MULTICAST_PHS)
    qc.self.remove()
Exemplo n.º 17
0
def spawn_tfog(org, *qwp_extra):
    global s
    s = qc.spawn()
    s.origin = org
    s.nextthink = qc.time + 0.2
    s.think = play_teleport
    qc.WriteByte(defs.MSG_MULTICAST, defs.SVC_TEMPENTITY)
    qc.WriteByte(defs.MSG_MULTICAST, defs.TE_TELEPORT)
    qc.WriteCoord(defs.MSG_MULTICAST, org.x)
    qc.WriteCoord(defs.MSG_MULTICAST, org.y)
    qc.WriteCoord(defs.MSG_MULTICAST, org.z)
    engine.multicast(org, defs.MULTICAST_PHS)
Exemplo n.º 18
0
def spawn_tfog(org, *qwp_extra):
    global s
    s = qc.spawn()
    s.origin = org
    s.nextthink = qc.time + 0.2
    s.think = play_teleport
    qc.WriteByte(defs.MSG_MULTICAST, defs.SVC_TEMPENTITY)
    qc.WriteByte(defs.MSG_MULTICAST, defs.TE_TELEPORT)
    qc.WriteCoord(defs.MSG_MULTICAST, org.x)
    qc.WriteCoord(defs.MSG_MULTICAST, org.y)
    qc.WriteCoord(defs.MSG_MULTICAST, org.z)
    engine.multicast(org, defs.MULTICAST_PHS)
Exemplo n.º 19
0
def barrel_explode(*qwp_extra):
    qc.self.takedamage = defs.DAMAGE_NO
    qc.self.classname = 'explo_box'
    #  did say self.owner
    combat.T_RadiusDamage(qc.self, qc.self, 160, qc.world, None)
    qc.WriteByte(defs.MSG_MULTICAST, defs.SVC_TEMPENTITY)
    qc.WriteByte(defs.MSG_MULTICAST, defs.TE_EXPLOSION)
    qc.WriteCoord(defs.MSG_MULTICAST, qc.self.origin.x)
    qc.WriteCoord(defs.MSG_MULTICAST, qc.self.origin.y)
    qc.WriteCoord(defs.MSG_MULTICAST, qc.self.origin.z + 32)
    engine.multicast(qc.self.origin, defs.MULTICAST_PHS)
    qc.self.remove()
Exemplo n.º 20
0
def barrel_explode(*qwp_extra):
    qc.self.takedamage = defs.DAMAGE_NO
    qc.self.classname = 'explo_box'
    #  did say self.owner
    combat.T_RadiusDamage(qc.self, qc.self, 160, qc.world, None)
    qc.WriteByte(defs.MSG_MULTICAST, defs.SVC_TEMPENTITY)
    qc.WriteByte(defs.MSG_MULTICAST, defs.TE_EXPLOSION)
    qc.WriteCoord(defs.MSG_MULTICAST, qc.self.origin.x)
    qc.WriteCoord(defs.MSG_MULTICAST, qc.self.origin.y)
    qc.WriteCoord(defs.MSG_MULTICAST, qc.self.origin.z + 32)
    engine.multicast(qc.self.origin, defs.MULTICAST_PHS)
    qc.self.remove()
Exemplo n.º 21
0
def Multi_Finish(*qwp_extra):
    if puff_count:
        qc.WriteByte(defs.MSG_MULTICAST, defs.SVC_TEMPENTITY)
        qc.WriteByte(defs.MSG_MULTICAST, defs.TE_GUNSHOT)
        qc.WriteByte(defs.MSG_MULTICAST, puff_count)
        qc.WriteCoord(defs.MSG_MULTICAST, puff_org.x)
        qc.WriteCoord(defs.MSG_MULTICAST, puff_org.y)
        qc.WriteCoord(defs.MSG_MULTICAST, puff_org.z)
        engine.multicast(puff_org, defs.MULTICAST_PVS)        
    if blood_count:
        qc.WriteByte(defs.MSG_MULTICAST, defs.SVC_TEMPENTITY)
        qc.WriteByte(defs.MSG_MULTICAST, defs.TE_BLOOD)
        qc.WriteByte(defs.MSG_MULTICAST, blood_count)
        qc.WriteCoord(defs.MSG_MULTICAST, blood_org.x)
        qc.WriteCoord(defs.MSG_MULTICAST, blood_org.y)
        qc.WriteCoord(defs.MSG_MULTICAST, blood_org.z)
        engine.multicast(puff_org, defs.MULTICAST_PVS)
Exemplo n.º 22
0
def Multi_Finish(*qwp_extra):
    if puff_count:
        qc.WriteByte(defs.MSG_MULTICAST, defs.SVC_TEMPENTITY)
        qc.WriteByte(defs.MSG_MULTICAST, defs.TE_GUNSHOT)
        qc.WriteByte(defs.MSG_MULTICAST, puff_count)
        qc.WriteCoord(defs.MSG_MULTICAST, puff_org.x)
        qc.WriteCoord(defs.MSG_MULTICAST, puff_org.y)
        qc.WriteCoord(defs.MSG_MULTICAST, puff_org.z)
        engine.multicast(puff_org, defs.MULTICAST_PVS)
    if blood_count:
        qc.WriteByte(defs.MSG_MULTICAST, defs.SVC_TEMPENTITY)
        qc.WriteByte(defs.MSG_MULTICAST, defs.TE_BLOOD)
        qc.WriteByte(defs.MSG_MULTICAST, blood_count)
        qc.WriteCoord(defs.MSG_MULTICAST, blood_org.x)
        qc.WriteCoord(defs.MSG_MULTICAST, blood_org.y)
        qc.WriteCoord(defs.MSG_MULTICAST, blood_org.z)
        engine.multicast(puff_org, defs.MULTICAST_PVS)
Exemplo n.º 23
0
def T_MissileTouch(*qwp_extra):
    damg = 0
    # 	if (deathmatch == 4)
    # 	{
    # 	if ( ((other.weapon == 32) || (other.weapon == 16)))
    # 		{	
    # 			if (random() < 0.1)
    # 			{
    # 				if (other != world)
    # 				{
    # 	//				bprint (PRINT_HIGH, "Got here\n");
    # 					other.deathtype = "blaze";
    # 					T_Damage (other, self, self.owner, 1000 );
    # 					T_RadiusDamage (self, self.owner, 1000, other);
    # 				}
    # 			}
    # 		}	
    # 	}
    if qc.other == qc.self.owner:
        return  #  don't explode on owner
    if qc.self.voided:
        return 
        
    qc.self.voided = 1
    if engine.pointcontents(qc.self.origin) == defs.CONTENT_SKY:
        qc.self.remove()
        return 
        
    damg = 100 + random.random() * 20
    if qc.other.health:
        qc.other.deathtype = 'rocket'
        combat.T_Damage(qc.other, qc.self, qc.self.owner, damg)
        
    #  don't do radius damage to the other, because all the damage
    #  was done in the impact
    combat.T_RadiusDamage(qc.self, qc.self.owner, 120, qc.other, 'rocket')
    #   sound (self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM);
    qc.self.origin -= 8 * qc.self.velocity.normalize()
    qc.WriteByte(defs.MSG_MULTICAST, defs.SVC_TEMPENTITY)
    qc.WriteByte(defs.MSG_MULTICAST, defs.TE_EXPLOSION)
    qc.WriteCoord(defs.MSG_MULTICAST, qc.self.origin.x)
    qc.WriteCoord(defs.MSG_MULTICAST, qc.self.origin.y)
    qc.WriteCoord(defs.MSG_MULTICAST, qc.self.origin.z)
    engine.multicast(qc.self.origin, defs.MULTICAST_PHS)
    qc.self.remove()
Exemplo n.º 24
0
def W_FireAxe(*qwp_extra):
    qc.makevectors(qc.self.v_angle)
    source = qc.self.origin + Vector(0, 0, 16)
    qc.traceline(source, source + qc.v_forward * 64, defs.FALSE, qc.self)
    if qc.trace_fraction == 1.0:
        return
    org = qc.trace_endpos - qc.v_forward * 4
    if qc.trace_ent.takedamage:
        qc.trace_ent.axhitme = 1
        SpawnBlood(org, 20)
        combat.T_Damage(qc.trace_ent, qc.self, qc.self, 20)
    else:
        #  hit wall
        qc.self.sound(defs.CHAN_WEAPON, 'player/axhit2.wav', 1, defs.ATTN_NORM)
        qc.WriteByte(defs.MSG_MULTICAST, defs.SVC_TEMPENTITY)
        qc.WriteByte(defs.MSG_MULTICAST, defs.TE_GUNSHOT)
        qc.WriteByte(defs.MSG_MULTICAST, 3)
        qc.WriteCoord(defs.MSG_MULTICAST, org.x)
        qc.WriteCoord(defs.MSG_MULTICAST, org.y)
        qc.WriteCoord(defs.MSG_MULTICAST, org.z)
        engine.multicast(org, defs.MULTICAST_PVS)
Exemplo n.º 25
0
def muzzleflash(*qwp_extra):
    qc.WriteByte(defs.MSG_MULTICAST, defs.SVC_MUZZLEFLASH)
    qc.WriteEntity(defs.MSG_MULTICAST, qc.self)
    engine.multicast(qc.self.origin, defs.MULTICAST_PVS)
Exemplo n.º 26
0
def muzzleflash(*qwp_extra):
    qc.WriteByte(defs.MSG_MULTICAST, defs.SVC_MUZZLEFLASH)
    qc.WriteEntity(defs.MSG_MULTICAST, qc.self)
    engine.multicast(qc.self.origin, defs.MULTICAST_PVS)