Skip to content

Commit

Permalink
InvulnerabilityTimeAfterDamage now optionally generates.
Browse files Browse the repository at this point in the history
  • Loading branch information
vchelaru committed Mar 2, 2024
1 parent 89ede45 commit fc78960
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,14 @@ public override ICodeBlock GenerateFields(ICodeBlock codeBlock, IElement element
if (UsesDamageV3)
{
codeBlock.Line("public bool IsDamageReceivingEnabled { get; set; } = true;");
codeBlock.Line("public double InvulnerabilityTimeAfterDamage { get; set; } = 0;");
codeBlock.Line("public double LastDamageTime { get; set; } = -999;");


var hasVariableForInvunerability = entity.GetCustomVariableRecursively("InvulnerabilityTimeAfterDamage") != null;
if(!hasVariableForInvunerability)
{
codeBlock.Line("public double InvulnerabilityTimeAfterDamage { get; set; } = 0;");
}
}
}
}
Expand Down

0 comments on commit fc78960

Please sign in to comment.