Based on Stoddard's code with small changes:
https://openxcom.org/forum/index.php/topic,5345.msg83664.html#msg83664units:
- type: STR_CHRYSSALID_TERRORIST
isLeeroyJenkins: true
Unit marked as leeroy must have a melee weapon (and be able to use it).
It will completely ignore vanilla AI "decision making" and run around (using vanilla patrol routine) until it spots someone and then charge at the nearest target (if multiple spotted).
Charge is mostly vanilla/OXCE, with the following differences:
- ignore remaining TUs (charge even if not enough TUs to attack now)
- ignore dangerous tiles (grenades? pfff!)
- ignore OXCE melee dodge (leeroy is not intelligent enough to attack from behind)
Units which are not marked behave normally... vanilla/OXCE behaviour is untouched.
@Stoddard:
1. cherrypicked commit c6b65f7dfbd2c66a5bdad69d612e7eee9627f19e
2. cherrypicked commit c8f23ec183f07c76b9f9e69112a7ff44868c3f6c
3. fixed compilation error (and vs. &&)
4. reverted all vanilla AI changes from first commit that you (probably?) forgot to revert in the second commit
5. iffed the AI trace logs
6. a few cosmetic changes in code formatting and log output
7. change: charge blindly #1 (don't care even if you end up in grenade blast radius)
8. change: charge blindly #2 (you're not intelligent enough to consider OXCE melee dodge and attack from behind)
[02-08-2017_14-56-31] [INFO] LEEROY: Unit 1000014 of type STR_CHRYSSALID_TERRORIST is Leeroy...
[02-08-2017_14-56-31] [INFO] LEEROY: visibleEnemiesToAttack: 0 _melee: 1
[02-08-2017_14-56-31] [INFO] LEEROY: No one to LEEROY!, patrolling...
[02-08-2017_14-56-33] [INFO] LEEROY: Unit 1000014 of type STR_CHRYSSALID_TERRORIST is Leeroy...
[02-08-2017_14-56-33] [INFO] LEEROY: visibleEnemiesToAttack: 2 _melee: 1
[02-08-2017_14-56-33] [INFO] LEEROY: LEEROYIN' at someone!
This code is highly experimental (doesn't mean it's buggy)... test it if you want and give feedback if it's usable in its current form.