Skip to content

Instantly share code, notes, and snippets.

@mburbea
Created February 6, 2024 03:41
Show Gist options
  • Save mburbea/787b92a057a0f02bb5c0b1f60d396d69 to your computer and use it in GitHub Desktop.
Save mburbea/787b92a057a0f02bb5c0b1f60d396d69 to your computer and use it in GitHub Desktop.
/***********************************************************************/
/** © 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.
/***********************************************************************/
statemachine class CMajorPlaceOfPowerEntity extends CInteractiveEntity
{
autobind interactionComponent : CInteractionComponent = "activationComponent";
public editable var buffType : EShrineBuffs;
public editable var buffUniqueName : string;
public editable var fxOnIdle : name;
public editable var fxOnChannel : name;
public editable var fxOnSuccess : name;
public var channelingTime : float;
public var buffDuration : float;
public var buffCooldown : GameTime;
public saved var skillPointGranted : bool;
public saved var isRecharging : bool;
public saved var lastUsed : GameTime;
public saved var isPlaceOfPowerInIdle : bool;
saved var voicesetTimestamp : GameTime;
saved var initialVoicesetPlayed : bool;
default initialVoicesetPlayed = false;
default fxOnIdle = 'default';
default fxOnChannel = 'use';
default fxOnSuccess = 'use';
default channelingTime = 2.5;
default buffDuration = 1999999999.0;
default skillPointGranted = false;
default isRecharging = false;
default autoState = 'PlaceOfPower_Idle';
event OnSpawned( spawnData : SEntitySpawnData )
{
if(spawnData.restored && isRecharging && (theGame.GetGameTime() < lastUsed + GetBuffCooldown()) )
{
buffCooldown = lastUsed + GetBuffCooldown() - theGame.GetGameTime();
GotoState( 'PlaceOfPower_Recharging' );
}
else
{
buffCooldown = GetBuffCooldown();
GotoStateAuto();
}
}
private final function GetBuffCooldown() : GameTime
{
return GameTimeCreate( 0, 0, 0, 1999999999 );
}
event OnInteraction( actionName : string, activator : CEntity )
{
if( activator != thePlayer || !thePlayer.CanPerformPlayerAction())
return false;
thePlayer.OnEquipMeleeWeapon( PW_None, true );
GotoState( 'PlaceOfPower_Channeling' );
}
event OnInteractionActivationTest( interactionComponentName : string, activator : CEntity )
{
if( isRecharging || GetCurrentStateName() != 'PlaceOfPower_Idle' )
return false;
else
return true;
}
event OnAreaEnter( area : CTriggerAreaComponent, activator : CComponent )
{
var mapManager : CCommonMapManager = theGame.GetCommonMapManager();
var vect : Vector;
var tags : array< name >;
if ( area == (CTriggerAreaComponent)this.GetComponent( "VoiceSetTrigger" ) && isPlaceOfPowerInIdle && !thePlayer.IsCombatMusicEnabled() && !thePlayer.IsInNonGameplayCutscene() )
{
theGame.VibrateController( 0, 0.3f, 1.0f );
GetWitcherPlayer().GetMedallion().Activate( true, 5.0f );
if ( CanPlayVoiceSet() )
{
thePlayer.PlayVoiceset( 100,'DetectPlaceOfPower' );
voicesetTimestamp = theGame.GetGameTime();
initialVoicesetPlayed = true;
}
}
if( area == (CTriggerAreaComponent)this.GetComponent( "FirstDiscoveryTrigger" ) && activator.GetEntity() == thePlayer )
{
this.GetComponent( "FirstDiscoveryTrigger" ).SetEnabled( false );
mapManager.SetEntityMapPinDiscoveredScript( false, entityName, true );
}
}
function CanPlayVoiceSet() : bool
{
if( thePlayer.IsSpeaking() )
return false;
else if( !initialVoicesetPlayed )
return true;
else if( theGame.GetGameTime() > voicesetTimestamp + GameTimeCreate( 0, 0, 0, CeilF( ConvertRealTimeSecondsToGameSeconds( 120 ) ) ) )
return true;
else
return false;
}
}
state PlaceOfPower_Idle in CMajorPlaceOfPowerEntity
{
event OnEnterState( prevStateName : name )
{
parent.isPlaceOfPowerInIdle = true;
parent.PlayEffect( parent.fxOnIdle );
if(thePlayer)
thePlayer.PlayerStopAction( PEA_Meditation );
parent.isRecharging = false;
if ( !parent.skillPointGranted )
{
theGame.GetCommonMapManager().SetEntityMapPinDisabled( parent.entityName, false );
}
}
event OnLeaveState( nextStateName : name )
{
parent.StopEffect( parent.fxOnIdle );
parent.isPlaceOfPowerInIdle = false;
}
}
state PlaceOfPower_Channeling in CMajorPlaceOfPowerEntity
{
var channelingStartTime : float;
event OnEnterState( prevStateName : name )
{
parent.PlayEffect( parent.fxOnChannel );
channelingStartTime = theGame.GetEngineTimeAsSeconds();
theGame.GetGuiManager().EnableHudHoldIndicator(IK_Pad_A_CROSS, IK_E, "InteractHold", parent.channelingTime, 'PlaceOfPower');
PlaceOfPower_Channel();
}
entry function PlaceOfPower_Channel()
{
var test : name;
var channelPerc : float;
thePlayer.PlayerStartAction( PEA_Meditation );
while( true )
{
SleepOneFrame();
if( theInput.IsActionPressed( 'InteractHold' ) && !thePlayer.GetIsWalking() && !thePlayer.GetIsSprinting())
{
if( channelingStartTime + parent.channelingTime > theGame.GetEngineTimeAsSeconds() )
{
channelPerc = (theGame.GetEngineTimeAsSeconds() - channelingStartTime) / parent.channelingTime;
theGame.VibrateController(channelPerc, channelPerc, 0.0001);
continue;
}
else
{
parent.GotoState( 'PlaceOfPower_Activated' );
}
}
else
{
test = theInput.GetContext();
parent.GotoState( 'PlaceOfPower_Idle' );
}
}
}
event OnLeaveState( nextStateName : name )
{
theGame.GetGuiManager().DisableHudHoldIndicator();
parent.StopEffect( parent.fxOnChannel );
}
}
state PlaceOfPower_Activated in CMajorPlaceOfPowerEntity
{
event OnEnterState( prevStateName : name )
{
parent.PlayEffect( parent.fxOnSuccess );
GrantSkillPointIfPossible();
GrantBuff();
thePlayer.PlayerStopAction( PEA_Meditation );
theGame.GetCommonMapManager().SetEntityMapPinDisabled( parent.entityName, true );
parent.GotoState( 'PlaceOfPower_Recharging' );
}
private function GrantSkillPointIfPossible()
{
if( !parent.skillPointGranted )
{
GetWitcherPlayer().AddPoints( ESkillPoint, 1, true );
GetWitcherPlayer().DisplayHudMessage(GetLocStringByKeyExt("panel_hud_message_pop_skillpoint"));
parent.skillPointGranted = true;
}
}
private function GrantBuff()
{
var params : SCustomEffectParams;
// if( GetWitcherPlayer().CanUseSkill( S_Perk_14 ) )
// {
// thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineAard );
// thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineAxii );
// thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineIgni );
// thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineQuen );
// thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineYrden );
// }
//params.effectType = GetStatFromEnum( parent.buffType );
//params.creator = parent;
//params.sourceName = parent.buffUniqueName;
//params.duration = 1999999999.0;
//thePlayer.AddEffectCustom( params );
switch(parent.buffType)
{
case ESB_Aard:
//modded begin
if (thePlayer.HasBuff(EET_ShrineAard))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineAard );
params.effectType = EET_ShrineAard1;
GetWitcherPlayer().DisplayHudMessage( "Aard Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineAard1))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineAard1 );
params.effectType = EET_ShrineAard2;
GetWitcherPlayer().DisplayHudMessage( "Aard Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineAard2))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineAard2 );
params.effectType = EET_ShrineAard3;
GetWitcherPlayer().DisplayHudMessage( "Aard Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineAard3))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineAard3 );
params.effectType = EET_ShrineAard4;
GetWitcherPlayer().DisplayHudMessage( "Aard Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineAard4))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineAard4 );
params.effectType = EET_ShrineAard5;
GetWitcherPlayer().DisplayHudMessage( "Aard Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineAard5))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineAard5 );
params.effectType = EET_ShrineAard6;
GetWitcherPlayer().DisplayHudMessage( "Aard Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineAard6))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineAard6 );
params.effectType = EET_ShrineAard7;
GetWitcherPlayer().DisplayHudMessage( "Aard Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineAard7))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineAard7 );
params.effectType = EET_ShrineAard8;
GetWitcherPlayer().DisplayHudMessage( "Aard Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineAard8))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineAard8 );
params.effectType = EET_ShrineAard9;
GetWitcherPlayer().DisplayHudMessage( "Aard Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineAard9))
{
GetWitcherPlayer().DisplayHudMessage( "Aard Sign intensity increased." );
break;
}
else
{
params.effectType = EET_ShrineAard;
GetWitcherPlayer().DisplayHudMessage( "Aard Sign intensity increased. FUCK" );
break;
}
//modded end
//GetWitcherPlayer().DisplayHudMessage( GetLocStringByKeyExt("panel_hud_message_pop_buff_aard") );
//break;
case ESB_Axii:
//modded begin
if (thePlayer.HasBuff(EET_ShrineAxii))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineAxii );
params.effectType = EET_ShrineAxii1;
GetWitcherPlayer().DisplayHudMessage( "Axii Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineAxii1))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineAxii1 );
params.effectType = EET_ShrineAxii2;
GetWitcherPlayer().DisplayHudMessage( "Axii Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineAxii2))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineAxii2 );
params.effectType = EET_ShrineAxii3;
GetWitcherPlayer().DisplayHudMessage( "Axii Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineAxii3))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineAxii3 );
params.effectType = EET_ShrineAxii4;
GetWitcherPlayer().DisplayHudMessage( "Axii Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineAxii4))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineAxii4 );
params.effectType = EET_ShrineAxii5;
GetWitcherPlayer().DisplayHudMessage( "Axii Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineAxii5))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineAxii5 );
params.effectType = EET_ShrineAxii6;
GetWitcherPlayer().DisplayHudMessage( "Axii Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineAxii6))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineAxii6 );
params.effectType = EET_ShrineAxii7;
GetWitcherPlayer().DisplayHudMessage( "Axii Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineAxii7))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineAxii7 );
params.effectType = EET_ShrineAxii8;
GetWitcherPlayer().DisplayHudMessage( "Axii Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineAxii8))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineAxii8 );
params.effectType = EET_ShrineAxii9;
GetWitcherPlayer().DisplayHudMessage( "Axii Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineAxii9))
{
GetWitcherPlayer().DisplayHudMessage( "Axii Sign intensity increased." );
break;
}
else
{
params.effectType = EET_ShrineAxii;
GetWitcherPlayer().DisplayHudMessage( "Axii Sign intensity increased." );
break;
}
//modded end
//GetWitcherPlayer().DisplayHudMessage( GetLocStringByKeyExt("panel_hud_message_pop_buff_axii") );
//break;
case ESB_Igni:
//modded begin
if (thePlayer.HasBuff(EET_ShrineIgni))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineIgni );
params.effectType = EET_ShrineIgni1;
GetWitcherPlayer().DisplayHudMessage( "Igni Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineIgni1))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineIgni1 );
params.effectType = EET_ShrineIgni2;
GetWitcherPlayer().DisplayHudMessage( "Igni Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineIgni2))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineIgni2 );
params.effectType = EET_ShrineIgni3;
GetWitcherPlayer().DisplayHudMessage( "Igni Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineIgni3))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineIgni3 );
params.effectType = EET_ShrineIgni4;
GetWitcherPlayer().DisplayHudMessage( "Igni Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineIgni4))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineIgni4 );
params.effectType = EET_ShrineIgni5;
GetWitcherPlayer().DisplayHudMessage( "Igni Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineIgni5))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineIgni5 );
params.effectType = EET_ShrineIgni6;
GetWitcherPlayer().DisplayHudMessage( "Igni Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineIgni6))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineIgni6 );
params.effectType = EET_ShrineIgni7;
GetWitcherPlayer().DisplayHudMessage( "Igni Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineIgni7))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineIgni7 );
params.effectType = EET_ShrineIgni8;
GetWitcherPlayer().DisplayHudMessage( "Igni Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineIgni8))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineIgni8 );
params.effectType = EET_ShrineIgni9;
GetWitcherPlayer().DisplayHudMessage( "Igni Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineIgni9))
{
GetWitcherPlayer().DisplayHudMessage( "Igni Sign intensity increased." );
break;
}
else
{
params.effectType = EET_ShrineIgni;
GetWitcherPlayer().DisplayHudMessage( "Igni Sign intensity increased." );
break;
}
//modded end
//GetWitcherPlayer().DisplayHudMessage( GetLocStringByKeyExt("panel_hud_message_pop_buff_igni") );
//break;
case ESB_Quen:
//modded begin
if (thePlayer.HasBuff(EET_ShrineQuen))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineQuen );
params.effectType = EET_ShrineQuen1;
GetWitcherPlayer().DisplayHudMessage( "Quen Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineQuen1))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineQuen1 );
params.effectType = EET_ShrineQuen2;
GetWitcherPlayer().DisplayHudMessage( "Quen Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineQuen2))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineQuen2 );
params.effectType = EET_ShrineQuen3;
GetWitcherPlayer().DisplayHudMessage( "Quen Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineQuen3))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineQuen3 );
params.effectType = EET_ShrineQuen4;
GetWitcherPlayer().DisplayHudMessage( "Quen Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineQuen4))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineQuen4 );
params.effectType = EET_ShrineQuen5;
GetWitcherPlayer().DisplayHudMessage( "Quen Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineQuen5))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineQuen5 );
params.effectType = EET_ShrineQuen6;
GetWitcherPlayer().DisplayHudMessage( "Quen Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineQuen6))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineQuen6 );
params.effectType = EET_ShrineQuen7;
GetWitcherPlayer().DisplayHudMessage( "Quen Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineQuen7))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineQuen7 );
params.effectType = EET_ShrineQuen8;
GetWitcherPlayer().DisplayHudMessage( "Quen Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineQuen8))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineQuen8 );
params.effectType = EET_ShrineQuen9;
GetWitcherPlayer().DisplayHudMessage( "Quen Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineQuen9))
{
GetWitcherPlayer().DisplayHudMessage( "Quen Sign intensity increased." );
break;
}
else
{
params.effectType = EET_ShrineQuen;
GetWitcherPlayer().DisplayHudMessage( "Quen Sign intensity increased." );
break;
}
//modded end
//GetWitcherPlayer().DisplayHudMessage( GetLocStringByKeyExt("panel_hud_message_pop_buff_quen") );
//break;
case ESB_Yrden:
//modded begin
if (thePlayer.HasBuff(EET_ShrineYrden))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineYrden );
params.effectType = EET_ShrineYrden1;
GetWitcherPlayer().DisplayHudMessage( "Yrden Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineYrden1))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineYrden1 );
params.effectType = EET_ShrineYrden2;
GetWitcherPlayer().DisplayHudMessage( "Yrden Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineYrden2))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineYrden2 );
params.effectType = EET_ShrineYrden3;
GetWitcherPlayer().DisplayHudMessage( "Yrden Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineYrden3))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineYrden3 );
params.effectType = EET_ShrineYrden4;
GetWitcherPlayer().DisplayHudMessage( "Yrden Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineYrden4))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineYrden4 );
params.effectType = EET_ShrineYrden5;
GetWitcherPlayer().DisplayHudMessage( "Yrden Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineYrden5))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineYrden5 );
params.effectType = EET_ShrineYrden6;
GetWitcherPlayer().DisplayHudMessage( "Yrden Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineYrden6))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineYrden6 );
params.effectType = EET_ShrineYrden7;
GetWitcherPlayer().DisplayHudMessage( "Yrden Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineYrden7))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineYrden7 );
params.effectType = EET_ShrineYrden8;
GetWitcherPlayer().DisplayHudMessage( "Yrden Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineYrden8))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineYrden8 );
params.effectType = EET_ShrineYrden9;
GetWitcherPlayer().DisplayHudMessage( "Yrden Sign intensity increased." );
break;
}
else if (thePlayer.HasBuff(EET_ShrineYrden9))
{
GetWitcherPlayer().DisplayHudMessage( "Yrden Sign intensity increased." );
break;
}
else
{
params.effectType = EET_ShrineYrden;
GetWitcherPlayer().DisplayHudMessage( "Yrden Sign intensity increased." );
break;
}
//modded end
//GetWitcherPlayer().DisplayHudMessage( GetLocStringByKeyExt("panel_hud_message_pop_buff_yrden") );
//break;
}
//modded begin
params.creator = parent;
params.sourceName = parent.buffUniqueName;
params.duration = 1999999999.0;
thePlayer.AddEffectCustom( params );
if (!GetWitcherPlayer().CanUseSkill( S_Perk_14 ))
{
if (thePlayer.HasBuff(EET_ShrineYrden5))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineYrden5 );
params.effectType = EET_ShrineYrden6;
params.creator = parent;
params.sourceName = parent.buffUniqueName;
params.duration = 1999999999.0;
thePlayer.AddEffectCustom( params );
GetWitcherPlayer().DisplayHudMessage( "Congratulation! You've found all Yrden's Place of Power." );
GetWitcherPlayer().DisplayHudMessage( "Yrden Sign intensity increased." );
}
else if (thePlayer.HasBuff(EET_ShrineQuen6))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineQuen6 );
params.effectType = EET_ShrineQuen7;
params.creator = parent;
params.sourceName = parent.buffUniqueName;
params.duration = 1999999999.0;
thePlayer.AddEffectCustom( params );
GetWitcherPlayer().DisplayHudMessage( "Congratulation! You've found all Quen's Place of Power." );
GetWitcherPlayer().DisplayHudMessage( "Quen Sign intensity increased." );
}
else if (thePlayer.HasBuff(EET_ShrineIgni6))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineIgni6 );
params.effectType = EET_ShrineIgni7;
params.creator = parent;
params.sourceName = parent.buffUniqueName;
params.duration = 1999999999.0;
thePlayer.AddEffectCustom( params );
GetWitcherPlayer().DisplayHudMessage( "Congratulation! You've found all Igni's Place of Power." );
GetWitcherPlayer().DisplayHudMessage( "Igni Sign intensity increased." );
}
else if (thePlayer.HasBuff(EET_ShrineAxii4))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineAxii4 );
params.effectType = EET_ShrineAxii5;
params.creator = parent;
params.sourceName = parent.buffUniqueName;
params.duration = 1999999999.0;
thePlayer.AddEffectCustom( params );
GetWitcherPlayer().DisplayHudMessage( "Congratulation! You've found all Axii's Place of Power." );
GetWitcherPlayer().DisplayHudMessage( "Axii Sign intensity increased." );
}
else if (thePlayer.HasBuff(EET_ShrineAard4))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineAard4 );
params.effectType = EET_ShrineAard5;
params.creator = parent;
params.sourceName = parent.buffUniqueName;
params.duration = 1999999999.0;
thePlayer.AddEffectCustom( params );
GetWitcherPlayer().DisplayHudMessage( "Congratulation! You've found all Aard's Place of Power." );
GetWitcherPlayer().DisplayHudMessage( "Aard Sign intensity increased." );
}
if (thePlayer.HasBuff(EET_ShrineYrden6) && thePlayer.HasBuff(EET_ShrineQuen7) && thePlayer.HasBuff(EET_ShrineIgni7)
&& thePlayer.HasBuff(EET_ShrineAxii5) && thePlayer.HasBuff(EET_ShrineAard5))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineYrden6 );
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineQuen7 );
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineIgni7 );
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineAxii5 );
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineAard5 );
params.effectType = EET_ShrineYrden7;
params.creator = parent;
params.sourceName = parent.buffUniqueName;
params.duration = 1999999999.0;
thePlayer.AddEffectCustom( params );
params.effectType = EET_ShrineQuen8;
params.creator = parent;
params.sourceName = parent.buffUniqueName;
params.duration = 1999999999.0;
thePlayer.AddEffectCustom( params );
params.effectType = EET_ShrineIgni8;
params.creator = parent;
params.sourceName = parent.buffUniqueName;
params.duration = 1999999999.0;
thePlayer.AddEffectCustom( params );
params.effectType = EET_ShrineAxii6;
params.creator = parent;
params.sourceName = parent.buffUniqueName;
params.duration = 1999999999.0;
thePlayer.AddEffectCustom( params );
params.effectType = EET_ShrineAard6;
params.creator = parent;
params.sourceName = parent.buffUniqueName;
params.duration = 1999999999.0;
thePlayer.AddEffectCustom( params );
GetWitcherPlayer().DisplayHudMessage( "Congratulation! You've found all Places of Power." );
GetWitcherPlayer().DisplayHudMessage( "All Signs intensity increased." );
}
}
else if (GetWitcherPlayer().CanUseSkill( S_Perk_14 ))
{
if (thePlayer.HasBuff(EET_ShrineYrden6))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineYrden6 );
params.effectType = EET_ShrineYrden7;
params.creator = parent;
params.sourceName = parent.buffUniqueName;
params.duration = 1999999999.0;
thePlayer.AddEffectCustom( params );
GetWitcherPlayer().DisplayHudMessage( "Congratulation! You've found all Yrden's Place of Power." );
GetWitcherPlayer().DisplayHudMessage( "Yrden Sign intensity increased." );
}
else if (thePlayer.HasBuff(EET_ShrineQuen7))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineQuen7 );
params.effectType = EET_ShrineQuen8;
params.creator = parent;
params.sourceName = parent.buffUniqueName;
params.duration = 1999999999.0;
thePlayer.AddEffectCustom( params );
GetWitcherPlayer().DisplayHudMessage( "Congratulation! You've found all Quen's Place of Power." );
GetWitcherPlayer().DisplayHudMessage( "Quen Sign intensity increased." );
}
else if (thePlayer.HasBuff(EET_ShrineIgni7))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineIgni7 );
params.effectType = EET_ShrineIgni8;
params.creator = parent;
params.sourceName = parent.buffUniqueName;
params.duration = 1999999999.0;
thePlayer.AddEffectCustom( params );
GetWitcherPlayer().DisplayHudMessage( "Congratulation! You've found all Igni's Place of Power." );
GetWitcherPlayer().DisplayHudMessage( "Igni Sign intensity increased." );
}
else if (thePlayer.HasBuff(EET_ShrineAxii5))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineAxii5 );
params.effectType = EET_ShrineAxii6;
params.creator = parent;
params.sourceName = parent.buffUniqueName;
params.duration = 1999999999.0;
thePlayer.AddEffectCustom( params );
GetWitcherPlayer().DisplayHudMessage( "Congratulation! You've found all Axii's Place of Power." );
GetWitcherPlayer().DisplayHudMessage( "Axii Sign intensity increased." );
}
else if (thePlayer.HasBuff(EET_ShrineAard5))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineAard5 );
params.effectType = EET_ShrineAard6;
params.creator = parent;
params.sourceName = parent.buffUniqueName;
params.duration = 1999999999.0;
thePlayer.AddEffectCustom( params );
GetWitcherPlayer().DisplayHudMessage( "Congratulation! You've found all Aard's Place of Power." );
GetWitcherPlayer().DisplayHudMessage( "Aard Sign intensity increased." );
}
if (thePlayer.HasBuff(EET_ShrineYrden7) && thePlayer.HasBuff(EET_ShrineQuen8) && thePlayer.HasBuff(EET_ShrineIgni8)
&& thePlayer.HasBuff(EET_ShrineAxii6) && thePlayer.HasBuff(EET_ShrineAard6))
{
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineYrden7 );
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineQuen8 );
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineIgni8 );
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineAxii6 );
thePlayer.RemoveAllShrineBuffsOfType( EET_ShrineAard6 );
params.effectType = EET_ShrineYrden8;
params.creator = parent;
params.sourceName = parent.buffUniqueName;
params.duration = 1999999999.0;
thePlayer.AddEffectCustom( params );
params.effectType = EET_ShrineQuen9;
params.creator = parent;
params.sourceName = parent.buffUniqueName;
params.duration = 1999999999.0;
thePlayer.AddEffectCustom( params );
params.effectType = EET_ShrineIgni9;
params.creator = parent;
params.sourceName = parent.buffUniqueName;
params.duration = 1999999999.0;
thePlayer.AddEffectCustom( params );
params.effectType = EET_ShrineAxii7;
params.creator = parent;
params.sourceName = parent.buffUniqueName;
params.duration = 1999999999.0;
thePlayer.AddEffectCustom( params );
params.effectType = EET_ShrineAard7;
params.creator = parent;
params.sourceName = parent.buffUniqueName;
params.duration = 1999999999.0;
thePlayer.AddEffectCustom( params );
GetWitcherPlayer().DisplayHudMessage( "Congratulation! You've found all Places of Power." );
GetWitcherPlayer().DisplayHudMessage( "All Signs intensity increased." );
}
}
//modded end
}
private function GetStatFromEnum( statName : EShrineBuffs ) : EEffectType
{
switch( statName )
{
case ESB_Aard: return EET_ShrineAard;
case ESB_Axii: return EET_ShrineAxii;
case ESB_Igni: return EET_ShrineIgni;
case ESB_Quen: return EET_ShrineQuen;
case ESB_Yrden: return EET_ShrineYrden;
}
}
}
state PlaceOfPower_Recharging in CMajorPlaceOfPowerEntity
{
event OnEnterState( prevStateName : name )
{
// exclude below 1st and 3rd row make shrine stop recharge/become once per game
parent.AddGameTimeTimer( 'Recharge', parent.buffCooldown, false,,,,true );
parent.isRecharging = true;
parent.lastUsed = theGame.GetGameTime();
}
timer function Recharge( timeDelta : GameTime , id : int )
{
parent.GotoState( 'PlaceOfPower_Idle' );
}
}
enum EShrineBuffs
{
ESB_Aard,
ESB_Axii,
ESB_Igni,
ESB_Quen,
ESB_Yrden
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment