コード例 #1
0
ファイル: teamplay.py プロジェクト: angeld29/qwpy
def func_ctf_wall(*qwp_extra):
    if engine.cvar('teamplay') & TEAM_CAPTURE_FLAG:
        qc.self.angles = Vector(0, 0, 0)
        qc.self.movetype = defs.MOVETYPE_PUSH  #  so it doesn't get pushed by anything
        qc.self.solid = defs.SOLID_BSP
        qc.self.setmodel(qc.self.model)
    else:
        qc.self.remove()
コード例 #2
0
ファイル: teamplay.py プロジェクト: barryp/qwpython
def func_ctf_wall(*qwp_extra):
    if engine.cvar("teamplay") & TEAM_CAPTURE_FLAG:
        qc.self.angles = Vector(0, 0, 0)
        qc.self.movetype = defs.MOVETYPE_PUSH  #  so it doesn't get pushed by anything
        qc.self.solid = defs.SOLID_BSP
        qc.self.setmodel(qc.self.model)
    else:
        qc.self.remove()
コード例 #3
0
ファイル: player.py プロジェクト: angeld29/qwpy
def PlayerDie(*qwp_extra):
    #  make dead guy release hook (wedge)
    if qc.self.hook_out:
        grapple.Reset_Grapple(qc.self.hook)
        qc.self.attack_finished = qc.time + 0.75
        qc.self.hook_out = defs.TRUE  #  PutClientInServer will reset this

    qc.self.items -= qc.self.items & defs.IT_INVISIBILITY
    qc.self.invisible_finished = 0  #  don't die as eyes
    qc.self.invincible_finished = 0
    qc.self.super_damage_finished = 0
    qc.self.radsuit_finished = 0
    qc.self.modelindex = client.modelindex_player  #  don't use eyes
    items.DropBackpack()
    items.DropRune()
    teamplay.TeamCaptureDropFlagOfPlayer(qc.self)
    if qc.self.killed == 2:
        qc.self.killed = 0
    else:
        qc.self.killed = 1
    qc.self.weaponmodel = None
    qc.self.view_ofs = Vector(0, 0, -8)
    qc.self.deadflag = defs.DEAD_DYING
    qc.self.solid = defs.SOLID_NOT
    qc.self.flags -= qc.self.flags & defs.FL_ONGROUND
    qc.self.movetype = defs.MOVETYPE_TOSS
    if qc.self.velocity.z < 10:
        qc.self.velocity %= Vector(None, None,
                                   qc.self.velocity.z + random.random() * 300)
    if qc.self.health < -40:
        GibPlayer()
        return

    DeathSound()
    qc.self.angles %= Vector(0, None, None)
    qc.self.angles %= Vector(None, None, 0)
    if qc.self.weapon == defs.IT_AXE:
        player_die_ax1()
        return

    i = engine.cvar('temp1')
    if not i:
        i = 1 + math.floor(random.random() * 6)
    if i == 1:
        player_diea1()
    elif i == 2:
        player_dieb1()
    elif i == 3:
        player_diec1()
    elif i == 4:
        player_died1()
    else:
        player_diee1()
コード例 #4
0
ファイル: client.py プロジェクト: barryp/qwpython
def changelevel_touch(*qwp_extra):
    global nextmap
    pos = engine.world
    if qc.other.classname != 'player':
        return 
    #  if "noexit" is set, blow up the player trying to leave
    # ZOID, 12-13-96, noexit isn't supported in QW.  Overload samelevel
    #       if ((cvar("noexit") == 1) || ((cvar("noexit") == 2) && (mapname != "start")))
    if (engine.cvar('samelevel') == 2) or ((engine.cvar('samelevel') == 3) and (qc.mapname != 'start')):
        combat.T_Damage(qc.other, qc.self, qc.self, 50000)
        return 
        
    engine.bprint(defs.PRINT_HIGH, qc.other.netname)
    engine.bprint(defs.PRINT_HIGH, ' exited the level\012')
    nextmap = qc.self.map
    subs.SUB_UseTargets()
    qc.self.touch = subs.SUB_Null
    #  we can't move people right now, because touch functions are called
    #  in the middle of C movement code, so set a think time to do it
    qc.self.think = execute_changelevel
    qc.self.nextthink = qc.time + 0.1
コード例 #5
0
ファイル: player.py プロジェクト: barryp/qwpython
def PlayerDie(*qwp_extra):
    #  make dead guy release hook (wedge)
    if qc.self.hook_out:
        grapple.Reset_Grapple(qc.self.hook)
        qc.self.attack_finished = qc.time + 0.75
        qc.self.hook_out = defs.TRUE #  PutClientInServer will reset this
        
    qc.self.items -= qc.self.items & defs.IT_INVISIBILITY
    qc.self.invisible_finished = 0 #  don't die as eyes
    qc.self.invincible_finished = 0
    qc.self.super_damage_finished = 0
    qc.self.radsuit_finished = 0
    qc.self.modelindex = client.modelindex_player #  don't use eyes
    items.DropBackpack()
    items.DropRune()
    teamplay.TeamCaptureDropFlagOfPlayer(qc.self)
    if qc.self.killed == 2:
        qc.self.killed = 0
    else:
        qc.self.killed = 1
    qc.self.weaponmodel = None
    qc.self.view_ofs = Vector(0, 0, -8)
    qc.self.deadflag = defs.DEAD_DYING
    qc.self.solid = defs.SOLID_NOT
    qc.self.flags -= qc.self.flags & defs.FL_ONGROUND
    qc.self.movetype = defs.MOVETYPE_TOSS
    if qc.self.velocity.z < 10:
        qc.self.velocity %= Vector(None, None, qc.self.velocity.z + random.random() * 300)
    if qc.self.health < -40:
        GibPlayer()
        return 
        
    DeathSound()
    qc.self.angles %= Vector(0, None, None)
    qc.self.angles %= Vector(None, None, 0)
    if qc.self.weapon == defs.IT_AXE:
        player_die_ax1()
        return 
        
    i = engine.cvar('temp1')
    if not i:
        i = 1 + math.floor(random.random() * 6)
    if i == 1:
        player_diea1()
    elif i == 2:
        player_dieb1()
    elif i == 3:
        player_diec1()
    elif i == 4:
        player_died1()
    else:
        player_diee1()
コード例 #6
0
ファイル: client.py プロジェクト: barryp/qwpython
def GotoNextMap(*qwp_extra):
    newmap = None
    # ZOID: 12-13-96, samelevel is overloaded, only 1 works for same level
    if engine.cvar('samelevel') == 1: #  if samelevel is set, stay on same level
        engine.changelevel(qc.mapname)
    else:
        #  configurable map lists, see if the current map exists as a
        #  serverinfo/localinfo var
        newmap = qc.world.infokey(qc.mapname)
        if newmap != None:
            engine.changelevel(newmap)
        else:
            engine.changelevel(nextmap)
コード例 #7
0
def changelevel_touch(*qwp_extra):
    global nextmap
    pos = engine.world
    if qc.other.classname != 'player':
        return
    #  if "noexit" is set, blow up the player trying to leave
    # ZOID, 12-13-96, noexit isn't supported in QW.  Overload samelevel
    #       if ((cvar("noexit") == 1) || ((cvar("noexit") == 2) && (mapname != "start")))
    if (engine.cvar('samelevel') == 2) or ((engine.cvar('samelevel') == 3) and
                                           (qc.mapname != 'start')):
        combat.T_Damage(qc.other, qc.self, qc.self, 50000)
        return

    engine.bprint(defs.PRINT_HIGH, qc.other.netname)
    engine.bprint(defs.PRINT_HIGH, ' exited the level\012')
    nextmap = qc.self.map
    subs.SUB_UseTargets()
    qc.self.touch = subs.SUB_Null
    #  we can't move people right now, because touch functions are called
    #  in the middle of C movement code, so set a think time to do it
    qc.self.think = execute_changelevel
    qc.self.nextthink = qc.time + 0.1
コード例 #8
0
ファイル: triggers.py プロジェクト: barryp/qwpython
def trigger_onlyregistered_touch(*qwp_extra):
    if qc.other.classname != 'player':
        return 
    if qc.self.attack_finished > qc.time:
        return 
    qc.self.attack_finished = qc.time + 2
    if engine.cvar('registered'):
        qc.self.message = None
        subs.SUB_UseTargets()
        qc.self.remove()        
    else:
        if qc.self.message != None:
            qc.centerprint(qc.other, qc.self.message)
            qc.other.sound(defs.CHAN_BODY, 'misc/talk.wav', 1, defs.ATTN_NORM)
コード例 #9
0
def GotoNextMap(*qwp_extra):
    newmap = None
    # ZOID: 12-13-96, samelevel is overloaded, only 1 works for same level
    if engine.cvar(
            'samelevel') == 1:  #  if samelevel is set, stay on same level
        engine.changelevel(qc.mapname)
    else:
        #  configurable map lists, see if the current map exists as a
        #  serverinfo/localinfo var
        newmap = qc.world.infokey(qc.mapname)
        if newmap != None:
            engine.changelevel(newmap)
        else:
            engine.changelevel(nextmap)
コード例 #10
0
ファイル: triggers.py プロジェクト: angeld29/qwpy
def trigger_onlyregistered_touch(*qwp_extra):
    if qc.other.classname != 'player':
        return
    if qc.self.attack_finished > qc.time:
        return
    qc.self.attack_finished = qc.time + 2
    if engine.cvar('registered'):
        qc.self.message = None
        subs.SUB_UseTargets()
        qc.self.remove()
    else:
        if qc.self.message != None:
            qc.centerprint(qc.other, qc.self.message)
            qc.other.sound(defs.CHAN_BODY, 'misc/talk.wav', 1, defs.ATTN_NORM)
コード例 #11
0
ファイル: teamplay.py プロジェクト: barryp/qwpython
def item_flag_team1(*qwp_extra):
    if not defs.deathmatch or not (engine.cvar("teamplay") & TEAM_CAPTURE_FLAG):
        qc.self.remove()
        return

    qc.self.steam = TEAM_COLOR1
    qc.self.items = defs.IT_KEY2
    engine.precache_model("progs/flag.mdl")
    qc.self.setmodel("progs/flag.mdl")
    qc.self.skin = 0
    engine.precache_sound("misc/flagtk.wav")  #  flag taken
    engine.precache_sound("misc/flagcap.wav")  #  flag capture
    engine.precache_sound("doors/runetry.wav")
    qc.self.noise = "misc/flagtk.wav"
    qc.self.noise1 = "doors/runetry.wav"
    qc.setsize(qc.self, Vector(-16, -16, 0), Vector(16, 16, 74))
    qc.self.nextthink = qc.time + 0.2  #  items start after other solids
    qc.self.think = place_flag
コード例 #12
0
ファイル: teamplay.py プロジェクト: angeld29/qwpy
def item_flag_team1(*qwp_extra):
    if not defs.deathmatch or not (engine.cvar('teamplay')
                                   & TEAM_CAPTURE_FLAG):
        qc.self.remove()
        return

    qc.self.steam = TEAM_COLOR1
    qc.self.items = defs.IT_KEY2
    engine.precache_model('progs/flag.mdl')
    qc.self.setmodel('progs/flag.mdl')
    qc.self.skin = 0
    engine.precache_sound('misc/flagtk.wav')  #  flag taken
    engine.precache_sound('misc/flagcap.wav')  #  flag capture
    engine.precache_sound('doors/runetry.wav')
    qc.self.noise = 'misc/flagtk.wav'
    qc.self.noise1 = 'doors/runetry.wav'
    qc.setsize(qc.self, Vector(-16, -16, 0), Vector(16, 16, 74))
    qc.self.nextthink = qc.time + 0.2  #  items start after other solids
    qc.self.think = place_flag
コード例 #13
0
ファイル: client.py プロジェクト: barryp/qwpython
def NextLevel(*qwp_extra):
    global nextmap
    o = engine.world
    newmap = None
    if nextmap != None:
        return  #  already done
    if qc.mapname == 'start':
        if not engine.cvar('registered'):
            qc.mapname = 'e1m1'
            
        elif not (qc.serverflags & 1):
            qc.mapname = 'e1m1'
            qc.serverflags |= 1
            
        elif not (qc.serverflags & 2):
            qc.mapname = 'e2m1'
            qc.serverflags |= 2
            
        elif not (qc.serverflags & 4):
            qc.mapname = 'e3m1'
            qc.serverflags |= 4
            
        elif not (qc.serverflags & 8):
            qc.mapname = 'e4m1'
            qc.serverflags -= 7
            
        o = qc.spawn()
        o.map = qc.mapname
        
    else:
        #  find a trigger changelevel
        o = qc.find(qc.world, 'classname', 'trigger_changelevel')
        if not o or qc.mapname == 'start':
            #  go back to same map if no trigger_changelevel
            o = qc.spawn()
            o.map = qc.mapname
            
        
    nextmap = o.map
    if o.nextthink < qc.time:
        o.think = execute_changelevel
        o.nextthink = qc.time + 0.1
コード例 #14
0
def NextLevel(*qwp_extra):
    global nextmap
    o = engine.world
    newmap = None
    if nextmap != None:
        return  #  already done
    if qc.mapname == 'start':
        if not engine.cvar('registered'):
            qc.mapname = 'e1m1'

        elif not (qc.serverflags & 1):
            qc.mapname = 'e1m1'
            qc.serverflags |= 1

        elif not (qc.serverflags & 2):
            qc.mapname = 'e2m1'
            qc.serverflags |= 2

        elif not (qc.serverflags & 4):
            qc.mapname = 'e3m1'
            qc.serverflags |= 4

        elif not (qc.serverflags & 8):
            qc.mapname = 'e4m1'
            qc.serverflags -= 7

        o = qc.spawn()
        o.map = qc.mapname

    else:
        #  find a trigger changelevel
        o = qc.find(qc.world, 'classname', 'trigger_changelevel')
        if not o or qc.mapname == 'start':
            #  go back to same map if no trigger_changelevel
            o = qc.spawn()
            o.map = qc.mapname

    nextmap = o.map
    if o.nextthink < qc.time:
        o.think = execute_changelevel
        o.nextthink = qc.time + 0.1
コード例 #15
0
ファイル: world.py プロジェクト: barryp/qwpython
def StartFrame(*qwp_extra):
    defs.timelimit = engine.cvar('timelimit') * 60
    defs.fraglimit = engine.cvar('fraglimit')
    defs.teamplay = engine.cvar('teamplay')
    defs.deathmatch = engine.cvar('deathmatch')
    defs.framecount += 1
コード例 #16
0
ファイル: world.py プロジェクト: angeld29/qwpy
def StartFrame(*qwp_extra):
    defs.timelimit = engine.cvar('timelimit') * 60
    defs.fraglimit = engine.cvar('fraglimit')
    defs.teamplay = engine.cvar('teamplay')
    defs.deathmatch = engine.cvar('deathmatch')
    defs.framecount += 1
コード例 #17
0
ファイル: player.py プロジェクト: barryp/qwpython
def PlayerDie(*qwp_extra):
    i = 0
    s = None
    qc.self.items -= qc.self.items & defs.IT_INVISIBILITY
    if (qc.stof(qc.world.infokey("dq"))) != 0:
        if qc.self.super_damage_finished > 0:
            items.DropQuad(qc.self.super_damage_finished - qc.time)
            engine.bprint(defs.PRINT_LOW, qc.self.netname)
            if defs.deathmatch == 4:
                engine.bprint(defs.PRINT_LOW, " lost an OctaPower with ")
            else:
                engine.bprint(defs.PRINT_LOW, " lost a quad with ")
            s = str(round(qc.self.super_damage_finished - qc.time))
            engine.bprint(defs.PRINT_LOW, s)
            engine.bprint(defs.PRINT_LOW, " seconds remaining\012")

    if (qc.stof(qc.world.infokey("dr"))) != 0:
        if qc.self.invisible_finished > 0:
            engine.bprint(defs.PRINT_LOW, qc.self.netname)
            engine.bprint(defs.PRINT_LOW, " lost a ring with ")
            s = str(round(qc.self.invisible_finished - qc.time))
            engine.bprint(defs.PRINT_LOW, s)
            engine.bprint(defs.PRINT_LOW, " seconds remaining\012")
            items.DropRing(qc.self.invisible_finished - qc.time)

    qc.self.invisible_finished = 0  #  don't die as eyes
    qc.self.invincible_finished = 0
    qc.self.super_damage_finished = 0
    qc.self.radsuit_finished = 0
    qc.self.modelindex = client.modelindex_player  #  don't use eyes
    items.DropBackpack()
    qc.self.weaponmodel = None
    qc.self.view_ofs = Vector(0, 0, -8)
    qc.self.deadflag = defs.DEAD_DYING
    qc.self.solid = defs.SOLID_NOT
    qc.self.flags -= qc.self.flags & defs.FL_ONGROUND
    qc.self.movetype = defs.MOVETYPE_TOSS
    if qc.self.velocity.z < 10:
        qc.self.velocity %= Vector(None, None, qc.self.velocity.z + random.random() * 300)
    if qc.self.health < -40:
        GibPlayer()
        return

    DeathSound()
    qc.self.angles %= Vector(0, None, None)
    qc.self.angles %= Vector(None, None, 0)
    if qc.self.weapon == defs.IT_AXE:
        player_die_ax1()
        return

    i = engine.cvar("temp1")
    if not i:
        i = 1 + math.floor(random.random() * 6)
    if i == 1:
        player_diea1()
    elif i == 2:
        player_dieb1()
    elif i == 3:
        player_diec1()
    elif i == 4:
        player_died1()
    else:
        player_diee1()
コード例 #18
0
ファイル: world.py プロジェクト: barryp/qwpython
def StartFrame(*qwp_extra):
    defs.timelimit = engine.cvar("timelimit") * 60
    defs.fraglimit = engine.cvar("fraglimit")
    defs.teamplay = engine.cvar("teamplay")
    defs.deathmatch = engine.cvar("deathmatch")
    defs.framecount += 1
コード例 #19
0
def PlayerDie(*qwp_extra):
    i = 0
    s = None
    qc.self.items -= qc.self.items & defs.IT_INVISIBILITY
    if (qc.stof(qc.world.infokey('dq'))) != 0:
        if qc.self.super_damage_finished > 0:
            items.DropQuad(qc.self.super_damage_finished - qc.time)
            engine.bprint(defs.PRINT_LOW, qc.self.netname)
            if defs.deathmatch == 4:
                engine.bprint(defs.PRINT_LOW, ' lost an OctaPower with ')
            else:
                engine.bprint(defs.PRINT_LOW, ' lost a quad with ')
            s = str(round(qc.self.super_damage_finished - qc.time))
            engine.bprint(defs.PRINT_LOW, s)
            engine.bprint(defs.PRINT_LOW, ' seconds remaining\012')
            
        
    if (qc.stof(qc.world.infokey('dr'))) != 0:
        if qc.self.invisible_finished > 0:
            engine.bprint(defs.PRINT_LOW, qc.self.netname)
            engine.bprint(defs.PRINT_LOW, ' lost a ring with ')
            s = str(round(qc.self.invisible_finished - qc.time))
            engine.bprint(defs.PRINT_LOW, s)
            engine.bprint(defs.PRINT_LOW, ' seconds remaining\012')
            items.DropRing(qc.self.invisible_finished - qc.time)
            
        
    qc.self.invisible_finished = 0 #  don't die as eyes
    qc.self.invincible_finished = 0
    qc.self.super_damage_finished = 0
    qc.self.radsuit_finished = 0
    qc.self.modelindex = client.modelindex_player #  don't use eyes
    items.DropBackpack()
    qc.self.weaponmodel = None
    qc.self.view_ofs = Vector(0, 0, -8)
    qc.self.deadflag = defs.DEAD_DYING
    qc.self.solid = defs.SOLID_NOT
    qc.self.flags -= qc.self.flags & defs.FL_ONGROUND
    qc.self.movetype = defs.MOVETYPE_TOSS
    if qc.self.velocity.z < 10:
        qc.self.velocity %= Vector(None, None, qc.self.velocity.z + random.random() * 300)
    if qc.self.health < -40:
        GibPlayer()
        return 
        
    DeathSound()
    qc.self.angles %= Vector(0, None, None)
    qc.self.angles %= Vector(None, None, 0)
    if qc.self.weapon == defs.IT_AXE:
        player_die_ax1()
        return 
        
    i = engine.cvar('temp1')
    if not i:
        i = 1 + math.floor(random.random() * 6)
    if i == 1:
        player_diea1()
    elif i == 2:
        player_dieb1()
    elif i == 3:
        player_diec1()
    elif i == 4:
        player_died1()
    else:
        player_diee1()