Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- /** © 2015 CD PROJEKT S.A. All rights reserved.
- /** THE WITCHER® is a trademark of CD PROJEKT S. A.
- /** The Witcher game is based on the prose of Andrzej Sapkowski.
- Copyright © CD Projekt RED 2015
- */
- /** Copyright © 2012-2014
- /** Author : Tomek Kozera
- class W3Effect_Burning extends W3CriticalDOTEffect
- {
- private var cachedMPAC : CMovingPhysicalAgentComponent;
- default criticalStateType = ECST_BurnCritical;
- default effectType = EET_Burning;
- default powerStatType = CPS_SpellPower;
- default resistStat = CDS_BurningRes;
- default canBeAppliedOnDeadTarget = true;
- public function CacheSettings()
- {
- super.CacheSettings();
- allowedHits[EHRT_Igni] = false;
- //blockedActions.PushBack(EIAB_Signs); needed for some quest with fire in a barn - you're burning and need to use aard to get out
- blockedActions.PushBack(EIAB_CallHorse);
- blockedActions.PushBack(EIAB_Jump);
- blockedActions.PushBack(EIAB_ThrowBomb);
- blockedActions.PushBack(EIAB_UsableItem);
- blockedActions.PushBack(EIAB_Parry);
- blockedActions.PushBack(EIAB_Counter);
- //vibration strength
- vibratePadLowFreq = 0.1;
- vibratePadHighFreq = 0.2;
- }
- event OnEffectAdded(optional customParams : W3BuffCustomParams)
- {
- if ( this.IsOnPlayer() && thePlayer.IsUsingVehicle() )
- {
- if ( blockedActions.Contains( EIAB_Crossbow ) )
- blockedActions.Remove(EIAB_Crossbow);
- }
- else
- blockedActions.PushBack(EIAB_Crossbow);
- super.OnEffectAdded(customParams);
- cachedMPAC = ((CMovingPhysicalAgentComponent)target.GetMovingAgentComponent());
- if (isOnPlayer )
- {
- if ( thePlayer.playerAiming.GetCurrentStateName() == 'Waiting' )
- thePlayer.AddCustomOrientationTarget(OT_CustomHeading, 'BurningEffect');
- }
- //keep corpse burning for some time
- if(!target.IsAlive())
- timeLeft = 10;
- //in case of player only signs use Spell Power, other sources don't use it
- if(EntityHandleGet(creatorHandle) == thePlayer && !isSignEffect)
- powerStatType = CPS_Undefined;
- //cache glyphword 12
- //surface post fx
- }
- event OnEffectAddedPost()
- {
- super.OnEffectAddedPost();
- target.AddTag(theGame.params.TAG_OPEN_FIRE);
- }
- public function OnLoad(t : CActor, eff : W3EffectManager)
- {
- super.OnLoad(t, eff);
- cachedMPAC = ((CMovingPhysicalAgentComponent)target.GetMovingAgentComponent());
- }
- event OnUpdate(deltaTime : float)
- {
- var player : CR4Player = thePlayer;
- if ( this.isOnPlayer )
- {
- if ( player.bLAxisReleased )
- player.SetOrientationTargetCustomHeading( player.GetHeading(), 'BurningEffect' );
- else if ( player.GetPlayerCombatStance() == PCS_AlertNear )
- player.SetOrientationTargetCustomHeading( VecHeading( player.moveTarget.GetWorldPosition() - player.GetWorldPosition() ), 'BurningEffect' );
- else
- player.SetOrientationTargetCustomHeading( VecHeading( theCamera.GetCameraDirection() ), 'BurningEffect' );
- }
- //glyphword 12 - enemies in close range get burning applied as well
- //try to add burning
- //add to ignored array
- //if 1m below water level remove all burnings
- if(cachedMPAC && cachedMPAC.GetSubmergeDepth() <= -1)
- target.RemoveAllBuffsOfType(effectType);
- else
- super.OnUpdate(deltaTime);
- }
- event OnEffectRemoved()
- {
- if ( isOnPlayer )
- thePlayer.RemoveCustomOrientationTarget('BurningEffect');
- target.RemoveTag(theGame.params.TAG_OPEN_FIRE);
- super.OnEffectRemoved();
- }
- //override
- public function OnTargetDeath()
- {
- //increase time left till death anim finishes
- timeLeft = 10;
- }
- //override
- public function OnTargetDeathAnimFinished()
- {
- //keep fire for some time after death anim finished
- timeLeft = 10;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement