diff --git a/data/json/martialarts_fictional.json b/data/json/martialarts_fictional.json index c999c8b9c630c..c93b35fbaea4a 100644 --- a/data/json/martialarts_fictional.json +++ b/data/json/martialarts_fictional.json @@ -300,8 +300,7 @@ "melee_allowed": true, "unarmed_allowed": true, "block_counter": true, - "crit_ok": true, - "mult_bonuses": [ { "stat": "movecost", "scale": 0.0 } ] + "crit_ok": true }, { "type": "technique", @@ -416,7 +415,7 @@ "weighting": 2, "knockback_dist": 1, "knockback_spread": 1, - "mult_bonuses": [ { "stat": "movecost", "scale": 0.0 }, { "stat": "damage", "type": "bash", "scale": 2.0 } ] + "mult_bonuses": [ { "stat": "damage", "type": "bash", "scale": 2.0 } ] }, { "type": "technique", @@ -426,8 +425,7 @@ "skill_requirements": [ { "name": "unarmed", "level": 5 } ], "unarmed_allowed": true, "dodge_counter": true, - "crit_ok": true, - "mult_bonuses": [ { "stat": "movecost", "scale": 0.0 } ] + "crit_ok": true }, { "type": "technique", @@ -529,7 +527,7 @@ "unarmed_allowed": true, "block_counter": true, "down_dur": 1, - "mult_bonuses": [ { "stat": "movecost", "scale": 0.0 }, { "stat": "damage", "type": "bash", "scale": 1.25 } ] + "mult_bonuses": [ { "stat": "damage", "type": "bash", "scale": 1.25 } ] }, { "type": "technique", @@ -541,7 +539,7 @@ "block_counter": true, "crit_tec": true, "down_dur": 1, - "mult_bonuses": [ { "stat": "movecost", "scale": 0.0 }, { "stat": "damage", "type": "bash", "scale": 2.0 } ] + "mult_bonuses": [ { "stat": "damage", "type": "bash", "scale": 2.0 } ] }, { "type": "technique", diff --git a/data/json/techniques.json b/data/json/techniques.json index 16bf659cd20ab..dfbf7066e830a 100644 --- a/data/json/techniques.json +++ b/data/json/techniques.json @@ -164,7 +164,6 @@ "melee_allowed": true, "block_counter": true, "crit_ok": true, - "mult_bonuses": [ { "stat": "movecost", "scale": 0.0 } ], "messages": [ "You counter-attack %s", " counter-attacks %s" ] }, { @@ -207,8 +206,7 @@ "crit_ok": true, "disarms": true, "down_dur": 1, - "knockback_dist": 1, - "mult_bonuses": [ { "stat": "movecost", "scale": 0.0 } ] + "knockback_dist": 1 }, { "type": "technique", @@ -221,8 +219,7 @@ "block_counter": true, "crit_ok": true, "down_dur": 1, - "knockback_dist": 1, - "mult_bonuses": [ { "stat": "movecost", "scale": 0.0 } ] + "knockback_dist": 1 }, { "type": "technique", @@ -236,8 +233,7 @@ "dodge_counter": true, "crit_ok": true, "down_dur": 1, - "knockback_dist": 1, - "mult_bonuses": [ { "stat": "movecost", "scale": 0.0 } ] + "knockback_dist": 1 }, { "type": "technique", @@ -252,8 +248,7 @@ "crit_ok": true, "disarms": true, "down_dur": 1, - "knockback_dist": 1, - "mult_bonuses": [ { "stat": "movecost", "scale": 0.0 } ] + "knockback_dist": 1 }, { "type": "technique", @@ -291,7 +286,7 @@ "knockback_spread": 1, "stun_dur": 1, "down_dur": 1, - "mult_bonuses": [ { "stat": "movecost", "scale": 0.0 }, { "stat": "damage", "type": "bash", "scale": 1.25 } ] + "mult_bonuses": [ { "stat": "damage", "type": "bash", "scale": 1.25 } ] }, { "type": "technique", @@ -346,8 +341,7 @@ "skill_requirements": [ { "name": "melee", "level": 5 } ], "melee_allowed": true, "block_counter": true, - "crit_ok": true, - "mult_bonuses": [ { "stat": "movecost", "scale": 0.0 } ] + "crit_ok": true }, { "type": "technique", @@ -357,8 +351,7 @@ "skill_requirements": [ { "name": "unarmed", "level": 5 } ], "unarmed_allowed": true, "block_counter": true, - "crit_ok": true, - "mult_bonuses": [ { "stat": "movecost", "scale": 0.0 } ] + "crit_ok": true }, { "type": "technique", @@ -501,8 +494,7 @@ "skill_requirements": [ { "name": "unarmed", "level": 2 } ], "unarmed_allowed": true, "dodge_counter": true, - "down_dur": 1, - "mult_bonuses": [ { "stat": "movecost", "scale": 0.0 } ] + "down_dur": 1 }, { "type": "technique", @@ -537,7 +529,6 @@ "block_counter": true, "down_dur": 1, "mult_bonuses": [ - { "stat": "movecost", "scale": 0.0 }, { "stat": "damage", "type": "bash", "scale": 0.5 }, { "stat": "damage", "type": "cut", "scale": 0.5 }, { "stat": "damage", "type": "stab", "scale": 0.5 } @@ -554,7 +545,6 @@ "dodge_counter": true, "stun_dur": 1, "mult_bonuses": [ - { "stat": "movecost", "scale": 0.0 }, { "stat": "damage", "type": "bash", "scale": 0.5 }, { "stat": "damage", "type": "cut", "scale": 0.5 }, { "stat": "damage", "type": "stab", "scale": 0.5 } @@ -700,7 +690,6 @@ "crit_ok": true, "stun_dur": 1, "mult_bonuses": [ - { "stat": "movecost", "scale": 0.0 }, { "stat": "damage", "type": "bash", "scale": 1.2 }, { "stat": "damage", "type": "cut", "scale": 1.2 }, { "stat": "damage", "type": "stab", "scale": 1.2 } @@ -853,8 +842,7 @@ "melee_allowed": true, "unarmed_weapons_allowed": false, "dodge_counter": true, - "down_dur": 1, - "mult_bonuses": [ { "stat": "movecost", "scale": 0.0 } ] + "down_dur": 1 }, { "type": "technique", @@ -864,8 +852,7 @@ "skill_requirements": [ { "name": "unarmed", "level": 5 } ], "unarmed_allowed": true, "block_counter": true, - "crit_ok": true, - "mult_bonuses": [ { "stat": "movecost", "scale": 0.0 } ] + "crit_ok": true }, { "type": "technique", @@ -973,8 +960,7 @@ "melee_allowed": true, "unarmed_allowed": true, "crit_ok": true, - "block_counter": true, - "mult_bonuses": [ { "stat": "movecost", "scale": 0.0 } ] + "block_counter": true }, { "type": "technique", @@ -1020,8 +1006,7 @@ "crit_ok": true, "dodge_counter": true, "knockback_dist": 1, - "knockback_spread": 1, - "mult_bonuses": [ { "stat": "movecost", "scale": 0.0 } ] + "knockback_spread": 1 }, { "type": "technique", @@ -1033,11 +1018,7 @@ "crit_ok": true, "dodge_counter": true, "down_dur": 1, - "mult_bonuses": [ - { "stat": "movecost", "scale": 0.0 }, - { "stat": "damage", "type": "cut", "scale": 0 }, - { "stat": "damage", "type": "stab", "scale": 0 } - ] + "mult_bonuses": [ { "stat": "damage", "type": "cut", "scale": 0 }, { "stat": "damage", "type": "stab", "scale": 0 } ] }, { "type": "technique", @@ -1411,7 +1392,6 @@ "crit_ok": true, "knockback_dist": 1, "mult_bonuses": [ - { "stat": "movecost", "scale": 0.0 }, { "stat": "damage", "type": "bash", "scale": 0.5 }, { "stat": "damage", "type": "cut", "scale": 0.5 }, { "stat": "damage", "type": "stab", "scale": 0.5 } @@ -1537,7 +1517,7 @@ "block_counter": true, "crit_ok": true, "down_dur": 1, - "mult_bonuses": [ { "stat": "movecost", "scale": 0.0 }, { "stat": "damage", "type": "bash", "scale": 1.2 } ] + "mult_bonuses": [ { "stat": "damage", "type": "bash", "scale": 1.2 } ] }, { "type": "technique", @@ -1637,8 +1617,7 @@ "skill_requirements": [ { "name": "unarmed", "level": 5 } ], "unarmed_allowed": true, "dodge_counter": true, - "crit_ok": true, - "mult_bonuses": [ { "stat": "movecost", "scale": 0.0 } ] + "crit_ok": true }, { "type": "technique", @@ -1658,7 +1637,7 @@ "unarmed_allowed": true, "dodge_counter": true, "crit_ok": true, - "mult_bonuses": [ { "stat": "movecost", "scale": 0.0 }, { "stat": "damage", "type": "bash", "scale": 1.25 } ] + "mult_bonuses": [ { "stat": "damage", "type": "bash", "scale": 1.25 } ] }, { "type": "technique", diff --git a/data/mods/MMA/techniques.json b/data/mods/MMA/techniques.json index 6bbf6603c20cf..1f811bb8b9d1f 100644 --- a/data/mods/MMA/techniques.json +++ b/data/mods/MMA/techniques.json @@ -185,7 +185,6 @@ "dodge_counter": true, "crit_ok": true, "mult_bonuses": [ - { "stat": "movecost", "scale": 0.0 }, { "stat": "damage", "type": "bash", "scale": 1.2 }, { "stat": "damage", "type": "cut", "scale": 1.2 }, { "stat": "damage", "type": "stab", "scale": 1.2 } @@ -282,7 +281,6 @@ "block_counter": true, "crit_ok": true, "mult_bonuses": [ - { "stat": "movecost", "scale": 0.0 }, { "stat": "damage", "type": "bash", "scale": 1.2 }, { "stat": "damage", "type": "cut", "scale": 1.2 }, { "stat": "damage", "type": "stab", "scale": 1.2 } diff --git a/src/melee.cpp b/src/melee.cpp index 2136b8fcc9d6d..4dfabb1f127e8 100644 --- a/src/melee.cpp +++ b/src/melee.cpp @@ -1221,14 +1221,23 @@ matec_id Character::pick_technique( Creature &t, const item &weap, continue; } - // skip dodge counter techniques - if( dodge_counter != tec.dodge_counter ) { - continue; - } + if( tec.block_counter || tec.dodge_counter ) { + // skip dodge counter techniques + if( dodge_counter != tec.dodge_counter ) { + continue; + } + // skip block counter techniques + if( block_counter != tec.block_counter ) { + continue; + } + int move_cost = attack_speed( used_weapon() ); + move_cost *= tec.move_cost_multiplier( *this ); + move_cost += tec.move_cost_penalty( *this ); - // skip block counter techniques - if( block_counter != tec.block_counter ) { - continue; + // Don't counter if it would exhaust moves. + if( get_moves() + get_speed() - move_cost < 0 ) { + continue; + } } // if critical then select only from critical tecs