Exemple #1
0
def W_FireGrenade(*qwp_extra):
    qc.self.currentammo = qc.self.ammo_rockets = qc.self.ammo_rockets - 1
    qc.self.sound(defs.CHAN_WEAPON, 'weapons/grenade.wav', 1, defs.ATTN_NORM)
    qc.msg_entity = qc.self
    qc.WriteByte(defs.MSG_ONE, defs.SVC_SMALLKICK)
    qc.newmis = qc.spawn()
    qc.newmis.owner = qc.self
    qc.newmis.movetype = defs.MOVETYPE_BOUNCE
    qc.newmis.solid = defs.SOLID_BBOX
    qc.newmis.classname = 'grenade'
    qc.newmis.cnt = 0
    #  set newmis speed	
    qc.makevectors(qc.self.v_angle)
    if qc.self.v_angle.x:
        qc.newmis.velocity = qc.v_forward * 600 + qc.v_up * 200 + crandom() * qc.v_right * 10 + crandom() * qc.v_up * 10
    else:
        qc.newmis.velocity = qc.self.aim(10000)
        qc.newmis.velocity *= 600
        qc.newmis.velocity %= Vector(None, None, 200)
        
    qc.newmis.avelocity = Vector(300, 300, 300)
    qc.newmis.angles = qc.vectoangles(qc.newmis.velocity)
    qc.newmis.touch = GrenadeTouch
    #  set newmis duration
    qc.newmis.nextthink = qc.time + 2.5
    qc.newmis.think = GrenadeExplode
    qc.newmis.setmodel('progs/grenade.mdl')
    qc.setsize(qc.newmis, Vector(0, 0, 0), Vector(0, 0, 0))
    qc.setorigin(qc.newmis, qc.self.origin)
Exemple #2
0
def W_FireGrenade(*qwp_extra):
    qc.self.currentammo = qc.self.ammo_rockets = qc.self.ammo_rockets - 1
    qc.self.sound(defs.CHAN_WEAPON, 'weapons/grenade.wav', 1, defs.ATTN_NORM)
    qc.msg_entity = qc.self
    qc.WriteByte(defs.MSG_ONE, defs.SVC_SMALLKICK)
    qc.newmis = qc.spawn()
    qc.newmis.owner = qc.self
    qc.newmis.movetype = defs.MOVETYPE_BOUNCE
    qc.newmis.solid = defs.SOLID_BBOX
    qc.newmis.classname = 'grenade'
    qc.newmis.cnt = 0
    #  set newmis speed
    qc.makevectors(qc.self.v_angle)
    if qc.self.v_angle.x:
        qc.newmis.velocity = qc.v_forward * 600 + qc.v_up * 200 + crandom(
        ) * qc.v_right * 10 + crandom() * qc.v_up * 10
    else:
        qc.newmis.velocity = qc.self.aim(10000)
        qc.newmis.velocity *= 600
        qc.newmis.velocity %= Vector(None, None, 200)

    qc.newmis.avelocity = Vector(300, 300, 300)
    qc.newmis.angles = qc.vectoangles(qc.newmis.velocity)
    qc.newmis.touch = GrenadeTouch
    #  set newmis duration
    qc.newmis.nextthink = qc.time + 2.5
    qc.newmis.think = GrenadeExplode
    qc.newmis.setmodel('progs/grenade.mdl')
    qc.setsize(qc.newmis, Vector(0, 0, 0), Vector(0, 0, 0))
    qc.setorigin(qc.newmis, qc.self.origin)
Exemple #3
0
def launch_spike(org, dir, *qwp_extra):
    qc.newmis = qc.spawn()
    qc.newmis.owner = qc.self
    qc.newmis.movetype = defs.MOVETYPE_FLYMISSILE
    qc.newmis.solid = defs.SOLID_BBOX
    qc.newmis.cnt = 0
    qc.newmis.angles = qc.vectoangles(dir)
    qc.newmis.touch = spike_touch
    qc.newmis.classname = 'spike'
    qc.newmis.think = subs.SUB_Remove
    qc.newmis.nextthink = qc.time + 6
    qc.newmis.setmodel('progs/spike.mdl')
    qc.setsize(qc.newmis, defs.VEC_ORIGIN, defs.VEC_ORIGIN)
    qc.setorigin(qc.newmis, org)
    qc.newmis.velocity = dir * 1000
Exemple #4
0
def launch_spike(org, dir, *qwp_extra):
    qc.newmis = qc.spawn()
    qc.newmis.owner = qc.self
    qc.newmis.movetype = defs.MOVETYPE_FLYMISSILE
    qc.newmis.solid = defs.SOLID_BBOX
    qc.newmis.cnt = 0
    qc.newmis.angles = qc.vectoangles(dir)
    qc.newmis.touch = spike_touch
    qc.newmis.classname = 'spike'
    qc.newmis.think = subs.SUB_Remove
    qc.newmis.nextthink = qc.time + 6
    qc.newmis.setmodel('progs/spike.mdl')
    qc.setsize(qc.newmis, defs.VEC_ORIGIN, defs.VEC_ORIGIN)
    qc.setorigin(qc.newmis, org)
    qc.newmis.velocity = dir * 1000
Exemple #5
0
def LaunchLaser(org, vec, *qwp_extra):
    if qc.self.classname == 'monster_enforcer':
        qc.self.sound(defs.CHAN_WEAPON, 'enforcer/enfire.wav', 1, defs.ATTN_NORM)
    vec = vec.normalize()
    qc.newmis = qc.spawn()
    qc.newmis.owner = qc.self
    qc.newmis.movetype = defs.MOVETYPE_FLY
    qc.newmis.solid = defs.SOLID_BBOX
    qc.newmis.effects = defs.EF_DIMLIGHT
    qc.newmis.setmodel('progs/laser.mdl')
    qc.setsize(qc.newmis, Vector(0, 0, 0), Vector(0, 0, 0))
    qc.setorigin(qc.newmis, org)
    qc.newmis.velocity = vec * 600
    qc.newmis.angles = qc.vectoangles(qc.newmis.velocity)
    qc.newmis.nextthink = qc.time + 5
    qc.newmis.think = subs.SUB_Remove
    qc.newmis.touch = Laser_Touch
Exemple #6
0
def LaunchLaser(org, vec, *qwp_extra):
    if qc.self.classname == 'monster_enforcer':
        qc.self.sound(defs.CHAN_WEAPON, 'enforcer/enfire.wav', 1,
                      defs.ATTN_NORM)
    vec = vec.normalize()
    qc.newmis = qc.spawn()
    qc.newmis.owner = qc.self
    qc.newmis.movetype = defs.MOVETYPE_FLY
    qc.newmis.solid = defs.SOLID_BBOX
    qc.newmis.effects = defs.EF_DIMLIGHT
    qc.newmis.setmodel('progs/laser.mdl')
    qc.setsize(qc.newmis, Vector(0, 0, 0), Vector(0, 0, 0))
    qc.setorigin(qc.newmis, org)
    qc.newmis.velocity = vec * 600
    qc.newmis.angles = qc.vectoangles(qc.newmis.velocity)
    qc.newmis.nextthink = qc.time + 5
    qc.newmis.think = subs.SUB_Remove
    qc.newmis.touch = Laser_Touch
Exemple #7
0
def W_FireRocket(*qwp_extra):
    qc.self.currentammo = qc.self.ammo_rockets = qc.self.ammo_rockets - 1
    qc.self.sound(defs.CHAN_WEAPON, 'weapons/sgun1.wav', 1, defs.ATTN_NORM)
    qc.msg_entity = qc.self
    qc.WriteByte(defs.MSG_ONE, defs.SVC_SMALLKICK)
    qc.newmis = qc.spawn()
    qc.newmis.owner = qc.self
    qc.newmis.movetype = defs.MOVETYPE_FLYMISSILE
    qc.newmis.solid = defs.SOLID_BBOX
    qc.newmis.classname = 'missile'
    qc.newmis.cnt = 0
    #  set newmis speed	
    qc.makevectors(qc.self.v_angle)
    qc.newmis.velocity = qc.self.aim(1000)
    qc.newmis.velocity *= 1000
    qc.newmis.angles = qc.vectoangles(qc.newmis.velocity)
    qc.newmis.touch = T_MissileTouch
    #  set newmis duration
    qc.newmis.nextthink = qc.time + 5
    qc.newmis.think = subs.SUB_Remove
    qc.newmis.setmodel('progs/missile.mdl')
    qc.setsize(qc.newmis, Vector(0, 0, 0), Vector(0, 0, 0))
    qc.setorigin(qc.newmis, qc.self.origin + qc.v_forward * 8 + Vector(0, 0, 16))
Exemple #8
0
def W_FireRocket(*qwp_extra):
    qc.self.currentammo = qc.self.ammo_rockets = qc.self.ammo_rockets - 1
    qc.self.sound(defs.CHAN_WEAPON, 'weapons/sgun1.wav', 1, defs.ATTN_NORM)
    qc.msg_entity = qc.self
    qc.WriteByte(defs.MSG_ONE, defs.SVC_SMALLKICK)
    qc.newmis = qc.spawn()
    qc.newmis.owner = qc.self
    qc.newmis.movetype = defs.MOVETYPE_FLYMISSILE
    qc.newmis.solid = defs.SOLID_BBOX
    qc.newmis.classname = 'missile'
    qc.newmis.cnt = 0
    #  set newmis speed
    qc.makevectors(qc.self.v_angle)
    qc.newmis.velocity = qc.self.aim(1000)
    qc.newmis.velocity *= 1000
    qc.newmis.angles = qc.vectoangles(qc.newmis.velocity)
    qc.newmis.touch = T_MissileTouch
    #  set newmis duration
    qc.newmis.nextthink = qc.time + 5
    qc.newmis.think = subs.SUB_Remove
    qc.newmis.setmodel('progs/missile.mdl')
    qc.setsize(qc.newmis, Vector(0, 0, 0), Vector(0, 0, 0))
    qc.setorigin(qc.newmis,
                 qc.self.origin + qc.v_forward * 8 + Vector(0, 0, 16))