Skip to content

Commit

Permalink
Rewrote the stories for the Allied Armor bookcase
Browse files Browse the repository at this point in the history
  • Loading branch information
jwvhewitt committed Nov 29, 2024
1 parent 2998196 commit afef93b
Show file tree
Hide file tree
Showing 11 changed files with 127 additions and 27 deletions.
7 changes: 4 additions & 3 deletions data/stc_default.txt
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,12 @@ BeamWeapon
desig = "PHS-8"
name = "Phase Cannon"
reach = 8
damage = 2
accuracy = 2
damage = 3
accuracy = 3
penetration = 5
scale = MechaScale
shot_anim = SmallBeam
attributes = (Accurate)
attributes = (Accurate, LinkedFire)
attack_stat = Perception

BeamWeapon
Expand All @@ -190,4 +190,5 @@ BeamWeapon
penetration = 5
scale = MechaScale
shot_anim = GunBeam
attributes = (Accurate)
attack_stat = Perception
97 changes: 94 additions & 3 deletions design/Mecha_Equipment.txt
Original file line number Diff line number Diff line change
Expand Up @@ -170,21 +170,21 @@ Shield
faction_list = (None,)

Engine
desig = "MP-850 High Output"
desig = "MP-850C"
size = 850
material = Ceramic
shop_tags= ("MEXTRA",)
faction_list = (None,)

Engine
desig = "MP-1100 High Output"
desig = "MP-1100C"
size = 1100
material = Ceramic
shop_tags= ("MEXTRA",)
faction_list = (None,)

Engine
desig = "MP-1350 High Output"
desig = "MP-1350C"
size = 1350
material = Ceramic
shop_tags= ("MEXTRA",)
Expand Down Expand Up @@ -218,6 +218,97 @@ Engine
shop_tags= ("MEXTRA",)
faction_list = (None,)

HighOutputEngine
desig = "DRV-700"
size = 700
material = Metal
shop_tags= ("MEXTRA",)
faction_list = (None,)

HighOutputEngine
desig = "DRV-900"
size = 900
material = Metal
shop_tags= ("MEXTRA",)
faction_list = (None,)

HighOutputEngine
desig = "CI-1200"
size = 1200
material = Advanced
shop_tags= ("MEXTRA",)
faction_list = (None,)

HighOutputEngine
desig = "FPP-1600 Utility"
size = 1600
material = Metal
shop_tags= ("MEXTRA",)
faction_list = (None,)

HighOutputEngine
desig = "Pro Combat 800"
size = 800
material = Ceramic
shop_tags= ("MEXTRA",)
faction_list = (None,)
SUB
Armor
size = 2
END

HighPerformanceEngine
desig = "ZZGO-950"
size = 950
material = Advanced
shop_tags= ("MEXTRA",)
faction_list = (None,)

HighPerformanceEngine
desig = "ZZGO-1300"
size = 1300
material = Advanced
shop_tags= ("MEXTRA",)
faction_list = (None,)

HighPerformanceEngine
desig = "HMW-1750"
size = 1750
material = Ceramic
shop_tags= ("MEXTRA",)
faction_list = (None,)

HighPerformanceEngine
desig = "Fireball 1050"
size = 1050
material = Metal
shop_tags= ("MEXTRA",)
faction_list = (None,)

AdvancedGyroscope
desig = "G2"
material = Metal
shop_tags= ("MEXTRA",)
faction_list = (None,)

AdvancedGyroscope
desig = "G3"
material = Advanced
shop_tags= ("MEXTRA",)
faction_list = (None,)

DMCCockpit
desig = "JMJ-30"
material = Advanced
shop_tags= ("MEXTRA",)
faction_list = (None,)

ReflexCockpit
desig = "PR406"
material = Advanced
shop_tags= ("MEXTRA",)
faction_list = (None,)

EWSystem
desig = "Comet T92"
size = 2
Expand Down
4 changes: 2 additions & 2 deletions game/combat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@ def __setstate__(self, state):
self.__dict__.update(state)

def bonus_action_cost(self):
return max(self.extra_actions_taken * 5 + 10 - self.combatant.get_bonus_action_cost_mod(), 5)
return max(self.extra_actions_taken * 5 + self.combatant.scale.BONUS_ACTION_BASE_COST - self.combatant.get_bonus_action_cost_mod(), 5)

def can_buy_bonus_action(self):
return self.combatant.get_current_stamina() >= self.bonus_action_cost()
return isinstance(self.combatant, (gears.base.Character, gears.base.Mecha)) and self.combatant.get_current_stamina() >= self.bonus_action_cost()

def buy_bonus_action(self):
if self.can_buy_bonus_action():
Expand Down
5 changes: 5 additions & 0 deletions game/combat/aibrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,11 @@ def act(self, camp: gears.GearHeadCampaign):

self.minr, self.midr, self.maxr = self.get_min_mid_max_range()

# Maybe buy an extra action or two?
if camp.fight.cstat[self.npc].can_buy_bonus_action():
while random.randint(1,10) == 5 and (self.npc.get_current_stamina() - camp.fight.cstat[self.npc].bonus_action_cost()) > random.randint(10,20):
camp.fight.cstat[self.npc].buy_bonus_action()

# Attempt to use a skill first.
if camp.fight.cstat[self.npc].action_points > 0 and random.randint(1, 2) == 1:
self.try_to_use_a_skill(camp)
Expand Down
15 changes: 5 additions & 10 deletions game/content/ghplots/dd_homebase.py
Original file line number Diff line number Diff line change
Expand Up @@ -1244,29 +1244,24 @@ def STAIRSDOWN_menu(self, camp, thingmenu):
thingmenu.add_item("Read white book", self._use_bookshelf)

def _read_black_book(self, camp):
# First sentence by me, the rest of the story written by TalkToTransformer.
pbge.alert(
"""The black battlemech looked utterly invincible. It struck out a slash from its chest, the mercenary's chest pierced through. The mercenary found that the black battlemech's combat speed and its lethal reflexes were far surpassing that of the robot. At the same time, the mercenary could feel how quick the black battlemech was on its movements.\n \n Vayu punched back, swinging his spear, a wooden sword, even though the axe came in seconds. The black battlemech didn't even show any reaction at all.\n \n This opponent was very tough.""")
"""The black battlemech looked utterly invincible. It stood twenty three meters high, with five gauss cannons and a mighty sword the length of a cargo train. As it strode across the battlefield, mowing down all opposition with ease, one cavalier steeled her resolve and prepared to charge.\n\n Deftly evading multiple blasts from the gauss cannons, she came within range and plunged her plasma lance deep into the heart of the black mecha. For a moment there was only silence.\n\n Then the black mecha's powerplant blew up in a spectacular fusion explosion, taking out both armies in a gigantic fireball.""")

def _read_blue_book(self, camp):
# First sentence by me, the rest of the story written by TalkToTransformer.
pbge.alert(
"""All that stood between the space pirates and the treasure was a lone blue mecha. It seemed to be at the point of becoming an ordinary mecha.\n \n That was the one the pirates had called a new type of mecha, one that defeated enemy machines in a single blow. They were machines that changed shapes and could create weapons.\n \n These were ZEBES, what the space pirates had named this mecha.\n \n Thinking of ZEBES, Thomas muttered "All the metal on that one is metal. Looks like its ability is to take the energy".""")
"""All that stood between the space pirates and the treasure was a lone blue mecha. Hadron recognized the blue- this was an agent of L5Law, presumably the same agent who had been trailing them since the Mukluk Incident.\n\n "Follow my lead", he said to his teammates.\n\n As one the team turned and fled. The blue mecha gave chase. No doubt there would be more police waiting outside the derelict.\n\n When the pirates emerged into open space, they found themselves surrounded. "What do we do now?!" yelled Iolo. Hadron pushed the detonator for the bombs they had planted in the aft end of the wreck.\n\n In a flash, half of the L5Law patrol was vaporized and the derelict ship was moving on a course to the intercept point. The detective in the blue mecha could do nothing but look on in horror.\n\n "We fight or we die", said Hadron. "Same as always." """)

def _read_green_book(self, camp):
# First sentence by me, the rest of the story written by TalkToTransformer.
pbge.alert(
"""A green mecha rolled into the dead zone. He was an Angel wearing a cape. A great horned helmet with a great ornate skull appeared on his head. He raised his arms, each joint jutting out sharply.\n \n Sasha ripped through space at speeds faster than bullets, but could only manage to keep up with one of the machines, and even then he only managed a glimpse of his face. The Angel helmet had received damage, and was covered in more scars. It made him look scarier.\n \n "Now, this will be fun!" the Angel said.""")
"""A green mecha rolled into the small dead zone community of Trouser Falls. The pilot descended from the cockpit, spit on the ground, and walked into the nearest bar.\n\n "My name is Verdan Hooks and I'm the toughest, meanest bandit in the wastes!" he shouted. "If any of you wangtta have a problem with that, we can take it outside!"\n\n His body was never found. """)

def _read_purple_book(self, camp):
# First sentence by me, the rest of the story written by TalkToTransformer.
pbge.alert(
"""Carolyn stepped out from the cockpit of her purple mecha. "So he's not being as good as before?"\n \n "Er... well, not in the way you might think," said the mechanic, lowering his shoulder visor and turning his sunglasses to face her.\n \n "Then why is he still so confident?" asked Carolyn. "It doesn't make any sense."\n \n "His taste for politics is legendary," said the mechanic, indicating the facade that had kept Kiri's consciousness isolated and that had been the victim of Kimberly's advances.""")
"""Carolyn stepped out from the cockpit of her purple mecha. She brushed her mauve hair out of her eyes and called to her mechanic Violet, asking "Do you have any idea how long I've been marooned out there?!"\n\n "No, but I bet you're going to tell me", Violet responded. """)

def _read_red_book(self, camp):
# First sentence by me, the rest of the story written by TalkToTransformer.
pbge.alert(
"""The battle was going poorly for the defenders, when out of nowhere a red mecha appeared. In the hands of this mecha the industrial city was seemingly taken over by metal, lifting everything that was in the way of the construction project above the buildings. The clock tower and factory buildings were falling in on themselves.\n \n A smile spread on Jondal's face as he saw this. "By the Emperor's clock... this is a miracle of construction."\n \n Conde winced. "What's a miracle of construction? I was raised as an engineer, and our government has a contract that we need a certain percentage to receive." """)
"""The battle was going poorly for the defenders, when out of nowhere a red mecha appeared. Neither side knew the identity of this mystery pilot, and combat halted momentarily as intel officers on both sides consulted CavNet on their phones to try and identify the interloper's heraldry.\n\n The attacking commander made a rash move. Deciding that this red mecha must be working for the defenders, he ordered his troops to attack. As quickly as the attackers moved to intercept, they were cut down by the red mecha's nova scythe.\n\n After that things got a bit chaotic. Neither side knew who the red mecha was working for, nor where it was going. The attackers sent wave after wave to avenge their fallen commander. The defenders fired wildly, trying to maintain their battle lines. Soon the conflict descended into utter anarchy.\n\n And still the red mecha drew closer to its target. """)

def _use_bookshelf(self, camp):
pbge.alert("Moving the white book activates a hidden staircase!")
Expand Down
2 changes: 1 addition & 1 deletion game/exploration.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ def update_npcs(self):

def update_enchantments(self):
for thing in self.scene.contents:
if hasattr(thing, 'ench_list'):
if hasattr(thing, 'ench_list') and hasattr(thing, "is_operational") and thing.is_operational():
thing.ench_list.update(self.camp, thing)

def get_item(self):
Expand Down
12 changes: 6 additions & 6 deletions gears/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3518,9 +3518,9 @@ def check_multiplicity(self, part):

def is_legal_sub_com(self, part):
if isinstance(part, Engine):
if self.material is materials.Biotech and part.material is not materials.Biotech:
if self.material.repair_type == materials.RT_BIOTECHNOLOGY and part.material.repair_type != materials.RT_BIOTECHNOLOGY:
return False
elif part.material is materials.Biotech:
elif part.material.repair_type == materials.RT_BIOTECHNOLOGY:
return False

return self.form.is_legal_sub_com(part)
Expand Down Expand Up @@ -3993,10 +3993,10 @@ def __init__(self, form=MT_Battroid,
self.pilot = None

def _material_matches(self, part):
if self.material is materials.Biotech:
return part.material is materials.Biotech
if self.material.repair_type == materials.RT_BIOTECHNOLOGY:
return part.material.repair_type == materials.RT_BIOTECHNOLOGY
else:
return part.material is not materials.Biotech
return part.material.repair_type != materials.RT_BIOTECHNOLOGY

def is_legal_sub_com(self, part):
return self.form.is_legal_sub_com(part) and self._material_matches(part)
Expand Down Expand Up @@ -4313,7 +4313,7 @@ def get_bonus_action_cost_mod(self):
for part in self.ok_descendants(False):
if hasattr(part, "bonus_action_cost_mod"):
it += part.bonus_action_cost_mod
return it
return it + self.material.BONUS_ACTION_COST_MOD

def dole_experience(self, xp, xp_type=None):
pilot = self.get_pilot()
Expand Down
2 changes: 2 additions & 0 deletions gears/materials.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class Material( Singleton ):
cost_scale = 0
repair_type = RT_REPAIR
repair_cost = 1
BONUS_ACTION_COST_MOD = 0

class Metal( Material ):
desig = "M"
Expand Down Expand Up @@ -61,6 +62,7 @@ class Biotech( Material ):
cost_scale = 120
repair_type = RT_BIOTECHNOLOGY
repair_cost = 2
BONUS_ACTION_COST_MOD = 2

class DamageMat(Material):
# Only used for rolling damage. Do not use this for a gear. I'll only warn you once.
Expand Down
2 changes: 2 additions & 0 deletions gears/scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class MechaScale( object ):
MELEE_SKILL = stats.MechaFighting
XP_MULTIPLIER = 1
DEFAULT_DAMAGE_DIE = 4
BONUS_ACTION_BASE_COST = 10
@classmethod
def scale_mass( cls, mass, material ):
# Scale mass based on scale and material.
Expand Down Expand Up @@ -46,6 +47,7 @@ class HumanScale( MechaScale ):
MELEE_SKILL = stats.CloseCombat
XP_MULTIPLIER = 2
DEFAULT_DAMAGE_DIE = 6
BONUS_ACTION_BASE_COST = 5
@staticmethod
def get_mass_string( mass ):
return '{:.1f}kg'.format(mass / 10.0)
Expand Down
6 changes: 5 additions & 1 deletion history.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
* Characters can spend stamina to get extra actions
v0.975 November 29, 2024
* Updated the Allied Armor bookshelf
* Enchantments do not continue to update on dead/destroyed combatants
* Biotech mecha get a +2 action bonus
* Characters and mecha can spend stamina to get extra actions
* Added different cockpit control types
* Added High Output Engine, High Performance Engine
* Added Advanced Gyroscope; Gyroscopes are no longer Integral by default
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.974"
VERSION = "v0.975"

class TitleScreenRedraw(object):

Expand Down

0 comments on commit afef93b

Please sign in to comment.