Skip to content

Commit

Permalink
Merge pull request #34135 from Hymore246/rebalance-ninjutsu
Browse files Browse the repository at this point in the history
Martial Arts Rebalance for Ninjutsu
  • Loading branch information
Rivet-the-Zombie authored Sep 22, 2019
2 parents 168d578 + 5480d5f commit fb08b0b
Show file tree
Hide file tree
Showing 6 changed files with 194 additions and 49 deletions.
175 changes: 140 additions & 35 deletions data/json/martialarts.json
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,146 @@
],
"techniques": [ "tec_muay_thai_elbow", "tec_muay_thai_kick", "tec_muay_thai_knee", "tec_muay_thai_break" ]
},
{
"type": "martial_art",
"id": "style_ninjutsu",
"name": "Ninjutsu",
"description": "Ninjutsu is a martial art and set of tactics used by ninja in feudal Japan. It focuses on rapid, precise, silent strikes. Ninjutsu is almost entirely silent and does extra damage if on the first attack. It also provides small combat bonuses every time you move.",
"initiate": [ "You perform a kuji-in mantra with your hands. Rin, Kai, Jin!", "%s performs a series of intricate hand signs." ],
"learn_difficulty": 6,
"arm_block": 3,
"static_buffs": [
{
"id": "buff_ninjutsu_static1",
"name": "Ninjutsu Stance",
"description": "Your training allows you to make no noise when attacking and less noise when moving around.\n\nMelee and unarmed attacks generate 0 noise. Moving generates 1/2 as much noise.",
"min_unarmed": 0,
"unarmed_allowed": true,
"melee_allowed": true,
"quiet": true,
"stealthy": true
},
{
"id": "buff_ninjutsu_static2",
"name": "Sneak Attack",
"description": "To a true shinobi, the first strike and the last strike are one in the same.\n\n+50%% all damage.",
"min_unarmed": 0,
"unarmed_allowed": true,
"melee_allowed": true,
"mult_bonuses": [ [ "damage", "bash", 1.5 ], [ "damage", "cut", 1.5 ], [ "damage", "stab", 1.5 ] ]
}
],
"onattack_buffs": [
{
"id": "buff_ninjutsu_onattack",
"name": "Loss of Surprise",
"description": "You intentions are known! It will take you a few moments to sneak attack again.\n\n-50%% all damage.\nLast 3 turns.",
"min_unarmed": 0,
"unarmed_allowed": true,
"melee_allowed": true,
"buff_duration": 3,
"mult_bonuses": [ [ "damage", "bash", 0.5 ], [ "damage", "cut", 0.5 ], [ "damage", "stab", 0.5 ] ]
}
],
"onmove_buffs": [
{
"id": "buff_ninjutsu_onmove",
"name": "Momentum Shift",
"description": "Ninjas are training to be extremely agile and mobile.\n\n+1.0 Dodge skill, Accuracy increased by 20%% of Dexterity.\nLast 1 turn.",
"min_unarmed": 2,
"unarmed_allowed": true,
"melee_allowed": true,
"buff_duration": 1,
"flat_bonuses": [ [ "dodge", 1.0 ], [ "hit", "dex", 0.2 ] ]
}
],
"onkill_buffs": [
{
"id": "buff_ninjutsu_onkill",
"name": "Escape Plan",
"description": "Your target has perished. It is time to leave and plan your next attack.\n\n+2 Dodge attempts, +10 movement speed.\nLast 3 turns.",
"min_melee": 3,
"unarmed_allowed": true,
"melee_allowed": true,
"buff_duration": 3,
"bonus_dodges": 2,
"flat_bonuses": [ [ "speed", 10 ] ]
}
],
"techniques": [ "tec_ninjutsu_swift", "tec_ninjutsu_takedown", "tec_ninjutsu_precise" ],
"weapons": [
"arming_sword",
"arming_sword_inferior",
"arming_sword_fake",
"bio_blade_weapon",
"bio_claws_weapon",
"bokken",
"bokken_inferior",
"bokken_fake",
"broadsword",
"broadsword_inferior",
"broadsword_fake",
"broadfire_off",
"broadfire_on",
"cavalry_sabre",
"cavalry_sabre_fake",
"copper_knife",
"cutlass_fake",
"cutlass_inferior",
"cutlass",
"dao",
"diveknife",
"firekatana_off",
"firekatana_on",
"i_staff",
"jian",
"jian_inferior",
"jian_fake",
"katana",
"katana_inferior",
"katana_fake",
"kirpan",
"knife_combat",
"knife_hunting",
"knife_rambo",
"knife_rm42",
"knife_trench",
"kirpan_cheap",
"kris",
"kukri",
"khopesh",
"longsword",
"longsword_inferior",
"longsword_fake",
"l-stick",
"l-stick_on",
"machete",
"makeshift_knife",
"nodachi",
"nodachi_inferior",
"nodachi_fake",
"q_staff",
"scimitar",
"scimitar_fake",
"scimitar_inferior",
"shishkebab_off",
"shishkebab_on",
"shock_staff",
"sickle",
"switchblade",
"sword_bayonet",
"sword_crude",
"sword_nail",
"sword_wood",
"sword_xiphos",
"tanto",
"tanto_inferior",
"tanto_fake",
"wakizashi",
"wakizashi_inferior",
"wakizashi_fake"
]
},
{
"type": "martial_art",
"id": "style_tai_chi",
Expand All @@ -811,41 +951,6 @@
],
"techniques": [ "tec_taichi_disarm", "tec_taichi_precise" ]
},
{
"type": "martial_art",
"id": "style_ninjutsu",
"name": "Ninjutsu",
"description": "Ninjutsu is a martial art and set of tactics used by ninja in feudal Japan. It focuses on rapid, precise, silent strikes. Ninjutsu is almost entirely silent. It also provides small combat bonuses every time you move.",
"initiate": [ "You perform a kuji-in mantra with your hands. Rin, Kai, Jin!", "%s performs a series of ninja hand signs." ],
"learn_difficulty": 6,
"arm_block": 3,
"leg_block": 99,
"allow_melee": true,
"static_buffs": [
{
"id": "ninjutsu_static",
"name": "Ninjutsu",
"unarmed_allowed": true,
"melee_allowed": true,
"quiet": true,
"description": "Silent melee attacks."
}
],
"onmove_buffs": [
{
"id": "ninjutsu_momentum",
"name": "Momentum shift",
"description": "Bonus dodges and increased to-hit",
"unarmed_allowed": true,
"melee_allowed": true,
"buff_duration": 2,
"max_stacks": 1,
"bonus_dodges": 1,
"flat_bonuses": [ [ "hit", "dex", 0.17 ] ]
}
],
"techniques": [ "tec_ninjutsu_precise" ]
},
{
"type": "martial_art",
"id": "style_pankration",
Expand Down
47 changes: 34 additions & 13 deletions data/json/techniques.json
Original file line number Diff line number Diff line change
Expand Up @@ -1072,6 +1072,40 @@
"defensive": true,
"grab_break": true
},
{
"type": "technique",
"id": "tec_ninjutsu_swift",
"name": "Swift Strike",
"messages": [ "You swiftly strike %s", "<npcname> swiftly strikes %s" ],
"min_melee": 2,
"unarmed_allowed": true,
"melee_allowed": true,
"mult_bonuses": [ [ "movecost", 0.8 ] ]
},
{
"type": "technique",
"id": "tec_ninjutsu_precise",
"name": "Assassinate",
"messages": [ "You attempt to slay %s in a single stroke", "<npcname> attempts to slay %s in a single stroke" ],
"min_melee": 5,
"unarmed_allowed": true,
"melee_allowed": true,
"crit_tec": true,
"stun_dur": 1,
"mult_bonuses": [ [ "damage", "bash", 1.5 ], [ "damage", "cut", 1.5 ], [ "damage", "stab", 1.5 ] ]
},
{
"type": "technique",
"id": "tec_ninjutsu_takedown",
"name": "Ninjutsu Takedown",
"messages": [ "You quickly grab and bring %s to the ground", "<npcname> quickly grabs and brings attacks %s to the ground" ],
"min_unarmed": 5,
"unarmed_allowed": true,
"crit_tec": true,
"down_dur": 2,
"stun_dur": 2,
"mult_bonuses": [ [ "damage", "bash", 2.0 ] ]
},
{
"type": "technique",
"id": "tec_pankration_kick",
Expand Down Expand Up @@ -1161,19 +1195,6 @@
"stun_dur": 2,
"messages": [ "You strike %s", "<npcname> strikes %s" ]
},
{
"type": "technique",
"id": "tec_ninjutsu_precise",
"name": "surprise attack",
"min_unarmed": 3,
"min_melee": 3,
"unarmed_allowed": true,
"melee_allowed": true,
"crit_tec": true,
"messages": [ "You surprise attack %s", "<npcname> surprise attacks %s" ],
"stun_dur": 2,
"mult_bonuses": [ [ "damage", "bash", 1.4 ], [ "damage", "cut", 2 ] ]
},
{
"type": "technique",
"id": "tec_taekwondo_precise",
Expand Down
2 changes: 1 addition & 1 deletion src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9078,7 +9078,7 @@ bool game::walk_move( const tripoint &dest_loc )
}
}
if( !u.has_artifact_with( AEP_STEALTH ) && !u.has_trait( trait_id( "DEBUG_SILENT" ) ) ) {
int volume = 6;
int volume = u.is_stealthy() ? 3 : 6;
volume *= u.mutation_value( "noise_modifier" );
if( volume > 0 ) {
if( u.is_wearing( "rm13_armor_on" ) ) {
Expand Down
15 changes: 15 additions & 0 deletions src/martialarts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ void ma_buff::load( JsonObject &jo, const std::string &src )

optional( jo, was_loaded, "quiet", quiet, false );
optional( jo, was_loaded, "throw_immune", throw_immune, false );
optional( jo, was_loaded, "stealthy", stealthy, false );

reqs.load( jo, src );
bonuses.load( jo );
Expand Down Expand Up @@ -599,6 +600,10 @@ bool ma_buff::is_quiet() const
{
return quiet;
}
bool ma_buff::is_stealthy() const
{
return stealthy;
}

bool ma_buff::can_melee() const
{
Expand Down Expand Up @@ -649,6 +654,10 @@ std::string ma_buff::get_description( bool passive ) const
dump << _( "* Attacks will be completely <info>silent</info>" ) << std::endl;
}

if( stealthy ) {
dump << _( "* Movement will make <info>less noise</info>" ) << std::endl;
}

return dump.str();
}

Expand Down Expand Up @@ -1084,6 +1093,12 @@ bool player::is_quiet() const
return b.is_quiet();
} );
}
bool player::is_stealthy() const
{
return search_ma_buff_effect( *effects, []( const ma_buff & b, const effect & ) {
return b.is_stealthy();
} );
}

bool player::can_melee() const
{
Expand Down
2 changes: 2 additions & 0 deletions src/martialarts.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ class ma_buff
bool is_throw_immune() const;
bool is_quiet() const;
bool can_melee() const;
bool is_stealthy() const;

// The ID of the effect that is used to store this buff
efftype_id get_effect_id() const;
Expand Down Expand Up @@ -189,6 +190,7 @@ class ma_buff
bool throw_immune; // are we immune to throws/grabs?
bool strictly_unarmed; // can we use unarmed weapons?
bool strictly_melee; // can we use it without weapons?
bool stealthy; // do we make less noise when moving?

void load( JsonObject &jo, const std::string &src );
};
Expand Down
2 changes: 2 additions & 0 deletions src/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,8 @@ class player : public Character
float stability_roll() const override;
/** Returns true if the player has quiet melee attacks */
bool is_quiet() const;
/** Returns true if the player has stealthy movement */
bool is_stealthy() const;
/** Returns true if the current martial art works with the player's current weapon */
bool can_melee() const;
/** Always returns false, since players can't dig currently */
Expand Down

0 comments on commit fb08b0b

Please sign in to comment.