Skip to content

Commit

Permalink
Professions can define starting cash and update Aftershock
Browse files Browse the repository at this point in the history
  • Loading branch information
QuillInkwell committed Jan 31, 2025
1 parent 2eaa72c commit b8e8915
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 11 deletions.
26 changes: 16 additions & 10 deletions data/mods/Aftershock/player/professions.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"name": "Deck Engineer",
"description": "A skilled ship technician, turned to independent salvage work.",
"points": 4,
"starting_cash": 1120000,
"CBMs": [ "bio_weight", "bn_bio_solar", "bio_power_storage_mkII", "bio_flashlight", "bio_tools", "bio_sunglasses" ],
"skills": [ { "level": 4, "name": "electronics" }, { "level": 2, "name": "launcher" } ],
"items": {
Expand All @@ -16,7 +17,6 @@
{ "item": "boots" },
{ "item": "afs_herc_rig" },
{ "item": "afs_foamgun", "ammo-item": "afs_foamcrete", "charges": 30 },
{ "item": "cash_card", "charges": 1120000 },
{ "item": "afs_foam_tank", "ammo-item": "afs_foamcrete", "charges": 30 }
]
},
Expand All @@ -30,6 +30,7 @@
"name": "Rating",
"description": "You were a junior crewmember on a freight spaceship. Without any exceptionally valuable abilities, you spent your workshifts performing miscellaneous maintenance tasks within the ship. As such, you are moderately skilled at performing all sorts of minor electrical and mechanical repairs, a skillset you hope remains useful planetside…",
"points": 0,
"starting_cash": 1120000,
"copy-from": "mechanic",
"flags": [ "SCEN_ONLY" ],
"skills": [ { "level": 3, "name": "electronics" }, { "level": 3, "name": "mechanics" } ],
Expand Down Expand Up @@ -57,6 +58,7 @@
"name": "Espatier",
"description": "You are a well experienced mercenary espatier, a soldier rated for both orbital and planetary combat. Until the crash, you were part of a minor mercenary outfit that provided on-board and landing-site security for freight corporations, although it seems that your last contractor required more protection than what you could provide. Unfortunately, most of your more specialized gear was left behind in your hasty evacuation…",
"points": 6,
"starting_cash": 1120000,
"flags": [ "SCEN_ONLY" ],
"copy-from": "specops",
"CBMs": [ "bio_targeting", "bio_purifier", "bio_geiger", "bio_adrenaline", "bio_ethanol", "bio_power_storage_mkII" ],
Expand Down Expand Up @@ -241,6 +243,7 @@
"name": "CBM Engineer",
"description": "You worked as a technician in a sterile, high-security facility concerned with the fabrication of bionic implants. The final evacuation order caught you in the middle of your 16 hour extended shift, and you barely managed to escape the building, tools in hand.",
"points": 2,
"starting_cash": 1120000,
"skills": [ { "level": 4, "name": "electronics" } ],
"items": {
"both": {
Expand All @@ -253,7 +256,6 @@
{ "item": "boots" },
{ "item": "backpack" },
{ "item": "jeans" },
{ "item": "cash_card", "charges": 1120000 },
{ "item": "mask_dust", "variant": "white_mask_dust" }
]
},
Expand All @@ -267,6 +269,7 @@
"name": "Wraitheon Executive",
"description": "The exiled scion of an unfavorable seat within the Wraitheon board of directors, wealthy beyond measure even in their estrangement. Sent to the frontier in a last-ditch effort to salvage their reputation, or more likely, to find a silent and politically convenient death.",
"points": 8,
"starting_cash": 200000000,
"CBMs": [ "bio_batteries", "bio_power_storage_mkII", "bio_eye_enhancer", "bio_int_enhancer", "bio_memory", "bio_cable" ],
"traits": [ "FLIMSY3", "SLOWHEALER3", "AFS_MENTAL_CAPABILITY_GENEMOD", "AFS_RECOVERY_CAPABILITY_GENEMOD" ],
"pets": [ { "name": "afs_mon_sentinel_lx", "amount": 2 } ],
Expand All @@ -280,8 +283,8 @@
{ "item": "gold_watch" },
{ "item": "undershirt" },
{ "item": "afs_10mm_smart_template" },
{ "item": "cash_card", "charges": 200000000 },
{ "item": "cash_card", "charges": 200000000 },
{ "item": "cash_card", "charges": 100000000 },
{ "item": "cash_card", "charges": 100000000 },
{
"item": "afs_silvergram_pistol",
"ammo-item": "afs_10mm_smart",
Expand All @@ -302,6 +305,7 @@
"name": "Corporate Infiltrator",
"description": "A spy and mercenary at the direct service of the Solar Corporations. Touring the frontier in search of intelligence gathering and sabotage contracts. Equipped with a set of irreplaceable holographic technology that borders on the miraculous.",
"points": 8,
"starting_cash": 2600000,
"skills": [
{ "level": 4, "name": "gun" },
{ "level": 4, "name": "pistol" },
Expand Down Expand Up @@ -333,7 +337,6 @@
{ "item": "afs_holo_flare_caster" },
{ "item": "afs_holo_cloak_mk2" },
{ "item": "kukri", "container-item": "sheath" },
{ "item": "cash_card", "charges": 2600000 },
{ "item": "afs_cam_spy", "ammo-item": "light_minus_disposable_cell", "charges": 500 },
{ "item": "radiocontrol", "ammo-item": "light_battery_cell", "charges": 1000 },
{ "item": "afs_eidolon_derringer", "ammo-item": "afs_5x50heavy", "charges": 4, "container-item": "holster" },
Expand All @@ -348,6 +351,7 @@
"name": "Assistant Sub-Executive",
"description": "Through a lifetime of hard work, dedication, boot-licking and immense luck, you achieved the almost impossible, and were promoted from an indentured clerk to a minor managerial position. Although you were still an expendable peon among the ranks of the corporation, you earned numbers most people could only dream of, and you savored it.",
"points": 2,
"starting_cash": 200000000,
"items": {
"both": {
"entries": [
Expand All @@ -357,7 +361,6 @@
{ "item": "gold_watch" },
{ "item": "undershirt" },
{ "item": "gasdiscount_platinum" },
{ "item": "cash_card", "charges": 200000000 },
{ "group": "charged_smart_phone" }
]
},
Expand Down Expand Up @@ -482,6 +485,7 @@
"name": "Roboticist",
"description": "Scavenging and reselling abandoned robotics is what you call your \"job.\" It certainly isn't official in any means of the word, but it rakes in the dough and that is all that matters to you, even if it involves dangerous activities, be it cracking old Wraitheon security cyphers or crossing well-worn wires on ancient mining drones.",
"points": 4,
"starting_cash": 1120000,
"skills": [
{ "level": 2, "name": "gun" },
{ "level": 2, "name": "rifle" },
Expand All @@ -499,7 +503,6 @@
{ "item": "wristwatch" },
{ "item": "bot_manhack", "count": 2 },
{ "group": "charged_smart_phone" },
{ "item": "cash_card", "charges": 1120000 },
{ "item": "afs_cartridge", "ammo-item": "battery", "charges": 1500 },
{
"item": "afs_cartridge",
Expand All @@ -519,6 +522,7 @@
"name": "Academy Technologist",
"description": "A senior technologist from the Planetary Academy of Khorat, sent to Salus IV to oversee the procurement of valuable technological artifacts. Although generously equipped, you are neither a fighter nor a good fit for life in the frontier. You'd feel far more comfortable and capable commanding this salvage operation from the faraway safety of your office.",
"points": 4,
"starting_cash": 1120000,
"traits": [ "PACIFIST", "AFS_LEADERSHIP" ],
"skills": [
{ "level": 1, "name": "gun" },
Expand All @@ -537,7 +541,6 @@
{ "item": "dress_shoes" },
{ "item": "dress_shirt" },
{ "item": "wristwatch" },
{ "item": "cash_card", "charges": 1120000 },
{
"item": "afs_voltaic_cartridge",
"ammo-item": "battery",
Expand All @@ -558,6 +561,7 @@
"name": "Salvor",
"description": "A scavenger by necessity, born and raised in between ruins and slums. Some might be lured to your profession by romantic notions of wealth, adventure or scientific discovery. You know better.",
"points": 4,
"starting_cash": 1120000,
"skills": [
{ "level": 1, "name": "dodge" },
{ "level": 1, "name": "gun" },
Expand All @@ -573,7 +577,6 @@
{ "item": "socks" },
{ "item": "boots_combat" },
{ "item": "wristwatch" },
{ "item": "cash_card", "charges": 1120000 },
{ "group": "charged_smart_phone" }
]
},
Expand All @@ -587,6 +590,7 @@
"name": "Rocket Jumper",
"description": "A skilled airborne scout and salvager equipped with a rocket pack, eking out a living on the edge of legality.",
"points": 4,
"starting_cash": 1120000,
"skills": [
{ "level": 3, "name": "dodge" },
{ "level": 2, "name": "gun" },
Expand All @@ -612,7 +616,6 @@
{ "item": "ammonia_liquid" },
{ "item": "afs_cartridge", "ammo-item": "battery", "charges": 1500 },
{ "item": "afs_cartridge", "ammo-item": "battery", "charges": 1500, "container-item": "afs_v29" },
{ "item": "cash_card", "charges": 1120000 },
{
"item": "afs_40g_plasma_civ",
"ammo-item": "afs_shydrogen",
Expand All @@ -639,6 +642,7 @@
"name": "Whisper",
"description": "You are a telepath, able to sense minds and influence thoughts. You aren't entirely sure how you got your powers, but you seem to have an instinctive sense of how to use them. That's not sinister at all, right?",
"points": 7,
"starting_cash": 1120000,
"traits": [ "AFS_TELEPATH" ],
"flags": [ "SCEN_ONLY" ],
"skills": [ { "level": 4, "name": "metaphysics" } ],
Expand Down Expand Up @@ -675,6 +679,7 @@
"name": "Spark",
"description": "You are an electrokinetic, able to control electricity with your mind. You aren't entirely sure how you got your powers, but you seem to have an instinctive sense of how to use them. That's not sinister at all, right?",
"points": 7,
"starting_cash": 1120000,
"traits": [ "AFS_ELECTROKINETIC" ],
"flags": [ "SCEN_ONLY" ],
"skills": [ { "level": 4, "name": "metaphysics" } ],
Expand Down Expand Up @@ -711,6 +716,7 @@
"name": "Geist",
"description": "You are a telekinetic, able to move objects without touching them. You aren't entirely sure how you got your powers, but you seem to have an instinctive sense of how to use them. That's not sinister at all, right?",
"points": 7,
"starting_cash": 1120000,
"traits": [ "AFS_TELEKINETIC" ],
"flags": [ "SCEN_ONLY" ],
"skills": [ { "level": 4, "name": "metaphysics" } ],
Expand Down
16 changes: 15 additions & 1 deletion src/newcharacter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,12 @@ void Character::initialize( bool learn_recipes )
set_skills_from_hobbies();

// setup staring bank money
cash = rng( -200000, 200000 );
if( prof->starting_cash() == -1 ) {
cash = rng( -200000, 200000 );
} else {
cash = prof->starting_cash();
}

randomize_heartrate();

//set stored kcal to a normal amount for your height
Expand Down Expand Up @@ -2393,6 +2398,15 @@ static std::string assemble_profession_details( const avatar &u, const input_con
assembled += mission_type::get( mission_id )->tname() + "\n";
}
}

// Profession money
auto cash = sorted_profs[cur_id]->starting_cash();

if( !( cash == -1 ) ) {
assembled += "\n" + colorize( _( "Profession money:" ), COL_HEADER ) + "\n";
assembled += format_money( cash ) + "\n";
}

return assembled;
}

Expand Down
6 changes: 6 additions & 0 deletions src/profession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ void profession::load( const JsonObject &jo, const std::string_view )
Trait_group_BG_survival_story_UNIVERSAL );
optional( jo, was_loaded, "age_lower", age_lower, 16 );
optional( jo, was_loaded, "age_upper", age_upper, 55 );
optional( jo, was_loaded, "starting_cash", _starting_cash, -1 );

if( jo.has_string( "vehicle" ) ) {
_starting_vehicle = vproto_id( jo.get_string( "vehicle" ) );
Expand Down Expand Up @@ -520,6 +521,11 @@ signed int profession::point_cost() const
return _point_cost;
}

int profession::starting_cash() const
{
return _starting_cash;
}

static void clear_faults( item &it )
{
if( it.get_var( "dirt", 0 ) > 0 ) {
Expand Down
2 changes: 2 additions & 0 deletions src/profession.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class profession
translation _description_male;
translation _description_female;
signed int _point_cost = 0;
signed int _starting_cash = -1;

// TODO: In professions.json, replace lists of itypes (legacy) with item groups
itypedecvec legacy_starting_items;
Expand Down Expand Up @@ -117,6 +118,7 @@ class profession
std::string gender_appropriate_name( bool male ) const;
std::string description( bool male ) const;
signed int point_cost() const;
signed int starting_cash() const;
std::list<item> items( bool male, const std::vector<trait_id> &traits ) const;
std::vector<addiction> addictions() const;
vproto_id vehicle() const;
Expand Down

0 comments on commit b8e8915

Please sign in to comment.