DP. Anyone? I kind of left out a detail if possible could the flipper be lowered in power so the bots just get flipped over just like in Robot Wars instead of throwing bots OOTA.
from __future__ import generators
import plus
import Arenas
import random
import Hazards
import math
import LuTze
from random import randint
import time
import HazardsBlueRay
import string
import Gooey
class Special_Robot_Wars(Arenas.SuperArena):
"robot wars series 2 arena. Be warned its a killer with flames and the pit"
name = "robot wars series2"
preview = "lt_rwarena/rwarena_preview.bmp"
game_types = ['DEATHMATCH', 'BATTLE ROYAL', 'TEAM MATCH']
extent = (-21, 17, 22, -18)
def __init__(self):
Arenas.SuperArena.__init__(self, "Arenas/robotwarsseries2/robotwarsseries2.gmf")
#plus.Arena.__init__(self, "")
plus.setBackColor(0,0,0)
degrad = 0.01745
self.AddStaticCamera("Craig Charles Cam", (-22, 18, 0), (50*degrad,math.pi/2), 80*degrad)
self.AddStaticCamera("Center Cam 1", (0, 8, -18), (35*degrad,0*degrad), 70*degrad)
self.AddStaticCamera("Side", (-30.0, 30.275, 0.5), (0.7158, 1.575), 0.675)
self.AddWatchCamera("Combat Cam", (5, 4, 5), (12, 20, 65*degrad, 40*degrad))
self.AddStaticCamera("Static 1", (10.8, 6.6, -17.04), (.367, -40*degrad), degrad*55)
self.AddStaticCamera("FLAME CAM", (-2, 7.8, 5), (40*degrad, 0), degrad*62)
self.AddStaticCamera("PIT CAM", (9, 4, 3.5), (90*degrad, 0), degrad*62)
#self.AddStaticCamera("Center Cam 2", (0, 8, 18), (35*degrad,180*degrad), 70*degrad)
self.AddStaticCamera("Corner Cam 1", (18, 20, 16), (45*degrad,212*degrad), 50*degrad)
self.AddStaticCamera("Corner Cam 2", (-18, 20, 16), (45*degrad,122*degrad), 50*degrad)
self.AddStaticCamera("Top Cam", (00, 15, 0), (90*degrad,math.pi), 80*degrad)
self.AddWatchCamera("Watch Cam 1", (-24, 15, 18), (12, 20, 30*degrad, 20*degrad))
self.AddWatchCamera("Watch Cam 2", (24, 15, -18), (12, 20, 30*degrad, 20*degrad))
self.AddWatchCamera("Watch Cam 3", (10, 20, 10), (14, 22, 30*degrad, 30*degrad))
self.AddWatchCamera("Watch Cam 4", (-10, 20, -10), (16, 24, 30*degrad, 40*degrad))
self.dropstart = 0
self.droptimer = 0
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(0, 19.159, 0)
#Main Arena Floor Shadow Triangles
self.AddShadowTriangle((-10.2877,0.063,1.83754), (-12.4182,0.063,12.4283), (-12.4182,0.063,1.83754))
self.AddShadowTriangle((-8.17686,0.063,9.91855), (-8.17686,0.063,12.4283), (-12.4182,0.063,12.4283))
self.AddShadowTriangle((-8.17686,0.063,9.91855), (-12.4182,0.063,12.4283), (-10.2877,0.063,1.83754))
self.AddShadowTriangle((2.25999,0.063,12.4283), (-2.49123,0.063,12.4283), (-2.49123,0.063,9.91855))
self.AddShadowTriangle((2.25999,0.063,9.91855), (2.25999,0.063,12.4283), (-2.49123,0.063,9.91855))
self.AddShadowTriangle((12.413,0.063,12.4283), (7.93297,0.063,12.4283), (7.93297,0.063,9.91855))
self.AddShadowTriangle((10.2878,0.063,1.91641), (12.413,0.063,12.4283), (7.93297,0.063,9.91855))
self.AddShadowTriangle((10.2878,0.063,1.91641), (12.413,0.063,1.91641), (12.413,0.063,12.4283))
self.AddShadowTriangle((8.17711,0.063,-9.92447), (12.413,0.063,-12.4279), (10.2878,0.063,-1.93329))
self.AddShadowTriangle((10.2878,0.063,-1.93329), (12.413,0.063,-12.4279), (12.413,0.063,-1.93329))
self.AddShadowTriangle((8.17711,0.063,-9.92447), (8.17711,0.063,-12.4279), (12.413,0.063,-12.4279))
self.AddShadowTriangle((-2.26871,0.063,-12.4279), (2.49519,0.063,-12.4279), (2.49519,0.063,-9.92447))
self.AddShadowTriangle((-2.26871,0.063,-9.92447), (-2.26871,0.063,-12.4279), (2.49519,0.063,-9.92447))
self.AddShadowTriangle((-12.4182,0.063,-12.4279), (-7.93688,0.063,-12.4279), (-7.93688,0.063,-9.92447))
self.AddShadowTriangle((-10.2877,0.063,-1.8361), (-12.4182,0.063,-12.4279), (-7.93688,0.063,-9.92447))
self.AddShadowTriangle((-10.2877,0.063,-1.8361), (-12.4182,0.063,-1.8361), (-12.4182,0.063,-12.4279))
self.AddShadowTriangle((-2.49123,0.063,9.91855), (-8.17686,0.063,9.91855), (-10.2877,0.063,1.83754))
self.AddShadowTriangle((2.49519,0.063,-9.92447), (8.17711,0.063,-9.92447), (10.2878,0.063,-1.93329))
self.AddShadowTriangle((10.2878,0.063,-1.93329), (-10.2877,0.063,-1.8361), (-2.26871,0.063,-9.92447))
self.AddShadowTriangle((10.2878,0.063,1.91641), (7.93297,0.063,9.91855), (2.25999,0.063,9.91855))
self.AddShadowTriangle((2.25999,0.063,9.91855), (-2.49123,0.063,9.91855), (-10.2877,0.063,1.83754))
self.AddShadowTriangle((10.2878,0.063,1.91641), (2.25999,0.063,9.91855), (-10.2877,0.063,1.83754))
self.AddShadowTriangle((10.2878,0.063,-1.93329), (10.2878,0.063,1.91641), (-10.2877,0.063,1.83754))
self.AddShadowTriangle((-10.2877,0.063,-1.8361), (10.2878,0.063,-1.93329), (-10.2877,0.063,1.83754))
self.AddShadowTriangle((-2.26871,0.063,-9.92447), (2.49519,0.063,-9.92447), (10.2878,0.063,-1.93329))
self.AddShadowTriangle((-10.2877,0.063,-1.8361), (-7.93688,0.063,-9.92447), (-2.26871,0.063,-9.92447))
def Activate(self, on):
if on: self.players = plus.getPlayers()
Arenas.SuperArena.Activate(self, on)
def HazardsOn(self, on):
if on:
self.flame1 = Hazards.Flame((-11.0, -.6, -11.6), (0, 5, 0), (.8, .8, .8), .8)
self.AddHazard(self.flame1)
self.flame2 = Hazards.Flame((-11.2, -.6, 11.0), (0, 5, 0), (.8, .8, .8), .8)
self.AddHazard(self.flame2)
self.flame3 = Hazards.Flame((11.2, -.6, 11.0 ), (0, 5, 0), (.8, .8, .8), .8)
self.AddHazard(self.flame3)
self.flame4 = Hazards.Flame((11.4, -.6, -11.3), (0, 5, 0), (.8, .8, .8), .8)
self.AddHazard(self.flame4)
self.flame5 = Hazards.Flame((-3.42, -.6, 3.9), (0, 5, 0), (.8, .8, .8), .8)
self.AddHazard(self.flame5)
self.flame6a = Hazards.Flame((-2.809, -.6, 10.342), (0, 10, 0), (.2, .4, .2), .8)
self.AddHazard(self.flame6a)
self.flame6b = Hazards.Flame((-2.809, -.6, 11.342), (0, 10, 0), (.2, .4, .2), .8)
self.AddHazard(self.flame6b)
self.flame6c = Hazards.Flame((-3.809, -.6, 10.342), (0, 10, 0), (.2, .4, .2), .8)
self.AddHazard(self.flame6c)
self.flame6d = Hazards.Flame((-3.809, -.6, 11.342), (0, 10, 0), (.2, .4, .2), .8)
self.AddHazard(self.flame6d)
self.RegisterZone("sfz5",8)
self.RegisterZone("lfz",9)
prism = self.AddPrismatic("arena_collision", "pitcover", 0, 1, 0, 0, -5, 0)
self.lift1 = LuTze.Saws(prism, (1,1,2))
self.AddHazard(self.lift1)
hinge = self.GetHinge("fliphinge")
self.RegisterZone("flipzone", 9)
self.Hell1 = LuTze.HellRaiser(hinge, (9, 0, 4))
self.AddHazard(self.Hell1)
self.SetActive("fridge", False)
self.SetActive("saws", False)
self.RegisterZone("dropzone",6)
self.RegisterZone("sfz2",1)
self.RegisterZone("sfz1",2)
self.RegisterZone("sfz4",3)
self.RegisterZone("sfz3",4)
self.RegisterZone("pitzone",0)
self.SetSubMaterialSound("fridge", "metal", 4.0, "Sounds\\hzd_comp_hit.wav")
self.SetSubMaterialSound("saws", "metal", 8.0, "Sounds\\sawblade_hits_loop.wav")
# Pit avoidance
self.AddCollisionLine((8, 6), (12,6))
self.AddCollisionLine((12, 6), (12, 2))
self.AddCollisionLine((12, 2), (8, 2))
self.AddCollisionLine((8, 2), (8, 6))
self.AddCollisionLine((7.8, 6.2), (12.2, 6.2))
self.AddCollisionLine((12.2, 6.2), (12.2, 1.8))
self.AddCollisionLine((12.2, 1.8), (7.8, 1.8))
self.AddCollisionLine((7.8, 1.8), (7.8, 6.2))
self.AddCollisionLine((7.9, 6.1), (12.1, 6.1))
self.AddCollisionLine((12.1, 6.1), (12.1, 1.9))
self.AddCollisionLine((12.1, 1.9), (7.1, 1.9))
self.AddCollisionLine((7.9, 1.9), (7.9, 6.1))
#walls
self.AddCollisionLine((18, 14), (18, -14))
self.AddCollisionLine((18 ,-14 ), (-18 , -14))
self.AddCollisionLine((-18, -14), (-18, 14))
self.AddCollisionLine((-18, 14 ), (18, 14))
################## 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 ##################-------------
return Arenas.SuperArena.HazardsOn(self, on)
def Tick(self):
if self.bHazardsOn:
self.Hell1.Tick()
self.flame1.Tick()
self.flame2.Tick()
self.flame3.Tick()
self.flame4.Tick()
self.flame5.Tick()
self.flame6a.Tick()
self.flame6b.Tick()
self.flame6c.Tick()
self.flame6d.Tick()
self.lift1.Tick()
if self.dropstart >=1:
self.droptimer +=.5
if self.droptimer == 8:
self.SetActive ("fridge", True)
if self.droptimer == 20:
self.SetPinned ("fridge", True)
# check to see if anyone has been "eliminated" by falling off the tabletop
for each in self.players:
if plus.getLocation(each)[1] < -0.1 and not plus.isDefeated(each):
plus.eliminatePlayer(each)
plus.emitSmoke(200, (10, -1.3, 4), (0, 4, 0), (3, 5, 3))
################## 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)
def ZoneEvent(self, direction, id, robot, chassis):
if id ==1:
self.flame1.ZoneEvent(direction)
elif id ==2:
self.flame2.ZoneEvent(direction)
elif id ==3:
self.flame3.ZoneEvent(direction)
elif id ==4:
self.flame4.ZoneEvent(direction)
if (id==5 and direction==1):
self.Hell1.RaiseHell()
if (id==6 and direction==1):
self.dropstart += 1
if (id==6 and direction==-1):
self.dropstart -= 1
if self.dropstart ==0:
self.droptimer = 0
if (id==7 and direction==1):
self.lift1.MoveSaw(1)
if id ==8:
self.flame5.ZoneEvent(direction)
if id ==9:
self.flame6a.ZoneEvent(direction)
self.flame6b.ZoneEvent(direction)
self.flame6c.ZoneEvent(direction)
self.flame6d.ZoneEvent(direction)
return True
Arenas.register(Special_Robot_Wars)
That is how the 3D object is, (GMF)