Skip to content

Commit

Permalink
Added decor for more buildings; counters to most shops.
Browse files Browse the repository at this point in the history
  • Loading branch information
jwvhewitt committed Sep 1, 2024
1 parent 0e27afe commit e14cbed
Show file tree
Hide file tree
Showing 21 changed files with 229 additions and 38 deletions.
42 changes: 38 additions & 4 deletions game/content/gharchitecture.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
import random


class CheeseShopDecor(OmniDec):
WALL_DECOR = (ghterrain.WoodenShelves,)


class ResidentialDecor(OmniDec):
WALL_DECOR = (ghterrain.WoodenShelves,)
WIN_DECOR = ghterrain.ScreenWindow
Expand All @@ -26,6 +22,44 @@ class RestaurantDecor(OmniDec):
FLOOR_FILL_FACTOR = 0.05


class BreakRoomDecor(OmniDec):
WALL_DECOR = (ghterrain.LoungeTableTerrain,)
WALL_FILL_FACTOR = 0.33
FLOOR_DECOR = (ghterrain.TableAndChairsTerrain,)
FLOOR_FILL_FACTOR = 0.05


class WeaponShopDecor(OmniDec):
WALL_DECOR = (ghterrain.GervaisWeaponRacks,)


class ArmorShopDecor(OmniDec):
WALL_DECOR = (ghterrain.ArmorCabinetTerrain, ghterrain.ArmorMannequinTerrain)


class ArmoryDecor(OmniDec):
WALL_DECOR = (
ghterrain.GervaisWeaponRacks, ghterrain.ArmorCabinetTerrain, ghterrain.ArmorMannequinTerrain
)


class CheeseShopDecor(OmniDec):
WALL_DECOR = (ghterrain.WoodenShelves, ghterrain.ProvisionsTerrain)


class GeneralShopDecor(OmniDec):
WALL_DECOR = (
ghterrain.GervaisWeaponRacks, ghterrain.ArmorCabinetTerrain, ghterrain.WoodenShelves, ghterrain.ProvisionsTerrain
)


class BlackMarketDecor(OmniDec):
WALL_DECOR = (
ghterrain.GervaisWeaponRacks, ghterrain.ArmorCabinetTerrain, ghterrain.ArmorMannequinTerrain,
ghterrain.ShippingShelvesTerrain, ghterrain.JollyRogerSign
)


class DungeonDecor(OmniDec):
WALL_DECOR = (ghterrain.TorchTerrain,)
WALL_FILL_FACTOR = 0.33
Expand Down
17 changes: 17 additions & 0 deletions game/content/ghplots/bbmc_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1466,6 +1466,23 @@ def NPC_offers(self, camp):
allow_generics=False
))

elif gears.tags.Criminal in camp.pc.get_tags():
mylist.append(Offer(
"Hey, I know you! You're [audience]! Last I heard the Guardians put a bounty of ${:,} on your head. So are you still doing crimes, or have you decided to go straight like me?".format(gears.selector.calc_mission_reward(camp.pc.renown, 200, True)),
ContextTag([context.HELLO]), effect=self._have_first_conversation, allow_generics=False
))
mylist.append(Offer(
"Hah! You may be right, you may be... Why don't you take a look at the scenery around this park and see if there's anything you can pocket? Just walk over and bump into stuff, same as you did for me.",
ContextTag([context.CUSTOM]),
data={"reply": "Still doing crimes. And I'll believe you've gone straight when I see it!"}, allow_generics=False
))
mylist.append(Offer(
"Seriously? You know, the Cavalier Code don't say anything about breaking the law... I'd be at it myself if there wasn't better money in teaching. Which brings me to your first lesson: take a look at the things in this park. Just walk over and bump into 'em, like you did for me.",
ContextTag([context.CUSTOM]),
data={"reply": "I'm a cavalier now. I've left that behind."},
allow_generics=False
))

else:
mylist.append(Offer(
"Good job, you can move around and interact with other people. You're going to be doing a whole lot of that as a cavalier.",
Expand Down
27 changes: 22 additions & 5 deletions game/content/ghplots/dd_homebase.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def custom_init(self, nart):
# tplot = self.add_sub_plot(nart, "TEST_DUNGEON")
# tplot = self.add_sub_plot(nart, "TEST_CHAR_MOVER")
self.add_sub_plot(nart, "DZD_BLACK_ISLE_PUB")
self.add_sub_plot(nart, "RANDOM_SHOP")
# Hwang-Sa Mission
# Reconstruction Site
tplot = self.add_sub_plot(nart, "QOL_REPORTER")
Expand Down Expand Up @@ -1146,10 +1147,15 @@ def custom_init(self, nart):
room2=foyer, door1=building.waypoints["OTHER"],
move_door1=False)

mycounter = ghrooms.ShopCounterArea(random.randint(4, 6), random.randint(3, 5), anchor=pbge.randmaps.anchors.north)
foyer.contents.append(mycounter)
salesteam = self.register_element("SALES_TEAM", teams.Team(name="Sales Team", allies=[team2]))
mycounter.contents.append(salesteam)

npc = self.register_element("SHOPKEEPER",
gears.selector.random_character(50, local_tags=self.elements["LOCALE"].attributes,
job=gears.jobs.ALL_JOBS["Shopkeeper"]))
team2.contents.append(npc)
salesteam.contents.append(npc)

self.shop = services.Shop(npc=npc, rank=50)

Expand Down Expand Up @@ -1321,11 +1327,17 @@ def custom_init(self, nart):
room2=foyer, door1=building.waypoints["DOOR"],
move_door1=False)


mycounter = ghrooms.ShopCounterArea(random.randint(4, 6), random.randint(3, 5), anchor=pbge.randmaps.anchors.north)
foyer.contents.append(mycounter)
salesteam = self.register_element("SALES_TEAM", teams.Team(name="Sales Team", allies=[team2]))
mycounter.contents.append(salesteam)

npc = self.register_element("SHOPKEEPER",
gears.selector.random_character(50, local_tags=self.elements["LOCALE"].attributes,
job=gears.jobs.ALL_JOBS["Shopkeeper"],
combatant=False))
npc.place(intscene, team=team2)
npc.place(intscene, team=salesteam)

self.shop = services.Shop(npc=npc, ware_types=services.TIRE_STORE)

Expand Down Expand Up @@ -1375,18 +1387,23 @@ def custom_init(self, nart):
intscenegen = pbge.randmaps.SceneGenerator(intscene, game.content.gharchitecture.CommercialBuilding())
self.register_scene(nart, intscene, intscenegen, ident="INTERIOR", dident="LOCALE")
foyer = self.register_element('_introom', pbge.randmaps.rooms.ClosedRoom(anchor=pbge.randmaps.anchors.south,
decorate=game.content.gharchitecture.CheeseShopDecor()),
decorate=game.content.gharchitecture.ArmoryDecor()),
dident="INTERIOR")

mycon2 = game.content.plotutility.TownBuildingConnection(nart, self, self.elements["LOCALE"], intscene,
room1=building,
room2=foyer, door1=building.waypoints["DOOR"],
move_door1=False)

mycounter = ghrooms.ShopCounterArea(random.randint(4, 6), random.randint(3, 5), anchor=pbge.randmaps.anchors.north)
foyer.contents.append(mycounter)
salesteam = self.register_element("SALES_TEAM", teams.Team(name="Sales Team", allies=[team2]))
mycounter.contents.append(salesteam)

npc = self.register_element("SHOPKEEPER",
gears.selector.random_character(50, local_tags=self.elements["LOCALE"].attributes,
job=gears.jobs.ALL_JOBS["Shopkeeper"]))
npc.place(intscene, team=team2)
npc.place(intscene, team=salesteam)

self.shop = services.Shop(npc=npc, rank=50,
ware_types=services.GENERAL_STORE)
Expand Down Expand Up @@ -1788,7 +1805,7 @@ def REGEXNPC_offers(self, camp):
))

mylist.append(Offer(
"That would be great. More work will help us to rebuild our office faster, and I for one can't wait to get out of this building. It alway`s smells like coffee and magnetic grease in here.",
"That would be great. More work will help us to rebuild our office faster, and I for one can't wait to get out of this building. It always smells like coffee and magnetic grease in here.",
context=ContextTag([context.CUSTOMREPLY]), subject=self,
data={"reply": "I'll see what I can do about that."}, effect=self._tell_about_services
))
Expand Down
7 changes: 6 additions & 1 deletion game/content/ghplots/dd_roadstops.py
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,12 @@ def custom_init(self, nart):
room2=foyer, door1=building.waypoints["DOOR"],
move_door1=False)

npc1.place(intscene, team=team2)
mycounter = ghrooms.ShopCounterArea(random.randint(4, 6), random.randint(3, 5), anchor=pbge.randmaps.anchors.north)
foyer.contents.append(mycounter)
salesteam = self.register_element("SALES_TEAM", teams.Team(name="Sales Team", allies=[team2]))
mycounter.contents.append(salesteam)

npc1.place(intscene, team=salesteam)

self.shop = services.Shop(npc=npc1, ware_types=services.GENERAL_STORE)

Expand Down
6 changes: 3 additions & 3 deletions game/content/ghplots/missionbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,17 +435,17 @@ def _generate_entrance_room(self):
self.elements["ENTRANCE_ANCHOR"] = myanchor
myscene: gears.GearHeadScene = self.elements["LOCALE"]
if myanchor in (pbge.randmaps.anchors.east, pbge.randmaps.anchors.west):
corridor = pbge.randmaps.rooms.OpenRoom(width=myscene.width, height=14, anchor=pbge.randmaps.anchors.west)
corridor = pbge.randmaps.rooms.OpenRoom(width=myscene.width, height=15, anchor=pbge.randmaps.anchors.west)
else:
corridor = pbge.randmaps.rooms.OpenRoom(width=14, height=myscene.height, anchor=pbge.randmaps.anchors.north)
corridor = pbge.randmaps.rooms.OpenRoom(width=15, height=myscene.height, anchor=pbge.randmaps.anchors.north)
self.register_element("ESCORT_PATH", corridor, dident="LOCALE")
interior_anchors = list(pbge.randmaps.anchors.ADJACENT_ANCHORS[myanchor])
random.shuffle(interior_anchors)
self.register_element("ENTRANCE_ROOM", pbge.randmaps.rooms.OpenRoom(5, 5, anchor=interior_anchors[0]), dident="ESCORT_PATH")
self.register_element("_ENTRANCE",
game.content.ghwaypoints.Exit(anchor=pbge.randmaps.anchors.middle, plot_locked=True),
dident="ENTRANCE_ROOM")
self.register_element("ESCORT_ROOM", pbge.randmaps.rooms.OpenRoom(7, 7, anchor=interior_anchors[1]), dident="ESCORT_PATH")
self.register_element("ESCORT_ROOM", pbge.randmaps.rooms.OpenRoom(8, 8, anchor=interior_anchors[1]), dident="ESCORT_PATH")


# ****************************
Expand Down
34 changes: 32 additions & 2 deletions game/content/ghplots/mocha.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ def custom_init(self, nart):
sp = self.add_sub_plot(nart, "MOCHA_CARTER")
self.elements["CARTER"] = sp.elements["CARTER"]

#self.add_sub_plot(nart, "MOCHA_ONAWA")

# Add the puzzle to get through the snowdrift.
#
# Bibliography for procedural puzzle generation:
Expand Down Expand Up @@ -559,7 +561,8 @@ def custom_init(self, nart):
intscene = gears.GearHeadScene(
50, 35, "Mauna Chalet", player_team=team1, civilian_team=team2,
attributes=(gears.tags.SCENE_PUBLIC, gears.tags.SCENE_BUILDING, gears.tags.SCENE_MEETING),
scale=gears.scale.HumanScale
scale=gears.scale.HumanScale,
exploration_music='Doctor_Turtle_-_04_-_Lets_Just_Get_Through_Christmas.ogg',
)

intscenegen = pbge.randmaps.PackedBuildingGenerator(
Expand All @@ -569,11 +572,13 @@ def custom_init(self, nart):

foyer = self.register_element('_introom', pbge.randmaps.rooms.ClosedRoom(width=random.randint(10,15),
height=random.randint(6,8),
anchor=pbge.randmaps.anchors.south,),
anchor=pbge.randmaps.anchors.south,
decorate=gharchitecture.BreakRoomDecor()),
dident="LOCALE")
foyer.contents.append(team2)

self.register_element("ENTRANCE", ghwaypoints.Waypoint(anchor=pbge.randmaps.anchors.middle), dident="_introom")
self.register_element("POSTER", ghwaypoints.MechaPoster(name="Poster", desc="A promotional poster for the charity mecha tournament.", plot_locked=True), dident="_introom")

self.register_element("EXIT",
ghwaypoints.Exit(name="Exit", anchor=pbge.randmaps.anchors.south, plot_locked=True), dident="_introom")
Expand Down Expand Up @@ -733,6 +738,31 @@ def CARTER_offers(self, camp):
return mylist


class WinterMochaOnawa(Plot):
LABEL = "MOCHA_ONAWA"
active = True
scope = "LOCALE"

did_greeting = False

def custom_init(self, nart):
myscene = self.elements["LOCALE"]
hyolee = nart.camp.get_major_npc("Onawa GH1")
hyolee.mmode = pbge.scenes.movement.Walking
self.register_element("NPC", hyolee, dident="ROOM")
self.asked_join = False
return True

def NPC_offers(self, camp):
# Return list of dialogue offers.
mylist = list()
mylist.append(Offer("Centuries of technological development and nobody has found a better use for computers than turn based gaming. They have played us for fools...",
context=ContextTag([context.CUSTOM]), data={'reply': 'Say the line, please.'},
effect=None, no_repeats=True, dead_end=True))

return mylist


class WinterMochaHyolee(Plot):
LABEL = "MOCHA_HYOLEE"
active = True
Expand Down
64 changes: 56 additions & 8 deletions game/content/ghplots/shops_plus.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,30 @@ def custom_init(self, nart):
return True


# *********************
# *** RANDOM_SHOP ***
# *********************
#
# To spice up a random place, add a random shop.
# Elements:
# LOCALE
# Optional:
# CITY_COLORS
#

class RandomShop(Plot):
LABEL = "RANDOM_SHOP"

SHOP_TYPES = (
"SHOP_ARMORSTORE", "SHOP_WEAPONSTORE", "SHOP_MECHA",
"SHOP_BLACKMARKET", "SHOP_GENERALSTORE", "SHOP_TAVERN"
)

def custom_init(self, nart):
self.add_sub_plot(nart, random.choice(self.SHOP_TYPES))
return True


# *************************
# *** SHOP_ARMORSTORE ***
# *************************
Expand Down Expand Up @@ -186,14 +210,22 @@ def custom_init(self, nart):

intscenegen = pbge.randmaps.SceneGenerator(intscene, gharchitecture.CommercialBuilding())
self.register_scene(nart, intscene, intscenegen, ident="INTERIOR", dident="LOCALE")
foyer = self.register_element('FOYER', pbge.randmaps.rooms.ClosedRoom(random.randint(10,15), random.randint(10,15), anchor=pbge.randmaps.anchors.south),
foyer = self.register_element('FOYER', pbge.randmaps.rooms.ClosedRoom(
random.randint(10,15), random.randint(10,15), anchor=pbge.randmaps.anchors.south,
decorate=gharchitecture.ArmorShopDecor()
),
dident="INTERIOR")

mycon2 = plotutility.TownBuildingConnection(
nart, self, self.elements["LOCALE"], intscene, room1=building,
room2=foyer, door1=building.waypoints["DOOR"], move_door1=False)

npc1.place(intscene, team=team2)
mycounter = ghrooms.ShopCounterArea(random.randint(4, 6), random.randint(3, 5), anchor=pbge.randmaps.anchors.north)
foyer.contents.append(mycounter)
salesteam = self.register_element("SALES_TEAM", teams.Team(name="Sales Team", allies=[team2]))
mycounter.contents.append(salesteam)

npc1.place(intscene, team=salesteam)

self.shop = services.Shop(npc=npc1, ware_types=services.ARMOR_STORE, rank=self.rank + random.randint(0, 15),
shop_faction=self.elements.get("SHOP_FACTION"))
Expand Down Expand Up @@ -270,15 +302,21 @@ def custom_init(self, nart):

intscenegen = pbge.randmaps.SceneGenerator(intscene, gharchitecture.CommercialBuilding())
self.register_scene(nart, intscene, intscenegen, ident="INTERIOR", dident="LOCALE")
foyer = self.register_element('FOYER', pbge.randmaps.rooms.ClosedRoom(random.randint(10,15), random.randint(10,15), anchor=pbge.randmaps.anchors.south,
decorate=gharchitecture.CheeseShopDecor()),
dident="INTERIOR")
foyer = self.register_element('FOYER', pbge.randmaps.rooms.ClosedRoom(
random.randint(10,15), random.randint(10,15), anchor=pbge.randmaps.anchors.south,
decorate=gharchitecture.ArmoryDecor()
), dident="INTERIOR")

mycon2 = plotutility.TownBuildingConnection(
nart, self, self.elements["LOCALE"], intscene, room1=building,
room2=foyer, door1=building.waypoints["DOOR"], move_door1=False)

npc1.place(intscene, team=team2)
mycounter = ghrooms.ShopCounterArea(random.randint(4, 6), random.randint(3, 5), anchor=pbge.randmaps.anchors.north)
foyer.contents.append(mycounter)
salesteam = self.register_element("SALES_TEAM", teams.Team(name="Sales Team", allies=[team2]))
mycounter.contents.append(salesteam)

npc1.place(intscene, team=salesteam)

self.shop = services.Shop(npc=npc1, ware_types=services.BLACK_MARKET, rank=self.rank + 25,
shop_faction=self.elements.get("SHOP_FACTION"), buy_stolen_items=True)
Expand Down Expand Up @@ -569,7 +607,12 @@ def custom_init(self, nart):
nart, self, self.elements["LOCALE"], intscene, room1=building,
room2=foyer, door1=building.waypoints["DOOR"], move_door1=False)

npc1.place(intscene, team=team2)
mycounter = ghrooms.ShopCounterArea(random.randint(4, 6), random.randint(3, 5), anchor=pbge.randmaps.anchors.north)
foyer.contents.append(mycounter)
salesteam = self.register_element("SALES_TEAM", teams.Team(name="Sales Team", allies=[team2]))
mycounter.contents.append(salesteam)

npc1.place(intscene, team=salesteam)

self.shop = services.Shop(npc=npc1, ware_types=services.GENERAL_STORE, rank=self.rank + random.randint(0, 15),
shop_faction=self.elements.get("SHOP_FACTION"))
Expand Down Expand Up @@ -934,7 +977,12 @@ def custom_init(self, nart):
nart, self, self.elements["LOCALE"], intscene, room1=building,
room2=foyer, door1=building.waypoints["DOOR"], move_door1=False)

npc1.place(intscene, team=team2)
mycounter = ghrooms.ShopCounterArea(random.randint(4, 6), random.randint(3, 5), anchor=pbge.randmaps.anchors.north)
foyer.contents.append(mycounter)
salesteam = self.register_element("SALES_TEAM", teams.Team(name="Sales Team", allies=[team2]))
mycounter.contents.append(salesteam)

npc1.place(intscene, team=salesteam)

self.shop = services.Shop(npc=npc1, ware_types=services.WEAPON_STORE, rank=self.rank + random.randint(0, 15),
shop_faction=self.elements.get("SHOP_FACTION"))
Expand Down
Loading

0 comments on commit e14cbed

Please sign in to comment.