Exemple #1
0
def secret_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 qc.self.message:
        qc.centerprint(qc.other, qc.self.message)
        qc.other.sound(defs.CHAN_BODY, 'misc/talk.wav', 1, defs.ATTN_NORM)
Exemple #2
0
def MOTD_ChooseTeam(*qwp_extra):
    if qc.self.motd_count < 6:
        qc.self.motd_count += 1
        qc.centerprint(
            qc.self,
            'Welcome!\012Running ThreeWave CTF 4.2\012\012\303\301\320\324\325\322\305 \324\310\305 \306\314\301\307!\012\012Press 1 for \322\305\304 team\012Press 2 for \302\314\325\305 team\012Or Press Jump for automatic team\012'
        )
        return
    qc.self.motd_count = 0
Exemple #3
0
def secret_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 qc.self.message:
        qc.centerprint(qc.other, qc.self.message)
        qc.other.sound(defs.CHAN_BODY, 'misc/talk.wav', 1, defs.ATTN_NORM)
Exemple #4
0
def SUB_UseTargets(*qwp_extra):
    # 
    #  check for a delay
    # 
    if qc.self.delay:
        #  create a temp object to fire at a later time
        t = qc.spawn()
        t.classname = 'DelayedUse'
        t.nextthink = qc.time + qc.self.delay
        t.think = DelayThink
        t.enemy = defs.activator
        t.message = qc.self.message
        t.killtarget = qc.self.killtarget
        t.target = qc.self.target
        return 
        
    # 
    #  print the message
    # 
    if defs.activator.classname == 'player' and qc.self.message != None:
        qc.centerprint(defs.activator, qc.self.message)
        if not qc.self.noise:
            defs.activator.sound(defs.CHAN_VOICE, 'misc/talk.wav', 1, defs.ATTN_NORM)
        
    # 
    #  kill the killtagets
    # 
    if qc.self.killtarget:
        t = qc.world
        while 1:
            t = qc.find(t, 'targetname', qc.self.killtarget)
            if not t:
                return 
            t.remove()
                    
    # 
    #  fire targets
    # 
    if qc.self.target:
        act = defs.activator
        t = qc.world
        while 1:
            t = qc.find(t, 'targetname', qc.self.target)
            if not t:
                return 
                
            stemp = qc.self
            otemp = qc.other
            qc.self = t
            qc.other = stemp
            if qc.self.use != SUB_Null:
                if qc.self.use:
                    qc.self.use()
                
            qc.self = stemp
            qc.other = otemp
            defs.activator = act
Exemple #5
0
def sigil_touch(*qwp_extra):
    if qc.other.classname != 'player':
        return 
    if qc.other.health <= 0:
        return 
    qc.centerprint(qc.other, 'You got the rune!')
    qc.other.sound(defs.CHAN_ITEM, qc.self.noise, 1, defs.ATTN_NORM)
    qc.other.stuffcmd('bf\012')
    qc.self.solid = defs.SOLID_NOT
    qc.self.model = defs.string_null
    qc.serverflags |= qc.self.spawnflags & 15
    qc.self.classname = None #  so rune doors won't find it
    defs.activator = qc.other
    subs.SUB_UseTargets() #  fire all targets / killtargets
Exemple #6
0
def MOTD(*qwp_extra):
    if qc.self.motd_count < 4:
        qc.self.motd_count += 1
        if qc.self.classname == 'spectator':
            qc.centerprint(
                qc.self,
                'Welcome!\012Running ThreeWave CTF 4.21\012\012\303\301\320\324\325\322\305 \324\310\305 \306\314\301\307!\012'
            )
            return
        if defs.gamestart:
            qc.centerprint(
                qc.self,
                'Welcome!\012Running ThreeWave CTF 4.21\012\012\303\301\320\324\325\322\305 \324\310\305 \306\314\301\307!\012\012Choose an exit...\012'
            )  # red
            return
        if qc.self.steam == teamplay.TEAM_COLOR1:
            qc.centerprint(
                qc.self,
                'Welcome!\012Running ThreeWave CTF 4.21\012\012\303\301\320\324\325\322\305 \324\310\305 \306\314\301\307!\012\012You are \322\305\304 team\012'
            )  # red
        else:
            qc.centerprint(
                qc.self,
                'Welcome!\012Running Threewave CTF 4.21\012\012\303\301\320\324\325\322\305 \324\310\305 \306\314\301\307!\012\012You are \302\314\325\305 team'
            )  # blue
        return

    qc.self.sprint(defs.PRINT_HIGH, 'Impulse 70 to turn off status bar\012')
    qc.self.sprint(defs.PRINT_HIGH,
                   'Impulse 71 through 81 to set status bar resolution\012')
    qc.self.sprint(
        defs.PRINT_HIGH,
        '71:200 72:240 73:300 74:350 75:384 76:400 77:480 78:600 79:768 81:1024\012'
    )
    qc.self.motd_count = 0
Exemple #7
0
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)
Exemple #8
0
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)
Exemple #9
0
def TeamPlayerUpdate(who, s, *qwp_extra):
    TeamCaptureCheckUpdate()
    who.laststattime = qc.time + PLAYERSTATTIME
    if who.statstate < 0:
        qc.centerprint(who, s)
        return 
        
    res = TeamSetStatRes2(who)
    if teamplay.teamscr1 == 0 and teamplay.teamscr2 == 0:
        qc.centerprint3(who, res, s, '\012                       Capture The Flag')        
    elif teamplay.teamscr1 > teamplay.teamscr2:
        n = str(teamplay.teamscr1 - teamplay.teamscr2)
        qc.centerprint4(who, res, s, '\012                               RED ', n)        
    elif teamplay.teamscr1 < teamplay.teamscr2:
        n = str(teamplay.teamscr2 - teamplay.teamscr1)
        qc.centerprint4(who, res, s, '\012                               BLUE ', n)        
    else:
        qc.centerprint3(who, res, s, '\012                               TIED')
Exemple #10
0
def counter_use(*qwp_extra):
    qc.self.count -= 1
    if qc.self.count < 0:
        return 
    if qc.self.count != 0:
        if defs.activator.classname == 'player' and (qc.self.spawnflags & SPAWNFLAG_NOMESSAGE) == 0:
            if qc.self.count >= 4:
                qc.centerprint(defs.activator, 'There are more to go...')
            elif qc.self.count == 3:
                qc.centerprint(defs.activator, 'Only 3 more to go...')
            elif qc.self.count == 2:
                qc.centerprint(defs.activator, 'Only 2 more to go...')
            else:
                qc.centerprint(defs.activator, 'Only 1 more to go...')            
        return 
        
    if defs.activator.classname == 'player' and (qc.self.spawnflags & SPAWNFLAG_NOMESSAGE) == 0:
        qc.centerprint(defs.activator, 'Sequence completed!')
    qc.self.enemy = defs.activator
    multi_trigger()
Exemple #11
0
def TeamPlayerUpdate(who, s, *qwp_extra):
    TeamCaptureCheckUpdate()
    who.laststattime = qc.time + PLAYERSTATTIME
    if who.statstate < 0:
        qc.centerprint(who, s)
        return

    res = TeamSetStatRes2(who)
    if teamplay.teamscr1 == 0 and teamplay.teamscr2 == 0:
        qc.centerprint3(who, res, s,
                        '\012                       Capture The Flag')
    elif teamplay.teamscr1 > teamplay.teamscr2:
        n = str(teamplay.teamscr1 - teamplay.teamscr2)
        qc.centerprint4(who, res, s, '\012                               RED ',
                        n)
    elif teamplay.teamscr1 < teamplay.teamscr2:
        n = str(teamplay.teamscr2 - teamplay.teamscr1)
        qc.centerprint4(who, res, s,
                        '\012                               BLUE ', n)
    else:
        qc.centerprint3(who, res, s, '\012                               TIED')
Exemple #12
0
def counter_use(*qwp_extra):
    qc.self.count -= 1
    if qc.self.count < 0:
        return
    if qc.self.count != 0:
        if defs.activator.classname == 'player' and (
                qc.self.spawnflags & SPAWNFLAG_NOMESSAGE) == 0:
            if qc.self.count >= 4:
                qc.centerprint(defs.activator, 'There are more to go...')
            elif qc.self.count == 3:
                qc.centerprint(defs.activator, 'Only 3 more to go...')
            elif qc.self.count == 2:
                qc.centerprint(defs.activator, 'Only 2 more to go...')
            else:
                qc.centerprint(defs.activator, 'Only 1 more to go...')
        return

    if defs.activator.classname == 'player' and (qc.self.spawnflags
                                                 & SPAWNFLAG_NOMESSAGE) == 0:
        qc.centerprint(defs.activator, 'Sequence completed!')
    qc.self.enemy = defs.activator
    multi_trigger()
Exemple #13
0
def MOTD(*qwp_extra):
    if qc.self.motd_count < 4:
        qc.self.motd_count += 1
        if qc.self.classname == 'spectator':
            qc.centerprint(qc.self, 'Welcome!\012Running ThreeWave CTF 4.21\012\012\303\301\320\324\325\322\305 \324\310\305 \306\314\301\307!\012')
            return             
        if defs.gamestart:
            qc.centerprint(qc.self, 'Welcome!\012Running ThreeWave CTF 4.21\012\012\303\301\320\324\325\322\305 \324\310\305 \306\314\301\307!\012\012Choose an exit...\012') # red
            return             
        if qc.self.steam == teamplay.TEAM_COLOR1:
            qc.centerprint(qc.self, 'Welcome!\012Running ThreeWave CTF 4.21\012\012\303\301\320\324\325\322\305 \324\310\305 \306\314\301\307!\012\012You are \322\305\304 team\012') # red
        else:
            qc.centerprint(qc.self, 'Welcome!\012Running Threewave CTF 4.21\012\012\303\301\320\324\325\322\305 \324\310\305 \306\314\301\307!\012\012You are \302\314\325\305 team') # blue
        return 
        
    qc.self.sprint(defs.PRINT_HIGH, 'Impulse 70 to turn off status bar\012')
    qc.self.sprint(defs.PRINT_HIGH, 'Impulse 71 through 81 to set status bar resolution\012')
    qc.self.sprint(defs.PRINT_HIGH, '71:200 72:240 73:300 74:350 75:384 76:400 77:480 78:600 79:768 81:1024\012')
    qc.self.motd_count = 0
Exemple #14
0
def door_touch(*qwp_extra):
    if qc.other.classname != 'player':
        return 
    if qc.self.owner.attack_finished > qc.time:
        return 
    qc.self.owner.attack_finished = qc.time + 2
    if qc.self.owner.message != None:
        qc.centerprint(qc.other, qc.self.owner.message)
        qc.other.sound(defs.CHAN_VOICE, 'misc/talk.wav', 1, defs.ATTN_NORM)
        
    #  key door stuff
    if not qc.self.items:
        return 
    #  FIXME: blink key on player's status bar
    if (qc.self.items & qc.other.items) != qc.self.items:
        if qc.self.owner.items == defs.IT_KEY1:
            if qc.world.worldtype == 2:
                qc.centerprint(qc.other, 'You need the silver keycard')
                qc.self.sound(defs.CHAN_VOICE, qc.self.noise3, 1, defs.ATTN_NORM)
                
            elif qc.world.worldtype == 1:
                qc.centerprint(qc.other, 'You need the silver runekey')
                qc.self.sound(defs.CHAN_VOICE, qc.self.noise3, 1, defs.ATTN_NORM)
                
            elif qc.world.worldtype == 0:
                qc.centerprint(qc.other, 'You need the silver key')
                qc.self.sound(defs.CHAN_VOICE, qc.self.noise3, 1, defs.ATTN_NORM)                           
        else:
            if qc.world.worldtype == 2:
                qc.centerprint(qc.other, 'You need the gold keycard')
                qc.self.sound(defs.CHAN_VOICE, qc.self.noise3, 1, defs.ATTN_NORM)
                
            elif qc.world.worldtype == 1:
                qc.centerprint(qc.other, 'You need the gold runekey')
                qc.self.sound(defs.CHAN_VOICE, qc.self.noise3, 1, defs.ATTN_NORM)
                
            elif qc.world.worldtype == 0:
                qc.centerprint(qc.other, 'You need the gold key')
                qc.self.sound(defs.CHAN_VOICE, qc.self.noise3, 1, defs.ATTN_NORM)                            
        return 
        
    qc.other.items -= qc.self.items
    qc.self.touch = subs.SUB_Null
    if qc.self.enemy:
        qc.self.enemy.touch = subs.SUB_Null #  get paired door
    door_use()
Exemple #15
0
def door_touch(*qwp_extra):
    if qc.other.classname != 'player':
        return
    if qc.self.owner.attack_finished > qc.time:
        return
    qc.self.owner.attack_finished = qc.time + 2
    if qc.self.owner.message != None:
        qc.centerprint(qc.other, qc.self.owner.message)
        qc.other.sound(defs.CHAN_VOICE, 'misc/talk.wav', 1, defs.ATTN_NORM)

    #  key door stuff
    if not qc.self.items:
        return
    #  FIXME: blink key on player's status bar
    if (qc.self.items & qc.other.items) != qc.self.items:
        if qc.self.owner.items == defs.IT_KEY1:
            if qc.world.worldtype == 2:
                qc.centerprint(qc.other, 'You need the silver keycard')
                qc.self.sound(defs.CHAN_VOICE, qc.self.noise3, 1,
                              defs.ATTN_NORM)

            elif qc.world.worldtype == 1:
                qc.centerprint(qc.other, 'You need the silver runekey')
                qc.self.sound(defs.CHAN_VOICE, qc.self.noise3, 1,
                              defs.ATTN_NORM)

            elif qc.world.worldtype == 0:
                qc.centerprint(qc.other, 'You need the silver key')
                qc.self.sound(defs.CHAN_VOICE, qc.self.noise3, 1,
                              defs.ATTN_NORM)
        else:
            if qc.world.worldtype == 2:
                qc.centerprint(qc.other, 'You need the gold keycard')
                qc.self.sound(defs.CHAN_VOICE, qc.self.noise3, 1,
                              defs.ATTN_NORM)

            elif qc.world.worldtype == 1:
                qc.centerprint(qc.other, 'You need the gold runekey')
                qc.self.sound(defs.CHAN_VOICE, qc.self.noise3, 1,
                              defs.ATTN_NORM)

            elif qc.world.worldtype == 0:
                qc.centerprint(qc.other, 'You need the gold key')
                qc.self.sound(defs.CHAN_VOICE, qc.self.noise3, 1,
                              defs.ATTN_NORM)
        return

    qc.other.items -= qc.self.items
    qc.self.touch = subs.SUB_Null
    if qc.self.enemy:
        qc.self.enemy.touch = subs.SUB_Null  #  get paired door
    door_use()
Exemple #16
0
def MOTD_ChooseTeam(*qwp_extra):
    if qc.self.motd_count < 6:
        qc.self.motd_count += 1
        qc.centerprint(qc.self, 'Welcome!\012Running ThreeWave CTF 4.2\012\012\303\301\320\324\325\322\305 \324\310\305 \306\314\301\307!\012\012Press 1 for \322\305\304 team\012Press 2 for \302\314\325\305 team\012Or Press Jump for automatic team\012')
        return         
    qc.self.motd_count = 0