I am having a difficult time getting macro output to be displayed only to GM's. I can get simple rolls to whisper to a specific person (getting around the 'only GM' issue), but I cannot get items inside a if(): block to do it.
Here is sample code;
Spoiler
[h: abort(isGM())]
[h: tempState = 0]
[h: negCon = 0]
[h: massiveDMG = 0]
[h: acidDamage = 0]
[h: coldDamage = 0]
[h: electricityDamage = 0]
[h: fireDamage = 0]
[h: damage = 0]
[h:status=input(
"physicalDamage|0|Amount of damage",
"AD|0|Acid based damage",
"CD|0|Cold based damage",
"ED|0|Electricity based damage",
"FD|0|Fire based damage")]
[h:abort(status)]
<!-- Take care of the elemental damages -->
[h: oldAcidProtection = AcidProtection]
[h, if(AD == 0), CODE:
{
};{
[if(AD <= AcidProtection), CODE:
{
[h: AcidProtection = AcidProtection - AD]
Takes [AD] Acid damage, losing [AD] Acid Protection. You now have [AcidProtection] Acid Protection with [AcidResistance] Resistance.<br>
[h: AD = 0]
};{
[h: overdamage = 0]
[h: overdamage = AD - AcidProtection]
[h: AcidProtection = 0]
[h: setState("Protection from Acid",0)]
Takes [AD] damage, losing [oldAcidProtection] Acid Protection. You now have 0 Acid Protection with [AcidResistance] Resistance.<br>
[h: overdamage = if(AcidResistance > 0, overdamage - AcidResistance, overdamage)]
[h: overdamage = if(overdamage < 0, 0, overdamage)]
[h: acidDamage = overdamage]
}]
}]
[h: oldColdProtection = ColdProtection]
[h, if(CD == 0), CODE:
{
};{
[if(CD <= ColdProtection), CODE:
{
[h: ColdProtection = ColdProtection - CD]
Takes [CD] Cold damage, losing [CD] Cold Protection. You now have [ColdProtection] Cold Protection with [ColdResistance] Resistance.<br>
[h: CD = 0]
};{
[h: overdamage = 0]
[h: overdamage = CD - ColdProtection]
[h: ColdProtection = 0]
[h: setState("Protection from Cold",0)]
Takes [CD] damage, losing [oldColdProtection] Cold Protection. You now have 0 Cold Protection with [ColdResistance] Resistance.<br>
[h: overdamage = if(ColdResistance > 0, overdamage - ColdResistance, overdamage)]
[h: overdamage = if(overdamage < 0, 0, overdamage)]
[h: coldDamage = overdamage]
}]
}]
[h: oldElectricityProtection = ElectricityProtection]
[h, if(ED == 0), CODE:
{
};{
[if(ED <= ElectricityProtection), CODE:
{
[h: ElectricityProtection = ElectricityProtection - ED]
Takes [ED] Electricity damage, losing [ED] Electricity Protection. You now have [ElectricityProtection] Electricity Protection with [ElectricityResistance] Resistance.<br>
[h: ED = 0]
};{
[h: overdamage = 0]
[h: overdamage = ED - ElectricityProtection]
[h: ElectricityProtection = 0]
[h: setState("Protection from Electricity",0)]
Takes [ED] damage, losing [oldElectricityProtection] Electricity Protection. You now have 0 Electricity Protection with [ElectricityResistance] Resistance.<br>
[h: overdamage = if(ElectricityResistance > 0, overdamage - ElectricityResistance, overdamage)]
[h: overdamage = if(overdamage < 0, 0, overdamage)]
[h: electricityDamage = overdamage]
}]
}]
[h: oldFireProtection = FireProtection]
[h, if(FD == 0), CODE:
{
};{
[if(FD <= FireProtection), CODE:
{
[h: FireProtection = FireProtection - FD]
Takes [FD] Fire damage, losing [FD] Fire Protection. You now have [FireProtection] Fire Protection with [FireResistance] Resistance.<br>
[h: FD = 0]
};{
[h: overdamage = 0]
[h: overdamage = FD - FireProtection]
[h: FireProtection = 0]
[h: setState("Protection from Fire",0)]
Takes [FD] damage, losing [oldFireProtection] Fire Protection. You now have 0 Fire Protection with [FireResistance] Resistance.<br>
[h: overdamage = if(FireResistance > 0, overdamage - FireResistance, overdamage)]
[h: overdamage = if(overdamage < 0, 0, overdamage)]
[h: fireDamage = overdamage]
}]
}]
<!-- Get damage ammount and check for massive damage -->
[w("meera"): damage = acidDamage + coldDamage + electricityDamage + fireDamage + physicalDamage]
[h: tempState = 0]
[h: negCon = 0]
[h: massiveDMG = 0]
[h: acidDamage = 0]
[h: coldDamage = 0]
[h: electricityDamage = 0]
[h: fireDamage = 0]
[h: damage = 0]
[h:status=input(
"physicalDamage|0|Amount of damage",
"AD|0|Acid based damage",
"CD|0|Cold based damage",
"ED|0|Electricity based damage",
"FD|0|Fire based damage")]
[h:abort(status)]
<!-- Take care of the elemental damages -->
[h: oldAcidProtection = AcidProtection]
[h, if(AD == 0), CODE:
{
};{
[if(AD <= AcidProtection), CODE:
{
[h: AcidProtection = AcidProtection - AD]
Takes [AD] Acid damage, losing [AD] Acid Protection. You now have [AcidProtection] Acid Protection with [AcidResistance] Resistance.<br>
[h: AD = 0]
};{
[h: overdamage = 0]
[h: overdamage = AD - AcidProtection]
[h: AcidProtection = 0]
[h: setState("Protection from Acid",0)]
Takes [AD] damage, losing [oldAcidProtection] Acid Protection. You now have 0 Acid Protection with [AcidResistance] Resistance.<br>
[h: overdamage = if(AcidResistance > 0, overdamage - AcidResistance, overdamage)]
[h: overdamage = if(overdamage < 0, 0, overdamage)]
[h: acidDamage = overdamage]
}]
}]
[h: oldColdProtection = ColdProtection]
[h, if(CD == 0), CODE:
{
};{
[if(CD <= ColdProtection), CODE:
{
[h: ColdProtection = ColdProtection - CD]
Takes [CD] Cold damage, losing [CD] Cold Protection. You now have [ColdProtection] Cold Protection with [ColdResistance] Resistance.<br>
[h: CD = 0]
};{
[h: overdamage = 0]
[h: overdamage = CD - ColdProtection]
[h: ColdProtection = 0]
[h: setState("Protection from Cold",0)]
Takes [CD] damage, losing [oldColdProtection] Cold Protection. You now have 0 Cold Protection with [ColdResistance] Resistance.<br>
[h: overdamage = if(ColdResistance > 0, overdamage - ColdResistance, overdamage)]
[h: overdamage = if(overdamage < 0, 0, overdamage)]
[h: coldDamage = overdamage]
}]
}]
[h: oldElectricityProtection = ElectricityProtection]
[h, if(ED == 0), CODE:
{
};{
[if(ED <= ElectricityProtection), CODE:
{
[h: ElectricityProtection = ElectricityProtection - ED]
Takes [ED] Electricity damage, losing [ED] Electricity Protection. You now have [ElectricityProtection] Electricity Protection with [ElectricityResistance] Resistance.<br>
[h: ED = 0]
};{
[h: overdamage = 0]
[h: overdamage = ED - ElectricityProtection]
[h: ElectricityProtection = 0]
[h: setState("Protection from Electricity",0)]
Takes [ED] damage, losing [oldElectricityProtection] Electricity Protection. You now have 0 Electricity Protection with [ElectricityResistance] Resistance.<br>
[h: overdamage = if(ElectricityResistance > 0, overdamage - ElectricityResistance, overdamage)]
[h: overdamage = if(overdamage < 0, 0, overdamage)]
[h: electricityDamage = overdamage]
}]
}]
[h: oldFireProtection = FireProtection]
[h, if(FD == 0), CODE:
{
};{
[if(FD <= FireProtection), CODE:
{
[h: FireProtection = FireProtection - FD]
Takes [FD] Fire damage, losing [FD] Fire Protection. You now have [FireProtection] Fire Protection with [FireResistance] Resistance.<br>
[h: FD = 0]
};{
[h: overdamage = 0]
[h: overdamage = FD - FireProtection]
[h: FireProtection = 0]
[h: setState("Protection from Fire",0)]
Takes [FD] damage, losing [oldFireProtection] Fire Protection. You now have 0 Fire Protection with [FireResistance] Resistance.<br>
[h: overdamage = if(FireResistance > 0, overdamage - FireResistance, overdamage)]
[h: overdamage = if(overdamage < 0, 0, overdamage)]
[h: fireDamage = overdamage]
}]
}]
<!-- Get damage ammount and check for massive damage -->
[w("meera"): damage = acidDamage + coldDamage + electricityDamage + fireDamage + physicalDamage]
Is there something I am just overlooking?
EDIT: There very last line works as intended.