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)
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)
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()
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)
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)
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
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)
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)
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)
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)