BattletechModders / CBTBehaviorsEnhanced

Applies Classic BattleTech behaviors to the HBS BattleTech Game
MIT License
5 stars 6 forks source link

Attack state can get confused #93

Open IceRaptor opened 3 years ago

IceRaptor commented 3 years ago

@FrostRaptor I have a bit of an oddity for you. I here have a log that shows that a Locust IIC (a 25 ton mech) did 95 damage with a kick (and 48 instability). Here's the relevant log excerpt: 19:41:22.553 Melee sequence 1387 created for attacker: Locust IIC_Recruit_124FB4F4 vs. target: Nightstar_Slapdash_7B9F1E30 using position: (-444.0, 163.8, -145.5) 19:41:22.553 -- Initial requested weapons: 19:41:22.554 Setting current melee type to: Kick and weapon to: Melee 19:41:22.554 For Locust IIC_Recruit_124FB4F4 set melee weapon damage: 95 and instability: 48 19:41:35.999 == Resolving cluster damage, instability, and unsteady on melee attacker: Locust IIC_Recruit_124FB4F4 and target: Nightstar_Slapdash_7B9F1E30. 19:41:35.999 -- AttackSequence: 1390 hit the target. 19:41:35.999 -- Adding 48 absolute instability to target. 19:41:35.999 -- Forcing target to become unsteady from attack!

File attached. This is obviously wrong, but I'm not sure why it's happening. Ticket is #ticket-0563 if you want full logs.

IceRaptor commented 3 years ago

Looks like the state got confused between player selection of type and the action, because the AI calculated retaliation:

19:41:22.533 AITUIL_EDFA - entered. 19:41:22.533 === Calculating expectedDamage for Nightstar_Slapdash_7B9F1E30 melee attack from position: (-457.9, 164.9, -124.7) against target: Locust IIC_Recruit_124FB4F4 at position: (-457.9, 164.9, -124.7) 19:41:22.533 useRevengeBonus: False 19:41:22.533 --- weaponList: 19:41:22.533 Melee 19:41:22.533 LRM20 19:41:22.533 Gauss Rifle 19:41:22.533 Gauss Rifle 19:41:22.533 ER M Laser 19:41:22.533 ER M Laser 19:41:22.533 C3 Master 19:41:22.534 Modifying Nightstar_Slapdash_7B9F1E30's melee attack damage for utility 19:41:22.534 Evaluating utility against state: KICK