Skip to content

Commit

Permalink
Finished Road of No Return quest
Browse files Browse the repository at this point in the history
  • Loading branch information
jwvhewitt committed Nov 14, 2024
1 parent a10005d commit 0aa3cb7
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 23 deletions.
69 changes: 50 additions & 19 deletions game/content/ghplots/dd_roadedge_unique.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def custom_init(self, nart):
self.elements["GATE_B"] = my_edge.end_node.entrance

# Add the entry scene.
self.elements[dungeonmaker.DG_NAME] = "The Road to Nowhere"
self.elements[dungeonmaker.DG_NAME] = "The Road of No Return"
self.elements[dungeonmaker.DG_ARCHITECTURE] = gharchitecture.MechaScaleSemiDeadzone()
self.elements[dungeonmaker.DG_SCENE_TAGS] = (gears.tags.SCENE_OUTDOORS, gears.personality.DeadZone)
self.elements[dungeonmaker.DG_EXPLO_MUSIC] = "HoliznaCC0 - Lost In Space.ogg"
Expand All @@ -58,8 +58,13 @@ def custom_init(self, nart):
self.elements["DUNGEON_ENTRANCE"] = my_dungeon.elements["ENTRANCE"]

self._got_rumor = False
self._got_rumor = True
return True

def MDG_DUNGEON_WIN(self, camp):
self.elements[mechadungeons.MDG_DUNGEON].status = self.elements[mechadungeons.MDG_DUNGEON].DEFEATED
self.elements["DZ_EDGE"].style = self.elements["DZ_EDGE"].STYLE_SAFE
self.road_cleared = True
self.memo = None

def GATE_A_menu(self, camp, thingmenu):
if self._got_rumor:
Expand Down Expand Up @@ -162,19 +167,24 @@ def custom_init(self, nart):
else:
direction = (pbge.randmaps.anchors.west, pbge.randmaps.anchors.east)

level_one = self.add_sub_plot(nart, "MECHA_DUNGEON_GENERIC", elements={dungeonmaker.DG_NAME: "Road of No Return 2"})
level_one = self.add_sub_plot(nart, "MECHA_DUNGEON_GENERIC", elements={dungeonmaker.DG_NAME: "Road of No Return 2", dungeonmaker.DG_PARENT_SCENE: myscene})
level_one_locale = level_one.elements["LOCALE"]
plotutility.SceneConnection(nart, self, myscene, level_one_locale, anchor1=direction[0], anchor2=direction[1])

two_to_three_room = pbge.randmaps.rooms.FuzzyRoom(9, 12, anchor=direction[0])
level_one_locale.contents.append(two_to_three_room)

level_two = self.add_sub_plot(nart, "MECHA_DUNGEON_GENERIC", elements={dungeonmaker.DG_NAME: "Road of No Return 3"})
level_two = self.add_sub_plot(nart, "MECHA_DUNGEON_GENERIC", elements={dungeonmaker.DG_NAME: "Road of No Return 3", dungeonmaker.DG_PARENT_SCENE: level_one_locale})
level_two_locale = level_two.elements["LOCALE"]
plotutility.SceneConnection(nart, self, level_one_locale, level_two_locale, room1=two_to_three_room, anchor2=direction[1])
self.add_sub_plot(nart, "MDUNGEON_ENCOUNTER", elements={"LOCALE": level_one_locale, "ROOM": two_to_three_room, "STRENGTH": 150})

if random.randint(1, 5) == 5:
final_anchor = direction[0]
else:
final_anchor = random.choice(pbge.randmaps.anchors.ADJACENT_ANCHORS[direction[0]])

self.add_sub_plot(nart, "DZD_RONR_BOSS")
self.add_sub_plot(nart, "DZD_RONR_BOSS", elements={"LOCALE": level_two_locale, "ANCHOR": final_anchor})
return True

def t_ENDCOMBAT(self, camp:gears.GearHeadCampaign):
Expand Down Expand Up @@ -212,28 +222,49 @@ class RoadOfNoReturnConclusion(Plot):
def custom_init(self, nart: pbge.plots.NarrativeRequest):
myscene = self.elements["LOCALE"]
fac = self.elements.get("ENEMY_FACTION")
self.register_element("ROOM", ghrooms.MechaScaleFortressRoom(random.randint(5,10), random.randint(5,10)), dident="LOCALE")
self.register_element("ROOM", ghrooms.MechaScaleFortressRoom(random.randint(8,16), random.randint(8,16), anchor=self.elements["ANCHOR"]), dident="LOCALE")
team2 = self.register_element("_eteam", teams.Team(enemies=(myscene.player_team,), faction=fac), dident="ROOM")
team2.contents += gears.selector.RandomMechaUnit(self.rank, 150, fac, myscene.environment).mecha_list

myfort = self.register_element("_FORT", gears.selector.generate_fortification(self.rank, fac, myscene.environment))
team2.contents.append(myfort)

self.enemy_combatants = list(team2.contents)

self.last_update = 0
return True

def _eteam_ACTIVATETEAM(self, camp):
self.last_update = camp.time

def LOCALE_ENTER(self, camp: gears.GearHeadCampaign):
myteam: teams.Team = self.elements["_eteam"]
myscene = self.elements["LOCALE"]
fac = self.elements.get("ENEMY_FACTION")
if camp.time > self.last_update:
dungeonmaker.dungeon_cleaner(self.elements["LOCALE"])
MDG = self.elements.get(mechadungeons.MDG_DUNGEON)
if len(myteam.get_members_in_play(camp)) < 1 and random.randint(1, 3) != 2 and not (MDG and MDG.status != MDG.HOSTILE):
camp.scene.deploy_team(gears.selector.RandomMechaUnit(
self.rank, random.randint(30,80), fac, myscene.environment
).mecha_list, myteam
)
self.last_update = camp.time
def t_ENDCOMBAT(self, camp: gears.GearHeadCampaign):
myteam = self.elements["_eteam"]
myguards = myteam.get_members_in_play(camp)

if len(myguards) < 1:
# Win the battle!
self.win_the_dungeon(camp)
else:
myscene = self.elements["LOCALE"]
for npc in list(self.enemy_combatants):
npc.restore_all()
if npc.is_operational() and npc.scale is gears.scale.MechaScale:
if npc not in myscene.contents:
myscene.contents.append(npc)
else:
self.enemy_combatants.remove(npc)

def win_the_dungeon(self, camp: gears.GearHeadCampaign):
camp.check_trigger("WIN", self.elements[mechadungeons.MDG_DUNGEON])
dest_node = random.choice((self.elements["DZ_EDGE"].start_node, self.elements["DZ_EDGE"].end_node))
pbge.alert("When the battle ends, you find the people who had disappeared from the highway: {ENEMY_FACTION} kidnapped them and forced them to work disassembling the captured vehicles to build mecha and war machines.".format(**self.elements))
pbge.alert("Soon, rescue teams from nearby communities arrive to provide aid to the victims. You return to {}.".format(dest_node.destination))
self.elements["DZ_EDGE"].start_node.destination.metrodat.local_reputation += 10
self.elements["DZ_EDGE"].end_node.destination.metrodat.local_reputation += 10
camp.dole_xp(200)
camp.go(dest_node.entrance)
self.end_plot(camp)



# *********************************
Expand Down
2 changes: 1 addition & 1 deletion game/content/ghplots/mechadungeons.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from game import teams
import gears
import pbge
from game.content import ghwaypoints, gharchitecture, plotutility, dungeonmaker
from game.content import dungeonmaker
import random
from game.content.dungeonmaker import DG_NAME, DG_ARCHITECTURE, DG_SCENE_TAGS, DG_TEMPORARY, DG_PARENT_SCENE, DG_EXPLO_MUSIC, DG_COMBAT_MUSIC, DG_DECOR

Expand Down
3 changes: 2 additions & 1 deletion game/content/ghrooms.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ class MechaScaleFortressRoom(pbge.randmaps.rooms.Room):
FLOOR_TERRAIN = ghterrain.MSConcreteSlabFloor
WALL_TERRAIN = ghterrain.MechaFortressWall
def build(self, gb, archi):
gb.fill(self.area.inflate(2, 2), floor=self.FLOOR_TERRAIN, wall=None)
gb.fill(self.area.inflate(2, 2), floor=archi.floor_terrain, wall=None)
gb.fill(self.area, floor=self.FLOOR_TERRAIN)
for x in range(self.area.w // 2 - 1):
gb.set_wall(x + self.area.left, self.area.top, self.WALL_TERRAIN)
gb.set_wall(self.area.right - x - 1, self.area.top, self.WALL_TERRAIN)
Expand Down
2 changes: 1 addition & 1 deletion game/content/ghterrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ class DragonTeethWall(pbge.scenes.terrain.WallTerrain):
class MechaFortressWall(pbge.scenes.terrain.WallTerrain):
image_top = 'terrain_wall_mechfort.png'
bordername = None
altitude = 20
#altitude = 20
blocks = (Walking, Skimming, Rolling)
movement_cost = {pbge.scenes.movement.Vision: 50}

Expand Down
5 changes: 4 additions & 1 deletion history.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
* Fixed unloadable save file is PC killed during combat bug
v0.974 November 14, 2024

* Added "Road of No Return" quest to DeadZone Drifter
* Fixed unloadable save file if PC killed during combat bug
* Incapacitated PCs may need lifesaving cybersurgery
* FieldHQ contents are sorted now
* Scenes without a defined parent scene should get added as root scenes
Expand Down
Binary file modified image/terrain_wall_mechfort.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0aa3cb7

Please sign in to comment.