After struggling against OR's, skip tokens and other nasty creatures from the world of hexes, I finally got explosive weapons with an extra random radius. The result may not be very appealing visually, but it indeed works. And this, combined with explosives random damage modlet now defenitively makes grenades something much less certain
Function: XComGame >> XGWeapon >> GetDamageRadius
Weapon types 7 and 19 are rocket launcher and blaster launcher, respectively. HasUpgrade(25) is Danger Zone perk, and 192 is 3 tiles wide.
What I've done is removing the Danger zone check, and add random extra radius to either grenades and rockets
New code in hex:
Code break down:
ight now once this change applied, when selecting a grenade or a rocket to throw, you'll see the blue semi-sphere marking the area of effect changing it's size constantly, as if blinking, so you can get an idea of how small or how big it can get, but there's no way to tell beforehand how it will end, no matter the size of the blue area at the moment of throwing the grenade, when it explodes it will calculate it again. Therefor I'm expecting inconsistant behaviour from AI, since they won't be able to tell 100% if a grenade will hit their target or won't, so maybe they'll hold some grenade they could throw or maybe they'll miss the grenade because of different random results. Anyway it should be of minor effect, but I'll report if I see it affecting in a relevant manner.
an please someone tell me how those skip token work? I assume they operate like: if previous condition evaluates to true, then skip the rest of checks (useful for conditions with a bunch of OR's, when it's either one or another or another one, so when one evals true just skip that section) but the numbers following the 18 puzzle me. I assume it's also some offset in little endian or however it's called, but the number itself I don't know what it should be. I got it working just by trial and error, but I can't see what it represents... and it's not even multiple of 4. Any clue?
edit: typo, copy-pasting, etc
Edited by anUser, 25 March 2013 - 02:58 AM.