bastd.maps
Standard maps.
1# Released under the MIT License. See LICENSE for details. 2# 3"""Standard maps.""" 4# pylint: disable=too-many-lines 5 6from __future__ import annotations 7 8from typing import TYPE_CHECKING 9 10import ba 11from bastd.gameutils import SharedObjects 12 13if TYPE_CHECKING: 14 from typing import Any 15 16 17class HockeyStadium(ba.Map): 18 """Stadium map used for ice hockey games.""" 19 20 from bastd.mapdata import hockey_stadium as defs 21 name = 'Hockey Stadium' 22 23 @classmethod 24 def get_play_types(cls) -> list[str]: 25 """Return valid play types for this map.""" 26 return ['melee', 'hockey', 'team_flag', 'keep_away'] 27 28 @classmethod 29 def get_preview_texture_name(cls) -> str: 30 return 'hockeyStadiumPreview' 31 32 @classmethod 33 def on_preload(cls) -> Any: 34 data: dict[str, Any] = { 35 'models': (ba.getmodel('hockeyStadiumOuter'), 36 ba.getmodel('hockeyStadiumInner'), 37 ba.getmodel('hockeyStadiumStands')), 38 'vr_fill_model': ba.getmodel('footballStadiumVRFill'), 39 'collide_model': ba.getcollidemodel('hockeyStadiumCollide'), 40 'tex': ba.gettexture('hockeyStadium'), 41 'stands_tex': ba.gettexture('footballStadium') 42 } 43 mat = ba.Material() 44 mat.add_actions(actions=('modify_part_collision', 'friction', 0.01)) 45 data['ice_material'] = mat 46 return data 47 48 def __init__(self) -> None: 49 super().__init__() 50 shared = SharedObjects.get() 51 self.node = ba.newnode('terrain', 52 delegate=self, 53 attrs={ 54 'model': 55 self.preloaddata['models'][0], 56 'collide_model': 57 self.preloaddata['collide_model'], 58 'color_texture': 59 self.preloaddata['tex'], 60 'materials': [ 61 shared.footing_material, 62 self.preloaddata['ice_material'] 63 ] 64 }) 65 ba.newnode('terrain', 66 attrs={ 67 'model': self.preloaddata['vr_fill_model'], 68 'vr_only': True, 69 'lighting': False, 70 'background': True, 71 'color_texture': self.preloaddata['stands_tex'] 72 }) 73 mats = [shared.footing_material, self.preloaddata['ice_material']] 74 self.floor = ba.newnode('terrain', 75 attrs={ 76 'model': self.preloaddata['models'][1], 77 'color_texture': self.preloaddata['tex'], 78 'opacity': 0.92, 79 'opacity_in_low_or_medium_quality': 1.0, 80 'materials': mats 81 }) 82 self.stands = ba.newnode( 83 'terrain', 84 attrs={ 85 'model': self.preloaddata['models'][2], 86 'visible_in_reflections': False, 87 'color_texture': self.preloaddata['stands_tex'] 88 }) 89 gnode = ba.getactivity().globalsnode 90 gnode.floor_reflection = True 91 gnode.debris_friction = 0.3 92 gnode.debris_kill_height = -0.3 93 gnode.tint = (1.2, 1.3, 1.33) 94 gnode.ambient_color = (1.15, 1.25, 1.6) 95 gnode.vignette_outer = (0.66, 0.67, 0.73) 96 gnode.vignette_inner = (0.93, 0.93, 0.95) 97 gnode.vr_camera_offset = (0, -0.8, -1.1) 98 gnode.vr_near_clip = 0.5 99 self.is_hockey = True 100 101 102class FootballStadium(ba.Map): 103 """Stadium map for football games.""" 104 from bastd.mapdata import football_stadium as defs 105 106 name = 'Football Stadium' 107 108 @classmethod 109 def get_play_types(cls) -> list[str]: 110 """Return valid play types for this map.""" 111 return ['melee', 'football', 'team_flag', 'keep_away'] 112 113 @classmethod 114 def get_preview_texture_name(cls) -> str: 115 return 'footballStadiumPreview' 116 117 @classmethod 118 def on_preload(cls) -> Any: 119 data: dict[str, Any] = { 120 'model': ba.getmodel('footballStadium'), 121 'vr_fill_model': ba.getmodel('footballStadiumVRFill'), 122 'collide_model': ba.getcollidemodel('footballStadiumCollide'), 123 'tex': ba.gettexture('footballStadium') 124 } 125 return data 126 127 def __init__(self) -> None: 128 super().__init__() 129 shared = SharedObjects.get() 130 self.node = ba.newnode( 131 'terrain', 132 delegate=self, 133 attrs={ 134 'model': self.preloaddata['model'], 135 'collide_model': self.preloaddata['collide_model'], 136 'color_texture': self.preloaddata['tex'], 137 'materials': [shared.footing_material] 138 }) 139 ba.newnode('terrain', 140 attrs={ 141 'model': self.preloaddata['vr_fill_model'], 142 'lighting': False, 143 'vr_only': True, 144 'background': True, 145 'color_texture': self.preloaddata['tex'] 146 }) 147 gnode = ba.getactivity().globalsnode 148 gnode.tint = (1.3, 1.2, 1.0) 149 gnode.ambient_color = (1.3, 1.2, 1.0) 150 gnode.vignette_outer = (0.57, 0.57, 0.57) 151 gnode.vignette_inner = (0.9, 0.9, 0.9) 152 gnode.vr_camera_offset = (0, -0.8, -1.1) 153 gnode.vr_near_clip = 0.5 154 155 def is_point_near_edge(self, 156 point: ba.Vec3, 157 running: bool = False) -> bool: 158 box_position = self.defs.boxes['edge_box'][0:3] 159 box_scale = self.defs.boxes['edge_box'][6:9] 160 xpos = (point.x - box_position[0]) / box_scale[0] 161 zpos = (point.z - box_position[2]) / box_scale[2] 162 return xpos < -0.5 or xpos > 0.5 or zpos < -0.5 or zpos > 0.5 163 164 165class Bridgit(ba.Map): 166 """Map with a narrow bridge in the middle.""" 167 from bastd.mapdata import bridgit as defs 168 169 name = 'Bridgit' 170 dataname = 'bridgit' 171 172 @classmethod 173 def get_play_types(cls) -> list[str]: 174 """Return valid play types for this map.""" 175 # print('getting playtypes', cls._getdata()['play_types']) 176 return ['melee', 'team_flag', 'keep_away'] 177 178 @classmethod 179 def get_preview_texture_name(cls) -> str: 180 return 'bridgitPreview' 181 182 @classmethod 183 def on_preload(cls) -> Any: 184 data: dict[str, Any] = { 185 'model_top': ba.getmodel('bridgitLevelTop'), 186 'model_bottom': ba.getmodel('bridgitLevelBottom'), 187 'model_bg': ba.getmodel('natureBackground'), 188 'bg_vr_fill_model': ba.getmodel('natureBackgroundVRFill'), 189 'collide_model': ba.getcollidemodel('bridgitLevelCollide'), 190 'tex': ba.gettexture('bridgitLevelColor'), 191 'model_bg_tex': ba.gettexture('natureBackgroundColor'), 192 'collide_bg': ba.getcollidemodel('natureBackgroundCollide'), 193 'railing_collide_model': 194 (ba.getcollidemodel('bridgitLevelRailingCollide')), 195 'bg_material': ba.Material() 196 } 197 data['bg_material'].add_actions(actions=('modify_part_collision', 198 'friction', 10.0)) 199 return data 200 201 def __init__(self) -> None: 202 super().__init__() 203 shared = SharedObjects.get() 204 self.node = ba.newnode( 205 'terrain', 206 delegate=self, 207 attrs={ 208 'collide_model': self.preloaddata['collide_model'], 209 'model': self.preloaddata['model_top'], 210 'color_texture': self.preloaddata['tex'], 211 'materials': [shared.footing_material] 212 }) 213 self.bottom = ba.newnode('terrain', 214 attrs={ 215 'model': self.preloaddata['model_bottom'], 216 'lighting': False, 217 'color_texture': self.preloaddata['tex'] 218 }) 219 self.background = ba.newnode( 220 'terrain', 221 attrs={ 222 'model': self.preloaddata['model_bg'], 223 'lighting': False, 224 'background': True, 225 'color_texture': self.preloaddata['model_bg_tex'] 226 }) 227 ba.newnode('terrain', 228 attrs={ 229 'model': self.preloaddata['bg_vr_fill_model'], 230 'lighting': False, 231 'vr_only': True, 232 'background': True, 233 'color_texture': self.preloaddata['model_bg_tex'] 234 }) 235 self.railing = ba.newnode( 236 'terrain', 237 attrs={ 238 'collide_model': self.preloaddata['railing_collide_model'], 239 'materials': [shared.railing_material], 240 'bumper': True 241 }) 242 self.bg_collide = ba.newnode('terrain', 243 attrs={ 244 'collide_model': 245 self.preloaddata['collide_bg'], 246 'materials': [ 247 shared.footing_material, 248 self.preloaddata['bg_material'], 249 shared.death_material 250 ] 251 }) 252 gnode = ba.getactivity().globalsnode 253 gnode.tint = (1.1, 1.2, 1.3) 254 gnode.ambient_color = (1.1, 1.2, 1.3) 255 gnode.vignette_outer = (0.65, 0.6, 0.55) 256 gnode.vignette_inner = (0.9, 0.9, 0.93) 257 258 259class BigG(ba.Map): 260 """Large G shaped map for racing""" 261 262 from bastd.mapdata import big_g as defs 263 264 name = 'Big G' 265 266 @classmethod 267 def get_play_types(cls) -> list[str]: 268 """Return valid play types for this map.""" 269 return [ 270 'race', 'melee', 'keep_away', 'team_flag', 'king_of_the_hill', 271 'conquest' 272 ] 273 274 @classmethod 275 def get_preview_texture_name(cls) -> str: 276 return 'bigGPreview' 277 278 @classmethod 279 def on_preload(cls) -> Any: 280 data: dict[str, Any] = { 281 'model_top': ba.getmodel('bigG'), 282 'model_bottom': ba.getmodel('bigGBottom'), 283 'model_bg': ba.getmodel('natureBackground'), 284 'bg_vr_fill_model': ba.getmodel('natureBackgroundVRFill'), 285 'collide_model': ba.getcollidemodel('bigGCollide'), 286 'tex': ba.gettexture('bigG'), 287 'model_bg_tex': ba.gettexture('natureBackgroundColor'), 288 'collide_bg': ba.getcollidemodel('natureBackgroundCollide'), 289 'bumper_collide_model': ba.getcollidemodel('bigGBumper'), 290 'bg_material': ba.Material() 291 } 292 data['bg_material'].add_actions(actions=('modify_part_collision', 293 'friction', 10.0)) 294 return data 295 296 def __init__(self) -> None: 297 super().__init__() 298 shared = SharedObjects.get() 299 self.node = ba.newnode( 300 'terrain', 301 delegate=self, 302 attrs={ 303 'collide_model': self.preloaddata['collide_model'], 304 'color': (0.7, 0.7, 0.7), 305 'model': self.preloaddata['model_top'], 306 'color_texture': self.preloaddata['tex'], 307 'materials': [shared.footing_material] 308 }) 309 self.bottom = ba.newnode('terrain', 310 attrs={ 311 'model': self.preloaddata['model_bottom'], 312 'color': (0.7, 0.7, 0.7), 313 'lighting': False, 314 'color_texture': self.preloaddata['tex'] 315 }) 316 self.background = ba.newnode( 317 'terrain', 318 attrs={ 319 'model': self.preloaddata['model_bg'], 320 'lighting': False, 321 'background': True, 322 'color_texture': self.preloaddata['model_bg_tex'] 323 }) 324 ba.newnode('terrain', 325 attrs={ 326 'model': self.preloaddata['bg_vr_fill_model'], 327 'lighting': False, 328 'vr_only': True, 329 'background': True, 330 'color_texture': self.preloaddata['model_bg_tex'] 331 }) 332 self.railing = ba.newnode( 333 'terrain', 334 attrs={ 335 'collide_model': self.preloaddata['bumper_collide_model'], 336 'materials': [shared.railing_material], 337 'bumper': True 338 }) 339 self.bg_collide = ba.newnode('terrain', 340 attrs={ 341 'collide_model': 342 self.preloaddata['collide_bg'], 343 'materials': [ 344 shared.footing_material, 345 self.preloaddata['bg_material'], 346 shared.death_material 347 ] 348 }) 349 gnode = ba.getactivity().globalsnode 350 gnode.tint = (1.1, 1.2, 1.3) 351 gnode.ambient_color = (1.1, 1.2, 1.3) 352 gnode.vignette_outer = (0.65, 0.6, 0.55) 353 gnode.vignette_inner = (0.9, 0.9, 0.93) 354 355 356class Roundabout(ba.Map): 357 """CTF map featuring two platforms and a long way around between them""" 358 359 from bastd.mapdata import roundabout as defs 360 361 name = 'Roundabout' 362 363 @classmethod 364 def get_play_types(cls) -> list[str]: 365 """Return valid play types for this map.""" 366 return ['melee', 'keep_away', 'team_flag'] 367 368 @classmethod 369 def get_preview_texture_name(cls) -> str: 370 return 'roundaboutPreview' 371 372 @classmethod 373 def on_preload(cls) -> Any: 374 data: dict[str, Any] = { 375 'model': ba.getmodel('roundaboutLevel'), 376 'model_bottom': ba.getmodel('roundaboutLevelBottom'), 377 'model_bg': ba.getmodel('natureBackground'), 378 'bg_vr_fill_model': ba.getmodel('natureBackgroundVRFill'), 379 'collide_model': ba.getcollidemodel('roundaboutLevelCollide'), 380 'tex': ba.gettexture('roundaboutLevelColor'), 381 'model_bg_tex': ba.gettexture('natureBackgroundColor'), 382 'collide_bg': ba.getcollidemodel('natureBackgroundCollide'), 383 'railing_collide_model': 384 (ba.getcollidemodel('roundaboutLevelBumper')), 385 'bg_material': ba.Material() 386 } 387 data['bg_material'].add_actions(actions=('modify_part_collision', 388 'friction', 10.0)) 389 return data 390 391 def __init__(self) -> None: 392 super().__init__(vr_overlay_offset=(0, -1, 1)) 393 shared = SharedObjects.get() 394 self.node = ba.newnode( 395 'terrain', 396 delegate=self, 397 attrs={ 398 'collide_model': self.preloaddata['collide_model'], 399 'model': self.preloaddata['model'], 400 'color_texture': self.preloaddata['tex'], 401 'materials': [shared.footing_material] 402 }) 403 self.bottom = ba.newnode('terrain', 404 attrs={ 405 'model': self.preloaddata['model_bottom'], 406 'lighting': False, 407 'color_texture': self.preloaddata['tex'] 408 }) 409 self.background = ba.newnode( 410 'terrain', 411 attrs={ 412 'model': self.preloaddata['model_bg'], 413 'lighting': False, 414 'background': True, 415 'color_texture': self.preloaddata['model_bg_tex'] 416 }) 417 ba.newnode('terrain', 418 attrs={ 419 'model': self.preloaddata['bg_vr_fill_model'], 420 'lighting': False, 421 'vr_only': True, 422 'background': True, 423 'color_texture': self.preloaddata['model_bg_tex'] 424 }) 425 self.bg_collide = ba.newnode('terrain', 426 attrs={ 427 'collide_model': 428 self.preloaddata['collide_bg'], 429 'materials': [ 430 shared.footing_material, 431 self.preloaddata['bg_material'], 432 shared.death_material 433 ] 434 }) 435 self.railing = ba.newnode( 436 'terrain', 437 attrs={ 438 'collide_model': self.preloaddata['railing_collide_model'], 439 'materials': [shared.railing_material], 440 'bumper': True 441 }) 442 gnode = ba.getactivity().globalsnode 443 gnode.tint = (1.0, 1.05, 1.1) 444 gnode.ambient_color = (1.0, 1.05, 1.1) 445 gnode.shadow_ortho = True 446 gnode.vignette_outer = (0.63, 0.65, 0.7) 447 gnode.vignette_inner = (0.97, 0.95, 0.93) 448 449 450class MonkeyFace(ba.Map): 451 """Map sorta shaped like a monkey face; teehee!""" 452 453 from bastd.mapdata import monkey_face as defs 454 455 name = 'Monkey Face' 456 457 @classmethod 458 def get_play_types(cls) -> list[str]: 459 """Return valid play types for this map.""" 460 return ['melee', 'keep_away', 'team_flag'] 461 462 @classmethod 463 def get_preview_texture_name(cls) -> str: 464 return 'monkeyFacePreview' 465 466 @classmethod 467 def on_preload(cls) -> Any: 468 data: dict[str, Any] = { 469 'model': ba.getmodel('monkeyFaceLevel'), 470 'bottom_model': ba.getmodel('monkeyFaceLevelBottom'), 471 'model_bg': ba.getmodel('natureBackground'), 472 'bg_vr_fill_model': ba.getmodel('natureBackgroundVRFill'), 473 'collide_model': ba.getcollidemodel('monkeyFaceLevelCollide'), 474 'tex': ba.gettexture('monkeyFaceLevelColor'), 475 'model_bg_tex': ba.gettexture('natureBackgroundColor'), 476 'collide_bg': ba.getcollidemodel('natureBackgroundCollide'), 477 'railing_collide_model': 478 (ba.getcollidemodel('monkeyFaceLevelBumper')), 479 'bg_material': ba.Material() 480 } 481 data['bg_material'].add_actions(actions=('modify_part_collision', 482 'friction', 10.0)) 483 return data 484 485 def __init__(self) -> None: 486 super().__init__() 487 shared = SharedObjects.get() 488 self.node = ba.newnode( 489 'terrain', 490 delegate=self, 491 attrs={ 492 'collide_model': self.preloaddata['collide_model'], 493 'model': self.preloaddata['model'], 494 'color_texture': self.preloaddata['tex'], 495 'materials': [shared.footing_material] 496 }) 497 self.bottom = ba.newnode('terrain', 498 attrs={ 499 'model': self.preloaddata['bottom_model'], 500 'lighting': False, 501 'color_texture': self.preloaddata['tex'] 502 }) 503 self.background = ba.newnode( 504 'terrain', 505 attrs={ 506 'model': self.preloaddata['model_bg'], 507 'lighting': False, 508 'background': True, 509 'color_texture': self.preloaddata['model_bg_tex'] 510 }) 511 ba.newnode('terrain', 512 attrs={ 513 'model': self.preloaddata['bg_vr_fill_model'], 514 'lighting': False, 515 'vr_only': True, 516 'background': True, 517 'color_texture': self.preloaddata['model_bg_tex'] 518 }) 519 self.bg_collide = ba.newnode('terrain', 520 attrs={ 521 'collide_model': 522 self.preloaddata['collide_bg'], 523 'materials': [ 524 shared.footing_material, 525 self.preloaddata['bg_material'], 526 shared.death_material 527 ] 528 }) 529 self.railing = ba.newnode( 530 'terrain', 531 attrs={ 532 'collide_model': self.preloaddata['railing_collide_model'], 533 'materials': [shared.railing_material], 534 'bumper': True 535 }) 536 gnode = ba.getactivity().globalsnode 537 gnode.tint = (1.1, 1.2, 1.2) 538 gnode.ambient_color = (1.2, 1.3, 1.3) 539 gnode.vignette_outer = (0.60, 0.62, 0.66) 540 gnode.vignette_inner = (0.97, 0.95, 0.93) 541 gnode.vr_camera_offset = (-1.4, 0, 0) 542 543 544class ZigZag(ba.Map): 545 """A very long zig-zaggy map""" 546 547 from bastd.mapdata import zig_zag as defs 548 549 name = 'Zigzag' 550 551 @classmethod 552 def get_play_types(cls) -> list[str]: 553 """Return valid play types for this map.""" 554 return [ 555 'melee', 'keep_away', 'team_flag', 'conquest', 'king_of_the_hill' 556 ] 557 558 @classmethod 559 def get_preview_texture_name(cls) -> str: 560 return 'zigzagPreview' 561 562 @classmethod 563 def on_preload(cls) -> Any: 564 data: dict[str, Any] = { 565 'model': ba.getmodel('zigZagLevel'), 566 'model_bottom': ba.getmodel('zigZagLevelBottom'), 567 'model_bg': ba.getmodel('natureBackground'), 568 'bg_vr_fill_model': ba.getmodel('natureBackgroundVRFill'), 569 'collide_model': ba.getcollidemodel('zigZagLevelCollide'), 570 'tex': ba.gettexture('zigZagLevelColor'), 571 'model_bg_tex': ba.gettexture('natureBackgroundColor'), 572 'collide_bg': ba.getcollidemodel('natureBackgroundCollide'), 573 'railing_collide_model': ba.getcollidemodel('zigZagLevelBumper'), 574 'bg_material': ba.Material() 575 } 576 data['bg_material'].add_actions(actions=('modify_part_collision', 577 'friction', 10.0)) 578 return data 579 580 def __init__(self) -> None: 581 super().__init__() 582 shared = SharedObjects.get() 583 self.node = ba.newnode( 584 'terrain', 585 delegate=self, 586 attrs={ 587 'collide_model': self.preloaddata['collide_model'], 588 'model': self.preloaddata['model'], 589 'color_texture': self.preloaddata['tex'], 590 'materials': [shared.footing_material] 591 }) 592 self.background = ba.newnode( 593 'terrain', 594 attrs={ 595 'model': self.preloaddata['model_bg'], 596 'lighting': False, 597 'color_texture': self.preloaddata['model_bg_tex'] 598 }) 599 self.bottom = ba.newnode('terrain', 600 attrs={ 601 'model': self.preloaddata['model_bottom'], 602 'lighting': False, 603 'color_texture': self.preloaddata['tex'] 604 }) 605 ba.newnode('terrain', 606 attrs={ 607 'model': self.preloaddata['bg_vr_fill_model'], 608 'lighting': False, 609 'vr_only': True, 610 'background': True, 611 'color_texture': self.preloaddata['model_bg_tex'] 612 }) 613 self.bg_collide = ba.newnode('terrain', 614 attrs={ 615 'collide_model': 616 self.preloaddata['collide_bg'], 617 'materials': [ 618 shared.footing_material, 619 self.preloaddata['bg_material'], 620 shared.death_material 621 ] 622 }) 623 self.railing = ba.newnode( 624 'terrain', 625 attrs={ 626 'collide_model': self.preloaddata['railing_collide_model'], 627 'materials': [shared.railing_material], 628 'bumper': True 629 }) 630 gnode = ba.getactivity().globalsnode 631 gnode.tint = (1.0, 1.15, 1.15) 632 gnode.ambient_color = (1.0, 1.15, 1.15) 633 gnode.vignette_outer = (0.57, 0.59, 0.63) 634 gnode.vignette_inner = (0.97, 0.95, 0.93) 635 gnode.vr_camera_offset = (-1.5, 0, 0) 636 637 638class ThePad(ba.Map): 639 """A simple square shaped map with a raised edge.""" 640 641 from bastd.mapdata import the_pad as defs 642 643 name = 'The Pad' 644 645 @classmethod 646 def get_play_types(cls) -> list[str]: 647 """Return valid play types for this map.""" 648 return ['melee', 'keep_away', 'team_flag', 'king_of_the_hill'] 649 650 @classmethod 651 def get_preview_texture_name(cls) -> str: 652 return 'thePadPreview' 653 654 @classmethod 655 def on_preload(cls) -> Any: 656 data: dict[str, Any] = { 657 'model': ba.getmodel('thePadLevel'), 658 'bottom_model': ba.getmodel('thePadLevelBottom'), 659 'collide_model': ba.getcollidemodel('thePadLevelCollide'), 660 'tex': ba.gettexture('thePadLevelColor'), 661 'bgtex': ba.gettexture('menuBG'), 662 'bgmodel': ba.getmodel('thePadBG'), 663 'railing_collide_model': ba.getcollidemodel('thePadLevelBumper'), 664 'vr_fill_mound_model': ba.getmodel('thePadVRFillMound'), 665 'vr_fill_mound_tex': ba.gettexture('vrFillMound') 666 } 667 # fixme should chop this into vr/non-vr sections for efficiency 668 return data 669 670 def __init__(self) -> None: 671 super().__init__() 672 shared = SharedObjects.get() 673 self.node = ba.newnode( 674 'terrain', 675 delegate=self, 676 attrs={ 677 'collide_model': self.preloaddata['collide_model'], 678 'model': self.preloaddata['model'], 679 'color_texture': self.preloaddata['tex'], 680 'materials': [shared.footing_material] 681 }) 682 self.bottom = ba.newnode('terrain', 683 attrs={ 684 'model': self.preloaddata['bottom_model'], 685 'lighting': False, 686 'color_texture': self.preloaddata['tex'] 687 }) 688 self.background = ba.newnode( 689 'terrain', 690 attrs={ 691 'model': self.preloaddata['bgmodel'], 692 'lighting': False, 693 'background': True, 694 'color_texture': self.preloaddata['bgtex'] 695 }) 696 self.railing = ba.newnode( 697 'terrain', 698 attrs={ 699 'collide_model': self.preloaddata['railing_collide_model'], 700 'materials': [shared.railing_material], 701 'bumper': True 702 }) 703 ba.newnode('terrain', 704 attrs={ 705 'model': self.preloaddata['vr_fill_mound_model'], 706 'lighting': False, 707 'vr_only': True, 708 'color': (0.56, 0.55, 0.47), 709 'background': True, 710 'color_texture': self.preloaddata['vr_fill_mound_tex'] 711 }) 712 gnode = ba.getactivity().globalsnode 713 gnode.tint = (1.1, 1.1, 1.0) 714 gnode.ambient_color = (1.1, 1.1, 1.0) 715 gnode.vignette_outer = (0.7, 0.65, 0.75) 716 gnode.vignette_inner = (0.95, 0.95, 0.93) 717 718 719class DoomShroom(ba.Map): 720 """A giant mushroom. Of doom!""" 721 722 from bastd.mapdata import doom_shroom as defs 723 724 name = 'Doom Shroom' 725 726 @classmethod 727 def get_play_types(cls) -> list[str]: 728 """Return valid play types for this map.""" 729 return ['melee', 'keep_away', 'team_flag'] 730 731 @classmethod 732 def get_preview_texture_name(cls) -> str: 733 return 'doomShroomPreview' 734 735 @classmethod 736 def on_preload(cls) -> Any: 737 data: dict[str, Any] = { 738 'model': ba.getmodel('doomShroomLevel'), 739 'collide_model': ba.getcollidemodel('doomShroomLevelCollide'), 740 'tex': ba.gettexture('doomShroomLevelColor'), 741 'bgtex': ba.gettexture('doomShroomBGColor'), 742 'bgmodel': ba.getmodel('doomShroomBG'), 743 'vr_fill_model': ba.getmodel('doomShroomVRFill'), 744 'stem_model': ba.getmodel('doomShroomStem'), 745 'collide_bg': ba.getcollidemodel('doomShroomStemCollide') 746 } 747 return data 748 749 def __init__(self) -> None: 750 super().__init__() 751 shared = SharedObjects.get() 752 self.node = ba.newnode( 753 'terrain', 754 delegate=self, 755 attrs={ 756 'collide_model': self.preloaddata['collide_model'], 757 'model': self.preloaddata['model'], 758 'color_texture': self.preloaddata['tex'], 759 'materials': [shared.footing_material] 760 }) 761 self.background = ba.newnode( 762 'terrain', 763 attrs={ 764 'model': self.preloaddata['bgmodel'], 765 'lighting': False, 766 'background': True, 767 'color_texture': self.preloaddata['bgtex'] 768 }) 769 ba.newnode('terrain', 770 attrs={ 771 'model': self.preloaddata['vr_fill_model'], 772 'lighting': False, 773 'vr_only': True, 774 'background': True, 775 'color_texture': self.preloaddata['bgtex'] 776 }) 777 self.stem = ba.newnode('terrain', 778 attrs={ 779 'model': self.preloaddata['stem_model'], 780 'lighting': False, 781 'color_texture': self.preloaddata['tex'] 782 }) 783 self.bg_collide = ba.newnode( 784 'terrain', 785 attrs={ 786 'collide_model': self.preloaddata['collide_bg'], 787 'materials': [shared.footing_material, shared.death_material] 788 }) 789 gnode = ba.getactivity().globalsnode 790 gnode.tint = (0.82, 1.10, 1.15) 791 gnode.ambient_color = (0.9, 1.3, 1.1) 792 gnode.shadow_ortho = False 793 gnode.vignette_outer = (0.76, 0.76, 0.76) 794 gnode.vignette_inner = (0.95, 0.95, 0.99) 795 796 def is_point_near_edge(self, 797 point: ba.Vec3, 798 running: bool = False) -> bool: 799 xpos = point.x 800 zpos = point.z 801 x_adj = xpos * 0.125 802 z_adj = (zpos + 3.7) * 0.2 803 if running: 804 x_adj *= 1.4 805 z_adj *= 1.4 806 return x_adj * x_adj + z_adj * z_adj > 1.0 807 808 809class LakeFrigid(ba.Map): 810 """An icy lake fit for racing.""" 811 812 from bastd.mapdata import lake_frigid as defs 813 814 name = 'Lake Frigid' 815 816 @classmethod 817 def get_play_types(cls) -> list[str]: 818 """Return valid play types for this map.""" 819 return ['melee', 'keep_away', 'team_flag', 'race'] 820 821 @classmethod 822 def get_preview_texture_name(cls) -> str: 823 return 'lakeFrigidPreview' 824 825 @classmethod 826 def on_preload(cls) -> Any: 827 data: dict[str, Any] = { 828 'model': ba.getmodel('lakeFrigid'), 829 'model_top': ba.getmodel('lakeFrigidTop'), 830 'model_reflections': ba.getmodel('lakeFrigidReflections'), 831 'collide_model': ba.getcollidemodel('lakeFrigidCollide'), 832 'tex': ba.gettexture('lakeFrigid'), 833 'tex_reflections': ba.gettexture('lakeFrigidReflections'), 834 'vr_fill_model': ba.getmodel('lakeFrigidVRFill') 835 } 836 mat = ba.Material() 837 mat.add_actions(actions=('modify_part_collision', 'friction', 0.01)) 838 data['ice_material'] = mat 839 return data 840 841 def __init__(self) -> None: 842 super().__init__() 843 shared = SharedObjects.get() 844 self.node = ba.newnode('terrain', 845 delegate=self, 846 attrs={ 847 'collide_model': 848 self.preloaddata['collide_model'], 849 'model': 850 self.preloaddata['model'], 851 'color_texture': 852 self.preloaddata['tex'], 853 'materials': [ 854 shared.footing_material, 855 self.preloaddata['ice_material'] 856 ] 857 }) 858 ba.newnode('terrain', 859 attrs={ 860 'model': self.preloaddata['model_top'], 861 'lighting': False, 862 'color_texture': self.preloaddata['tex'] 863 }) 864 ba.newnode('terrain', 865 attrs={ 866 'model': self.preloaddata['model_reflections'], 867 'lighting': False, 868 'overlay': True, 869 'opacity': 0.15, 870 'color_texture': self.preloaddata['tex_reflections'] 871 }) 872 ba.newnode('terrain', 873 attrs={ 874 'model': self.preloaddata['vr_fill_model'], 875 'lighting': False, 876 'vr_only': True, 877 'background': True, 878 'color_texture': self.preloaddata['tex'] 879 }) 880 gnode = ba.getactivity().globalsnode 881 gnode.tint = (1, 1, 1) 882 gnode.ambient_color = (1, 1, 1) 883 gnode.shadow_ortho = True 884 gnode.vignette_outer = (0.86, 0.86, 0.86) 885 gnode.vignette_inner = (0.95, 0.95, 0.99) 886 gnode.vr_near_clip = 0.5 887 self.is_hockey = True 888 889 890class TipTop(ba.Map): 891 """A pointy map good for king-of-the-hill-ish games.""" 892 893 from bastd.mapdata import tip_top as defs 894 895 name = 'Tip Top' 896 897 @classmethod 898 def get_play_types(cls) -> list[str]: 899 """Return valid play types for this map.""" 900 return ['melee', 'keep_away', 'team_flag', 'king_of_the_hill'] 901 902 @classmethod 903 def get_preview_texture_name(cls) -> str: 904 return 'tipTopPreview' 905 906 @classmethod 907 def on_preload(cls) -> Any: 908 data: dict[str, Any] = { 909 'model': ba.getmodel('tipTopLevel'), 910 'bottom_model': ba.getmodel('tipTopLevelBottom'), 911 'collide_model': ba.getcollidemodel('tipTopLevelCollide'), 912 'tex': ba.gettexture('tipTopLevelColor'), 913 'bgtex': ba.gettexture('tipTopBGColor'), 914 'bgmodel': ba.getmodel('tipTopBG'), 915 'railing_collide_model': ba.getcollidemodel('tipTopLevelBumper') 916 } 917 return data 918 919 def __init__(self) -> None: 920 super().__init__(vr_overlay_offset=(0, -0.2, 2.5)) 921 shared = SharedObjects.get() 922 self.node = ba.newnode( 923 'terrain', 924 delegate=self, 925 attrs={ 926 'collide_model': self.preloaddata['collide_model'], 927 'model': self.preloaddata['model'], 928 'color_texture': self.preloaddata['tex'], 929 'color': (0.7, 0.7, 0.7), 930 'materials': [shared.footing_material] 931 }) 932 self.bottom = ba.newnode('terrain', 933 attrs={ 934 'model': self.preloaddata['bottom_model'], 935 'lighting': False, 936 'color': (0.7, 0.7, 0.7), 937 'color_texture': self.preloaddata['tex'] 938 }) 939 self.background = ba.newnode( 940 'terrain', 941 attrs={ 942 'model': self.preloaddata['bgmodel'], 943 'lighting': False, 944 'color': (0.4, 0.4, 0.4), 945 'background': True, 946 'color_texture': self.preloaddata['bgtex'] 947 }) 948 self.railing = ba.newnode( 949 'terrain', 950 attrs={ 951 'collide_model': self.preloaddata['railing_collide_model'], 952 'materials': [shared.railing_material], 953 'bumper': True 954 }) 955 gnode = ba.getactivity().globalsnode 956 gnode.tint = (0.8, 0.9, 1.3) 957 gnode.ambient_color = (0.8, 0.9, 1.3) 958 gnode.vignette_outer = (0.79, 0.79, 0.69) 959 gnode.vignette_inner = (0.97, 0.97, 0.99) 960 961 962class CragCastle(ba.Map): 963 """A lovely castle map.""" 964 965 from bastd.mapdata import crag_castle as defs 966 967 name = 'Crag Castle' 968 969 @classmethod 970 def get_play_types(cls) -> list[str]: 971 """Return valid play types for this map.""" 972 return ['melee', 'keep_away', 'team_flag', 'conquest'] 973 974 @classmethod 975 def get_preview_texture_name(cls) -> str: 976 return 'cragCastlePreview' 977 978 @classmethod 979 def on_preload(cls) -> Any: 980 data: dict[str, Any] = { 981 'model': ba.getmodel('cragCastleLevel'), 982 'bottom_model': ba.getmodel('cragCastleLevelBottom'), 983 'collide_model': ba.getcollidemodel('cragCastleLevelCollide'), 984 'tex': ba.gettexture('cragCastleLevelColor'), 985 'bgtex': ba.gettexture('menuBG'), 986 'bgmodel': ba.getmodel('thePadBG'), 987 'railing_collide_model': 988 (ba.getcollidemodel('cragCastleLevelBumper')), 989 'vr_fill_mound_model': ba.getmodel('cragCastleVRFillMound'), 990 'vr_fill_mound_tex': ba.gettexture('vrFillMound') 991 } 992 # fixme should chop this into vr/non-vr sections 993 return data 994 995 def __init__(self) -> None: 996 super().__init__() 997 shared = SharedObjects.get() 998 self.node = ba.newnode( 999 'terrain', 1000 delegate=self, 1001 attrs={ 1002 'collide_model': self.preloaddata['collide_model'], 1003 'model': self.preloaddata['model'], 1004 'color_texture': self.preloaddata['tex'], 1005 'materials': [shared.footing_material] 1006 }) 1007 self.bottom = ba.newnode('terrain', 1008 attrs={ 1009 'model': self.preloaddata['bottom_model'], 1010 'lighting': False, 1011 'color_texture': self.preloaddata['tex'] 1012 }) 1013 self.background = ba.newnode( 1014 'terrain', 1015 attrs={ 1016 'model': self.preloaddata['bgmodel'], 1017 'lighting': False, 1018 'background': True, 1019 'color_texture': self.preloaddata['bgtex'] 1020 }) 1021 self.railing = ba.newnode( 1022 'terrain', 1023 attrs={ 1024 'collide_model': self.preloaddata['railing_collide_model'], 1025 'materials': [shared.railing_material], 1026 'bumper': True 1027 }) 1028 ba.newnode('terrain', 1029 attrs={ 1030 'model': self.preloaddata['vr_fill_mound_model'], 1031 'lighting': False, 1032 'vr_only': True, 1033 'color': (0.2, 0.25, 0.2), 1034 'background': True, 1035 'color_texture': self.preloaddata['vr_fill_mound_tex'] 1036 }) 1037 gnode = ba.getactivity().globalsnode 1038 gnode.shadow_ortho = True 1039 gnode.shadow_offset = (0, 0, -5.0) 1040 gnode.tint = (1.15, 1.05, 0.75) 1041 gnode.ambient_color = (1.15, 1.05, 0.75) 1042 gnode.vignette_outer = (0.6, 0.65, 0.6) 1043 gnode.vignette_inner = (0.95, 0.95, 0.95) 1044 gnode.vr_near_clip = 1.0 1045 1046 1047class TowerD(ba.Map): 1048 """Map used for runaround mini-game.""" 1049 1050 from bastd.mapdata import tower_d as defs 1051 1052 name = 'Tower D' 1053 1054 @classmethod 1055 def get_play_types(cls) -> list[str]: 1056 """Return valid play types for this map.""" 1057 return [] 1058 1059 @classmethod 1060 def get_preview_texture_name(cls) -> str: 1061 return 'towerDPreview' 1062 1063 @classmethod 1064 def on_preload(cls) -> Any: 1065 data: dict[str, Any] = { 1066 'model': 1067 ba.getmodel('towerDLevel'), 1068 'model_bottom': 1069 ba.getmodel('towerDLevelBottom'), 1070 'collide_model': 1071 ba.getcollidemodel('towerDLevelCollide'), 1072 'tex': 1073 ba.gettexture('towerDLevelColor'), 1074 'bgtex': 1075 ba.gettexture('menuBG'), 1076 'bgmodel': 1077 ba.getmodel('thePadBG'), 1078 'player_wall_collide_model': 1079 ba.getcollidemodel('towerDPlayerWall'), 1080 'player_wall_material': 1081 ba.Material() 1082 } 1083 # fixme should chop this into vr/non-vr sections 1084 data['player_wall_material'].add_actions( 1085 actions=('modify_part_collision', 'friction', 0.0)) 1086 # anything that needs to hit the wall can apply this material 1087 data['collide_with_wall_material'] = ba.Material() 1088 data['player_wall_material'].add_actions( 1089 conditions=('they_dont_have_material', 1090 data['collide_with_wall_material']), 1091 actions=('modify_part_collision', 'collide', False)) 1092 data['vr_fill_mound_model'] = ba.getmodel('stepRightUpVRFillMound') 1093 data['vr_fill_mound_tex'] = ba.gettexture('vrFillMound') 1094 return data 1095 1096 def __init__(self) -> None: 1097 super().__init__(vr_overlay_offset=(0, 1, 1)) 1098 shared = SharedObjects.get() 1099 self.node = ba.newnode( 1100 'terrain', 1101 delegate=self, 1102 attrs={ 1103 'collide_model': self.preloaddata['collide_model'], 1104 'model': self.preloaddata['model'], 1105 'color_texture': self.preloaddata['tex'], 1106 'materials': [shared.footing_material] 1107 }) 1108 self.node_bottom = ba.newnode( 1109 'terrain', 1110 delegate=self, 1111 attrs={ 1112 'model': self.preloaddata['model_bottom'], 1113 'lighting': False, 1114 'color_texture': self.preloaddata['tex'] 1115 }) 1116 ba.newnode('terrain', 1117 attrs={ 1118 'model': self.preloaddata['vr_fill_mound_model'], 1119 'lighting': False, 1120 'vr_only': True, 1121 'color': (0.53, 0.57, 0.5), 1122 'background': True, 1123 'color_texture': self.preloaddata['vr_fill_mound_tex'] 1124 }) 1125 self.background = ba.newnode( 1126 'terrain', 1127 attrs={ 1128 'model': self.preloaddata['bgmodel'], 1129 'lighting': False, 1130 'background': True, 1131 'color_texture': self.preloaddata['bgtex'] 1132 }) 1133 self.player_wall = ba.newnode( 1134 'terrain', 1135 attrs={ 1136 'collide_model': self.preloaddata['player_wall_collide_model'], 1137 'affect_bg_dynamics': False, 1138 'materials': [self.preloaddata['player_wall_material']] 1139 }) 1140 gnode = ba.getactivity().globalsnode 1141 gnode.tint = (1.15, 1.11, 1.03) 1142 gnode.ambient_color = (1.2, 1.1, 1.0) 1143 gnode.vignette_outer = (0.7, 0.73, 0.7) 1144 gnode.vignette_inner = (0.95, 0.95, 0.95) 1145 1146 def is_point_near_edge(self, 1147 point: ba.Vec3, 1148 running: bool = False) -> bool: 1149 # see if we're within edge_box 1150 boxes = self.defs.boxes 1151 box_position = boxes['edge_box'][0:3] 1152 box_scale = boxes['edge_box'][6:9] 1153 box_position2 = boxes['edge_box2'][0:3] 1154 box_scale2 = boxes['edge_box2'][6:9] 1155 xpos = (point.x - box_position[0]) / box_scale[0] 1156 zpos = (point.z - box_position[2]) / box_scale[2] 1157 xpos2 = (point.x - box_position2[0]) / box_scale2[0] 1158 zpos2 = (point.z - box_position2[2]) / box_scale2[2] 1159 # if we're outside of *both* boxes we're near the edge 1160 return ((xpos < -0.5 or xpos > 0.5 or zpos < -0.5 or zpos > 0.5) and 1161 (xpos2 < -0.5 or xpos2 > 0.5 or zpos2 < -0.5 or zpos2 > 0.5)) 1162 1163 1164class HappyThoughts(ba.Map): 1165 """Flying map.""" 1166 1167 from bastd.mapdata import happy_thoughts as defs 1168 1169 name = 'Happy Thoughts' 1170 1171 @classmethod 1172 def get_play_types(cls) -> list[str]: 1173 """Return valid play types for this map.""" 1174 return [ 1175 'melee', 'keep_away', 'team_flag', 'conquest', 'king_of_the_hill' 1176 ] 1177 1178 @classmethod 1179 def get_preview_texture_name(cls) -> str: 1180 return 'alwaysLandPreview' 1181 1182 @classmethod 1183 def on_preload(cls) -> Any: 1184 data: dict[str, Any] = { 1185 'model': ba.getmodel('alwaysLandLevel'), 1186 'bottom_model': ba.getmodel('alwaysLandLevelBottom'), 1187 'bgmodel': ba.getmodel('alwaysLandBG'), 1188 'collide_model': ba.getcollidemodel('alwaysLandLevelCollide'), 1189 'tex': ba.gettexture('alwaysLandLevelColor'), 1190 'bgtex': ba.gettexture('alwaysLandBGColor'), 1191 'vr_fill_mound_model': ba.getmodel('alwaysLandVRFillMound'), 1192 'vr_fill_mound_tex': ba.gettexture('vrFillMound') 1193 } 1194 return data 1195 1196 @classmethod 1197 def get_music_type(cls) -> ba.MusicType: 1198 return ba.MusicType.FLYING 1199 1200 def __init__(self) -> None: 1201 super().__init__(vr_overlay_offset=(0, -3.7, 2.5)) 1202 shared = SharedObjects.get() 1203 self.node = ba.newnode( 1204 'terrain', 1205 delegate=self, 1206 attrs={ 1207 'collide_model': self.preloaddata['collide_model'], 1208 'model': self.preloaddata['model'], 1209 'color_texture': self.preloaddata['tex'], 1210 'materials': [shared.footing_material] 1211 }) 1212 self.bottom = ba.newnode('terrain', 1213 attrs={ 1214 'model': self.preloaddata['bottom_model'], 1215 'lighting': False, 1216 'color_texture': self.preloaddata['tex'] 1217 }) 1218 self.background = ba.newnode( 1219 'terrain', 1220 attrs={ 1221 'model': self.preloaddata['bgmodel'], 1222 'lighting': False, 1223 'background': True, 1224 'color_texture': self.preloaddata['bgtex'] 1225 }) 1226 ba.newnode('terrain', 1227 attrs={ 1228 'model': self.preloaddata['vr_fill_mound_model'], 1229 'lighting': False, 1230 'vr_only': True, 1231 'color': (0.2, 0.25, 0.2), 1232 'background': True, 1233 'color_texture': self.preloaddata['vr_fill_mound_tex'] 1234 }) 1235 gnode = ba.getactivity().globalsnode 1236 gnode.happy_thoughts_mode = True 1237 gnode.shadow_offset = (0.0, 8.0, 5.0) 1238 gnode.tint = (1.3, 1.23, 1.0) 1239 gnode.ambient_color = (1.3, 1.23, 1.0) 1240 gnode.vignette_outer = (0.64, 0.59, 0.69) 1241 gnode.vignette_inner = (0.95, 0.95, 0.93) 1242 gnode.vr_near_clip = 1.0 1243 self.is_flying = True 1244 1245 # throw out some tips on flying 1246 txt = ba.newnode('text', 1247 attrs={ 1248 'text': ba.Lstr(resource='pressJumpToFlyText'), 1249 'scale': 1.2, 1250 'maxwidth': 800, 1251 'position': (0, 200), 1252 'shadow': 0.5, 1253 'flatness': 0.5, 1254 'h_align': 'center', 1255 'v_attach': 'bottom' 1256 }) 1257 cmb = ba.newnode('combine', 1258 owner=txt, 1259 attrs={ 1260 'size': 4, 1261 'input0': 0.3, 1262 'input1': 0.9, 1263 'input2': 0.0 1264 }) 1265 ba.animate(cmb, 'input3', {3.0: 0, 4.0: 1, 9.0: 1, 10.0: 0}) 1266 cmb.connectattr('output', txt, 'color') 1267 ba.timer(10.0, txt.delete) 1268 1269 1270class StepRightUp(ba.Map): 1271 """Wide stepped map good for CTF or Assault.""" 1272 1273 from bastd.mapdata import step_right_up as defs 1274 1275 name = 'Step Right Up' 1276 1277 @classmethod 1278 def get_play_types(cls) -> list[str]: 1279 """Return valid play types for this map.""" 1280 return ['melee', 'keep_away', 'team_flag', 'conquest'] 1281 1282 @classmethod 1283 def get_preview_texture_name(cls) -> str: 1284 return 'stepRightUpPreview' 1285 1286 @classmethod 1287 def on_preload(cls) -> Any: 1288 data: dict[str, Any] = { 1289 'model': ba.getmodel('stepRightUpLevel'), 1290 'model_bottom': ba.getmodel('stepRightUpLevelBottom'), 1291 'collide_model': ba.getcollidemodel('stepRightUpLevelCollide'), 1292 'tex': ba.gettexture('stepRightUpLevelColor'), 1293 'bgtex': ba.gettexture('menuBG'), 1294 'bgmodel': ba.getmodel('thePadBG'), 1295 'vr_fill_mound_model': ba.getmodel('stepRightUpVRFillMound'), 1296 'vr_fill_mound_tex': ba.gettexture('vrFillMound') 1297 } 1298 # fixme should chop this into vr/non-vr chunks 1299 return data 1300 1301 def __init__(self) -> None: 1302 super().__init__(vr_overlay_offset=(0, -1, 2)) 1303 shared = SharedObjects.get() 1304 self.node = ba.newnode( 1305 'terrain', 1306 delegate=self, 1307 attrs={ 1308 'collide_model': self.preloaddata['collide_model'], 1309 'model': self.preloaddata['model'], 1310 'color_texture': self.preloaddata['tex'], 1311 'materials': [shared.footing_material] 1312 }) 1313 self.node_bottom = ba.newnode( 1314 'terrain', 1315 delegate=self, 1316 attrs={ 1317 'model': self.preloaddata['model_bottom'], 1318 'lighting': False, 1319 'color_texture': self.preloaddata['tex'] 1320 }) 1321 ba.newnode('terrain', 1322 attrs={ 1323 'model': self.preloaddata['vr_fill_mound_model'], 1324 'lighting': False, 1325 'vr_only': True, 1326 'color': (0.53, 0.57, 0.5), 1327 'background': True, 1328 'color_texture': self.preloaddata['vr_fill_mound_tex'] 1329 }) 1330 self.background = ba.newnode( 1331 'terrain', 1332 attrs={ 1333 'model': self.preloaddata['bgmodel'], 1334 'lighting': False, 1335 'background': True, 1336 'color_texture': self.preloaddata['bgtex'] 1337 }) 1338 gnode = ba.getactivity().globalsnode 1339 gnode.tint = (1.2, 1.1, 1.0) 1340 gnode.ambient_color = (1.2, 1.1, 1.0) 1341 gnode.vignette_outer = (0.7, 0.65, 0.75) 1342 gnode.vignette_inner = (0.95, 0.95, 0.93) 1343 1344 1345class Courtyard(ba.Map): 1346 """A courtyard-ish looking map for co-op levels.""" 1347 1348 from bastd.mapdata import courtyard as defs 1349 1350 name = 'Courtyard' 1351 1352 @classmethod 1353 def get_play_types(cls) -> list[str]: 1354 """Return valid play types for this map.""" 1355 return ['melee', 'keep_away', 'team_flag'] 1356 1357 @classmethod 1358 def get_preview_texture_name(cls) -> str: 1359 return 'courtyardPreview' 1360 1361 @classmethod 1362 def on_preload(cls) -> Any: 1363 data: dict[str, Any] = { 1364 'model': ba.getmodel('courtyardLevel'), 1365 'model_bottom': ba.getmodel('courtyardLevelBottom'), 1366 'collide_model': ba.getcollidemodel('courtyardLevelCollide'), 1367 'tex': ba.gettexture('courtyardLevelColor'), 1368 'bgtex': ba.gettexture('menuBG'), 1369 'bgmodel': ba.getmodel('thePadBG'), 1370 'player_wall_collide_model': 1371 (ba.getcollidemodel('courtyardPlayerWall')), 1372 'player_wall_material': ba.Material() 1373 } 1374 # FIXME: Chop this into vr and non-vr chunks. 1375 data['player_wall_material'].add_actions( 1376 actions=('modify_part_collision', 'friction', 0.0)) 1377 # anything that needs to hit the wall should apply this. 1378 data['collide_with_wall_material'] = ba.Material() 1379 data['player_wall_material'].add_actions( 1380 conditions=('they_dont_have_material', 1381 data['collide_with_wall_material']), 1382 actions=('modify_part_collision', 'collide', False)) 1383 data['vr_fill_mound_model'] = ba.getmodel('stepRightUpVRFillMound') 1384 data['vr_fill_mound_tex'] = ba.gettexture('vrFillMound') 1385 return data 1386 1387 def __init__(self) -> None: 1388 super().__init__() 1389 shared = SharedObjects.get() 1390 self.node = ba.newnode( 1391 'terrain', 1392 delegate=self, 1393 attrs={ 1394 'collide_model': self.preloaddata['collide_model'], 1395 'model': self.preloaddata['model'], 1396 'color_texture': self.preloaddata['tex'], 1397 'materials': [shared.footing_material] 1398 }) 1399 self.background = ba.newnode( 1400 'terrain', 1401 attrs={ 1402 'model': self.preloaddata['bgmodel'], 1403 'lighting': False, 1404 'background': True, 1405 'color_texture': self.preloaddata['bgtex'] 1406 }) 1407 self.bottom = ba.newnode('terrain', 1408 attrs={ 1409 'model': self.preloaddata['model_bottom'], 1410 'lighting': False, 1411 'color_texture': self.preloaddata['tex'] 1412 }) 1413 ba.newnode('terrain', 1414 attrs={ 1415 'model': self.preloaddata['vr_fill_mound_model'], 1416 'lighting': False, 1417 'vr_only': True, 1418 'color': (0.53, 0.57, 0.5), 1419 'background': True, 1420 'color_texture': self.preloaddata['vr_fill_mound_tex'] 1421 }) 1422 # in co-op mode games, put up a wall to prevent players 1423 # from getting in the turrets (that would foil our brilliant AI) 1424 if isinstance(ba.getsession(), ba.CoopSession): 1425 cmodel = self.preloaddata['player_wall_collide_model'] 1426 self.player_wall = ba.newnode( 1427 'terrain', 1428 attrs={ 1429 'collide_model': cmodel, 1430 'affect_bg_dynamics': False, 1431 'materials': [self.preloaddata['player_wall_material']] 1432 }) 1433 gnode = ba.getactivity().globalsnode 1434 gnode.tint = (1.2, 1.17, 1.1) 1435 gnode.ambient_color = (1.2, 1.17, 1.1) 1436 gnode.vignette_outer = (0.6, 0.6, 0.64) 1437 gnode.vignette_inner = (0.95, 0.95, 0.93) 1438 1439 def is_point_near_edge(self, 1440 point: ba.Vec3, 1441 running: bool = False) -> bool: 1442 # count anything off our ground level as safe (for our platforms) 1443 # see if we're within edge_box 1444 box_position = self.defs.boxes['edge_box'][0:3] 1445 box_scale = self.defs.boxes['edge_box'][6:9] 1446 xpos = (point.x - box_position[0]) / box_scale[0] 1447 zpos = (point.z - box_position[2]) / box_scale[2] 1448 return xpos < -0.5 or xpos > 0.5 or zpos < -0.5 or zpos > 0.5 1449 1450 1451class Rampage(ba.Map): 1452 """Wee little map with ramps on the sides.""" 1453 1454 from bastd.mapdata import rampage as defs 1455 1456 name = 'Rampage' 1457 1458 @classmethod 1459 def get_play_types(cls) -> list[str]: 1460 """Return valid play types for this map.""" 1461 return ['melee', 'keep_away', 'team_flag'] 1462 1463 @classmethod 1464 def get_preview_texture_name(cls) -> str: 1465 return 'rampagePreview' 1466 1467 @classmethod 1468 def on_preload(cls) -> Any: 1469 data: dict[str, Any] = { 1470 'model': ba.getmodel('rampageLevel'), 1471 'bottom_model': ba.getmodel('rampageLevelBottom'), 1472 'collide_model': ba.getcollidemodel('rampageLevelCollide'), 1473 'tex': ba.gettexture('rampageLevelColor'), 1474 'bgtex': ba.gettexture('rampageBGColor'), 1475 'bgtex2': ba.gettexture('rampageBGColor2'), 1476 'bgmodel': ba.getmodel('rampageBG'), 1477 'bgmodel2': ba.getmodel('rampageBG2'), 1478 'vr_fill_model': ba.getmodel('rampageVRFill'), 1479 'railing_collide_model': ba.getcollidemodel('rampageBumper') 1480 } 1481 return data 1482 1483 def __init__(self) -> None: 1484 super().__init__(vr_overlay_offset=(0, 0, 2)) 1485 shared = SharedObjects.get() 1486 self.node = ba.newnode( 1487 'terrain', 1488 delegate=self, 1489 attrs={ 1490 'collide_model': self.preloaddata['collide_model'], 1491 'model': self.preloaddata['model'], 1492 'color_texture': self.preloaddata['tex'], 1493 'materials': [shared.footing_material] 1494 }) 1495 self.background = ba.newnode( 1496 'terrain', 1497 attrs={ 1498 'model': self.preloaddata['bgmodel'], 1499 'lighting': False, 1500 'background': True, 1501 'color_texture': self.preloaddata['bgtex'] 1502 }) 1503 self.bottom = ba.newnode('terrain', 1504 attrs={ 1505 'model': self.preloaddata['bottom_model'], 1506 'lighting': False, 1507 'color_texture': self.preloaddata['tex'] 1508 }) 1509 self.bg2 = ba.newnode('terrain', 1510 attrs={ 1511 'model': self.preloaddata['bgmodel2'], 1512 'lighting': False, 1513 'background': True, 1514 'color_texture': self.preloaddata['bgtex2'] 1515 }) 1516 ba.newnode('terrain', 1517 attrs={ 1518 'model': self.preloaddata['vr_fill_model'], 1519 'lighting': False, 1520 'vr_only': True, 1521 'background': True, 1522 'color_texture': self.preloaddata['bgtex2'] 1523 }) 1524 self.railing = ba.newnode( 1525 'terrain', 1526 attrs={ 1527 'collide_model': self.preloaddata['railing_collide_model'], 1528 'materials': [shared.railing_material], 1529 'bumper': True 1530 }) 1531 gnode = ba.getactivity().globalsnode 1532 gnode.tint = (1.2, 1.1, 0.97) 1533 gnode.ambient_color = (1.3, 1.2, 1.03) 1534 gnode.vignette_outer = (0.62, 0.64, 0.69) 1535 gnode.vignette_inner = (0.97, 0.95, 0.93) 1536 1537 def is_point_near_edge(self, 1538 point: ba.Vec3, 1539 running: bool = False) -> bool: 1540 box_position = self.defs.boxes['edge_box'][0:3] 1541 box_scale = self.defs.boxes['edge_box'][6:9] 1542 xpos = (point.x - box_position[0]) / box_scale[0] 1543 zpos = (point.z - box_position[2]) / box_scale[2] 1544 return xpos < -0.5 or xpos > 0.5 or zpos < -0.5 or zpos > 0.5
18class HockeyStadium(ba.Map): 19 """Stadium map used for ice hockey games.""" 20 21 from bastd.mapdata import hockey_stadium as defs 22 name = 'Hockey Stadium' 23 24 @classmethod 25 def get_play_types(cls) -> list[str]: 26 """Return valid play types for this map.""" 27 return ['melee', 'hockey', 'team_flag', 'keep_away'] 28 29 @classmethod 30 def get_preview_texture_name(cls) -> str: 31 return 'hockeyStadiumPreview' 32 33 @classmethod 34 def on_preload(cls) -> Any: 35 data: dict[str, Any] = { 36 'models': (ba.getmodel('hockeyStadiumOuter'), 37 ba.getmodel('hockeyStadiumInner'), 38 ba.getmodel('hockeyStadiumStands')), 39 'vr_fill_model': ba.getmodel('footballStadiumVRFill'), 40 'collide_model': ba.getcollidemodel('hockeyStadiumCollide'), 41 'tex': ba.gettexture('hockeyStadium'), 42 'stands_tex': ba.gettexture('footballStadium') 43 } 44 mat = ba.Material() 45 mat.add_actions(actions=('modify_part_collision', 'friction', 0.01)) 46 data['ice_material'] = mat 47 return data 48 49 def __init__(self) -> None: 50 super().__init__() 51 shared = SharedObjects.get() 52 self.node = ba.newnode('terrain', 53 delegate=self, 54 attrs={ 55 'model': 56 self.preloaddata['models'][0], 57 'collide_model': 58 self.preloaddata['collide_model'], 59 'color_texture': 60 self.preloaddata['tex'], 61 'materials': [ 62 shared.footing_material, 63 self.preloaddata['ice_material'] 64 ] 65 }) 66 ba.newnode('terrain', 67 attrs={ 68 'model': self.preloaddata['vr_fill_model'], 69 'vr_only': True, 70 'lighting': False, 71 'background': True, 72 'color_texture': self.preloaddata['stands_tex'] 73 }) 74 mats = [shared.footing_material, self.preloaddata['ice_material']] 75 self.floor = ba.newnode('terrain', 76 attrs={ 77 'model': self.preloaddata['models'][1], 78 'color_texture': self.preloaddata['tex'], 79 'opacity': 0.92, 80 'opacity_in_low_or_medium_quality': 1.0, 81 'materials': mats 82 }) 83 self.stands = ba.newnode( 84 'terrain', 85 attrs={ 86 'model': self.preloaddata['models'][2], 87 'visible_in_reflections': False, 88 'color_texture': self.preloaddata['stands_tex'] 89 }) 90 gnode = ba.getactivity().globalsnode 91 gnode.floor_reflection = True 92 gnode.debris_friction = 0.3 93 gnode.debris_kill_height = -0.3 94 gnode.tint = (1.2, 1.3, 1.33) 95 gnode.ambient_color = (1.15, 1.25, 1.6) 96 gnode.vignette_outer = (0.66, 0.67, 0.73) 97 gnode.vignette_inner = (0.93, 0.93, 0.95) 98 gnode.vr_camera_offset = (0, -0.8, -1.1) 99 gnode.vr_near_clip = 0.5 100 self.is_hockey = True
Stadium map used for ice hockey games.
49 def __init__(self) -> None: 50 super().__init__() 51 shared = SharedObjects.get() 52 self.node = ba.newnode('terrain', 53 delegate=self, 54 attrs={ 55 'model': 56 self.preloaddata['models'][0], 57 'collide_model': 58 self.preloaddata['collide_model'], 59 'color_texture': 60 self.preloaddata['tex'], 61 'materials': [ 62 shared.footing_material, 63 self.preloaddata['ice_material'] 64 ] 65 }) 66 ba.newnode('terrain', 67 attrs={ 68 'model': self.preloaddata['vr_fill_model'], 69 'vr_only': True, 70 'lighting': False, 71 'background': True, 72 'color_texture': self.preloaddata['stands_tex'] 73 }) 74 mats = [shared.footing_material, self.preloaddata['ice_material']] 75 self.floor = ba.newnode('terrain', 76 attrs={ 77 'model': self.preloaddata['models'][1], 78 'color_texture': self.preloaddata['tex'], 79 'opacity': 0.92, 80 'opacity_in_low_or_medium_quality': 1.0, 81 'materials': mats 82 }) 83 self.stands = ba.newnode( 84 'terrain', 85 attrs={ 86 'model': self.preloaddata['models'][2], 87 'visible_in_reflections': False, 88 'color_texture': self.preloaddata['stands_tex'] 89 }) 90 gnode = ba.getactivity().globalsnode 91 gnode.floor_reflection = True 92 gnode.debris_friction = 0.3 93 gnode.debris_kill_height = -0.3 94 gnode.tint = (1.2, 1.3, 1.33) 95 gnode.ambient_color = (1.15, 1.25, 1.6) 96 gnode.vignette_outer = (0.66, 0.67, 0.73) 97 gnode.vignette_inner = (0.93, 0.93, 0.95) 98 gnode.vr_camera_offset = (0, -0.8, -1.1) 99 gnode.vr_near_clip = 0.5 100 self.is_hockey = True
Instantiate a map.
24 @classmethod 25 def get_play_types(cls) -> list[str]: 26 """Return valid play types for this map.""" 27 return ['melee', 'hockey', 'team_flag', 'keep_away']
Return valid play types for this map.
Return the name of the preview texture for this map.
33 @classmethod 34 def on_preload(cls) -> Any: 35 data: dict[str, Any] = { 36 'models': (ba.getmodel('hockeyStadiumOuter'), 37 ba.getmodel('hockeyStadiumInner'), 38 ba.getmodel('hockeyStadiumStands')), 39 'vr_fill_model': ba.getmodel('footballStadiumVRFill'), 40 'collide_model': ba.getcollidemodel('hockeyStadiumCollide'), 41 'tex': ba.gettexture('hockeyStadium'), 42 'stands_tex': ba.gettexture('footballStadium') 43 } 44 mat = ba.Material() 45 mat.add_actions(actions=('modify_part_collision', 'friction', 0.01)) 46 data['ice_material'] = mat 47 return data
Called when the map is being preloaded.
It should return any media/data it requires to operate
Inherited Members
- ba._map.Map
- preload
- getname
- get_music_type
- is_point_near_edge
- get_def_bound_box
- get_def_point
- get_def_points
- get_start_position
- get_ffa_start_position
- get_flag_position
- exists
- handlemessage
- ba._actor.Actor
- autoretain
- on_expire
- expired
- is_alive
- activity
- getactivity
103class FootballStadium(ba.Map): 104 """Stadium map for football games.""" 105 from bastd.mapdata import football_stadium as defs 106 107 name = 'Football Stadium' 108 109 @classmethod 110 def get_play_types(cls) -> list[str]: 111 """Return valid play types for this map.""" 112 return ['melee', 'football', 'team_flag', 'keep_away'] 113 114 @classmethod 115 def get_preview_texture_name(cls) -> str: 116 return 'footballStadiumPreview' 117 118 @classmethod 119 def on_preload(cls) -> Any: 120 data: dict[str, Any] = { 121 'model': ba.getmodel('footballStadium'), 122 'vr_fill_model': ba.getmodel('footballStadiumVRFill'), 123 'collide_model': ba.getcollidemodel('footballStadiumCollide'), 124 'tex': ba.gettexture('footballStadium') 125 } 126 return data 127 128 def __init__(self) -> None: 129 super().__init__() 130 shared = SharedObjects.get() 131 self.node = ba.newnode( 132 'terrain', 133 delegate=self, 134 attrs={ 135 'model': self.preloaddata['model'], 136 'collide_model': self.preloaddata['collide_model'], 137 'color_texture': self.preloaddata['tex'], 138 'materials': [shared.footing_material] 139 }) 140 ba.newnode('terrain', 141 attrs={ 142 'model': self.preloaddata['vr_fill_model'], 143 'lighting': False, 144 'vr_only': True, 145 'background': True, 146 'color_texture': self.preloaddata['tex'] 147 }) 148 gnode = ba.getactivity().globalsnode 149 gnode.tint = (1.3, 1.2, 1.0) 150 gnode.ambient_color = (1.3, 1.2, 1.0) 151 gnode.vignette_outer = (0.57, 0.57, 0.57) 152 gnode.vignette_inner = (0.9, 0.9, 0.9) 153 gnode.vr_camera_offset = (0, -0.8, -1.1) 154 gnode.vr_near_clip = 0.5 155 156 def is_point_near_edge(self, 157 point: ba.Vec3, 158 running: bool = False) -> bool: 159 box_position = self.defs.boxes['edge_box'][0:3] 160 box_scale = self.defs.boxes['edge_box'][6:9] 161 xpos = (point.x - box_position[0]) / box_scale[0] 162 zpos = (point.z - box_position[2]) / box_scale[2] 163 return xpos < -0.5 or xpos > 0.5 or zpos < -0.5 or zpos > 0.5
Stadium map for football games.
128 def __init__(self) -> None: 129 super().__init__() 130 shared = SharedObjects.get() 131 self.node = ba.newnode( 132 'terrain', 133 delegate=self, 134 attrs={ 135 'model': self.preloaddata['model'], 136 'collide_model': self.preloaddata['collide_model'], 137 'color_texture': self.preloaddata['tex'], 138 'materials': [shared.footing_material] 139 }) 140 ba.newnode('terrain', 141 attrs={ 142 'model': self.preloaddata['vr_fill_model'], 143 'lighting': False, 144 'vr_only': True, 145 'background': True, 146 'color_texture': self.preloaddata['tex'] 147 }) 148 gnode = ba.getactivity().globalsnode 149 gnode.tint = (1.3, 1.2, 1.0) 150 gnode.ambient_color = (1.3, 1.2, 1.0) 151 gnode.vignette_outer = (0.57, 0.57, 0.57) 152 gnode.vignette_inner = (0.9, 0.9, 0.9) 153 gnode.vr_camera_offset = (0, -0.8, -1.1) 154 gnode.vr_near_clip = 0.5
Instantiate a map.
109 @classmethod 110 def get_play_types(cls) -> list[str]: 111 """Return valid play types for this map.""" 112 return ['melee', 'football', 'team_flag', 'keep_away']
Return valid play types for this map.
Return the name of the preview texture for this map.
118 @classmethod 119 def on_preload(cls) -> Any: 120 data: dict[str, Any] = { 121 'model': ba.getmodel('footballStadium'), 122 'vr_fill_model': ba.getmodel('footballStadiumVRFill'), 123 'collide_model': ba.getcollidemodel('footballStadiumCollide'), 124 'tex': ba.gettexture('footballStadium') 125 } 126 return data
Called when the map is being preloaded.
It should return any media/data it requires to operate
156 def is_point_near_edge(self, 157 point: ba.Vec3, 158 running: bool = False) -> bool: 159 box_position = self.defs.boxes['edge_box'][0:3] 160 box_scale = self.defs.boxes['edge_box'][6:9] 161 xpos = (point.x - box_position[0]) / box_scale[0] 162 zpos = (point.z - box_position[2]) / box_scale[2] 163 return xpos < -0.5 or xpos > 0.5 or zpos < -0.5 or zpos > 0.5
Return whether the provided point is near an edge of the map.
Simple bot logic uses this call to determine if they are approaching a cliff or wall. If this returns True they will generally not walk/run any farther away from the origin. If 'running' is True, the buffer should be a bit larger.
Inherited Members
- ba._map.Map
- preload
- getname
- get_music_type
- get_def_bound_box
- get_def_point
- get_def_points
- get_start_position
- get_ffa_start_position
- get_flag_position
- exists
- handlemessage
- ba._actor.Actor
- autoretain
- on_expire
- expired
- is_alive
- activity
- getactivity
166class Bridgit(ba.Map): 167 """Map with a narrow bridge in the middle.""" 168 from bastd.mapdata import bridgit as defs 169 170 name = 'Bridgit' 171 dataname = 'bridgit' 172 173 @classmethod 174 def get_play_types(cls) -> list[str]: 175 """Return valid play types for this map.""" 176 # print('getting playtypes', cls._getdata()['play_types']) 177 return ['melee', 'team_flag', 'keep_away'] 178 179 @classmethod 180 def get_preview_texture_name(cls) -> str: 181 return 'bridgitPreview' 182 183 @classmethod 184 def on_preload(cls) -> Any: 185 data: dict[str, Any] = { 186 'model_top': ba.getmodel('bridgitLevelTop'), 187 'model_bottom': ba.getmodel('bridgitLevelBottom'), 188 'model_bg': ba.getmodel('natureBackground'), 189 'bg_vr_fill_model': ba.getmodel('natureBackgroundVRFill'), 190 'collide_model': ba.getcollidemodel('bridgitLevelCollide'), 191 'tex': ba.gettexture('bridgitLevelColor'), 192 'model_bg_tex': ba.gettexture('natureBackgroundColor'), 193 'collide_bg': ba.getcollidemodel('natureBackgroundCollide'), 194 'railing_collide_model': 195 (ba.getcollidemodel('bridgitLevelRailingCollide')), 196 'bg_material': ba.Material() 197 } 198 data['bg_material'].add_actions(actions=('modify_part_collision', 199 'friction', 10.0)) 200 return data 201 202 def __init__(self) -> None: 203 super().__init__() 204 shared = SharedObjects.get() 205 self.node = ba.newnode( 206 'terrain', 207 delegate=self, 208 attrs={ 209 'collide_model': self.preloaddata['collide_model'], 210 'model': self.preloaddata['model_top'], 211 'color_texture': self.preloaddata['tex'], 212 'materials': [shared.footing_material] 213 }) 214 self.bottom = ba.newnode('terrain', 215 attrs={ 216 'model': self.preloaddata['model_bottom'], 217 'lighting': False, 218 'color_texture': self.preloaddata['tex'] 219 }) 220 self.background = ba.newnode( 221 'terrain', 222 attrs={ 223 'model': self.preloaddata['model_bg'], 224 'lighting': False, 225 'background': True, 226 'color_texture': self.preloaddata['model_bg_tex'] 227 }) 228 ba.newnode('terrain', 229 attrs={ 230 'model': self.preloaddata['bg_vr_fill_model'], 231 'lighting': False, 232 'vr_only': True, 233 'background': True, 234 'color_texture': self.preloaddata['model_bg_tex'] 235 }) 236 self.railing = ba.newnode( 237 'terrain', 238 attrs={ 239 'collide_model': self.preloaddata['railing_collide_model'], 240 'materials': [shared.railing_material], 241 'bumper': True 242 }) 243 self.bg_collide = ba.newnode('terrain', 244 attrs={ 245 'collide_model': 246 self.preloaddata['collide_bg'], 247 'materials': [ 248 shared.footing_material, 249 self.preloaddata['bg_material'], 250 shared.death_material 251 ] 252 }) 253 gnode = ba.getactivity().globalsnode 254 gnode.tint = (1.1, 1.2, 1.3) 255 gnode.ambient_color = (1.1, 1.2, 1.3) 256 gnode.vignette_outer = (0.65, 0.6, 0.55) 257 gnode.vignette_inner = (0.9, 0.9, 0.93)
Map with a narrow bridge in the middle.
202 def __init__(self) -> None: 203 super().__init__() 204 shared = SharedObjects.get() 205 self.node = ba.newnode( 206 'terrain', 207 delegate=self, 208 attrs={ 209 'collide_model': self.preloaddata['collide_model'], 210 'model': self.preloaddata['model_top'], 211 'color_texture': self.preloaddata['tex'], 212 'materials': [shared.footing_material] 213 }) 214 self.bottom = ba.newnode('terrain', 215 attrs={ 216 'model': self.preloaddata['model_bottom'], 217 'lighting': False, 218 'color_texture': self.preloaddata['tex'] 219 }) 220 self.background = ba.newnode( 221 'terrain', 222 attrs={ 223 'model': self.preloaddata['model_bg'], 224 'lighting': False, 225 'background': True, 226 'color_texture': self.preloaddata['model_bg_tex'] 227 }) 228 ba.newnode('terrain', 229 attrs={ 230 'model': self.preloaddata['bg_vr_fill_model'], 231 'lighting': False, 232 'vr_only': True, 233 'background': True, 234 'color_texture': self.preloaddata['model_bg_tex'] 235 }) 236 self.railing = ba.newnode( 237 'terrain', 238 attrs={ 239 'collide_model': self.preloaddata['railing_collide_model'], 240 'materials': [shared.railing_material], 241 'bumper': True 242 }) 243 self.bg_collide = ba.newnode('terrain', 244 attrs={ 245 'collide_model': 246 self.preloaddata['collide_bg'], 247 'materials': [ 248 shared.footing_material, 249 self.preloaddata['bg_material'], 250 shared.death_material 251 ] 252 }) 253 gnode = ba.getactivity().globalsnode 254 gnode.tint = (1.1, 1.2, 1.3) 255 gnode.ambient_color = (1.1, 1.2, 1.3) 256 gnode.vignette_outer = (0.65, 0.6, 0.55) 257 gnode.vignette_inner = (0.9, 0.9, 0.93)
Instantiate a map.
173 @classmethod 174 def get_play_types(cls) -> list[str]: 175 """Return valid play types for this map.""" 176 # print('getting playtypes', cls._getdata()['play_types']) 177 return ['melee', 'team_flag', 'keep_away']
Return valid play types for this map.
Return the name of the preview texture for this map.
183 @classmethod 184 def on_preload(cls) -> Any: 185 data: dict[str, Any] = { 186 'model_top': ba.getmodel('bridgitLevelTop'), 187 'model_bottom': ba.getmodel('bridgitLevelBottom'), 188 'model_bg': ba.getmodel('natureBackground'), 189 'bg_vr_fill_model': ba.getmodel('natureBackgroundVRFill'), 190 'collide_model': ba.getcollidemodel('bridgitLevelCollide'), 191 'tex': ba.gettexture('bridgitLevelColor'), 192 'model_bg_tex': ba.gettexture('natureBackgroundColor'), 193 'collide_bg': ba.getcollidemodel('natureBackgroundCollide'), 194 'railing_collide_model': 195 (ba.getcollidemodel('bridgitLevelRailingCollide')), 196 'bg_material': ba.Material() 197 } 198 data['bg_material'].add_actions(actions=('modify_part_collision', 199 'friction', 10.0)) 200 return data
Called when the map is being preloaded.
It should return any media/data it requires to operate
Inherited Members
- ba._map.Map
- preload
- getname
- get_music_type
- is_point_near_edge
- get_def_bound_box
- get_def_point
- get_def_points
- get_start_position
- get_ffa_start_position
- get_flag_position
- exists
- handlemessage
- ba._actor.Actor
- autoretain
- on_expire
- expired
- is_alive
- activity
- getactivity
260class BigG(ba.Map): 261 """Large G shaped map for racing""" 262 263 from bastd.mapdata import big_g as defs 264 265 name = 'Big G' 266 267 @classmethod 268 def get_play_types(cls) -> list[str]: 269 """Return valid play types for this map.""" 270 return [ 271 'race', 'melee', 'keep_away', 'team_flag', 'king_of_the_hill', 272 'conquest' 273 ] 274 275 @classmethod 276 def get_preview_texture_name(cls) -> str: 277 return 'bigGPreview' 278 279 @classmethod 280 def on_preload(cls) -> Any: 281 data: dict[str, Any] = { 282 'model_top': ba.getmodel('bigG'), 283 'model_bottom': ba.getmodel('bigGBottom'), 284 'model_bg': ba.getmodel('natureBackground'), 285 'bg_vr_fill_model': ba.getmodel('natureBackgroundVRFill'), 286 'collide_model': ba.getcollidemodel('bigGCollide'), 287 'tex': ba.gettexture('bigG'), 288 'model_bg_tex': ba.gettexture('natureBackgroundColor'), 289 'collide_bg': ba.getcollidemodel('natureBackgroundCollide'), 290 'bumper_collide_model': ba.getcollidemodel('bigGBumper'), 291 'bg_material': ba.Material() 292 } 293 data['bg_material'].add_actions(actions=('modify_part_collision', 294 'friction', 10.0)) 295 return data 296 297 def __init__(self) -> None: 298 super().__init__() 299 shared = SharedObjects.get() 300 self.node = ba.newnode( 301 'terrain', 302 delegate=self, 303 attrs={ 304 'collide_model': self.preloaddata['collide_model'], 305 'color': (0.7, 0.7, 0.7), 306 'model': self.preloaddata['model_top'], 307 'color_texture': self.preloaddata['tex'], 308 'materials': [shared.footing_material] 309 }) 310 self.bottom = ba.newnode('terrain', 311 attrs={ 312 'model': self.preloaddata['model_bottom'], 313 'color': (0.7, 0.7, 0.7), 314 'lighting': False, 315 'color_texture': self.preloaddata['tex'] 316 }) 317 self.background = ba.newnode( 318 'terrain', 319 attrs={ 320 'model': self.preloaddata['model_bg'], 321 'lighting': False, 322 'background': True, 323 'color_texture': self.preloaddata['model_bg_tex'] 324 }) 325 ba.newnode('terrain', 326 attrs={ 327 'model': self.preloaddata['bg_vr_fill_model'], 328 'lighting': False, 329 'vr_only': True, 330 'background': True, 331 'color_texture': self.preloaddata['model_bg_tex'] 332 }) 333 self.railing = ba.newnode( 334 'terrain', 335 attrs={ 336 'collide_model': self.preloaddata['bumper_collide_model'], 337 'materials': [shared.railing_material], 338 'bumper': True 339 }) 340 self.bg_collide = ba.newnode('terrain', 341 attrs={ 342 'collide_model': 343 self.preloaddata['collide_bg'], 344 'materials': [ 345 shared.footing_material, 346 self.preloaddata['bg_material'], 347 shared.death_material 348 ] 349 }) 350 gnode = ba.getactivity().globalsnode 351 gnode.tint = (1.1, 1.2, 1.3) 352 gnode.ambient_color = (1.1, 1.2, 1.3) 353 gnode.vignette_outer = (0.65, 0.6, 0.55) 354 gnode.vignette_inner = (0.9, 0.9, 0.93)
Large G shaped map for racing
297 def __init__(self) -> None: 298 super().__init__() 299 shared = SharedObjects.get() 300 self.node = ba.newnode( 301 'terrain', 302 delegate=self, 303 attrs={ 304 'collide_model': self.preloaddata['collide_model'], 305 'color': (0.7, 0.7, 0.7), 306 'model': self.preloaddata['model_top'], 307 'color_texture': self.preloaddata['tex'], 308 'materials': [shared.footing_material] 309 }) 310 self.bottom = ba.newnode('terrain', 311 attrs={ 312 'model': self.preloaddata['model_bottom'], 313 'color': (0.7, 0.7, 0.7), 314 'lighting': False, 315 'color_texture': self.preloaddata['tex'] 316 }) 317 self.background = ba.newnode( 318 'terrain', 319 attrs={ 320 'model': self.preloaddata['model_bg'], 321 'lighting': False, 322 'background': True, 323 'color_texture': self.preloaddata['model_bg_tex'] 324 }) 325 ba.newnode('terrain', 326 attrs={ 327 'model': self.preloaddata['bg_vr_fill_model'], 328 'lighting': False, 329 'vr_only': True, 330 'background': True, 331 'color_texture': self.preloaddata['model_bg_tex'] 332 }) 333 self.railing = ba.newnode( 334 'terrain', 335 attrs={ 336 'collide_model': self.preloaddata['bumper_collide_model'], 337 'materials': [shared.railing_material], 338 'bumper': True 339 }) 340 self.bg_collide = ba.newnode('terrain', 341 attrs={ 342 'collide_model': 343 self.preloaddata['collide_bg'], 344 'materials': [ 345 shared.footing_material, 346 self.preloaddata['bg_material'], 347 shared.death_material 348 ] 349 }) 350 gnode = ba.getactivity().globalsnode 351 gnode.tint = (1.1, 1.2, 1.3) 352 gnode.ambient_color = (1.1, 1.2, 1.3) 353 gnode.vignette_outer = (0.65, 0.6, 0.55) 354 gnode.vignette_inner = (0.9, 0.9, 0.93)
Instantiate a map.
267 @classmethod 268 def get_play_types(cls) -> list[str]: 269 """Return valid play types for this map.""" 270 return [ 271 'race', 'melee', 'keep_away', 'team_flag', 'king_of_the_hill', 272 'conquest' 273 ]
Return valid play types for this map.
Return the name of the preview texture for this map.
279 @classmethod 280 def on_preload(cls) -> Any: 281 data: dict[str, Any] = { 282 'model_top': ba.getmodel('bigG'), 283 'model_bottom': ba.getmodel('bigGBottom'), 284 'model_bg': ba.getmodel('natureBackground'), 285 'bg_vr_fill_model': ba.getmodel('natureBackgroundVRFill'), 286 'collide_model': ba.getcollidemodel('bigGCollide'), 287 'tex': ba.gettexture('bigG'), 288 'model_bg_tex': ba.gettexture('natureBackgroundColor'), 289 'collide_bg': ba.getcollidemodel('natureBackgroundCollide'), 290 'bumper_collide_model': ba.getcollidemodel('bigGBumper'), 291 'bg_material': ba.Material() 292 } 293 data['bg_material'].add_actions(actions=('modify_part_collision', 294 'friction', 10.0)) 295 return data
Called when the map is being preloaded.
It should return any media/data it requires to operate
Inherited Members
- ba._map.Map
- preload
- getname
- get_music_type
- is_point_near_edge
- get_def_bound_box
- get_def_point
- get_def_points
- get_start_position
- get_ffa_start_position
- get_flag_position
- exists
- handlemessage
- ba._actor.Actor
- autoretain
- on_expire
- expired
- is_alive
- activity
- getactivity
357class Roundabout(ba.Map): 358 """CTF map featuring two platforms and a long way around between them""" 359 360 from bastd.mapdata import roundabout as defs 361 362 name = 'Roundabout' 363 364 @classmethod 365 def get_play_types(cls) -> list[str]: 366 """Return valid play types for this map.""" 367 return ['melee', 'keep_away', 'team_flag'] 368 369 @classmethod 370 def get_preview_texture_name(cls) -> str: 371 return 'roundaboutPreview' 372 373 @classmethod 374 def on_preload(cls) -> Any: 375 data: dict[str, Any] = { 376 'model': ba.getmodel('roundaboutLevel'), 377 'model_bottom': ba.getmodel('roundaboutLevelBottom'), 378 'model_bg': ba.getmodel('natureBackground'), 379 'bg_vr_fill_model': ba.getmodel('natureBackgroundVRFill'), 380 'collide_model': ba.getcollidemodel('roundaboutLevelCollide'), 381 'tex': ba.gettexture('roundaboutLevelColor'), 382 'model_bg_tex': ba.gettexture('natureBackgroundColor'), 383 'collide_bg': ba.getcollidemodel('natureBackgroundCollide'), 384 'railing_collide_model': 385 (ba.getcollidemodel('roundaboutLevelBumper')), 386 'bg_material': ba.Material() 387 } 388 data['bg_material'].add_actions(actions=('modify_part_collision', 389 'friction', 10.0)) 390 return data 391 392 def __init__(self) -> None: 393 super().__init__(vr_overlay_offset=(0, -1, 1)) 394 shared = SharedObjects.get() 395 self.node = ba.newnode( 396 'terrain', 397 delegate=self, 398 attrs={ 399 'collide_model': self.preloaddata['collide_model'], 400 'model': self.preloaddata['model'], 401 'color_texture': self.preloaddata['tex'], 402 'materials': [shared.footing_material] 403 }) 404 self.bottom = ba.newnode('terrain', 405 attrs={ 406 'model': self.preloaddata['model_bottom'], 407 'lighting': False, 408 'color_texture': self.preloaddata['tex'] 409 }) 410 self.background = ba.newnode( 411 'terrain', 412 attrs={ 413 'model': self.preloaddata['model_bg'], 414 'lighting': False, 415 'background': True, 416 'color_texture': self.preloaddata['model_bg_tex'] 417 }) 418 ba.newnode('terrain', 419 attrs={ 420 'model': self.preloaddata['bg_vr_fill_model'], 421 'lighting': False, 422 'vr_only': True, 423 'background': True, 424 'color_texture': self.preloaddata['model_bg_tex'] 425 }) 426 self.bg_collide = ba.newnode('terrain', 427 attrs={ 428 'collide_model': 429 self.preloaddata['collide_bg'], 430 'materials': [ 431 shared.footing_material, 432 self.preloaddata['bg_material'], 433 shared.death_material 434 ] 435 }) 436 self.railing = ba.newnode( 437 'terrain', 438 attrs={ 439 'collide_model': self.preloaddata['railing_collide_model'], 440 'materials': [shared.railing_material], 441 'bumper': True 442 }) 443 gnode = ba.getactivity().globalsnode 444 gnode.tint = (1.0, 1.05, 1.1) 445 gnode.ambient_color = (1.0, 1.05, 1.1) 446 gnode.shadow_ortho = True 447 gnode.vignette_outer = (0.63, 0.65, 0.7) 448 gnode.vignette_inner = (0.97, 0.95, 0.93)
CTF map featuring two platforms and a long way around between them
392 def __init__(self) -> None: 393 super().__init__(vr_overlay_offset=(0, -1, 1)) 394 shared = SharedObjects.get() 395 self.node = ba.newnode( 396 'terrain', 397 delegate=self, 398 attrs={ 399 'collide_model': self.preloaddata['collide_model'], 400 'model': self.preloaddata['model'], 401 'color_texture': self.preloaddata['tex'], 402 'materials': [shared.footing_material] 403 }) 404 self.bottom = ba.newnode('terrain', 405 attrs={ 406 'model': self.preloaddata['model_bottom'], 407 'lighting': False, 408 'color_texture': self.preloaddata['tex'] 409 }) 410 self.background = ba.newnode( 411 'terrain', 412 attrs={ 413 'model': self.preloaddata['model_bg'], 414 'lighting': False, 415 'background': True, 416 'color_texture': self.preloaddata['model_bg_tex'] 417 }) 418 ba.newnode('terrain', 419 attrs={ 420 'model': self.preloaddata['bg_vr_fill_model'], 421 'lighting': False, 422 'vr_only': True, 423 'background': True, 424 'color_texture': self.preloaddata['model_bg_tex'] 425 }) 426 self.bg_collide = ba.newnode('terrain', 427 attrs={ 428 'collide_model': 429 self.preloaddata['collide_bg'], 430 'materials': [ 431 shared.footing_material, 432 self.preloaddata['bg_material'], 433 shared.death_material 434 ] 435 }) 436 self.railing = ba.newnode( 437 'terrain', 438 attrs={ 439 'collide_model': self.preloaddata['railing_collide_model'], 440 'materials': [shared.railing_material], 441 'bumper': True 442 }) 443 gnode = ba.getactivity().globalsnode 444 gnode.tint = (1.0, 1.05, 1.1) 445 gnode.ambient_color = (1.0, 1.05, 1.1) 446 gnode.shadow_ortho = True 447 gnode.vignette_outer = (0.63, 0.65, 0.7) 448 gnode.vignette_inner = (0.97, 0.95, 0.93)
Instantiate a map.
364 @classmethod 365 def get_play_types(cls) -> list[str]: 366 """Return valid play types for this map.""" 367 return ['melee', 'keep_away', 'team_flag']
Return valid play types for this map.
Return the name of the preview texture for this map.
373 @classmethod 374 def on_preload(cls) -> Any: 375 data: dict[str, Any] = { 376 'model': ba.getmodel('roundaboutLevel'), 377 'model_bottom': ba.getmodel('roundaboutLevelBottom'), 378 'model_bg': ba.getmodel('natureBackground'), 379 'bg_vr_fill_model': ba.getmodel('natureBackgroundVRFill'), 380 'collide_model': ba.getcollidemodel('roundaboutLevelCollide'), 381 'tex': ba.gettexture('roundaboutLevelColor'), 382 'model_bg_tex': ba.gettexture('natureBackgroundColor'), 383 'collide_bg': ba.getcollidemodel('natureBackgroundCollide'), 384 'railing_collide_model': 385 (ba.getcollidemodel('roundaboutLevelBumper')), 386 'bg_material': ba.Material() 387 } 388 data['bg_material'].add_actions(actions=('modify_part_collision', 389 'friction', 10.0)) 390 return data
Called when the map is being preloaded.
It should return any media/data it requires to operate
Inherited Members
- ba._map.Map
- preload
- getname
- get_music_type
- is_point_near_edge
- get_def_bound_box
- get_def_point
- get_def_points
- get_start_position
- get_ffa_start_position
- get_flag_position
- exists
- handlemessage
- ba._actor.Actor
- autoretain
- on_expire
- expired
- is_alive
- activity
- getactivity
451class MonkeyFace(ba.Map): 452 """Map sorta shaped like a monkey face; teehee!""" 453 454 from bastd.mapdata import monkey_face as defs 455 456 name = 'Monkey Face' 457 458 @classmethod 459 def get_play_types(cls) -> list[str]: 460 """Return valid play types for this map.""" 461 return ['melee', 'keep_away', 'team_flag'] 462 463 @classmethod 464 def get_preview_texture_name(cls) -> str: 465 return 'monkeyFacePreview' 466 467 @classmethod 468 def on_preload(cls) -> Any: 469 data: dict[str, Any] = { 470 'model': ba.getmodel('monkeyFaceLevel'), 471 'bottom_model': ba.getmodel('monkeyFaceLevelBottom'), 472 'model_bg': ba.getmodel('natureBackground'), 473 'bg_vr_fill_model': ba.getmodel('natureBackgroundVRFill'), 474 'collide_model': ba.getcollidemodel('monkeyFaceLevelCollide'), 475 'tex': ba.gettexture('monkeyFaceLevelColor'), 476 'model_bg_tex': ba.gettexture('natureBackgroundColor'), 477 'collide_bg': ba.getcollidemodel('natureBackgroundCollide'), 478 'railing_collide_model': 479 (ba.getcollidemodel('monkeyFaceLevelBumper')), 480 'bg_material': ba.Material() 481 } 482 data['bg_material'].add_actions(actions=('modify_part_collision', 483 'friction', 10.0)) 484 return data 485 486 def __init__(self) -> None: 487 super().__init__() 488 shared = SharedObjects.get() 489 self.node = ba.newnode( 490 'terrain', 491 delegate=self, 492 attrs={ 493 'collide_model': self.preloaddata['collide_model'], 494 'model': self.preloaddata['model'], 495 'color_texture': self.preloaddata['tex'], 496 'materials': [shared.footing_material] 497 }) 498 self.bottom = ba.newnode('terrain', 499 attrs={ 500 'model': self.preloaddata['bottom_model'], 501 'lighting': False, 502 'color_texture': self.preloaddata['tex'] 503 }) 504 self.background = ba.newnode( 505 'terrain', 506 attrs={ 507 'model': self.preloaddata['model_bg'], 508 'lighting': False, 509 'background': True, 510 'color_texture': self.preloaddata['model_bg_tex'] 511 }) 512 ba.newnode('terrain', 513 attrs={ 514 'model': self.preloaddata['bg_vr_fill_model'], 515 'lighting': False, 516 'vr_only': True, 517 'background': True, 518 'color_texture': self.preloaddata['model_bg_tex'] 519 }) 520 self.bg_collide = ba.newnode('terrain', 521 attrs={ 522 'collide_model': 523 self.preloaddata['collide_bg'], 524 'materials': [ 525 shared.footing_material, 526 self.preloaddata['bg_material'], 527 shared.death_material 528 ] 529 }) 530 self.railing = ba.newnode( 531 'terrain', 532 attrs={ 533 'collide_model': self.preloaddata['railing_collide_model'], 534 'materials': [shared.railing_material], 535 'bumper': True 536 }) 537 gnode = ba.getactivity().globalsnode 538 gnode.tint = (1.1, 1.2, 1.2) 539 gnode.ambient_color = (1.2, 1.3, 1.3) 540 gnode.vignette_outer = (0.60, 0.62, 0.66) 541 gnode.vignette_inner = (0.97, 0.95, 0.93) 542 gnode.vr_camera_offset = (-1.4, 0, 0)
Map sorta shaped like a monkey face; teehee!
486 def __init__(self) -> None: 487 super().__init__() 488 shared = SharedObjects.get() 489 self.node = ba.newnode( 490 'terrain', 491 delegate=self, 492 attrs={ 493 'collide_model': self.preloaddata['collide_model'], 494 'model': self.preloaddata['model'], 495 'color_texture': self.preloaddata['tex'], 496 'materials': [shared.footing_material] 497 }) 498 self.bottom = ba.newnode('terrain', 499 attrs={ 500 'model': self.preloaddata['bottom_model'], 501 'lighting': False, 502 'color_texture': self.preloaddata['tex'] 503 }) 504 self.background = ba.newnode( 505 'terrain', 506 attrs={ 507 'model': self.preloaddata['model_bg'], 508 'lighting': False, 509 'background': True, 510 'color_texture': self.preloaddata['model_bg_tex'] 511 }) 512 ba.newnode('terrain', 513 attrs={ 514 'model': self.preloaddata['bg_vr_fill_model'], 515 'lighting': False, 516 'vr_only': True, 517 'background': True, 518 'color_texture': self.preloaddata['model_bg_tex'] 519 }) 520 self.bg_collide = ba.newnode('terrain', 521 attrs={ 522 'collide_model': 523 self.preloaddata['collide_bg'], 524 'materials': [ 525 shared.footing_material, 526 self.preloaddata['bg_material'], 527 shared.death_material 528 ] 529 }) 530 self.railing = ba.newnode( 531 'terrain', 532 attrs={ 533 'collide_model': self.preloaddata['railing_collide_model'], 534 'materials': [shared.railing_material], 535 'bumper': True 536 }) 537 gnode = ba.getactivity().globalsnode 538 gnode.tint = (1.1, 1.2, 1.2) 539 gnode.ambient_color = (1.2, 1.3, 1.3) 540 gnode.vignette_outer = (0.60, 0.62, 0.66) 541 gnode.vignette_inner = (0.97, 0.95, 0.93) 542 gnode.vr_camera_offset = (-1.4, 0, 0)
Instantiate a map.
458 @classmethod 459 def get_play_types(cls) -> list[str]: 460 """Return valid play types for this map.""" 461 return ['melee', 'keep_away', 'team_flag']
Return valid play types for this map.
Return the name of the preview texture for this map.
467 @classmethod 468 def on_preload(cls) -> Any: 469 data: dict[str, Any] = { 470 'model': ba.getmodel('monkeyFaceLevel'), 471 'bottom_model': ba.getmodel('monkeyFaceLevelBottom'), 472 'model_bg': ba.getmodel('natureBackground'), 473 'bg_vr_fill_model': ba.getmodel('natureBackgroundVRFill'), 474 'collide_model': ba.getcollidemodel('monkeyFaceLevelCollide'), 475 'tex': ba.gettexture('monkeyFaceLevelColor'), 476 'model_bg_tex': ba.gettexture('natureBackgroundColor'), 477 'collide_bg': ba.getcollidemodel('natureBackgroundCollide'), 478 'railing_collide_model': 479 (ba.getcollidemodel('monkeyFaceLevelBumper')), 480 'bg_material': ba.Material() 481 } 482 data['bg_material'].add_actions(actions=('modify_part_collision', 483 'friction', 10.0)) 484 return data
Called when the map is being preloaded.
It should return any media/data it requires to operate
Inherited Members
- ba._map.Map
- preload
- getname
- get_music_type
- is_point_near_edge
- get_def_bound_box
- get_def_point
- get_def_points
- get_start_position
- get_ffa_start_position
- get_flag_position
- exists
- handlemessage
- ba._actor.Actor
- autoretain
- on_expire
- expired
- is_alive
- activity
- getactivity
545class ZigZag(ba.Map): 546 """A very long zig-zaggy map""" 547 548 from bastd.mapdata import zig_zag as defs 549 550 name = 'Zigzag' 551 552 @classmethod 553 def get_play_types(cls) -> list[str]: 554 """Return valid play types for this map.""" 555 return [ 556 'melee', 'keep_away', 'team_flag', 'conquest', 'king_of_the_hill' 557 ] 558 559 @classmethod 560 def get_preview_texture_name(cls) -> str: 561 return 'zigzagPreview' 562 563 @classmethod 564 def on_preload(cls) -> Any: 565 data: dict[str, Any] = { 566 'model': ba.getmodel('zigZagLevel'), 567 'model_bottom': ba.getmodel('zigZagLevelBottom'), 568 'model_bg': ba.getmodel('natureBackground'), 569 'bg_vr_fill_model': ba.getmodel('natureBackgroundVRFill'), 570 'collide_model': ba.getcollidemodel('zigZagLevelCollide'), 571 'tex': ba.gettexture('zigZagLevelColor'), 572 'model_bg_tex': ba.gettexture('natureBackgroundColor'), 573 'collide_bg': ba.getcollidemodel('natureBackgroundCollide'), 574 'railing_collide_model': ba.getcollidemodel('zigZagLevelBumper'), 575 'bg_material': ba.Material() 576 } 577 data['bg_material'].add_actions(actions=('modify_part_collision', 578 'friction', 10.0)) 579 return data 580 581 def __init__(self) -> None: 582 super().__init__() 583 shared = SharedObjects.get() 584 self.node = ba.newnode( 585 'terrain', 586 delegate=self, 587 attrs={ 588 'collide_model': self.preloaddata['collide_model'], 589 'model': self.preloaddata['model'], 590 'color_texture': self.preloaddata['tex'], 591 'materials': [shared.footing_material] 592 }) 593 self.background = ba.newnode( 594 'terrain', 595 attrs={ 596 'model': self.preloaddata['model_bg'], 597 'lighting': False, 598 'color_texture': self.preloaddata['model_bg_tex'] 599 }) 600 self.bottom = ba.newnode('terrain', 601 attrs={ 602 'model': self.preloaddata['model_bottom'], 603 'lighting': False, 604 'color_texture': self.preloaddata['tex'] 605 }) 606 ba.newnode('terrain', 607 attrs={ 608 'model': self.preloaddata['bg_vr_fill_model'], 609 'lighting': False, 610 'vr_only': True, 611 'background': True, 612 'color_texture': self.preloaddata['model_bg_tex'] 613 }) 614 self.bg_collide = ba.newnode('terrain', 615 attrs={ 616 'collide_model': 617 self.preloaddata['collide_bg'], 618 'materials': [ 619 shared.footing_material, 620 self.preloaddata['bg_material'], 621 shared.death_material 622 ] 623 }) 624 self.railing = ba.newnode( 625 'terrain', 626 attrs={ 627 'collide_model': self.preloaddata['railing_collide_model'], 628 'materials': [shared.railing_material], 629 'bumper': True 630 }) 631 gnode = ba.getactivity().globalsnode 632 gnode.tint = (1.0, 1.15, 1.15) 633 gnode.ambient_color = (1.0, 1.15, 1.15) 634 gnode.vignette_outer = (0.57, 0.59, 0.63) 635 gnode.vignette_inner = (0.97, 0.95, 0.93) 636 gnode.vr_camera_offset = (-1.5, 0, 0)
A very long zig-zaggy map
581 def __init__(self) -> None: 582 super().__init__() 583 shared = SharedObjects.get() 584 self.node = ba.newnode( 585 'terrain', 586 delegate=self, 587 attrs={ 588 'collide_model': self.preloaddata['collide_model'], 589 'model': self.preloaddata['model'], 590 'color_texture': self.preloaddata['tex'], 591 'materials': [shared.footing_material] 592 }) 593 self.background = ba.newnode( 594 'terrain', 595 attrs={ 596 'model': self.preloaddata['model_bg'], 597 'lighting': False, 598 'color_texture': self.preloaddata['model_bg_tex'] 599 }) 600 self.bottom = ba.newnode('terrain', 601 attrs={ 602 'model': self.preloaddata['model_bottom'], 603 'lighting': False, 604 'color_texture': self.preloaddata['tex'] 605 }) 606 ba.newnode('terrain', 607 attrs={ 608 'model': self.preloaddata['bg_vr_fill_model'], 609 'lighting': False, 610 'vr_only': True, 611 'background': True, 612 'color_texture': self.preloaddata['model_bg_tex'] 613 }) 614 self.bg_collide = ba.newnode('terrain', 615 attrs={ 616 'collide_model': 617 self.preloaddata['collide_bg'], 618 'materials': [ 619 shared.footing_material, 620 self.preloaddata['bg_material'], 621 shared.death_material 622 ] 623 }) 624 self.railing = ba.newnode( 625 'terrain', 626 attrs={ 627 'collide_model': self.preloaddata['railing_collide_model'], 628 'materials': [shared.railing_material], 629 'bumper': True 630 }) 631 gnode = ba.getactivity().globalsnode 632 gnode.tint = (1.0, 1.15, 1.15) 633 gnode.ambient_color = (1.0, 1.15, 1.15) 634 gnode.vignette_outer = (0.57, 0.59, 0.63) 635 gnode.vignette_inner = (0.97, 0.95, 0.93) 636 gnode.vr_camera_offset = (-1.5, 0, 0)
Instantiate a map.
552 @classmethod 553 def get_play_types(cls) -> list[str]: 554 """Return valid play types for this map.""" 555 return [ 556 'melee', 'keep_away', 'team_flag', 'conquest', 'king_of_the_hill' 557 ]
Return valid play types for this map.
Return the name of the preview texture for this map.
563 @classmethod 564 def on_preload(cls) -> Any: 565 data: dict[str, Any] = { 566 'model': ba.getmodel('zigZagLevel'), 567 'model_bottom': ba.getmodel('zigZagLevelBottom'), 568 'model_bg': ba.getmodel('natureBackground'), 569 'bg_vr_fill_model': ba.getmodel('natureBackgroundVRFill'), 570 'collide_model': ba.getcollidemodel('zigZagLevelCollide'), 571 'tex': ba.gettexture('zigZagLevelColor'), 572 'model_bg_tex': ba.gettexture('natureBackgroundColor'), 573 'collide_bg': ba.getcollidemodel('natureBackgroundCollide'), 574 'railing_collide_model': ba.getcollidemodel('zigZagLevelBumper'), 575 'bg_material': ba.Material() 576 } 577 data['bg_material'].add_actions(actions=('modify_part_collision', 578 'friction', 10.0)) 579 return data
Called when the map is being preloaded.
It should return any media/data it requires to operate
Inherited Members
- ba._map.Map
- preload
- getname
- get_music_type
- is_point_near_edge
- get_def_bound_box
- get_def_point
- get_def_points
- get_start_position
- get_ffa_start_position
- get_flag_position
- exists
- handlemessage
- ba._actor.Actor
- autoretain
- on_expire
- expired
- is_alive
- activity
- getactivity
639class ThePad(ba.Map): 640 """A simple square shaped map with a raised edge.""" 641 642 from bastd.mapdata import the_pad as defs 643 644 name = 'The Pad' 645 646 @classmethod 647 def get_play_types(cls) -> list[str]: 648 """Return valid play types for this map.""" 649 return ['melee', 'keep_away', 'team_flag', 'king_of_the_hill'] 650 651 @classmethod 652 def get_preview_texture_name(cls) -> str: 653 return 'thePadPreview' 654 655 @classmethod 656 def on_preload(cls) -> Any: 657 data: dict[str, Any] = { 658 'model': ba.getmodel('thePadLevel'), 659 'bottom_model': ba.getmodel('thePadLevelBottom'), 660 'collide_model': ba.getcollidemodel('thePadLevelCollide'), 661 'tex': ba.gettexture('thePadLevelColor'), 662 'bgtex': ba.gettexture('menuBG'), 663 'bgmodel': ba.getmodel('thePadBG'), 664 'railing_collide_model': ba.getcollidemodel('thePadLevelBumper'), 665 'vr_fill_mound_model': ba.getmodel('thePadVRFillMound'), 666 'vr_fill_mound_tex': ba.gettexture('vrFillMound') 667 } 668 # fixme should chop this into vr/non-vr sections for efficiency 669 return data 670 671 def __init__(self) -> None: 672 super().__init__() 673 shared = SharedObjects.get() 674 self.node = ba.newnode( 675 'terrain', 676 delegate=self, 677 attrs={ 678 'collide_model': self.preloaddata['collide_model'], 679 'model': self.preloaddata['model'], 680 'color_texture': self.preloaddata['tex'], 681 'materials': [shared.footing_material] 682 }) 683 self.bottom = ba.newnode('terrain', 684 attrs={ 685 'model': self.preloaddata['bottom_model'], 686 'lighting': False, 687 'color_texture': self.preloaddata['tex'] 688 }) 689 self.background = ba.newnode( 690 'terrain', 691 attrs={ 692 'model': self.preloaddata['bgmodel'], 693 'lighting': False, 694 'background': True, 695 'color_texture': self.preloaddata['bgtex'] 696 }) 697 self.railing = ba.newnode( 698 'terrain', 699 attrs={ 700 'collide_model': self.preloaddata['railing_collide_model'], 701 'materials': [shared.railing_material], 702 'bumper': True 703 }) 704 ba.newnode('terrain', 705 attrs={ 706 'model': self.preloaddata['vr_fill_mound_model'], 707 'lighting': False, 708 'vr_only': True, 709 'color': (0.56, 0.55, 0.47), 710 'background': True, 711 'color_texture': self.preloaddata['vr_fill_mound_tex'] 712 }) 713 gnode = ba.getactivity().globalsnode 714 gnode.tint = (1.1, 1.1, 1.0) 715 gnode.ambient_color = (1.1, 1.1, 1.0) 716 gnode.vignette_outer = (0.7, 0.65, 0.75) 717 gnode.vignette_inner = (0.95, 0.95, 0.93)
A simple square shaped map with a raised edge.
671 def __init__(self) -> None: 672 super().__init__() 673 shared = SharedObjects.get() 674 self.node = ba.newnode( 675 'terrain', 676 delegate=self, 677 attrs={ 678 'collide_model': self.preloaddata['collide_model'], 679 'model': self.preloaddata['model'], 680 'color_texture': self.preloaddata['tex'], 681 'materials': [shared.footing_material] 682 }) 683 self.bottom = ba.newnode('terrain', 684 attrs={ 685 'model': self.preloaddata['bottom_model'], 686 'lighting': False, 687 'color_texture': self.preloaddata['tex'] 688 }) 689 self.background = ba.newnode( 690 'terrain', 691 attrs={ 692 'model': self.preloaddata['bgmodel'], 693 'lighting': False, 694 'background': True, 695 'color_texture': self.preloaddata['bgtex'] 696 }) 697 self.railing = ba.newnode( 698 'terrain', 699 attrs={ 700 'collide_model': self.preloaddata['railing_collide_model'], 701 'materials': [shared.railing_material], 702 'bumper': True 703 }) 704 ba.newnode('terrain', 705 attrs={ 706 'model': self.preloaddata['vr_fill_mound_model'], 707 'lighting': False, 708 'vr_only': True, 709 'color': (0.56, 0.55, 0.47), 710 'background': True, 711 'color_texture': self.preloaddata['vr_fill_mound_tex'] 712 }) 713 gnode = ba.getactivity().globalsnode 714 gnode.tint = (1.1, 1.1, 1.0) 715 gnode.ambient_color = (1.1, 1.1, 1.0) 716 gnode.vignette_outer = (0.7, 0.65, 0.75) 717 gnode.vignette_inner = (0.95, 0.95, 0.93)
Instantiate a map.
646 @classmethod 647 def get_play_types(cls) -> list[str]: 648 """Return valid play types for this map.""" 649 return ['melee', 'keep_away', 'team_flag', 'king_of_the_hill']
Return valid play types for this map.
Return the name of the preview texture for this map.
655 @classmethod 656 def on_preload(cls) -> Any: 657 data: dict[str, Any] = { 658 'model': ba.getmodel('thePadLevel'), 659 'bottom_model': ba.getmodel('thePadLevelBottom'), 660 'collide_model': ba.getcollidemodel('thePadLevelCollide'), 661 'tex': ba.gettexture('thePadLevelColor'), 662 'bgtex': ba.gettexture('menuBG'), 663 'bgmodel': ba.getmodel('thePadBG'), 664 'railing_collide_model': ba.getcollidemodel('thePadLevelBumper'), 665 'vr_fill_mound_model': ba.getmodel('thePadVRFillMound'), 666 'vr_fill_mound_tex': ba.gettexture('vrFillMound') 667 } 668 # fixme should chop this into vr/non-vr sections for efficiency 669 return data
Called when the map is being preloaded.
It should return any media/data it requires to operate
Inherited Members
- ba._map.Map
- preload
- getname
- get_music_type
- is_point_near_edge
- get_def_bound_box
- get_def_point
- get_def_points
- get_start_position
- get_ffa_start_position
- get_flag_position
- exists
- handlemessage
- ba._actor.Actor
- autoretain
- on_expire
- expired
- is_alive
- activity
- getactivity
720class DoomShroom(ba.Map): 721 """A giant mushroom. Of doom!""" 722 723 from bastd.mapdata import doom_shroom as defs 724 725 name = 'Doom Shroom' 726 727 @classmethod 728 def get_play_types(cls) -> list[str]: 729 """Return valid play types for this map.""" 730 return ['melee', 'keep_away', 'team_flag'] 731 732 @classmethod 733 def get_preview_texture_name(cls) -> str: 734 return 'doomShroomPreview' 735 736 @classmethod 737 def on_preload(cls) -> Any: 738 data: dict[str, Any] = { 739 'model': ba.getmodel('doomShroomLevel'), 740 'collide_model': ba.getcollidemodel('doomShroomLevelCollide'), 741 'tex': ba.gettexture('doomShroomLevelColor'), 742 'bgtex': ba.gettexture('doomShroomBGColor'), 743 'bgmodel': ba.getmodel('doomShroomBG'), 744 'vr_fill_model': ba.getmodel('doomShroomVRFill'), 745 'stem_model': ba.getmodel('doomShroomStem'), 746 'collide_bg': ba.getcollidemodel('doomShroomStemCollide') 747 } 748 return data 749 750 def __init__(self) -> None: 751 super().__init__() 752 shared = SharedObjects.get() 753 self.node = ba.newnode( 754 'terrain', 755 delegate=self, 756 attrs={ 757 'collide_model': self.preloaddata['collide_model'], 758 'model': self.preloaddata['model'], 759 'color_texture': self.preloaddata['tex'], 760 'materials': [shared.footing_material] 761 }) 762 self.background = ba.newnode( 763 'terrain', 764 attrs={ 765 'model': self.preloaddata['bgmodel'], 766 'lighting': False, 767 'background': True, 768 'color_texture': self.preloaddata['bgtex'] 769 }) 770 ba.newnode('terrain', 771 attrs={ 772 'model': self.preloaddata['vr_fill_model'], 773 'lighting': False, 774 'vr_only': True, 775 'background': True, 776 'color_texture': self.preloaddata['bgtex'] 777 }) 778 self.stem = ba.newnode('terrain', 779 attrs={ 780 'model': self.preloaddata['stem_model'], 781 'lighting': False, 782 'color_texture': self.preloaddata['tex'] 783 }) 784 self.bg_collide = ba.newnode( 785 'terrain', 786 attrs={ 787 'collide_model': self.preloaddata['collide_bg'], 788 'materials': [shared.footing_material, shared.death_material] 789 }) 790 gnode = ba.getactivity().globalsnode 791 gnode.tint = (0.82, 1.10, 1.15) 792 gnode.ambient_color = (0.9, 1.3, 1.1) 793 gnode.shadow_ortho = False 794 gnode.vignette_outer = (0.76, 0.76, 0.76) 795 gnode.vignette_inner = (0.95, 0.95, 0.99) 796 797 def is_point_near_edge(self, 798 point: ba.Vec3, 799 running: bool = False) -> bool: 800 xpos = point.x 801 zpos = point.z 802 x_adj = xpos * 0.125 803 z_adj = (zpos + 3.7) * 0.2 804 if running: 805 x_adj *= 1.4 806 z_adj *= 1.4 807 return x_adj * x_adj + z_adj * z_adj > 1.0
A giant mushroom. Of doom!
750 def __init__(self) -> None: 751 super().__init__() 752 shared = SharedObjects.get() 753 self.node = ba.newnode( 754 'terrain', 755 delegate=self, 756 attrs={ 757 'collide_model': self.preloaddata['collide_model'], 758 'model': self.preloaddata['model'], 759 'color_texture': self.preloaddata['tex'], 760 'materials': [shared.footing_material] 761 }) 762 self.background = ba.newnode( 763 'terrain', 764 attrs={ 765 'model': self.preloaddata['bgmodel'], 766 'lighting': False, 767 'background': True, 768 'color_texture': self.preloaddata['bgtex'] 769 }) 770 ba.newnode('terrain', 771 attrs={ 772 'model': self.preloaddata['vr_fill_model'], 773 'lighting': False, 774 'vr_only': True, 775 'background': True, 776 'color_texture': self.preloaddata['bgtex'] 777 }) 778 self.stem = ba.newnode('terrain', 779 attrs={ 780 'model': self.preloaddata['stem_model'], 781 'lighting': False, 782 'color_texture': self.preloaddata['tex'] 783 }) 784 self.bg_collide = ba.newnode( 785 'terrain', 786 attrs={ 787 'collide_model': self.preloaddata['collide_bg'], 788 'materials': [shared.footing_material, shared.death_material] 789 }) 790 gnode = ba.getactivity().globalsnode 791 gnode.tint = (0.82, 1.10, 1.15) 792 gnode.ambient_color = (0.9, 1.3, 1.1) 793 gnode.shadow_ortho = False 794 gnode.vignette_outer = (0.76, 0.76, 0.76) 795 gnode.vignette_inner = (0.95, 0.95, 0.99)
Instantiate a map.
727 @classmethod 728 def get_play_types(cls) -> list[str]: 729 """Return valid play types for this map.""" 730 return ['melee', 'keep_away', 'team_flag']
Return valid play types for this map.
Return the name of the preview texture for this map.
736 @classmethod 737 def on_preload(cls) -> Any: 738 data: dict[str, Any] = { 739 'model': ba.getmodel('doomShroomLevel'), 740 'collide_model': ba.getcollidemodel('doomShroomLevelCollide'), 741 'tex': ba.gettexture('doomShroomLevelColor'), 742 'bgtex': ba.gettexture('doomShroomBGColor'), 743 'bgmodel': ba.getmodel('doomShroomBG'), 744 'vr_fill_model': ba.getmodel('doomShroomVRFill'), 745 'stem_model': ba.getmodel('doomShroomStem'), 746 'collide_bg': ba.getcollidemodel('doomShroomStemCollide') 747 } 748 return data
Called when the map is being preloaded.
It should return any media/data it requires to operate
797 def is_point_near_edge(self, 798 point: ba.Vec3, 799 running: bool = False) -> bool: 800 xpos = point.x 801 zpos = point.z 802 x_adj = xpos * 0.125 803 z_adj = (zpos + 3.7) * 0.2 804 if running: 805 x_adj *= 1.4 806 z_adj *= 1.4 807 return x_adj * x_adj + z_adj * z_adj > 1.0
Return whether the provided point is near an edge of the map.
Simple bot logic uses this call to determine if they are approaching a cliff or wall. If this returns True they will generally not walk/run any farther away from the origin. If 'running' is True, the buffer should be a bit larger.
Inherited Members
- ba._map.Map
- preload
- getname
- get_music_type
- get_def_bound_box
- get_def_point
- get_def_points
- get_start_position
- get_ffa_start_position
- get_flag_position
- exists
- handlemessage
- ba._actor.Actor
- autoretain
- on_expire
- expired
- is_alive
- activity
- getactivity
810class LakeFrigid(ba.Map): 811 """An icy lake fit for racing.""" 812 813 from bastd.mapdata import lake_frigid as defs 814 815 name = 'Lake Frigid' 816 817 @classmethod 818 def get_play_types(cls) -> list[str]: 819 """Return valid play types for this map.""" 820 return ['melee', 'keep_away', 'team_flag', 'race'] 821 822 @classmethod 823 def get_preview_texture_name(cls) -> str: 824 return 'lakeFrigidPreview' 825 826 @classmethod 827 def on_preload(cls) -> Any: 828 data: dict[str, Any] = { 829 'model': ba.getmodel('lakeFrigid'), 830 'model_top': ba.getmodel('lakeFrigidTop'), 831 'model_reflections': ba.getmodel('lakeFrigidReflections'), 832 'collide_model': ba.getcollidemodel('lakeFrigidCollide'), 833 'tex': ba.gettexture('lakeFrigid'), 834 'tex_reflections': ba.gettexture('lakeFrigidReflections'), 835 'vr_fill_model': ba.getmodel('lakeFrigidVRFill') 836 } 837 mat = ba.Material() 838 mat.add_actions(actions=('modify_part_collision', 'friction', 0.01)) 839 data['ice_material'] = mat 840 return data 841 842 def __init__(self) -> None: 843 super().__init__() 844 shared = SharedObjects.get() 845 self.node = ba.newnode('terrain', 846 delegate=self, 847 attrs={ 848 'collide_model': 849 self.preloaddata['collide_model'], 850 'model': 851 self.preloaddata['model'], 852 'color_texture': 853 self.preloaddata['tex'], 854 'materials': [ 855 shared.footing_material, 856 self.preloaddata['ice_material'] 857 ] 858 }) 859 ba.newnode('terrain', 860 attrs={ 861 'model': self.preloaddata['model_top'], 862 'lighting': False, 863 'color_texture': self.preloaddata['tex'] 864 }) 865 ba.newnode('terrain', 866 attrs={ 867 'model': self.preloaddata['model_reflections'], 868 'lighting': False, 869 'overlay': True, 870 'opacity': 0.15, 871 'color_texture': self.preloaddata['tex_reflections'] 872 }) 873 ba.newnode('terrain', 874 attrs={ 875 'model': self.preloaddata['vr_fill_model'], 876 'lighting': False, 877 'vr_only': True, 878 'background': True, 879 'color_texture': self.preloaddata['tex'] 880 }) 881 gnode = ba.getactivity().globalsnode 882 gnode.tint = (1, 1, 1) 883 gnode.ambient_color = (1, 1, 1) 884 gnode.shadow_ortho = True 885 gnode.vignette_outer = (0.86, 0.86, 0.86) 886 gnode.vignette_inner = (0.95, 0.95, 0.99) 887 gnode.vr_near_clip = 0.5 888 self.is_hockey = True
An icy lake fit for racing.
842 def __init__(self) -> None: 843 super().__init__() 844 shared = SharedObjects.get() 845 self.node = ba.newnode('terrain', 846 delegate=self, 847 attrs={ 848 'collide_model': 849 self.preloaddata['collide_model'], 850 'model': 851 self.preloaddata['model'], 852 'color_texture': 853 self.preloaddata['tex'], 854 'materials': [ 855 shared.footing_material, 856 self.preloaddata['ice_material'] 857 ] 858 }) 859 ba.newnode('terrain', 860 attrs={ 861 'model': self.preloaddata['model_top'], 862 'lighting': False, 863 'color_texture': self.preloaddata['tex'] 864 }) 865 ba.newnode('terrain', 866 attrs={ 867 'model': self.preloaddata['model_reflections'], 868 'lighting': False, 869 'overlay': True, 870 'opacity': 0.15, 871 'color_texture': self.preloaddata['tex_reflections'] 872 }) 873 ba.newnode('terrain', 874 attrs={ 875 'model': self.preloaddata['vr_fill_model'], 876 'lighting': False, 877 'vr_only': True, 878 'background': True, 879 'color_texture': self.preloaddata['tex'] 880 }) 881 gnode = ba.getactivity().globalsnode 882 gnode.tint = (1, 1, 1) 883 gnode.ambient_color = (1, 1, 1) 884 gnode.shadow_ortho = True 885 gnode.vignette_outer = (0.86, 0.86, 0.86) 886 gnode.vignette_inner = (0.95, 0.95, 0.99) 887 gnode.vr_near_clip = 0.5 888 self.is_hockey = True
Instantiate a map.
817 @classmethod 818 def get_play_types(cls) -> list[str]: 819 """Return valid play types for this map.""" 820 return ['melee', 'keep_away', 'team_flag', 'race']
Return valid play types for this map.
Return the name of the preview texture for this map.
826 @classmethod 827 def on_preload(cls) -> Any: 828 data: dict[str, Any] = { 829 'model': ba.getmodel('lakeFrigid'), 830 'model_top': ba.getmodel('lakeFrigidTop'), 831 'model_reflections': ba.getmodel('lakeFrigidReflections'), 832 'collide_model': ba.getcollidemodel('lakeFrigidCollide'), 833 'tex': ba.gettexture('lakeFrigid'), 834 'tex_reflections': ba.gettexture('lakeFrigidReflections'), 835 'vr_fill_model': ba.getmodel('lakeFrigidVRFill') 836 } 837 mat = ba.Material() 838 mat.add_actions(actions=('modify_part_collision', 'friction', 0.01)) 839 data['ice_material'] = mat 840 return data
Called when the map is being preloaded.
It should return any media/data it requires to operate
Inherited Members
- ba._map.Map
- preload
- getname
- get_music_type
- is_point_near_edge
- get_def_bound_box
- get_def_point
- get_def_points
- get_start_position
- get_ffa_start_position
- get_flag_position
- exists
- handlemessage
- ba._actor.Actor
- autoretain
- on_expire
- expired
- is_alive
- activity
- getactivity
891class TipTop(ba.Map): 892 """A pointy map good for king-of-the-hill-ish games.""" 893 894 from bastd.mapdata import tip_top as defs 895 896 name = 'Tip Top' 897 898 @classmethod 899 def get_play_types(cls) -> list[str]: 900 """Return valid play types for this map.""" 901 return ['melee', 'keep_away', 'team_flag', 'king_of_the_hill'] 902 903 @classmethod 904 def get_preview_texture_name(cls) -> str: 905 return 'tipTopPreview' 906 907 @classmethod 908 def on_preload(cls) -> Any: 909 data: dict[str, Any] = { 910 'model': ba.getmodel('tipTopLevel'), 911 'bottom_model': ba.getmodel('tipTopLevelBottom'), 912 'collide_model': ba.getcollidemodel('tipTopLevelCollide'), 913 'tex': ba.gettexture('tipTopLevelColor'), 914 'bgtex': ba.gettexture('tipTopBGColor'), 915 'bgmodel': ba.getmodel('tipTopBG'), 916 'railing_collide_model': ba.getcollidemodel('tipTopLevelBumper') 917 } 918 return data 919 920 def __init__(self) -> None: 921 super().__init__(vr_overlay_offset=(0, -0.2, 2.5)) 922 shared = SharedObjects.get() 923 self.node = ba.newnode( 924 'terrain', 925 delegate=self, 926 attrs={ 927 'collide_model': self.preloaddata['collide_model'], 928 'model': self.preloaddata['model'], 929 'color_texture': self.preloaddata['tex'], 930 'color': (0.7, 0.7, 0.7), 931 'materials': [shared.footing_material] 932 }) 933 self.bottom = ba.newnode('terrain', 934 attrs={ 935 'model': self.preloaddata['bottom_model'], 936 'lighting': False, 937 'color': (0.7, 0.7, 0.7), 938 'color_texture': self.preloaddata['tex'] 939 }) 940 self.background = ba.newnode( 941 'terrain', 942 attrs={ 943 'model': self.preloaddata['bgmodel'], 944 'lighting': False, 945 'color': (0.4, 0.4, 0.4), 946 'background': True, 947 'color_texture': self.preloaddata['bgtex'] 948 }) 949 self.railing = ba.newnode( 950 'terrain', 951 attrs={ 952 'collide_model': self.preloaddata['railing_collide_model'], 953 'materials': [shared.railing_material], 954 'bumper': True 955 }) 956 gnode = ba.getactivity().globalsnode 957 gnode.tint = (0.8, 0.9, 1.3) 958 gnode.ambient_color = (0.8, 0.9, 1.3) 959 gnode.vignette_outer = (0.79, 0.79, 0.69) 960 gnode.vignette_inner = (0.97, 0.97, 0.99)
A pointy map good for king-of-the-hill-ish games.
920 def __init__(self) -> None: 921 super().__init__(vr_overlay_offset=(0, -0.2, 2.5)) 922 shared = SharedObjects.get() 923 self.node = ba.newnode( 924 'terrain', 925 delegate=self, 926 attrs={ 927 'collide_model': self.preloaddata['collide_model'], 928 'model': self.preloaddata['model'], 929 'color_texture': self.preloaddata['tex'], 930 'color': (0.7, 0.7, 0.7), 931 'materials': [shared.footing_material] 932 }) 933 self.bottom = ba.newnode('terrain', 934 attrs={ 935 'model': self.preloaddata['bottom_model'], 936 'lighting': False, 937 'color': (0.7, 0.7, 0.7), 938 'color_texture': self.preloaddata['tex'] 939 }) 940 self.background = ba.newnode( 941 'terrain', 942 attrs={ 943 'model': self.preloaddata['bgmodel'], 944 'lighting': False, 945 'color': (0.4, 0.4, 0.4), 946 'background': True, 947 'color_texture': self.preloaddata['bgtex'] 948 }) 949 self.railing = ba.newnode( 950 'terrain', 951 attrs={ 952 'collide_model': self.preloaddata['railing_collide_model'], 953 'materials': [shared.railing_material], 954 'bumper': True 955 }) 956 gnode = ba.getactivity().globalsnode 957 gnode.tint = (0.8, 0.9, 1.3) 958 gnode.ambient_color = (0.8, 0.9, 1.3) 959 gnode.vignette_outer = (0.79, 0.79, 0.69) 960 gnode.vignette_inner = (0.97, 0.97, 0.99)
Instantiate a map.
898 @classmethod 899 def get_play_types(cls) -> list[str]: 900 """Return valid play types for this map.""" 901 return ['melee', 'keep_away', 'team_flag', 'king_of_the_hill']
Return valid play types for this map.
Return the name of the preview texture for this map.
907 @classmethod 908 def on_preload(cls) -> Any: 909 data: dict[str, Any] = { 910 'model': ba.getmodel('tipTopLevel'), 911 'bottom_model': ba.getmodel('tipTopLevelBottom'), 912 'collide_model': ba.getcollidemodel('tipTopLevelCollide'), 913 'tex': ba.gettexture('tipTopLevelColor'), 914 'bgtex': ba.gettexture('tipTopBGColor'), 915 'bgmodel': ba.getmodel('tipTopBG'), 916 'railing_collide_model': ba.getcollidemodel('tipTopLevelBumper') 917 } 918 return data
Called when the map is being preloaded.
It should return any media/data it requires to operate
Inherited Members
- ba._map.Map
- preload
- getname
- get_music_type
- is_point_near_edge
- get_def_bound_box
- get_def_point
- get_def_points
- get_start_position
- get_ffa_start_position
- get_flag_position
- exists
- handlemessage
- ba._actor.Actor
- autoretain
- on_expire
- expired
- is_alive
- activity
- getactivity
963class CragCastle(ba.Map): 964 """A lovely castle map.""" 965 966 from bastd.mapdata import crag_castle as defs 967 968 name = 'Crag Castle' 969 970 @classmethod 971 def get_play_types(cls) -> list[str]: 972 """Return valid play types for this map.""" 973 return ['melee', 'keep_away', 'team_flag', 'conquest'] 974 975 @classmethod 976 def get_preview_texture_name(cls) -> str: 977 return 'cragCastlePreview' 978 979 @classmethod 980 def on_preload(cls) -> Any: 981 data: dict[str, Any] = { 982 'model': ba.getmodel('cragCastleLevel'), 983 'bottom_model': ba.getmodel('cragCastleLevelBottom'), 984 'collide_model': ba.getcollidemodel('cragCastleLevelCollide'), 985 'tex': ba.gettexture('cragCastleLevelColor'), 986 'bgtex': ba.gettexture('menuBG'), 987 'bgmodel': ba.getmodel('thePadBG'), 988 'railing_collide_model': 989 (ba.getcollidemodel('cragCastleLevelBumper')), 990 'vr_fill_mound_model': ba.getmodel('cragCastleVRFillMound'), 991 'vr_fill_mound_tex': ba.gettexture('vrFillMound') 992 } 993 # fixme should chop this into vr/non-vr sections 994 return data 995 996 def __init__(self) -> None: 997 super().__init__() 998 shared = SharedObjects.get() 999 self.node = ba.newnode( 1000 'terrain', 1001 delegate=self, 1002 attrs={ 1003 'collide_model': self.preloaddata['collide_model'], 1004 'model': self.preloaddata['model'], 1005 'color_texture': self.preloaddata['tex'], 1006 'materials': [shared.footing_material] 1007 }) 1008 self.bottom = ba.newnode('terrain', 1009 attrs={ 1010 'model': self.preloaddata['bottom_model'], 1011 'lighting': False, 1012 'color_texture': self.preloaddata['tex'] 1013 }) 1014 self.background = ba.newnode( 1015 'terrain', 1016 attrs={ 1017 'model': self.preloaddata['bgmodel'], 1018 'lighting': False, 1019 'background': True, 1020 'color_texture': self.preloaddata['bgtex'] 1021 }) 1022 self.railing = ba.newnode( 1023 'terrain', 1024 attrs={ 1025 'collide_model': self.preloaddata['railing_collide_model'], 1026 'materials': [shared.railing_material], 1027 'bumper': True 1028 }) 1029 ba.newnode('terrain', 1030 attrs={ 1031 'model': self.preloaddata['vr_fill_mound_model'], 1032 'lighting': False, 1033 'vr_only': True, 1034 'color': (0.2, 0.25, 0.2), 1035 'background': True, 1036 'color_texture': self.preloaddata['vr_fill_mound_tex'] 1037 }) 1038 gnode = ba.getactivity().globalsnode 1039 gnode.shadow_ortho = True 1040 gnode.shadow_offset = (0, 0, -5.0) 1041 gnode.tint = (1.15, 1.05, 0.75) 1042 gnode.ambient_color = (1.15, 1.05, 0.75) 1043 gnode.vignette_outer = (0.6, 0.65, 0.6) 1044 gnode.vignette_inner = (0.95, 0.95, 0.95) 1045 gnode.vr_near_clip = 1.0
A lovely castle map.
996 def __init__(self) -> None: 997 super().__init__() 998 shared = SharedObjects.get() 999 self.node = ba.newnode( 1000 'terrain', 1001 delegate=self, 1002 attrs={ 1003 'collide_model': self.preloaddata['collide_model'], 1004 'model': self.preloaddata['model'], 1005 'color_texture': self.preloaddata['tex'], 1006 'materials': [shared.footing_material] 1007 }) 1008 self.bottom = ba.newnode('terrain', 1009 attrs={ 1010 'model': self.preloaddata['bottom_model'], 1011 'lighting': False, 1012 'color_texture': self.preloaddata['tex'] 1013 }) 1014 self.background = ba.newnode( 1015 'terrain', 1016 attrs={ 1017 'model': self.preloaddata['bgmodel'], 1018 'lighting': False, 1019 'background': True, 1020 'color_texture': self.preloaddata['bgtex'] 1021 }) 1022 self.railing = ba.newnode( 1023 'terrain', 1024 attrs={ 1025 'collide_model': self.preloaddata['railing_collide_model'], 1026 'materials': [shared.railing_material], 1027 'bumper': True 1028 }) 1029 ba.newnode('terrain', 1030 attrs={ 1031 'model': self.preloaddata['vr_fill_mound_model'], 1032 'lighting': False, 1033 'vr_only': True, 1034 'color': (0.2, 0.25, 0.2), 1035 'background': True, 1036 'color_texture': self.preloaddata['vr_fill_mound_tex'] 1037 }) 1038 gnode = ba.getactivity().globalsnode 1039 gnode.shadow_ortho = True 1040 gnode.shadow_offset = (0, 0, -5.0) 1041 gnode.tint = (1.15, 1.05, 0.75) 1042 gnode.ambient_color = (1.15, 1.05, 0.75) 1043 gnode.vignette_outer = (0.6, 0.65, 0.6) 1044 gnode.vignette_inner = (0.95, 0.95, 0.95) 1045 gnode.vr_near_clip = 1.0
Instantiate a map.
970 @classmethod 971 def get_play_types(cls) -> list[str]: 972 """Return valid play types for this map.""" 973 return ['melee', 'keep_away', 'team_flag', 'conquest']
Return valid play types for this map.
Return the name of the preview texture for this map.
979 @classmethod 980 def on_preload(cls) -> Any: 981 data: dict[str, Any] = { 982 'model': ba.getmodel('cragCastleLevel'), 983 'bottom_model': ba.getmodel('cragCastleLevelBottom'), 984 'collide_model': ba.getcollidemodel('cragCastleLevelCollide'), 985 'tex': ba.gettexture('cragCastleLevelColor'), 986 'bgtex': ba.gettexture('menuBG'), 987 'bgmodel': ba.getmodel('thePadBG'), 988 'railing_collide_model': 989 (ba.getcollidemodel('cragCastleLevelBumper')), 990 'vr_fill_mound_model': ba.getmodel('cragCastleVRFillMound'), 991 'vr_fill_mound_tex': ba.gettexture('vrFillMound') 992 } 993 # fixme should chop this into vr/non-vr sections 994 return data
Called when the map is being preloaded.
It should return any media/data it requires to operate
Inherited Members
- ba._map.Map
- preload
- getname
- get_music_type
- is_point_near_edge
- get_def_bound_box
- get_def_point
- get_def_points
- get_start_position
- get_ffa_start_position
- get_flag_position
- exists
- handlemessage
- ba._actor.Actor
- autoretain
- on_expire
- expired
- is_alive
- activity
- getactivity
1048class TowerD(ba.Map): 1049 """Map used for runaround mini-game.""" 1050 1051 from bastd.mapdata import tower_d as defs 1052 1053 name = 'Tower D' 1054 1055 @classmethod 1056 def get_play_types(cls) -> list[str]: 1057 """Return valid play types for this map.""" 1058 return [] 1059 1060 @classmethod 1061 def get_preview_texture_name(cls) -> str: 1062 return 'towerDPreview' 1063 1064 @classmethod 1065 def on_preload(cls) -> Any: 1066 data: dict[str, Any] = { 1067 'model': 1068 ba.getmodel('towerDLevel'), 1069 'model_bottom': 1070 ba.getmodel('towerDLevelBottom'), 1071 'collide_model': 1072 ba.getcollidemodel('towerDLevelCollide'), 1073 'tex': 1074 ba.gettexture('towerDLevelColor'), 1075 'bgtex': 1076 ba.gettexture('menuBG'), 1077 'bgmodel':