Ejemplo n.º 1
0
def wall_velocity(*qwp_extra):
    vel = qc.self.velocity.normalize()
    vel = qc.normalize(vel + qc.v_up * (random.random() - 0.5) + qc.v_right *
                       (random.random() - 0.5))
    vel += 2 * qc.trace_plane_normal
    vel *= 200
    return vel
Ejemplo n.º 2
0
def VelocityForDamage(dm, *qwp_extra):
    v = Vector(0, 0, 0)
    if defs.damage_inflictor.velocity.length() > 0:
        v = 0.5 * defs.damage_inflictor.velocity
        v += 25 * qc.normalize(qc.self.origin - defs.damage_inflictor.origin)
        v %= Vector(None, None, 100 + 240 * random.random())
        v %= Vector(v.x + (200 * weapons.crandom()), None, None)
        v %= Vector(None, v.y + (200 * weapons.crandom()), None)
        # dprint ("Velocity gib\n");

    else:
        v %= Vector(100 * weapons.crandom(), None, None)
        v %= Vector(None, 100 * weapons.crandom(), None)
        v %= Vector(None, None, 200 + 100 * random.random())

    # v_x = 100 * crandom();
    # v_y = 100 * crandom();
    # v_z = 200 + 100 * random();
    if dm > -50:
        #       dprint ("level 1\n");
        v *= 0.7

    elif dm > -200:
        #       dprint ("level 3\n");
        v *= 2

    else:
        v *= 10
    return v
Ejemplo n.º 3
0
def VelocityForDamage(dm, *qwp_extra):
    v = Vector(0, 0, 0)
    if defs.damage_inflictor.velocity.length() > 0:
        v = 0.5 * defs.damage_inflictor.velocity
        v += 25 * qc.normalize(qc.self.origin - defs.damage_inflictor.origin)
        v %= Vector(None, None, 100 + 240 * random.random())
        v %= Vector(v.x + (200 * weapons.crandom()), None, None)
        v %= Vector(None, v.y + (200 * weapons.crandom()), None)
        # dprint ("Velocity gib\n");                
        
    else:
        v %= Vector(100 * weapons.crandom(), None, None)
        v %= Vector(None, 100 * weapons.crandom(), None)
        v %= Vector(None, None, 200 + 100 * random.random())
        
    # v_x = 100 * crandom();
    # v_y = 100 * crandom();
    # v_z = 200 + 100 * random();
    if dm > -50:
        #       dprint ("level 1\n");
        v *= 0.7
        
    elif dm > -200:
        #       dprint ("level 3\n");
        v *= 2
        
    else:
        v *= 10
    return v
Ejemplo n.º 4
0
def wall_velocity(*qwp_extra):
    vel = Vector(0, 0, 0)
    vel = qc.self.velocity.normalize()
    vel = qc.normalize(vel + qc.v_up * (random.random() - 0.5) + qc.v_right * (random.random() - 0.5))
    vel += 2 * qc.trace_plane_normal
    vel *= 200
    return vel
Ejemplo n.º 5
0
def TraceAttack(damage, dir, *qwp_extra):
    global blood_count
    global blood_org
    global puff_count

    vel = qc.normalize(dir + qc.v_up * crandom() + qc.v_right * crandom())
    vel += 2 * qc.trace_plane_normal
    vel *= 200
    org = qc.trace_endpos - dir * 4
    if qc.trace_ent.takedamage:
        blood_count += 1
        blood_org = org
        AddMultiDamage(qc.trace_ent, damage)
    else:
        puff_count += 1
Ejemplo n.º 6
0
def TraceAttack(damage, dir, *qwp_extra):
    global blood_count
    global blood_org
    global puff_count
    
    vel = qc.normalize(dir + qc.v_up * crandom() + qc.v_right * crandom())
    vel += 2 * qc.trace_plane_normal
    vel *= 200
    org = qc.trace_endpos - dir * 4
    if qc.trace_ent.takedamage:
        blood_count += 1
        blood_org = org
        AddMultiDamage(qc.trace_ent, damage)        
    else:
        puff_count += 1