Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function name PAShakeUpApplyChance(const out EffectAppliedData ApplyEffectParameters, XComGameState_BaseObject kNewTargetState, XComGameState NewGameState)
- {
- // this mimics the panic hit roll without actually BEING the panic hit roll
- local XComGameState_Unit TargetUnit;
- local name ImmuneName;
- local int TargetRoll, RandRoll;
- local XMBValue_Visibility Value;
- local int BadGuysValue;
- Value = new class'XMBValue_Visibility';
- Value.bCountEnemies = true;
- Value.bSquadsight = true;
- TargetUnit = XComGameState_Unit(kNewTargetState);
- if (TargetUnit != none)
- {
- foreach class'X2AbilityToHitCalc_PanicCheck'.default.PanicImmunityAbilities(ImmuneName)
- {
- if (TargetUnit.FindAbility(ImmuneName).ObjectID != 0)
- {
- return 'AA_UnitIsImmune';
- }
- if (default.PAShakeUp_BerserkerImmunity) {
- if (TargetUnit.GetMyTemplate().CharacterGroupName == 'Berserker')
- {
- return 'AA_UnitIsImmune';
- }
- }
- }
- BadGuysValue = Value * default.PAShakeUp_DECREASE_PER_VISIBLE_ENEMY;
- TargetRoll = default.PAShakeUp_BASE_CHANCE - BadGuysValue;
- RandRoll = `SYNC_RAND(100);
- if (RandRoll < TargetRoll)
- {
- return 'AA_Success';
- }
- }
- return 'AA_EffectChanceFailed';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement