Changeset 11639 for code/branches/ProtectBoss_HS17/data/levels
- Timestamp:
- Dec 4, 2017, 4:23:58 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ProtectBoss_HS17/data/levels/ProtectBoss.oxw
r11604 r11639 2 2 name = "ProtectBoss" 3 3 description = "Protect a disabled cargo ship!" 4 tags = "test "4 tags = "test, mission" 5 5 screenshot = "emptylevel.png" 6 6 /> 7 7 8 8 9 <?lua … … 13 14 include("HUDPickupTemplate.oxo") 14 15 include("templates/pickupRepresentationTemplates.oxt") 15 include("includes/pickups.oxi")16 16 ?> 17 17 … … 45 45 skybox = "Orxonox/Starbox" 46 46 > 47 48 <?lua 49 include("includes/pickups.oxi") 50 ?> 47 51 48 52 <WorldAmbientSound source="Earth.ogg" looping="true" playOnLoad="true" /> <!-- AlphaCentauri.ogg, Mars.ogg--> … … 65 69 position = "0,0,-2500" 66 70 mass = 100000 67 health = 100 0 initialhealth=1000 maxhealth="1000"71 health = 100 initialhealth=100 maxhealth="100" 68 72 direction = "1,0,0" 69 73 rotationaxis="0,0,1" rotationrate="4.5" velocity="0,0,30" … … 114 118 115 119 <!-- triggers when first pirate wave is defeated --> 120 116 121 <Trigger name="firstPirateWaveKilled" mode="and"> 117 <EventTrigger activations="1" stayactive="true" > 122 <?lua 123 for n = 1, 3, 1 do 124 print("<EventTrigger activations=1 stayactive=true><events><trigger><EventListener event=p" .. n .. "/></trigger></events></EventTrigger>") 125 end 126 ?> 127 <!--EventTrigger activations="1" stayactive="true" > 118 128 <events> 119 129 <trigger> … … 135 145 </trigger> 136 146 </events> 137 </EventTrigger >147 </EventTrigger--> 138 148 </Trigger> 139 149 140 <!-- create asteroids --> 150 <!-- triggers when second pirate wave is defeated --> 151 <Trigger name="secondPirateWaveKilled" mode="and"> 152 <?lua 153 for n = 1, 6, 1 do 154 print("<EventTrigger activations=1 stayactive=true><events><trigger><EventListener event=p1" .. n .. "/></trigger></events></EventTrigger>") 155 end 156 ?> 157 <!--EventTrigger activations="1" stayactive="true" > 158 <events> 159 <trigger> 160 <EventListener event="p11" /> 161 </trigger> 162 </events> 163 </EventTrigger> 164 <EventTrigger activations="1" stayactive="true" > 165 <events> 166 <trigger> 167 <EventListener event="p12" /> 168 </trigger> 169 </events> 170 </EventTrigger> 171 <EventTrigger activations="1" stayactive="true" > 172 <events> 173 <trigger> 174 <EventListener event="p13" /> 175 </trigger> 176 </events> 177 </EventTrigger> 178 <EventTrigger activations="1" stayactive="true" > 179 <events> 180 <trigger> 181 <EventListener event="p14" /> 182 </trigger> 183 </events> 184 </EventTrigger> 185 <EventTrigger activations="1" stayactive="true" > 186 <events> 187 <trigger> 188 <EventListener event="p15" /> 189 </trigger> 190 </events> 191 </EventTrigger> 192 <EventTrigger activations="1" stayactive="true" > 193 <events> 194 <trigger> 195 <EventListener event="p16" /> 196 </trigger> 197 </events> 198 </EventTrigger--> 199 </Trigger> 200 201 <!-- triggers some time after the second pirate wave was defeated --> 202 <Trigger name="thirdPirateWaveStarting" delay=15> 203 <EventTrigger activations="1" stayactive="true" > 204 <events> 205 <trigger> 206 <EventListener event="secondPirateWaveKilled" /> 207 </trigger> 208 </events> 209 </EventTrigger> 210 </Trigger> 211 212 <!-- triggers when third pirate wave is defeated --> 213 <Trigger name="thirdPirateWaveKilled" mode="and" delay=5> 214 <?lua 215 for n = 1, 7, 1 do 216 print("<EventTrigger activations=1 stayactive=true><events><trigger><EventListener event=p2" .. n .. "/></trigger></events></EventTrigger>") 217 end 218 ?> 219 <!--EventTrigger activations="1" stayactive="true" > 220 <events> 221 <trigger> 222 <EventListener event="p21" /> 223 </trigger> 224 </events> 225 </EventTrigger> 226 <EventTrigger activations="1" stayactive="true" > 227 <events> 228 <trigger> 229 <EventListener event="p22" /> 230 </trigger> 231 </events> 232 </EventTrigger> 233 <EventTrigger activations="1" stayactive="true" > 234 <events> 235 <trigger> 236 <EventListener event="p23" /> 237 </trigger> 238 </events> 239 </EventTrigger> 240 <EventTrigger activations="1" stayactive="true" > 241 <events> 242 <trigger> 243 <EventListener event="p24" /> 244 </trigger> 245 </events> 246 </EventTrigger> 247 <EventTrigger activations="1" stayactive="true" > 248 <events> 249 <trigger> 250 <EventListener event="p25" /> 251 </trigger> 252 </events> 253 </EventTrigger> 254 <EventTrigger activations="1" stayactive="true" > 255 <events> 256 <trigger> 257 <EventListener event="p26" /> 258 </trigger> 259 </events> 260 </EventTrigger> 261 <EventTrigger activations="1" stayactive="true" > 262 <events> 263 <trigger> 264 <EventListener event="p27" /> 265 </trigger> 266 </events> 267 </EventTrigger--> 268 </Trigger> 269 270 <Trigger name="succeedMission" delay=7> 271 <EventTrigger activations="1" stayactive="true" > 272 <events> 273 <trigger> 274 <EventListener event="thirdPirateWaveKilled" /> 275 </trigger> 276 </events> 277 </EventTrigger> 278 </Trigger> 279 280 <EventTrigger activations="1" stayactive="true" name="failMission" delay=0.1> 281 <events> 282 <trigger> 283 <EventListener event="CargoShip" /> 284 </trigger> 285 </events> 286 </EventTrigger> 287 288 <!-- create asteroids and pickups --> 141 289 <?lua 142 290 function asteroidMesh() … … 163 311 vz = math.random(-vmax, vmax) 164 312 rr = math.random() * 10 165 print("< Pawn team=1 health=30 position=\"" .. x .. "," .. y .. "," .. z .. "\" direction=\"0,0,-1\" velocity=\"" .. vx .. "," .. vy .. "," .. vz .. "\"rotationaxis=\"" .. rx .. "," .. ry .. "," .. rz .. "\" rotationrate=" .. rr .. " collisionType=dynamic mass=1 name=asteroid radarname=Asteroid> <attached> <Model position=\"0,0,0\" mesh=\"" .. asteroidMesh() .. "\" scale3D=\"10,10,10\" /> </attached> <collisionShapes> <SphereCollisionShape position=\"0,0,0\" radius=5 /> </collisionShapes> <controller> <WaypointController team=1> </WaypointController> </controller> <explosion> <ExplosionPart minspeed=0 maxspeed=0 effect1=\"orxonox/explosion_flash2\" effect2=\"orxonox/explosion_flame2\" /> <ExplosionPart minspeed=0 maxspeed=0 effect1=\"orxonox/explosion_shockwave2\" effect2=\"orxonox/explosion_sparks2\" /> <ExplosionPart minspeed=0 maxspeed=0 effect1=\"orxonox/explosion_streak2\" effect2=\"orxonox/explosion_afterglow\" /> </explosion> </Pawn>")313 print("<ShootableObstacle team=1 enablecollisiondamage=true collisiondamage=10 health=100 maxhealth=100 initialhealth=100 position=\"" .. x .. "," .. y .. "," .. z .. "\" direction=\"0,0,-1\" velocity=\"" .. vx .. "," .. vy .. "," .. vz .. "\"rotationaxis=\"" .. rx .. "," .. ry .. "," .. rz .. "\" rotationrate=" .. rr .. " collisionType=dynamic mass=1 name=asteroid radarname=Asteroid> <attached> <Model position=\"0,0,0\" mesh=\"" .. asteroidMesh() .. "\" scale3D=\"10,10,10\" /> </attached> <collisionShapes> <SphereCollisionShape position=\"0,0,0\" radius=5 /> </collisionShapes> <controller> <WaypointController team=1> </WaypointController> </controller> <explosion> <ExplosionPart minspeed=0 maxspeed=0 effect1=\"orxonox/explosion_flash2\" effect2=\"orxonox/explosion_flame2\" /> <ExplosionPart minspeed=0 maxspeed=0 effect1=\"orxonox/explosion_shockwave2\" effect2=\"orxonox/explosion_sparks2\" /> <ExplosionPart minspeed=0 maxspeed=0 effect1=\"orxonox/explosion_streak2\" effect2=\"orxonox/explosion_afterglow\" /> </explosion> </ShootableObstacle>") 166 314 end 167 315 168 for count = 1, 20, 1 do316 for count = 1, 50, 1 do 169 317 x = math.random(-1000, 1000) 170 318 y = math.random(-1000, 1000) 171 319 z = 125 * count + math.random(-250, 250) 172 typenum = math.random( 7)320 typenum = math.random(11) 173 321 type = "" 174 322 if typenum == 1 then … … 184 332 elseif typenum == 6 then 185 333 type = "hugehealth" 334 elseif typenum == 7 then 335 type = "crazyhealth" 336 elseif typenum == 8 then 337 type = "smallshield" 338 elseif typenum == 9 then 339 type = "mediumshield" 340 elseif typenum == 10 then 341 type = "hugeshield" 186 342 else 187 type = " crazyhealth"343 type = "drone" 188 344 end 189 345 type = type .. "pickup" 190 --[[print("<PickupSpawner pickup=\"" .. "mediumhealth" .. "\" position=\"" .. x .. "," .. y .. "," .. z .. "\" triggerDistance=10 respawnTime=5 maxSpawnedItems=1 />")]]346 print("<PickupSpawner pickup=\"" .. type .. "\" position=\"" .. x .. "," .. y .. "," .. z .. "\" triggerDistance=10 respawnTime=5 maxSpawnedItems=1 />") 191 347 end 192 348 ?> 193 194 <!--PickupSpawner pickup=mediumhealthpickup position="0,0,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="1" /-->195 <!--PickupSpawner pickup=smallshieldpickup position="-25,-25,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" /-->196 349 197 350 <!-- start first quest --> … … 247 400 </SimpleNotification> 248 401 249 <SimpleNotification message="The cargo ship got destroyed! " broadcast=true >402 <SimpleNotification message="The cargo ship got destroyed! Game over!" broadcast=true > 250 403 <events> 251 404 <trigger> … … 263 416 </SimpleNotification> 264 417 265 266 <!-- A function to put pirates and asteroids to a certain location --> 418 <SimpleNotification message="The third and last pirate wave is preparing for attack! They will arrive soon!" broadcast=true > 419 <events> 420 <trigger> 421 <EventListener event="secondPirateWaveKilled" /> 422 </trigger> 423 </events> 424 </SimpleNotification> 425 426 <SimpleNotification message="The pirates are attacking!" broadcast=true > 427 <events> 428 <trigger> 429 <EventListener event="thirdPirateWaveStarting" /> 430 </trigger> 431 </events> 432 </SimpleNotification> 433 434 <SimpleNotification message="You defeated the pirates! The cargo ship is exiting the asteroid field. You made it!" broadcast=true > 435 <events> 436 <trigger> 437 <EventListener event="thirdPirateWaveKilled" /> 438 </trigger> 439 </events> 440 </SimpleNotification> 441 442 <Script code="Mission endMission true" onLoad="false"> 443 <events> 444 <trigger> 445 <EventListener event="succeedMission" /> 446 </trigger> 447 </events> 448 </Script> 449 450 <Script code="Mission endMission false" onLoad="false"> 451 <events> 452 <trigger> 453 <EventListener event="CargoShip" /> 454 </trigger> 455 </events> 456 </Script> 457 458 <!-- A function to put pirates to a certain location --> 267 459 <?lua 268 460 function placePirate(posX, posY, posZ, name, trigger) 269 461 print("<SpaceShip mass=10 health=25 initialhealth=25 maxhealth=25 shieldhealth=10 maxshieldhealth=10 initialshieldhealth=10 shieldabsorption=0.3 shieldrechargerate=1 shieldrechargewaittime=1 primaryThrust=40 auxiliaryThrust=15 rotationThrust=10 boostpower=5 boostrate=2 boostCooldownDuration = 20 position=\"" .. posX .. "," .. posY .. "," .. posZ .. "\" name=\"" .. name .. "\" radarname=Pirate><events><visibility><EventListener event=\"" .. trigger .. "\"/></visibility><activity><EventListener event=\"" .. trigger .. "\"/></activity></events><templates><Template link=spaceshippirate /></templates><controller><WaypointPatrolController alertnessradius=3129 team=1 active=false><waypoints><Model mesh=\"cube.mesh\" scale=0 position=\"-1300,-600,900\" /><Model mesh=\"cube.mesh\" scale=0 position=\"0,0,0\" /></waypoints><events><activity><EventListener event=attack /></activity></events></WaypointPatrolController></controller></SpaceShip>") 270 462 end 271 272 function placeAsteroid(posX, posY, posZ, vx, vy, vz, trigger)273 rx = math.random(-vmax, vmax)274 ry = math.random(-vmax, vmax)275 rz = math.random(-vmax, vmax)276 rr = math.random() * 10277 print("<Pawn team=1 health=30 position=\"" .. posX .. "," .. posY .. "," .. posZ .. "\" direction=\"0,0,-1\" velocity=\"" .. vx .. "," .. vy .. "," .. vz .. "\"rotationaxis=\"" .. rx .. "," .. ry .. "," .. rz .. "\" rotationrate=" .. rr .. " collisionType=dynamic mass=1 name=asteroid radarname=Asteroid> <events> <visibility> <EventListener event=\"" .. trigger .. "\" /> </visibility> </events> <attached> <Model position=\"0,0,0\" mesh=\"" .. asteroidMesh() .. "\" scale3D=\"10,10,10\" /> </attached> <collisionShapes> <SphereCollisionShape position=\"0,0,0\" radius=5 /> </collisionShapes> <!--controller> <WaypointController team=1> </WaypointController> </controller--> <explosion> <ExplosionPart minspeed=0 maxspeed=0 effect1=\"orxonox/explosion_flash2\" effect2=\"orxonox/explosion_flame2\" /> <ExplosionPart minspeed=0 maxspeed=0 effect1=\"orxonox/explosion_shockwave2\" effect2=\"orxonox/explosion_sparks2\" /> <ExplosionPart minspeed=0 maxspeed=0 effect1=\"orxonox/explosion_streak2\" effect2=\"orxonox/explosion_afterglow\" /> </explosion> </Pawn>")278 end279 463 ?> 280 464 281 465 <?lua 282 placeAsteroid(0, 0, -1000, 0, 0, 0, "spawntrigger") 283 placeAsteroid(0, 0, -1100, 0, 0, 0, "spawntrigger") 284 placeAsteroid(0, 0, -1200, 0, 0, 0, "spawntrigger") 285 placeAsteroid(0, 0, -1300, 0, 0, 0, "spawntrigger") 286 placeAsteroid(0, 0, -1400, 0, 0, 0, "spawntrigger") 287 placeAsteroid(0, 0, -1500, 0, 0, 0, "spawntrigger") 288 placePirate(0, 0, 5500, "p1", "spawntrigger") 289 placePirate(0, 0, 6500, "p2", "spawntrigger") 290 placePirate(0, 0, 7500, "p3", "spawntrigger") 466 placePirate(0, 0, 3000, "p1", "passedAsteroidFieldOne") 467 placePirate(50, 0, 3500, "p2", "passedAsteroidFieldOne") 468 placePirate(0, 50, 4000, "p3", "passedAsteroidFieldOne") 291 469 placePirate(0, 0, 5500, "p11", "firstPirateWaveKilled") 292 placePirate( 0, 0, 5600, "p12", "firstPirateWaveKilled")293 placePirate( 0, 0, 5700, "p13", "firstPirateWaveKilled")294 placePirate(0, 0, 5800, "p14", "firstPirateWaveKilled")295 placePirate(0, 0, 5900, "p15", "firstPirateWaveKilled")470 placePirate(50, 0, 5600, "p12", "firstPirateWaveKilled") 471 placePirate(-50, 0, 5700, "p13", "firstPirateWaveKilled") 472 placePirate(0, 50, 5800, "p14", "firstPirateWaveKilled") 473 placePirate(0, -50, 5900, "p15", "firstPirateWaveKilled") 296 474 placePirate(0, 0, 6000, "p16", "firstPirateWaveKilled") 475 placePirate(0, 0, 7000, "p21", "thirdPirateWaveStarting") 476 placePirate(50, 0, 7100, "p22", "thirdPirateWaveStarting") 477 placePirate(-50, 0, 7200, "p23", "thirdPirateWaveStarting") 478 placePirate(0, 50, 7300, "p24", "thirdPirateWaveStarting") 479 placePirate(0, -50, 7400, "p25", "thirdPirateWaveStarting") 480 placePirate(50, 50, 7500, "p26", "thirdPirateWaveStarting") 481 placePirate(-50, -50, 7600, "p27", "thirdPirateWaveStarting") 297 482 ?> 298 483
Note: See TracChangeset
for help on using the changeset viewer.