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()
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)
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()
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) qc.WriteByte(defs.MSG_BROADCAST, defs.SVC_TEMPENTITY) qc.WriteByte(defs.MSG_BROADCAST, defs.TE_EXPLOSION) qc.WriteCoord(defs.MSG_BROADCAST, qc.self.origin.x) qc.WriteCoord(defs.MSG_BROADCAST, qc.self.origin.y) qc.WriteCoord(defs.MSG_BROADCAST, qc.self.origin.z + 32) qc.self.remove()