Jump to content

Need help with mod "var mutation12IsOnCooldown"


Recommended Posts

Guys Hello,
I'm having this weird error that I don't know how to fix:
Error [mod0000_mergedfiles]game\player\playerwitcher.ws(3503): syntax error, unexpected TOKEN_VAR, expecting TOKEN_FUNCTION, near 'var'
And as much as I look at it, in the "playerwitcher.ws" file, even vanilla as a comparision,
The way its written is supposed to be the right way.

 

private var mutation12IsOnCooldown : bool;

public final function AddMutation12Decoction()
{
var params : SCustomEffectParams;
var buffs : array< EEffectType >;
var existingDecoctionBuffs : array<CBaseGameplayEffect>;
var i : int;
var effectType : EEffectType;
var decoctions : array< SItemUniqueId >;
var tmpName : name;
var min, max : SAbilityAttributeValue;
if( mutation12IsOnCooldown )
{
return;
}
existingDecoctionBuffs = GetDrunkMutagens( "Mutation12" );
theGame.GetDefinitionsManager().GetAbilityAttributeValue( 'Mutation12', 'maxcap', min, max );
if( existingDecoctionBuffs.Size() >= min.valueAdditive )
{
return;
}
mutation12IsOnCooldown = true;
theGame.GetDefinitionsManager().GetAbilityAttributeValue( 'Mutation12', 'cooldown', min, max );
AddTimer( 'Mutation12Cooldown', CalculateAttributeValue( min ) );
decoctions = inv.GetItemsByTag( 'Mutagen' );
for( i=decoctions.Size()-1; i>=0; i-=1 )
{
inv.GetPotionItemBuffData( decoctions, effectType, tmpName );
if( HasBuff( effectType ) )
{
decoctions.EraseFast( i );
continue;
}
buffs.PushBack( effectType );
}
if( buffs.Size() == 0 )
{
for( i=EET_Mutagen01; i<=EET_Mutagen28; i+=1 )
{
if( !HasBuff( i ) )
{
buffs.PushBack( i );
}
}
}
buffs.Remove( EET_Mutagen16 );
buffs.Remove( EET_Mutagen24 );
if( buffs.Size() == 0 )
{
return;
}
theGame.GetDefinitionsManager().GetAbilityAttributeValue( 'Mutation12', 'duration', min, max );
params.effectType = buffs[ RandRange( buffs.Size() ) ];
params.creator = this;
params.sourceName = "Mutation12";
params.duration = min.valueAdditive;
AddEffectCustom( params );
( ( W3Mutagen_Effect ) GetBuff( params.effectType, params.sourceName ) ).OverrideIcon( DecoctionEffectTypeToItemName( params.effectType ) );
if ( !IsEffectActive( 'invisible' ) )
{
PlayEffect( 'use_potion' );
}
theGame.MutationHUDFeedback( MFT_PlayOnce );
}
timer function Mutation12Cooldown( dt : float, id : int )
{
mutation12IsOnCooldown = false;
}
public final function HasResourcesToStartAnyMutationResearch() : bool
{
var greenPoints, redPoints, bluePoints, count : int;
var itemIDs : array< SItemUniqueId >;
if( levelManager.GetPointsFree( ESkillPoint ) > 0 )
{
return true;
}
count = inv.GetItemQuantityByName( 'Greater mutagen green' );
if( count > 0 )
{
itemIDs = inv.GetItemsByName( 'Greater mutagen green' );
greenPoints = inv.GetMutationResearchPoints( SC_Green, itemIDs[0] );
if( greenPoints > 0 )
{
return true;
}
}
count = inv.GetItemQuantityByName( 'Greater mutagen red' );
if( count > 0 )
{
itemIDs.Clear();
itemIDs = inv.GetItemsByName( 'Greater mutagen red' );
redPoints = inv.GetMutationResearchPoints( SC_Red, itemIDs[0] );
if( redPoints > 0 )
{
return true;
}
}
count = inv.GetItemQuantityByName( 'Greater mutagen blue' );
if( count > 0 )
{
itemIDs.Clear();
itemIDs = inv.GetItemsByName( 'Greater mutagen blue' );
bluePoints = inv.GetMutationResearchPoints( SC_Blue, itemIDs[0] );
if( bluePoints > 0 )
{
return true;
}
}
return false;
}

 

 

Can someone please help?

 

Thanks,

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...