Skip to content

Commit

Permalink
FieldHQ now gets sorted
Browse files Browse the repository at this point in the history
  • Loading branch information
jwvhewitt committed Nov 7, 2024
1 parent 43d2fe1 commit 416dea9
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 9 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,13 @@ nosetests.xml
.mr.developer.cfg
.project
.pydevproject

.eric7project
.idea
.jedi
*.epj
caramel-recolor-cython/pbgerecolor.c




4 changes: 2 additions & 2 deletions game/content/ghplots/dd_homebase.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ def NPC2_offers(self, camp):

def register_adventure(self, camp):
self.mission_seed = missionbuilder.BuildAMissionSeed(
camp, "{}'s Mission".format(self.elements["NPC"]),
camp, "{NPC}'s mission against {ENEMY_FACTION}".format(**self.elements),
self.elements["METROSCENE"], self.elements["MISSION_GATE"],
self.elements.get("ENEMY_FACTION"), rank=self.rank, architecture=gharchitecture.MechaScaleGreenzone(),
objectives=(missionbuilder.BAMO_DEFEAT_COMMANDER,),
Expand Down Expand Up @@ -986,7 +986,7 @@ def generate_enemy_faction(self):
return random.choice(self.ENEMY_FACTIONS)

def register_adventure(self, camp):
self.adventure_seed = CombatMissionSeed(camp, "{}'s Mission".format(self.elements["DISPATCHER"]),
self.adventure_seed = CombatMissionSeed(camp, "{}'s mission against {}".format(self.elements["DISPATCHER"], self.next_enemy_faction),
self.elements["LOCALE"], self.elements["MISSION_GATE"],
enemy_faction=self.next_enemy_faction,
allied_faction=factions.TerranDefenseForce,
Expand Down
13 changes: 11 additions & 2 deletions game/content/ghplots/dd_roadedge_unique.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ def custom_init(self, nart):
my_edge = self.elements["DZ_EDGE"]
self.elements["GATE_A"] = my_edge.start_node.entrance
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_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"
self.elements[dungeonmaker.DG_COMBAT_MUSIC] = "Komiku_-_03_-_Battle_Theme.ogg"

self._got_rumor = False
return True

Expand Down Expand Up @@ -66,15 +74,16 @@ def _get_generic_offers(self, npc, camp):
goffs = list()
myscene = camp.scene.get_root_scene()
myedge = self.elements["DZ_EDGE"]
if self.elements["DZ_EDGE"].connects_to_city(myscene) and not self.road_cleared and not self._got_rumor:
if myedge.connects_to_city(myscene) and not self.road_cleared and not self._got_rumor:
goffs.append(Offer(
"",
"A lot of people have disappeared without a trace while traveling the highway. Whole convoys gone, with no wreckage left behind. Some people say the road is haunted by the ghosts of a long-dead hive city.",
ContextTag([context.INFO,]), effect=self._get_rumor, subject="The Road of No Return"
))
return goffs

def _get_rumor(self, camp):
self._got_rumor = True
self.memo = "The highway between {} and {} is called the Road of No Return because a lot of convoys have gone missing there.".format(self.elements["DZ_EDGE"].start_node.destination, self.elements["DZ_EDGE"].end_node.destination)


# *********************************
Expand Down
2 changes: 1 addition & 1 deletion game/content/ghplots/localproblems.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from game import content, services, teams, ghdialogue
import gears
import pbge
from game.content import gharchitecture, plotutility, dungeonmaker, ghwaypoints, adventureseed, ghcutscene, ghterrain, \
from game.content import gharchitecture, plotutility, dungeonmaker, ghwaypoints, ghterrain, \
ghchallenges, ghrooms
from game.ghdialogue import context
from pbge.dialogue import Offer, ContextTag
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 @@ -21,7 +21,7 @@ def custom_init(self, nart):
exploration_music=self.elements[DG_EXPLO_MUSIC],
scale=gears.scale.MechaScale)
intscenegen = pbge.randmaps.SceneGenerator(intscene, self.elements[DG_ARCHITECTURE],
decorate=self.elements[DG_DECOR])
decorate=self.elements.get(DG_DECOR))
self.register_scene(nart, intscene, intscenegen, ident="LOCALE", dident=DG_PARENT_SCENE,
temporary=self.elements.get(DG_TEMPORARY,False))

Expand Down
14 changes: 14 additions & 0 deletions game/fieldhq/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,21 @@ def update_party(self):
else:
self.member_widgets[pc] = ItemInfoWidget(self.camp, pc, self, active=False)
self.children.append(self.member_widgets[pc])
self.member_selector.sort(key=self._get_sort_order)
self.active_info = return_to

def _get_sort_order(self, wid):
pc = wid.pc
if pc is self.camp.pc:
return (0, str(pc))
elif isinstance(pc, gears.base.Character):
return (100, str(pc))
elif isinstance(pc, gears.base.Being):
return (200, str(pc))
elif isinstance(pc, gears.base.Mecha) and pc.pilot:
return (300, str(pc.pilot))
else:
return (500, str(pc))

def click_member(self, wid, ev):
# self.active_pc = wid.pc
Expand Down
7 changes: 6 additions & 1 deletion history.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
*
* FieldHQ contents are sorted now
* Scenes without a defined parent scene should get added as root scenes
* Most missions names now include faction being fought

v0.973 November 6, 2024

* Used cyberware is resold at a lower price
* Refactored cyberdoc unit to use current widget system
* Fixed crashing bug in cyberdoc unit
Expand All @@ -10,9 +13,11 @@ v0.973 November 6, 2024
* Sales menu will be properly reactivated after selling something

v0.972 November 3, 2024

* Fixed a bug in the Label widget

v0.971 November 3, 2024

* You can now access your inventory from the shop interface
* You can now switch characters in shop interface
* Added named boss monsters
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import logging
import traceback

VERSION = "v0.973"
VERSION = "v0.974"

class TitleScreenRedraw(object):

Expand Down
2 changes: 1 addition & 1 deletion pbge/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def register_scene(self, nart, myscene, mygen, ident=None, dident=None, rank=Non
# keep that scene alive even after deletion, but the scene's contents and scripts will be gone.
# Best bet is to link temporary scenes to the permanent parts of the campaign using something that will
# disappear when this plot ends, such as a conversation option or a waypoint menu item.
if not dident:
if not (dident and self.elements.get(dident)):
if self.adv and self.adv.world:
self.adv.world.contents.append(myscene)
self.move_records.append((myscene, self.adv.world.contents))
Expand Down

0 comments on commit 416dea9

Please sign in to comment.