From fc78960692633f1eccc84626938c29d357f0817b Mon Sep 17 00:00:00 2001 From: Victor Chelaru Date: Fri, 1 Mar 2024 22:06:16 -0700 Subject: [PATCH] InvulnerabilityTimeAfterDamage now optionally generates. --- .../CodeGenerators/DamageDealingCodeGenerator.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/FRBDK/Glue/OfficialPlugins/DamageDealingPlugin/CodeGenerators/DamageDealingCodeGenerator.cs b/FRBDK/Glue/OfficialPlugins/DamageDealingPlugin/CodeGenerators/DamageDealingCodeGenerator.cs index 611067e87..3a0252add 100644 --- a/FRBDK/Glue/OfficialPlugins/DamageDealingPlugin/CodeGenerators/DamageDealingCodeGenerator.cs +++ b/FRBDK/Glue/OfficialPlugins/DamageDealingPlugin/CodeGenerators/DamageDealingCodeGenerator.cs @@ -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;"); + } } } }