示例#1
0
def fd_secret_use(*qwp_extra):
    qc.self.health = 10000
    #  exit if still moving around...
    if qc.self.origin != qc.self.oldorigin:
        return
    qc.self.message = defs.string_null  #  no more message
    subs.SUB_UseTargets()  #  fire all targets / killtargets
    if qc.self.spawnflags & SECRET_NEVER:
        return  #  it never opens
    if not (qc.self.spawnflags & SECRET_NO_SHOOT):
        qc.self.th_pain = subs.SUB_Null
        qc.self.takedamage = defs.DAMAGE_NO

    qc.self.velocity = Vector(0, 0, 0)
    #  Make a sound, wait a little...
    qc.self.sound(defs.CHAN_VOICE, qc.self.noise1, 1, defs.ATTN_NORM)
    qc.self.nextthink = qc.self.ltime + 0.1
    temp = 1 - (qc.self.spawnflags & SECRET_1ST_LEFT)  #  1 or -1
    qc.makevectors(qc.self.mangle)
    if not qc.self.t_width:
        if qc.self.spawnflags & SECRET_1ST_DOWN:
            qc.self.t_width = math.fabs(qc.v_up * qc.self.size)
        else:
            qc.self.t_width = math.fabs(qc.v_right * qc.self.size)

    if not qc.self.t_length:
        qc.self.t_length = math.fabs(qc.v_forward * qc.self.size)
    if qc.self.spawnflags & SECRET_1ST_DOWN:
        qc.self.dest1 = qc.self.origin - qc.v_up * qc.self.t_width
    else:
        qc.self.dest1 = qc.self.origin + qc.v_right * (qc.self.t_width * temp)
    qc.self.dest2 = qc.self.dest1 + qc.v_forward * qc.self.t_length
    subs.SUB_CalcMove(qc.self.dest1, qc.self.speed, fd_secret_move1)
    qc.self.sound(defs.CHAN_VOICE, qc.self.noise2, 1, defs.ATTN_NORM)
示例#2
0
def door_go_down(*qwp_extra):
    qc.self.sound(defs.CHAN_VOICE, qc.self.noise2, 1, defs.ATTN_NORM)
    if qc.self.max_health:
        qc.self.takedamage = defs.DAMAGE_YES
        qc.self.health = qc.self.max_health
    qc.self.state = defs.STATE_DOWN
    subs.SUB_CalcMove(qc.self.pos1, qc.self.speed, door_hit_bottom)
示例#3
0
def door_go_up(*qwp_extra):
    if qc.self.state == defs.STATE_UP:
        return  #  allready going up
    if qc.self.state == defs.STATE_TOP:
        #  reset top wait time
        qc.self.nextthink = qc.self.ltime + qc.self.wait
        return
    qc.self.sound(defs.CHAN_VOICE, qc.self.noise2, 1, defs.ATTN_NORM)
    qc.self.state = defs.STATE_UP
    subs.SUB_CalcMove(qc.self.pos2, qc.self.speed, door_hit_top)
    subs.SUB_UseTargets()
示例#4
0
def train_next(*qwp_extra):
    targ = engine.world
    targ = qc.find(qc.world, 'targetname', qc.self.target)
    qc.self.target = targ.target
    if not qc.self.target:
        qc.objerror('train_next: no next target')
    if targ.wait:
        qc.self.wait = targ.wait
    else:
        qc.self.wait = 0
    qc.self.sound(defs.CHAN_VOICE, qc.self.noise1, 1, defs.ATTN_NORM)
    subs.SUB_CalcMove(targ.origin - qc.self.mins, qc.self.speed, train_wait)
示例#5
0
文件: buttons.py 项目: angeld29/qwpy
def button_fire(*qwp_extra):
    if qc.self.state == defs.STATE_UP or qc.self.state == defs.STATE_TOP:
        return 
    qc.self.sound(defs.CHAN_VOICE, qc.self.noise, 1, defs.ATTN_NORM)
    qc.self.state = defs.STATE_UP
    subs.SUB_CalcMove(qc.self.pos2, qc.self.speed, button_wait)
示例#6
0
文件: buttons.py 项目: angeld29/qwpy
def button_return(*qwp_extra):
    qc.self.state = defs.STATE_DOWN
    subs.SUB_CalcMove(qc.self.pos1, qc.self.speed, button_done)
    qc.self.frame = 0 #  use normal textures
    if qc.self.health:
        qc.self.takedamage = defs.DAMAGE_YES #  can be shot again
示例#7
0
def fd_secret_move6(*qwp_extra):
    qc.self.sound(defs.CHAN_VOICE, qc.self.noise2, 1, defs.ATTN_NORM)
    subs.SUB_CalcMove(qc.self.oldorigin, qc.self.speed, fd_secret_done)
示例#8
0
def fd_secret_move4(*qwp_extra):
    qc.self.sound(defs.CHAN_VOICE, qc.self.noise2, 1, defs.ATTN_NORM)
    subs.SUB_CalcMove(qc.self.dest1, qc.self.speed, fd_secret_move5)
示例#9
0
def plat_go_up(*qwp_extra):
    qc.self.sound(defs.CHAN_VOICE, qc.self.noise, 1, defs.ATTN_NORM)
    qc.self.state = defs.STATE_UP
    subs.SUB_CalcMove(qc.self.pos1, qc.self.speed, plat_hit_top)
示例#10
0
def plat_go_down(*qwp_extra):
    qc.self.sound(defs.CHAN_VOICE, qc.self.noise, 1, defs.ATTN_NORM)
    qc.self.state = defs.STATE_DOWN
    subs.SUB_CalcMove(qc.self.pos2, qc.self.speed, plat_hit_bottom)