diff --git a/data/json/martialarts.json b/data/json/martialarts.json index 36d08bde69ebf..4dfe4385e60b6 100644 --- a/data/json/martialarts.json +++ b/data/json/martialarts.json @@ -221,6 +221,37 @@ ], "techniques": [ "tec_crane_feint", "tec_crane_break", "tec_crane_counter", "tec_crane_precise" ] }, + { + "type": "martial_art", + "id": "style_dragon", + "name": "Dragon Kung Fu", + "description": "One of the five Shaolin animal styles. The Dragon uses fluid movements and hard strikes. Intelligence improves your accuracy instead of Dexterity. Your attacks lead to counterattacks which disable your opponents and set them up for a powerful finishing move.", + "initiate": [ "You relax and patiently await conflict like the great dragon.", "%s assumes a dragon-like stance." ], + "learn_difficulty": 10, + "arm_block": 2, + "static_buffs": [ + { + "id": "buff_dragon_static", + "name": "Dragon's Knowledge", + "description": "You plan your attack far in advance relying on your intution instead of your speed to strike true. Intelligence increases Accuracy instead of Dexterity.\n\nAccuracy increased by 25%% of Intelligence but decreased by 25%% of Dexterity.", + "min_unarmed": 0, + "unarmed_allowed": true, + "flat_bonuses": [ [ "hit", "int", 0.25 ], [ "hit", "dex", -0.25 ] ] + } + ], + "onhit_buffs": [ + { + "id": "buff_dragon_onhit", + "name": "Dragon's Flight", + "description": "Life and combat are a circle. An attack leads to a counter and to an attack once again. Seek to complete this loop.\n\n+1 Accuracy, +2 bash Damage.\nEnables \"Dragon Vortex Block\" and \"Dragon Wing Dodge\"\nLasts 1 turn.", + "unarmed_allowed": true, + "min_unarmed": 1, + "buff_duration": 1, + "flat_bonuses": [ [ "hit", 1.0 ], [ "damage", "bash", 2 ] ] + } + ], + "techniques": [ "tec_dragon_claw", "tec_dragon_blockcounter", "tec_dragon_dodgecounter", "tec_dragon_tail", "tec_dragon_strike" ] + }, { "type": "martial_art", "id": "style_karate", @@ -799,37 +830,6 @@ "l-stick_on" ] }, - { - "type": "martial_art", - "id": "style_dragon", - "name": "Dragon Kung Fu", - "description": "One of the five Shaolin animal styles. The Dragon uses fluid movements and hard strikes. Intelligence improves your accuracy and damage dealt, as does moving.", - "initiate": [ "You relax and patiently await conflict like the great dragon.", "%s assumes a dragon-like stance." ], - "learn_difficulty": 10, - "arm_block": 2, - "leg_block": 99, - "static_buffs": [ - { - "id": "dragon_static", - "name": "Dragon Style", - "description": "Bonus damage from intelligence.", - "unarmed_allowed": true, - "flat_bonuses": [ [ "damage", "bash", "int", 0.8 ] ] - } - ], - "onmove_buffs": [ - { - "id": "dragon_move_buff", - "name": "Dragon's Flight", - "description": "+2 Accuracy & Damage", - "unarmed_allowed": true, - "min_unarmed": 2, - "buff_duration": 2, - "flat_bonuses": [ [ "hit", 2.0 ], [ "damage", "bash", 2 ] ] - } - ], - "techniques": [ "tec_dragon_grab", "tec_dragon_counterb", "tec_dragon_counterd", "tec_dragon_sweep", "tec_dragon_brutal" ] - }, { "type": "martial_art", "id": "style_leopard", diff --git a/data/json/techniques.json b/data/json/techniques.json index 3cf5c4bbfe216..7694850fc2f4a 100644 --- a/data/json/techniques.json +++ b/data/json/techniques.json @@ -521,6 +521,63 @@ "stun_dur": 2, "mult_bonuses": [ [ "damage", "bash", 1.25 ] ] }, + { + "type": "technique", + "id": "tec_dragon_claw", + "name": "Dragon Claw", + "min_unarmed": 1, + "unarmed_allowed": true, + "mult_bonuses": [ [ "damage", "bash", 1.2 ] ], + "messages": [ "You lash out at %s with a Dragon Claw", " lashes out at %s with a Dragon Claw" ] + }, + { + "type": "technique", + "id": "tec_dragon_blockcounter", + "name": "Dragon Vortex Block", + "messages": [ "You block the attack and send %s spinning", " blocks and spins %s" ], + "min_unarmed": 2, + "unarmed_allowed": true, + "req_buffs": [ "buff_dragon_onhit" ], + "block_counter": true, + "down_dur": 1, + "mult_bonuses": [ [ "movecost", 0.0 ], [ "damage", "bash", 0.5 ], [ "damage", "cut", 0.5 ], [ "damage", "stab", 0.5 ] ] + }, + { + "type": "technique", + "id": "tec_dragon_dodgecounter", + "name": "Dragon Wing Dodge", + "messages": [ "You dodge the attack and leave %s off balance", " dodges and leaves %s off balance" ], + "min_unarmed": 3, + "unarmed_allowed": true, + "req_buffs": [ "buff_dragon_onhit" ], + "dodge_counter": true, + "stun_dur": 1, + "mult_bonuses": [ [ "movecost", 0.0 ], [ "damage", "bash", 0.5 ], [ "damage", "cut", 0.5 ], [ "damage", "stab", 0.5 ] ] + }, + { + "type": "technique", + "id": "tec_dragon_tail", + "name": "Dragon Tail", + "messages": [ "You sweep %s with a quick Dragon Tail", " sweeps %s with a quick Dragon Tail sweep" ], + "min_unarmed": 4, + "unarmed_allowed": true, + "crit_tec": true, + "stunned_target": true, + "down_dur": 2, + "mult_bonuses": [ [ "damage", "bash", 1.5 ] ] + }, + { + "type": "technique", + "id": "tec_dragon_strike", + "name": "Dragon Strike", + "messages": [ "You descend upon %s with a powerful Dragon Strike", " descends upon %s with a powerful Dragon Strike" ], + "min_unarmed": 5, + "unarmed_allowed": true, + "crit_tec": true, + "downed_target": true, + "stun_dur": 1, + "mult_bonuses": [ [ "damage", "bash", 2.0 ] ] + }, { "type": "technique", "id": "tec_karate_rapid", @@ -981,60 +1038,6 @@ "mult_bonuses": [ [ "movecost", 0.0 ], [ "damage", "bash", 1.5 ] ], "messages": [ "You dodge the attack and swipe at %s's exposed flank", " dodges and catches %s exposed" ] }, - { - "type": "technique", - "id": "tec_dragon_grab", - "name": "Dragon Snatch", - "min_unarmed": 4, - "unarmed_allowed": true, - "stun_dur": 2, - "mult_bonuses": [ [ "damage", "bash", 1.2 ] ], - "messages": [ "You grab and knee %s", " grabs and knees %s" ] - }, - { - "type": "technique", - "id": "tec_dragon_counterb", - "name": "Dragon's Vortex Block", - "min_unarmed": 4, - "unarmed_allowed": true, - "block_counter": true, - "crit_ok": true, - "mult_bonuses": [ [ "movecost", 0.0 ] ], - "stun_dur": 2, - "messages": [ "You block the attack and send %s spinning", " blocks and spins %s" ] - }, - { - "type": "technique", - "id": "tec_dragon_counterd", - "name": "Dragon's Vortex Dodge", - "min_unarmed": 4, - "unarmed_allowed": true, - "dodge_counter": true, - "crit_ok": true, - "mult_bonuses": [ [ "movecost", 0.0 ] ], - "stun_dur": 2, - "messages": [ "You dodge the attack and send %s spinning", " dodges and spins %s" ] - }, - { - "type": "technique", - "id": "tec_dragon_sweep", - "name": "Dragon Sweeper", - "min_unarmed": 5, - "unarmed_allowed": true, - "down_dur": 2, - "messages": [ "You low-roundhouse %s 's legs", " low-roundhouses %s 's legs" ] - }, - { - "type": "technique", - "id": "tec_dragon_brutal", - "name": "Dragon Strike", - "min_unarmed": 6, - "unarmed_allowed": true, - "crit_tec": true, - "stun_dur": 1, - "knockback_dist": 1, - "messages": [ "You send %s reeling with a Dragon Strike", " sends %s reeling with a Dragon Strike" ] - }, { "type": "technique", "id": "tec_snake_rapid", diff --git a/doc/MARTIALART_JSON.md b/doc/MARTIALART_JSON.md index 1920e5a122936..1ea018d07b799 100644 --- a/doc/MARTIALART_JSON.md +++ b/doc/MARTIALART_JSON.md @@ -45,6 +45,8 @@ "req_buffs": [ "eskrima_hit_buff" ], // This technique requires a named buff to be active "crit_tec" : true, // This technique only works on a critical hit "crit_ok" : true, // This technique works on both normal and critical hits +"downed_target": true, // Technique only works on a downed target +"stunned_target": true, // Technique only works on a stunned target "knockback_dist": 1, // Distance target is knocked back "knockback_spread": 1, // The knockback may not send the target straight back "knockback_follow": 1, // Attacker will follow target if they are knocked back diff --git a/src/martialarts.cpp b/src/martialarts.cpp index 5054439903229..8347db89c7476 100644 --- a/src/martialarts.cpp +++ b/src/martialarts.cpp @@ -106,6 +106,9 @@ void ma_technique::load( JsonObject &jo, const std::string &src ) optional( jo, was_loaded, "crit_tec", crit_tec, false ); optional( jo, was_loaded, "crit_ok", crit_ok, false ); + optional( jo, was_loaded, "downed_target", downed_target, false ); + optional( jo, was_loaded, "stunned_target", stunned_target, false ); + optional( jo, was_loaded, "defensive", defensive, false ); optional( jo, was_loaded, "disarms", disarms, false ); optional( jo, was_loaded, "dummy", dummy, false ); @@ -488,6 +491,10 @@ ma_technique::ma_technique() dodge_counter = false; // like tec_grab block_counter = false; // like tec_counter + // conditional + downed_target = false; // only works on downed enemies + stunned_target = false; // only works on stunned enemies + miss_recovery = false; // allows free recovery from misses, like tec_feint grab_break = false; // allows grab_breaks, like tec_break } @@ -1124,6 +1131,14 @@ std::string ma_technique::get_description() const dump << _( "* Will only activate on a crit" ) << std::endl; } + if( downed_target ) { + dump << _( "* Only works on a downed target" ) << std::endl; + } + + if( stunned_target ) { + dump << _( "* Only works on a stunned target" ) << std::endl; + } + if( dodge_counter ) { dump << _( "* Will counterattack when you dodge" ) << std::endl; } diff --git a/src/martialarts.h b/src/martialarts.h index b32298cc1e38a..5663e7f79c508 100644 --- a/src/martialarts.h +++ b/src/martialarts.h @@ -105,6 +105,10 @@ class ma_technique int weighting; //how often this technique is used + // conditional + bool downed_target; // only works on downed enemies + bool stunned_target; // only works on stunned enemies + /** All kinds of bonuses by types to damage, hit etc. */ bonus_container bonuses; diff --git a/src/melee.cpp b/src/melee.cpp index e2574e2741ec4..ab608cbfd622f 100644 --- a/src/melee.cpp +++ b/src/melee.cpp @@ -1012,6 +1012,7 @@ matec_id player::pick_technique( Creature &t, const item &weap, std::vector possible; bool downed = t.has_effect( effect_downed ); + bool stunned = t.has_effect( effect_stunned ); // first add non-aoe tecs for( auto &tec_id : all ) { @@ -1048,6 +1049,16 @@ matec_id player::pick_technique( Creature &t, const item &weap, continue; } + // don't apply "downed only" techniques to someone who's not downed + if( !downed && tec.downed_target ) { + continue; + } + + // don't apply "stunned only" techniques to someone who's not stunned + if( !stunned && tec.stunned_target ) { + continue; + } + // don't apply disarming techniques to someone without a weapon // TODO: these are the stat requirements for tec_disarm // dice( dex_cur + get_skill_level("unarmed"), 8) >