diff --git a/data/json/martialarts.json b/data/json/martialarts.json index b2076d244ea85..420ca75723fc8 100644 --- a/data/json/martialarts.json +++ b/data/json/martialarts.json @@ -929,6 +929,90 @@ "wakizashi_fake" ] }, + { + "type": "martial_art", + "id": "style_niten", + "name": "Niten Ichi-Ryu", + "description": "Niten Ichi-Ryu is an ancient school of combat, transmitting a style of classical Japanese swordsmanship conceived by the warrior Miyamoto Musashi. Perception increases damage and reduces blocked damage. Moving and attacking reduces dodging and damage until you pause. Pausing for a moment increases Dodge skill.", + "initiate": [ "You clear your mind as you prepare yourself for combat.", "%s relaxes and prepares for combat." ], + "learn_difficulty": 8, + "primary_skill": "cutting", + "strictly_melee": true, + "static_buffs": [ + { + "id": "buff_niten_static", + "name": "Niten Ichi-Ryu Stance", + "description": "Cautious watchful eyes\nmeasure and display your skill.\nPractice makes perfect.\n\nBash and Cut damage increased by 50%% of Perception, blocked damage reduced by 100%% of Perception.", + "min_melee": 0, + "melee_allowed": true, + "flat_bonuses": [ [ "arpen", "cut", "per", 0.5 ], [ "arpen", "bash", "per", 0.5 ], [ "block", "per", 1.0 ] ] + } + ], + "onmove_buffs": [ + { + "id": "buff_niten_onmove", + "name": "Waning Moon", + "description": "Blackened like darkness,\nnightmares approach from all sides.\nFlee at any cost!\n\n-5.0 Dodge skill.\nLasts 1 turn.", + "min_melee": 0, + "melee_allowed": true, + "buff_duration": 1, + "flat_bonuses": [ [ "dodge", -5.0 ] ] + } + ], + "onattack_buffs": [ + { + "id": "buff_niten_onattack", + "name": "Falling Leaf", + "description": "A sharp sword cuts true.\nAlthough, all things fade with time.\nRestraint hones your skills.\n\n-1.0 Dodge skill, -1 bash damage, -1 cut damage.\nLasts 1 turn. Stacks 5 times.", + "min_melee": 0, + "melee_allowed": true, + "buff_duration": 1, + "max_stacks": 5, + "flat_bonuses": [ [ "dodge", -1.0 ], [ "damage", "cut", -1.0 ], [ "damage", "bash", -1.0 ] ] + } + ], + "ondodge_buffs": [ + { + "id": "buff_niten_ondodge", + "name": "Moonlight", + "description": "Luck be the light,\non a dark and cloudy night\nas the moon shines down\n\nEnables \"In-One Timing\".\nLasts 1 turn.", + "min_melee": 5, + "melee_allowed": true, + "buff_duration": 1 + } + ], + "onpause_buffs": [ + { + "id": "buff_niten_onpause", + "name": "Stillness", + "description": "The eye of the storm,\na fleeting moment of peace,\ngone without a trace.\n\n+2 Accuracy, Dodge skill increased by 50%% of Perception.\nLasts 2 turns.", + "min_melee": 0, + "melee_allowed": true, + "buff_duration": 2, + "flat_bonuses": [ [ "hit", 2.0 ], [ "dodge", "per", 0.5 ] ] + } + ], + "techniques": [ "niten_water_cut", "niten_red_leaf", "niten_stone_cut", "niten_timing_attack", "niten_feint" ], + "weapons": [ + "bokken", + "bokken_inferior", + "bokken_fake", + "firekatana_off", + "firekatana_on", + "katana", + "katana_inferior", + "katana_fake", + "nodachi", + "nodachi_inferior", + "nodachi_fake", + "sword_nail", + "sword_crude", + "sword_wood", + "wakizashi", + "wakizashi_inferior", + "wakizashi_fake" + ] + }, { "type": "martial_art", "id": "style_tai_chi", @@ -1159,80 +1243,6 @@ "l-stick_on" ] }, - { - "type": "martial_art", - "id": "style_niten", - "name": "Niten Ichi-Ryu", - "description": "Niten Ichi-Ryu is an ancient school of combat, transmitting a style of classical Japanese swordsmanship conceived by the warrior Miyamoto Musashi.", - "initiate": [ "You clear your mind as you prepare yourself for combat.", "%s relaxes and prepares for combat." ], - "learn_difficulty": 8, - "primary_skill": "cutting", - "arm_block": 99, - "leg_block": 99, - "strictly_melee": true, - "static_buffs": [ - { - "id": "niten_stationary_buff", - "name": "Niten Ichi-Ryu", - "description": "Perception increases dodging and damage.", - "min_melee": 2, - "flat_bonuses": [ [ "damage", "cut", "per", 0.5 ], [ "damage", "bash", "per", 0.5 ], [ "dodge", "per", 0.5 ] ] - } - ], - "onmove_buffs": [ - { - "id": "niten_move_buff", - "name": "Blocking", - "description": "You forgo dodging on the move, but gain more blocks.", - "min_melee": 2, - "max_stacks": 1, - "buff_duration": 2, - "flat_bonuses": [ [ "dodge", -10.0 ] ], - "bonus_dodges": -1, - "bonus_blocks": 2 - } - ], - "onhit_buffs": [ - { - "id": "niten_hit_buff", - "name": "Blocking", - "description": "You forgo dodging on the offensive, but gain more blocks.", - "min_melee": 2, - "max_stacks": 1, - "buff_duration": 2, - "flat_bonuses": [ [ "dodge", -10.0 ] ], - "bonus_dodges": -1, - "bonus_blocks": 2 - } - ], - "ondodge_buffs": [ - { - "id": "niten_set-up", - "name": "In-One Timing Set-Up", - "description": "You found a gap in the enemy's defense!", - "min_melee": 4, - "buff_duration": 2, - "max_stacks": 1 - } - ], - "techniques": [ "niten_water_cut", "niten_red_leaf", "niten_stone_cut", "niten_timing_attack", "niten_feint" ], - "weapons": [ - "katana", - "katana_inferior", - "katana_fake", - "firekatana_off", - "firekatana_on", - "bokken", - "bokken_inferior", - "bokken_fake", - "wakizashi", - "wakizashi_inferior", - "wakizashi_fake", - "nodachi", - "nodachi_inferior", - "nodachi_fake" - ] - }, { "type": "martial_art", "id": "style_tiger", diff --git a/data/json/techniques.json b/data/json/techniques.json index 478725b37bf77..2a8efae7b6d11 100644 --- a/data/json/techniques.json +++ b/data/json/techniques.json @@ -1115,6 +1115,58 @@ "stun_dur": 2, "mult_bonuses": [ [ "damage", "bash", 2.0 ] ] }, + { + "type": "technique", + "id": "niten_water_cut", + "name": "Flowing Water Cut", + "messages": [ "You strike %s with the slow power of flowing water", " strikes %s with the slow power of flowing water" ], + "min_melee": 4, + "melee_allowed": true, + "mult_bonuses": [ [ "movecost", 1.75 ], [ "damage", "bash", 2.0 ], [ "damage", "cut", 2.0 ] ] + }, + { + "type": "technique", + "id": "niten_red_leaf", + "name": "Red Leaf's Cut", + "messages": [ "Your strike knocks %s off balance", "'s strike knocks %s off balance" ], + "min_melee": 3, + "melee_allowed": true, + "down_dur": 1 + }, + { + "type": "technique", + "id": "niten_stone_cut", + "name": "Fire and Stone's Cut", + "messages": [ "You stun %s with the force of your cut", " stuns %s with the force of their cut" ], + "min_melee": 5, + "melee_allowed": true, + "crit_tec": true, + "stun_dur": 1, + "mult_bonuses": [ [ "damage", "bash", 1.5 ], [ "damage", "cut", 1.5 ] ] + }, + { + "type": "technique", + "id": "niten_timing_attack", + "name": "In-One Timing", + "messages": [ "You strike at %s's weaknesses", " strikes %s's weaknesses" ], + "min_melee": 5, + "melee_allowed": true, + "req_buffs": [ "buff_niten_ondodge" ], + "crit_ok": true, + "stun_dur": 1, + "mult_bonuses": [ [ "movecost", 0.5 ], [ "damage", "bash", 1.5 ], [ "damage", "cut", 1.5 ] ] + }, + { + "type": "technique", + "id": "niten_feint", + "name": "Feint", + "messages": [ "You feint at %s", " feints at %s" ], + "min_melee": 2, + "melee_allowed": true, + "defensive": true, + "miss_recovery": true, + "mult_bonuses": [ [ "movecost", 0.8 ] ] + }, { "type": "technique", "id": "tec_pankration_kick", @@ -1344,58 +1396,6 @@ "messages": [ "You strike out at %s", " strikes out at %s" ], "stun_dur": 2 }, - { - "type": "technique", - "id": "niten_water_cut", - "name": "Flowing Water Cut", - "min_melee": 4, - "melee_allowed": true, - "mult_bonuses": [ [ "movecost", 1.75 ], [ "damage", "bash", 2.0 ], [ "damage", "cut", 2.0 ] ], - "messages": [ "You strike %s with the slow power of flowing water", " strikes %s with the slow power of flowing water" ] - }, - { - "type": "technique", - "id": "niten_red_leaf", - "name": "Red Leaf's Cut", - "min_melee": 5, - "melee_allowed": true, - "down_dur": 2, - "messages": [ "Your strike knocks %s off balance", "'s strike knocks %s off balance" ] - }, - { - "type": "technique", - "id": "niten_stone_cut", - "name": "Fire and Stone's Cut", - "min_melee": 6, - "melee_allowed": true, - "crit_tec": true, - "mult_bonuses": [ [ "damage", "bash", 1.5 ], [ "damage", "cut", 1.5 ] ], - "messages": [ "You stun %s with the force of the blow", " stuns %s with the force of the blow" ], - "stun_dur": 2 - }, - { - "type": "technique", - "id": "niten_timing_attack", - "name": "In-One Timing", - "min_melee": 5, - "melee_allowed": true, - "req_buffs": [ "niten_set-up" ], - "messages": [ "You strike at %s's weaknesses", " strikes %s's weaknesses" ], - "//": "Damage bonus plus Quick is severely powerful--generi-Quick takes a damage nerf.", - "mult_bonuses": [ [ "movecost", 0.5 ], [ "damage", "bash", 1.5 ], [ "damage", "cut", 1.5 ] ], - "stun_dur": 2 - }, - { - "type": "technique", - "id": "niten_feint", - "name": "feint at", - "min_melee": 2, - "melee_allowed": true, - "defensive": true, - "miss_recovery": true, - "mult_bonuses": [ [ "movecost", 0.8 ] ], - "messages": [ "You feint at %s", " feints at %s" ] - }, { "type": "technique", "id": "tec_debug_slow", diff --git a/src/martialarts.cpp b/src/martialarts.cpp index 997abeb3a42ed..fd4baf414ab28 100644 --- a/src/martialarts.cpp +++ b/src/martialarts.cpp @@ -227,6 +227,7 @@ void martialart::load( JsonObject &jo, const std::string & ) optional( jo, was_loaded, "static_buffs", static_buffs, ma_buff_reader{} ); optional( jo, was_loaded, "onmove_buffs", onmove_buffs, ma_buff_reader{} ); + optional( jo, was_loaded, "onpause_buffs", onpause_buffs, ma_buff_reader{} ); optional( jo, was_loaded, "onhit_buffs", onhit_buffs, ma_buff_reader{} ); optional( jo, was_loaded, "onattack_buffs", onattack_buffs, ma_buff_reader{} ); optional( jo, was_loaded, "ondodge_buffs", ondodge_buffs, ma_buff_reader{} ); @@ -693,6 +694,11 @@ void martialart::apply_onmove_buffs( player &u ) const simultaneous_add( u, onmove_buffs ); } +void martialart::apply_onpause_buffs( player &u ) const +{ + simultaneous_add( u, onpause_buffs ); +} + void martialart::apply_onhit_buffs( player &u ) const { simultaneous_add( u, onhit_buffs ); @@ -943,6 +949,10 @@ void player::ma_onmove_effects() { style_selected.obj().apply_onmove_buffs( *this ); } +void player::ma_onpause_effects() +{ + style_selected.obj().apply_onpause_buffs( *this ); +} void player::ma_onhit_effects() { style_selected.obj().apply_onhit_buffs( *this ); @@ -1332,6 +1342,7 @@ bool ma_style_callback::key( const input_context &ctxt, const input_event &event buff_desc( _( "Passive" ), ma.static_buffs, true ); buff_desc( _( "Move" ), ma.onmove_buffs ); + buff_desc( _( "Pause" ), ma.onpause_buffs ); buff_desc( _( "Hit" ), ma.onhit_buffs ); buff_desc( _( "Miss" ), ma.onmiss_buffs ); buff_desc( _( "Attack" ), ma.onattack_buffs ); diff --git a/src/martialarts.h b/src/martialarts.h index 2f92d11941359..16999c9beaa39 100644 --- a/src/martialarts.h +++ b/src/martialarts.h @@ -207,6 +207,8 @@ class martialart void apply_onmove_buffs( player &u ) const; + void apply_onpause_buffs( player &u ) const; + void apply_onhit_buffs( player &u ) const; void apply_onattack_buffs( player &u ) const; @@ -254,6 +256,7 @@ class martialart bool force_unarmed; // Don't use ANY weapon - punch or kick if needed std::vector static_buffs; // all buffs triggered by each condition std::vector onmove_buffs; + std::vector onpause_buffs; std::vector onhit_buffs; std::vector onattack_buffs; std::vector ondodge_buffs; diff --git a/src/player.cpp b/src/player.cpp index 45de9532e8bae..d180d4c836907 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -2410,6 +2410,9 @@ void player::pause() } } + // on-pause effects for martial arts + ma_onpause_effects(); + if( is_npc() ) { // The stuff below doesn't apply to NPCs // search_surroundings should eventually do, though diff --git a/src/player.h b/src/player.h index e9dbd8ec68b07..b5b94d3936f4e 100644 --- a/src/player.h +++ b/src/player.h @@ -461,6 +461,8 @@ class player : public Character void ma_static_effects(); /** Fires all move-triggered martial arts events */ void ma_onmove_effects(); + /** Fires all pause-triggered martial arts events */ + void ma_onpause_effects(); /** Fires all hit-triggered martial arts events */ void ma_onhit_effects(); /** Fires all attack-triggered martial arts events */