示例#1
0
def execute_changelevel(*qwp_extra):
    global intermission_running
    global intermission_exittime
    pos = engine.world
    intermission_running = 1
    #  enforce a wait time before allowing changelevel
    intermission_exittime = qc.time + 5
    pos = FindIntermission()
    #  play intermission music
    qc.WriteByte(defs.MSG_ALL, defs.SVC_CDTRACK)
    qc.WriteByte(defs.MSG_ALL, 3)
    qc.WriteByte(defs.MSG_ALL, defs.SVC_INTERMISSION)
    qc.WriteCoord(defs.MSG_ALL, pos.origin.x)
    qc.WriteCoord(defs.MSG_ALL, pos.origin.y)
    qc.WriteCoord(defs.MSG_ALL, pos.origin.z)
    qc.WriteAngle(defs.MSG_ALL, pos.mangle.x)
    qc.WriteAngle(defs.MSG_ALL, pos.mangle.y)
    qc.WriteAngle(defs.MSG_ALL, pos.mangle.z)
    qc.other = qc.find(qc.world, 'classname', 'player')
    while qc.other != qc.world:
        qc.other.takedamage = defs.DAMAGE_NO
        qc.other.solid = defs.SOLID_NOT
        qc.other.movetype = defs.MOVETYPE_NONE
        qc.other.modelindex = 0
        qc.other = qc.find(qc.other, 'classname', 'player')
示例#2
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()
示例#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()
示例#4
0
文件: misc.py 项目: angeld29/qwpy
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()
示例#5
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)
示例#6
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)
示例#7
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()
示例#8
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)
    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()
示例#9
0
文件: triggers.py 项目: angeld29/qwpy
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)
示例#10
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)
示例#11
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)
示例#12
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)