Skip to content

Commit

Permalink
Isolation Protocol: Geas knight starting class (CleverRaven#76320)
Browse files Browse the repository at this point in the history
* Geas Infrastructure

* Geas Knight

* Apply suggestions from code review

Co-authored-by: Standing-Storm <[email protected]>

---------

Co-authored-by: Standing-Storm <[email protected]>
  • Loading branch information
John-Candlebury and Standing-Storm authored Sep 10, 2024
1 parent 98be1d4 commit dd272dd
Show file tree
Hide file tree
Showing 11 changed files with 258 additions and 1 deletion.
12 changes: 12 additions & 0 deletions data/mods/Isolation-Protocol/Player/Perks/enchantments.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,17 @@
"description": "OH you aren't getting away with that.",
"condition": { "u_has_effect": "iso_eff_hypo_o" },
"values": [ { "value": "MELEE_DAMAGE", "multiply": 0.5 }, { "value": "RANGED_DAMAGE", "multiply": 0.5 } ]
},
{
"type": "enchantment",
"id": "iso_ench_geas_buff",
"name": { "str": "Ancient vow" },
"description": "Lightless monste! I give you oblivion!\n\n Deal 15% more damage and regen 100% more stamine per turn when fighting high danger enemies.",
"condition": { "u_has_effect": "iso_eff_geas_buff" },
"values": [
{ "value": "RANGED_DAMAGE", "multiply": 0.15 },
{ "value": "MELEE_DAMAGE", "multiply": 0.15 },
{ "value": "STAMINA_REGEN_MOD", "add": 1 }
]
}
]
8 changes: 8 additions & 0 deletions data/mods/Isolation-Protocol/Player/Perks/perk_effect.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,13 @@
"name": [ "Rapid Healing" ],
"max_duration": "6 s",
"base_mods": { "hurt_amount": [ -10 ] }
},
{
"type": "effect_type",
"id": "iso_eff_geas_buff",
"rating": "good",
"int_dur_factor": "1 s",
"max_duration": "6 s",
"show_in_info": false
}
]
49 changes: 49 additions & 0 deletions data/mods/Isolation-Protocol/Player/Perks/perk_eoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,54 @@
"required_event": "character_takes_damage",
"condition": { "u_has_trait": "iso_hypo_o" },
"effect": [ { "u_add_effect": "iso_eff_hypo_o", "duration": "2 seconds" } ]
},
{
"type": "effect_on_condition",
"id": "EOC_ISO_GEAS",
"eoc_type": "EVENT",
"required_event": "avatar_moves",
"condition": { "u_has_trait": "iso_geas" },
"effect": [
{ "u_location_variable": { "u_val": "avatar_new_pos" }, "min_radius": 0, "max_radius": 0 },
{
"u_run_monster_eocs": [
{
"id": "_EOC_ISO_GEAS",
"condition": { "math": [ "u_val('difficulty')", ">=", "30" ] },
"effect": [ { "run_eoc_with": "geas_monster", "beta_talker": "avatar" } ]
}
],
"monster_range": 65,
"monster_must_see": true
},
{ "u_location_variable": { "u_val": "avatar_old_pos" }, "min_radius": 0, "max_radius": 0 }
]
},
{
"type": "effect_on_condition",
"id": "geas_monster",
"effect": [
{ "math": [ "u_new_distance", "=", "distance('u', 'npc')" ] },
{ "u_location_variable": { "u_val": "monster_pos" }, "min_radius": 0, "max_radius": 0 },
{
"if": {
"and": [
{ "math": [ "has_var(u_old_distance)" ] },
{ "math": [ "u_new_distance", ">", "u_old_distance" ] },
{ "npc_can_see_location": { "u_val": "monster_pos" } }
]
},
"then": [
{ "npc_teleport": { "npc_val": "avatar_old_pos" } },
{ "npc_message": "You cannot flee from the abomination." },
{ "npc_add_effect": "iso_eff_geas_buff", "duration": "10 seconds" }
],
"else": [
{ "u_message": "Oh ho! Then come as close as you like." },
{ "npc_add_effect": "iso_eff_geas_buff", "duration": "10 seconds" }
]
},
{ "math": [ "u_old_distance", "=", "distance('u', 'npc')" ] }
]
}
]
11 changes: 11 additions & 0 deletions data/mods/Isolation-Protocol/Player/Perks/perks.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,16 @@
"category": [ "iso_start_perk" ],
"purifiable": false,
"valid": false
},
{
"type": "mutation",
"id": "iso_geas",
"name": { "str": "Ancient Vow" },
"points": 0,
"description": "A lifetime ago you swore to protect your vanished homeland. This oath binds you still.\n\nYou cannot flee from high danger enemies but gain increased damage and stamina regeneration when fighting them.",
"category": [ "iso_start_perk" ],
"enchantments": [ "iso_ench_geas_buff" ],
"purifiable": false,
"valid": false
}
]
40 changes: 40 additions & 0 deletions data/mods/Isolation-Protocol/Player/profession.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,5 +132,45 @@
"male": { "entries": [ { "item": "boxer_shorts" } ] },
"female": { "entries": [ { "item": "bra" }, { "item": "panties" } ] }
}
},
{
"type": "item_group",
"subtype": "collection",
"id": "quiver_geas_knight",
"entries": [ { "item": "iso_bolt_blackwood_bodkin", "charges": 16 } ]
},
{
"type": "profession",
"id": "iso_geas_knight",
"name": "Geas Knight",
"description": "A warrior from a destroyed land, still bound by ancient oaths sworn to mountains and stars.",
"points": 6,
"skills": [
{ "level": 3, "name": "melee" },
{ "level": 3, "name": "bashing" },
{ "level": 3, "name": "cutting" },
{ "level": 3, "name": "stabbing" },
{ "level": 2, "name": "gun" },
{ "level": 2, "name": "rifle" },
{ "level": 3, "name": "dodge" }
],
"traits": [ "iso_trait" ],
"items": {
"both": {
"entries": [
{ "item": "iso_old_cloak" },
{ "item": "iso_old_armor" },
{ "item": "iso_crossbow_sling" },
{ "item": "socks_wool" },
{ "item": "boots" },
{ "item": "iso_old_sword" },
{ "item": "iso_repeating_crossbow", "ammo-item": "iso_bolt_blackwood_bodkin", "charges": 4 },
{ "item": "quiver", "contents-group": "quiver_geas_knight" },
{ "item": "baldric" },
{ "item": "loincloth" }
]
},
"female": { "entries": [ { "item": "undershirt" } ] }
}
}
]
2 changes: 1 addition & 1 deletion data/mods/Isolation-Protocol/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"points": 0,
"description": "Room by room and level by level the facility drills into depths beyond the logical. An endless mode where the only goal is to reach the lowest level possible.",
"allowed_locs": [ "iso_entry_setpiece" ],
"professions": [ "iso_deliveryboy", "iso_cop", "iso_paramedic", "iso_hacker" ],
"professions": [ "iso_deliveryboy", "iso_cop", "iso_paramedic", "iso_hacker", "iso_geas_knight" ],
"flags": [ "LONE_START" ],
"start_name": "Facility Lobby",
"forbidden_traits": [ "ROBUST", "XS", "XXXL", "CHAOTIC_BAD", "QUICK", "NOMAD", "WAYFARER", "NYCTOPHOBIA" ],
Expand Down
127 changes: 127 additions & 0 deletions data/mods/Isolation-Protocol/unique_items.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
[
{
"id": "iso_repeating_crossbow",
"looks_like": "crossbow",
"type": "GUN",
"symbol": "(",
"color": "light_gray",
"name": { "str": "repeating crossbow" },
"reload_noise_volume": 4,
"description": "A crossbow fit with an automatic spanning mechanism that allows for the rapid firing of up to 4 bolts.\n\nIn an age long past, these weapons where issued to expeditions sent to contain a cursing plague in the northen reaches.",
"price": "890 USD",
"price_postapoc": "80 USD",
"material": [ "wood", "bone", "steel" ],
"flags": [ "PRIMITIVE_RANGED_WEAPON", "FRAGILE_MELEE", "RELOAD_ONE", "NEVER_JAMS", "NO_UNLOAD", "NO_TURRET", "NON_FOULING" ],
"modes": [ [ "DEFAULT", "standard", 1 ], [ "AUTO", "repeat fire", 2 ] ],
"skill": "rifle",
"min_strength": 6,
"ammo": [ "bolt" ],
"weight": "4500 g",
"volume": "1750 ml",
"longest_side": "86 cm",
"to_hit": 1,
"ranged_damage": { "damage_type": "stab", "amount": 4 },
"range": 16,
"loudness": 8,
"dispersion": 350,
"sight_dispersion": 90,
"durability": 6,
"clip_size": 4,
"reload": 1500,
"valid_mod_locations": [ [ "sling", 1 ] ],
"pocket_data": [ { "pocket_type": "MAGAZINE", "ammo_restriction": { "bolt": 4 } } ],
"melee_damage": { "bash": 5 }
},
{
"id": "iso_crossbow_sling",
"type": "ARMOR",
"name": { "str": "crossbow sling" },
"description": "A complex sling designed to carry a repeating crossbow while keeping it ready for use. The sling is designed to be worn across the torso and can be quickly adjusted to bring the crossbow to bear.",
"weight": "320 g",
"volume": "500 ml",
"price": "80 USD",
"price_postapoc": "5 USD",
"material": [ "leather" ],
"symbol": "[",
"looks_like": "slingpack",
"color": "green",
"material_thickness": 1,
"flags": [ "OVERSIZE", "BELTED" ],
"pocket_data": [
{
"pocket_type": "CONTAINER",
"holster": true,
"min_item_volume": "500 ml",
"max_contains_volume": "7 L",
"max_contains_weight": "5 kg",
"max_item_length": "200 cm",
"moves": 50,
"flag_restriction": [ "PRIMITIVE_RANGED_WEAPON" ]
}
],
"use_action": { "type": "holster" },
"armor": [ { "encumbrance": [ 3, 7 ], "coverage": 5, "covers": [ "torso" ], "specifically_covers": [ "torso_hanging_back" ] } ]
},
{
"type": "AMMO",
"id": "iso_bolt_blackwood_bodkin",
"name": { "str": "blackwood bolt" },
"symbol": "=",
"color": "light_gray",
"description": "A bodkin bolt expertly carved from blessed blackwood. Traces of its former power still linger.",
"copy-from": "bolt_wood_bodkin",
"relative": { "dispersion": -40 },
"damage": { "damage_type": "stab", "constant_damage_multiplier": 1.75 },
"range": 4,
"recovery_chance": 100
},
{
"id": "iso_old_cloak",
"type": "ARMOR",
"copy-from": "cape_sci_fi",
"name": { "str": "tattered cloak" },
"description": "The cloak of an imperial envoy, depicting a star chart in gold thread. Its terribly worn and frayed.",
"material": [ "wool" ]
},
{
"id": "iso_old_sword",
"type": "TOOL",
"copy-from": "mc_longsword",
"name": { "str": "ancient sword" },
"description": "A longsword worn down by countless battles. It was once finely engraved.",
"flags": [ "UNBREAKABLE_MELEE", "CONDUCTIVE", "SHEATH_SWORD" ]
},
{
"id": "iso_old_armor",
"type": "TOOL_ARMOR",
"copy-from": "armor_lc_plate",
"name": { "str": "envoy's armor" },
"description": "A suit of armor worn down by an endless journey. Only its sturdiest parts remain now.",
"material": [ "qt_steel", "qt_steel_chain", "leather", "wool" ],
"armor": [
{
"material": [
{ "type": "qt_steel", "covered_by_mat": 95, "thickness": 0.55 },
{ "type": "wool", "covered_by_mat": 100, "thickness": 2.8 },
{ "type": "leather", "covered_by_mat": 5, "thickness": 1.5 }
],
"covers": [ "leg_l", "leg_r", "arm_l", "arm_r" ],
"layers": [ "NORMAL", "OUTER" ],
"coverage": 100,
"encumbrance": 2
},
{
"material": [
{ "type": "qt_steel", "covered_by_mat": 95, "thickness": 2.8 },
{ "type": "wool", "covered_by_mat": 100, "thickness": 2.8 },
{ "type": "leather", "covered_by_mat": 5, "thickness": 1.5 }
],
"covers": [ "torso" ],
"coverage": 100,
"cover_vitals": 60,
"layers": [ "NORMAL", "OUTER" ],
"encumbrance": 10
}
]
}
]
1 change: 1 addition & 0 deletions src/condition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2150,6 +2150,7 @@ std::unordered_map<std::string_view, int ( talker::* )() const> const f_get_vals
{ "anger", &talker::get_anger },
{ "bmi_permil", &talker::get_bmi_permil },
{ "cash", &talker::cash },
{ "difficulty", &talker::get_difficulty },
{ "dexterity_base", &talker::get_dex_max },
{ "dexterity_bonus", &talker::get_dex_bonus },
{ "dexterity", &talker::dex_cur },
Expand Down
3 changes: 3 additions & 0 deletions src/talker.h
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,9 @@ class talker
virtual int get_friendly() const {
return 0;
}
virtual int get_difficulty() const {
return 0;
}
virtual void set_friendly( int ) {}
virtual void add_morale( const morale_type &, int, int, time_duration, time_duration, bool ) {}
virtual void remove_morale( const morale_type & ) {}
Expand Down
5 changes: 5 additions & 0 deletions src/talker_monster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ int talker_monster_const::get_friendly() const
return me_mon_const->friendly;
}

int talker_monster_const::get_difficulty() const
{
return me_mon_const->type->difficulty;
}

int talker_monster_const::get_size() const
{
add_msg_debug( debugmode::DF_TALKER, "Size category of monster %s = %d", me_mon_const->name(),
Expand Down
1 change: 1 addition & 0 deletions src/talker_monster.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class talker_monster_const: public talker_cloner<talker_monster_const>

std::string short_description() const override;
int get_anger() const override;
int get_difficulty() const override;
int morale_cur() const override;
int get_friendly() const override;
int get_size() const override;
Expand Down

0 comments on commit dd272dd

Please sign in to comment.