from __future__ import generatorsimport plusimport Arenasimport randomimport Hazardsimport mathfrom random import randintimport time import HazardsBlueRayimport stringimport Gooeyclass Twisted(Arenas.SuperArena): "We fight in tandem!" name = "In Tandem Arena" preview = "Tandem/tand_preview.bmp" game_types = ['DEATHMATCH', 'BATTLE ROYAL', 'TEAM MATCH'] extent = (-15, 15, 15, -15) def __init__(self): Arenas.SuperArena.__init__(self, "Arenas/Tandem/Tandem.gmf") #plus.Arena.__init__(self, "") plus.setBackColor(.36, .537, .788) degrad = 0.01745 self.AddStaticCamera("Main View", (0, 30, -20), (68*degrad,0), 55*degrad) self.AddStaticCamera("Battle View", (19.5, 25, 19.5), (56*degrad,225*degrad), 40*degrad) self.AddStaticCamera("High Flipper View", (-19.5, 45, -19.5), (48*degrad,45*degrad), 84*degrad) self.AddStaticCamera("Birds Eye View", (0, 45, 0), (90*degrad,0), 50*degrad) self.AddWatchCamera("Combat Cam", (-12, 8, 12), (16, 36, 65*degrad, 30*degrad)) self.AddWatchCamera("Aerial Cam", (-19.5, 35, -19.5), (50, 60, 45*degrad, 60*degrad)) self.AddWatchCamera("Ground Cam", (8, -5, -8), (15, 40, 75*degrad, 35*degrad)) self.AddWatchCamera("Spectator Cam", (13, 15, 13), (6, 18, 45*degrad, 45*degrad)) self.players = () ################## Bot Flames + Smoke ##################------------- self.RI_1 = 0 self.RI_2 = 0 self.RI_3 = 0 self.RI_4 = 0 self.RI_5 = 0 self.RI_6 = 0 self.RI_7 = 0 self.RI_8 = 0 self.RI_9 = 0 self.RI_D = 0 self.RI_Y = 0 self.RI_SandF_0 = random.randint(-4, 4) ### Random Smoke and Flames self.RI_SandF_1 = random.randint(-4, 4) ### Random Smoke and Flames self.RI_SandF_2 = random.randint(-4, 4) ### Random Smoke and Flames self.RI_SandF_3 = random.randint(-4, 4) ### Random Smoke and Flames ################## Bot Flames + Smoke ##################------------- def AddShadowReceivers(self): self.SetShadowSource(5.897, 19.159, 5.899) def Activate(self, on): if on: self.players = plus.getPlayers() Arenas.SuperArena.Activate(self, on) def HazardsOn(self, on): if on: ################## Bot Flames + Smoke ##################------------- self.BOT_Flame_0 = HazardsBlueRay.BotFlame((0, 0, 0), (0, 1, 0), (.2, .4, .2), .8) self.AddHazard(self.BOT_Flame_0) self.BOT_Flame_1 = HazardsBlueRay.BotFlame((0, 0, 0), (0, 1, 0), (.2, .4, .2), .8) self.AddHazard(self.BOT_Flame_1) self.BOT_Flame_2 = HazardsBlueRay.BotFlame((0, 0, 0), (0, 1, 0), (.2, .4, .2), .8) self.AddHazard(self.BOT_Flame_2) self.BOT_Flame_3 = HazardsBlueRay.BotFlame((0, 0, 0), (0, 1, 0), (.2, .4, .2), .8) self.AddHazard(self.BOT_Flame_3) self.BOT_Flame_4 = HazardsBlueRay.BotFlame((0, 0, 0), (0, 1, 0), (.2, .4, .2), .8) self.AddHazard(self.BOT_Flame_4) #self.BOT_Flame_5 = HazardsBlueRay.BotFlame((0, 0, 0), (0, 1, 0), (.2, .4, .2), .8) #self.AddHazard(self.BOT_Flame_5) #self.BOT_Flame_6 = HazardsBlueRay.BotFlame((0, 0, 0), (0, 1, 0), (.2, .4, .2), .8) #self.AddHazard(self.BOT_Flame_6) #self.BOT_Flame_7 = HazardsBlueRay.BotFlame((0, 0, 0), (0, 1, 0), (.2, .4, .2), .8) #self.AddHazard(self.BOT_Flame_7) #self.BOT_Flame_8 = HazardsBlueRay.BotFlame((0, 0, 0), (0, 1, 0), (.2, .4, .2), .8) #self.AddHazard(self.BOT_Flame_8) ################## Bot Flames + Smoke ##################------------- #wall self.AddCollisionLine((17, 17), (17, -17)) self.AddCollisionLine((17, -17), (-17, -17)) self.AddCollisionLine((-17, -17), (-17, 17)) self.AddCollisionLine((-17, 17), (17, 17)) self.AddPOV(0, (1, 1), (0, 1)) self.AddPOV(1, (1, -1), (1, 2)) self.AddPOV(2, (-1, -1), (2, 3)) self.AddPOV(3, (-1, 1), (3, 0)) self.AddPOV(0, (1, 1), (0, 3)) self.AddPOV(1, (1, -1), (1, 0)) self.AddPOV(2, (-1, -1), (2, 1)) self.AddPOV(3, (-1, 1), (3, 2)) self.AddCollisionLine((1, 1), (1, -1)) self.AddCollisionLine((1, -1), (-1, -1)) self.AddCollisionLine((-1, -1), (-1, 1)) self.AddCollisionLine((-1, 1), (1, 1)) return Arenas.SuperArena.HazardsOn(self, on) def Tick(self): for each in self.players: if plus.getLocation(each)[1] < -10: # Adjust this parameter to floor height(s). plus.eliminatePlayer(each) ################## Bot Flames + Smoke ##################------------- self.RI_0 = randint(-4, 4) self.RI_1 = randint(-4, 4) self.RI_2 = randint(-4, 4) self.RI_3 = randint(-2, 2) self.RI_4 = randint(-2, 2) self.RI_5 = randint(-2, 2) self.RI_6 = randint(-2, 2) self.RI_7 = randint(-2, 2) self.RI_8 = randint(-2, 2) self.RI_9 = randint(-2, 2) self.RI_D = randint(1, 4) self.RI_Y = randint(0, 2) self.BOT_Flame_0.Tick() # Individual bot flames self.BOT_Flame_1.Tick() # "" self.BOT_Flame_2.Tick() # "" self.BOT_Flame_3.Tick() # "" #self.BOT_Flame_4.Tick() # Generic Lightning striking bot_flame. #self.BOT_Flame_5.Tick() #self.BOT_Flame_6.Tick() #self.BOT_Flame_7.Tick() #self.BOT_Flame_8.Tick() if 0 in self.players: if plus.getHealth(0,0) < 0.2: # if self.RI_SandF_0 <= 2: plus.emitSmoke(1, (plus.getLocation(0)), (self.RI_3, 1 ,self.RI_4), (.2,.4,.2)) if plus.getHealth(0,0) < 0.1: # if self.RI_SandF_0 < 0: plus.emitSmoke(1, (plus.getLocation(0)), (self.RI_4, self.RI_Y, self.RI_5), (.2,.4,.2)) self.BOT_Flame_0.BotFlameOff() self.BOT_Flame_0 = HazardsBlueRay.BotFlame(plus.getLocation(0), (self.RI_4, self.RI_Y, self.RI_5), (.2, .4, .2), .8) self.BOT_Flame_0.BotFlameOn() if 1 in self.players: if plus.getHealth(1,0) < 0.2: # if self.RI_SandF_1 <= 2: plus.emitSmoke(1, (plus.getLocation(1)), (self.RI_4, 1 ,self.RI_5), (.2,.4,.2)) if plus.getHealth(1,0) < 0.1: # if self.RI_SandF_1 < 20: plus.emitSmoke(1, (plus.getLocation(1)), (self.RI_5, self.RI_Y, self.RI_6), (.2,.4,.2)) self.BOT_Flame_1.BotFlameOff() self.BOT_Flame_1 = HazardsBlueRay.BotFlame(plus.getLocation(1), (self.RI_5, self.RI_Y, self.RI_6), (.2, .4, .2), .8) self.BOT_Flame_1.BotFlameOn() if 2 in self.players: if plus.getHealth(2,0) < 0.2: # if self.RI_SandF_2 <= 2: plus.emitSmoke(1, (plus.getLocation(2)), (self.RI_5, 1 ,self.RI_6), (.2,.4,.2)) if plus.getHealth(2,0) < 0.1: # if self.RI_SandF_2 < 0: plus.emitSmoke(1, (plus.getLocation(2)), (self.RI_6, self.RI_Y ,self.RI_7), (.2,.4,.2)) self.BOT_Flame_2.BotFlameOff() self.BOT_Flame_2 = HazardsBlueRay.BotFlame(plus.getLocation(2), (self.RI_6, self.RI_Y, self.RI_7), (.2, .4, .2), .8) self.BOT_Flame_2.BotFlameOn() if 3 in self.players: if plus.getHealth(3,0) < 0.2: # if self.RI_SandF_3 <= 2: plus.emitSmoke(1, (plus.getLocation(3)), (self.RI_6, 1 ,self.RI_7), (.2,.4,.2)) if plus.getHealth(3,0) < 0.1: # if self.RI_SandF_3 < 0: plus.emitSmoke(1, (plus.getLocation(3)), (self.RI_8, self.RI_Y, self.RI_9), (.2,.4,.2)) self.BOT_Flame_3.BotFlameOff() self.BOT_Flame_3 = HazardsBlueRay.BotFlame(plus.getLocation(3), (self.RI_8, self.RI_Y, self.RI_9), (.2, .4, .2), .8) self.BOT_Flame_3.BotFlameOn() ################## Bot Flames + Smoke ##################------------- return Arenas.SuperArena.Tick(self) Arenas.register(Twisted)