Hero 6th Edition Framework

MapTool campaign files that encapsulate properties, tokens, and macros for a particular ruleset or game world. "Framework" is often abbreviated "FW".

Moderators: dorpond, trevor, Azhrei, giliath, Gamerdude, jay, Mr.Ice

Forum rules
This forum is LOCKED. If a thread belongs here, use the "Report" feature of the post to let a moderator know to move it. General discussion should occur in the User Creations or MapTool forums.
User avatar
nolgroth
Dragon
Posts: 441
Joined: Fri Sep 21, 2007 6:10 pm

Re: Hero 6th Edition Framework

Post by nolgroth »

I'll look a little deeper. See how things are playing (or not) together. I will delve into it and see what I can come up with. Today is Tuesday. The Quick macro set is pretty easy to go through so I can probably have an update by Thursday.

User avatar
nolgroth
Dragon
Posts: 441
Joined: Fri Sep 21, 2007 6:10 pm

Re: Hero 6th Edition Framework

Post by nolgroth »

Okay. Looking at the code, I never intended for the values to carry over. I built the Quick OCV macro to handle each attack separately. I will look into a quick macro that keeps the values until reset (either through the initiative mechanism or perhaps via a dedicated macro).

EDIT: Cut and Paste the Code below into a new macro. I named mine Quick OCV Expanded. The will keep the values to OCV (and DCV) persistent until cleared. My preferred method is the initiative mechanism built into the framework. If you don't use that, I will put a new macro to call the resetCV macro, that can be run independently of the initiative mechanism. In this case, I don't know if you'll even need the Quick CV Adjustments macro. Please let me know if this is what you are looking for.

EDIT 2: Added the DCV Multiple option. The Quick CV Adjustment can still be useful for shifting CV values without attacking.

Code: Select all

[h: getProperty ("baseOCV")]
[h: getProperty ("baseOMCV")]

[h: attackRoll=input(
	"whichOne|OCV, MentalOCV|Type of attack (Physical or Mental)|RADIO|VALUE=STRING ORIENT=H",
	"GMmod||Situational Modifiers assigned by the GM",
	"CSLs||Combat Skill Levels to OCV",
	"CSLsD||Combat Skill Levels to DCV",	
	"maBonus||Maneuver Bonus to OCV",
	"maBonusD||Maneuver Bonus to DCV",
	"adjDCVMulti|0, 0.5, 1|DCV Multiple|RADIO| ORIENT=H SELECT=2  VALUE=STRING",
	"autoFire|1|Number of Autofire attacks|"
	)
]

[h: abort(attackRoll)]

[h, if (whichOne == "OCV"), CODE:
	{
	[h: adjOCV=baseOCV+GMmod+CSLs+maBonus]
	[h: setProperty ("cslOCV", CSLs)]
	[h: setProperty ("cslDCV", CSLsD)]
	[h: setProperty ("ocvMod", maBonus)]
	[h: setProperty ("dcvMod", maBonusD)]
	[h: setProperty ("dcvMulti", adjDCVMulti, getSelected() )]
	[h: output="DCV"]
	};
	{
	[h: adjOCV=baseOMCV+GMmod+CSLs+maBonus]
	[h: setProperty ("cslOMCV", CSLs)]
	[h: setProperty ("cslDMCV", CSLsD)]
	[h: setProperty ("omcvMod", maBonus)]
	[h: setProperty ("dmcvMod", maBonusD)]
	[h: output="DMCV"]
	}
]

[h: hitRoll=3d6]
Hit Roll: <b>[hitRoll]</b>
[h: dcvHit=11+2+adjOCV-hitRoll]

<br>
[r, c (autoFire,"<br>"), code:
{
[h: dcvHit = dcvHit-2]
[output] hit: <b>[dcvHit]</b>
}]


OptionW
Giant
Posts: 102
Joined: Tue May 29, 2012 10:07 pm

Re: Hero 6th Edition Framework

Post by OptionW »

did a quick test..I think that works Perfect. thanks again
OptionW

OptionW
Giant
Posts: 102
Joined: Tue May 29, 2012 10:07 pm

Re: Hero 6th Edition Framework

Post by OptionW »

Hello :-) Also, the Quick Apply Damage does not seem to count Combat Luck.

OptionW

User avatar
nolgroth
Dragon
Posts: 441
Joined: Fri Sep 21, 2007 6:10 pm

Re: Hero 6th Edition Framework

Post by nolgroth »

OptionW wrote:Hello :-) Also, the Quick Apply Damage does not seem to count Combat Luck.

OptionW
Confirmed. It actually polls the data but doesn't use it anywhere. I'll post some code tonight to fix it.

User avatar
nolgroth
Dragon
Posts: 441
Joined: Fri Sep 21, 2007 6:10 pm

Re: Hero 6th Edition Framework

Post by nolgroth »

Okay. Try this. My preliminary tests suggests that it works as intended. Copy and replace the text in the existing Quick Apply Damage macro.

Code: Select all

[h: cLuck=getProperty ("CombatLuck")]
[h: getProperty ("currentCon")]
[h: useBleed=getLibProperty ("useBleeding", "Lib:Combat")]
[h: useStunned=getLibProperty ("useStunned", "Lib:Combat")]
[h: tNS=getProperty ("takesNoStun")]
[h: dNB=getProperty ("doesNotBleed")]
[h: cBS=getProperty ("cannotBeStunned")] 



[h,if (dNB==1): useBleed=0]
[h,if (cBS==1): useStunned=0]

[h: damage = input (
	"defType|PD, ED, Sight, Hearing, Touch, Olfactory, Mental, Power, None|Type of Attack|RADIO|VALUE=STRING ORIENT=H",
	"dmgType|Normal, Killing|Type of Damage|RADIO|SELECT=1 ORIENT=H",
	"stunDmg|0|Input Stun Damage Taken (use positive numbers)",
	"bodyDmg|0|Input Body Damage Taken (use positive numbers)",
	"armorPiercing|0|Check if attack is Armor Piercing|CHECK",
	"Pen|0|Check if attack is Penetrating|CHECK",
	"ignoreCL||Do not apply Combat Luck|CHECK",
	"dmgMultiStun|0.25, 0.5, 0.75, 1, 1.5, 2|Stun Damage Multiple|RADIO|ORIENT=H SELECT=3 VALUE=STRING",
	"dmgMultiBody|0.25, 0.5, 0.75, 1, 1.5, 2|Body Damage Multiple|RADIO|ORIENT=H SELECT=3 VALUE=STRING",
	"showHeader|0|Update/Show Character Sheet Header|CHECK"
	)
]

[h: abort (damage)]


[h: appCL = ABS(ignoreCL -1)]

[h, switch (defType), CODE:

	case "PD":
		{
		[temp_PD=getProperty ("currentPD")]
		[temp_HPD=getProperty ("currentHPD")]
		[temp_RPD=getProperty ("currentRPD")]
		[temp_HRPD=getProperty ("currentHRPD")]
		[temp_HRPD=temp_HRPD+(cLuck*3)]
		[rDef=temp_RPD+temp_HRPD]
		[tDef=temp_RPD+temp_HRPD+temp_PD+temp_HPD]
		};
		
	case "ED":
		{
		[temp_ED=getProperty ("currentED")]
		[temp_HED=getProperty ("currentHED")]
		[temp_RED=getProperty ("currentRED")]
		[temp_HRED=getProperty ("currentHRED")]
		[temp_HRED=temp_HRED+(cLuck*3)]
		[rDef=temp_RED+temp_HRED]
		[tDef=temp_RED+temp_HRED+temp_ED+temp_HED]
		};
	
	case "Sight":
		{
		[temp_SightDef=getProperty ("currentSightDef")]
		[temp_HSightDef=getProperty ("currentHSightDef")]
		[temp_RSightDef=getProperty ("currentRSightDef")]
		[temp_HRSightDef=getProperty ("currentHRSightDef")]
		[rDef=temp_RSightDef+temp_HRSightDef]
		[tDef=temp_RSightDef+temp_HRSightDef+temp_SightDef+temp_HSightDef]
		};
		
	case "Hearing":
		{
		[temp_HearingDef=getProperty ("currentHearingDef")]
		[temp_HHearingDef=getProperty ("currentHHearingDef")]
		[temp_RHearingDef=getProperty ("currentRHearingDef")]
		[temp_HRHearingDef=getProperty ("currentHRHearingDef")]
		[rDef=temp_RHearingDef+temp_HRHearingDef]
		[tDef=temp_RHearingDef+temp_HRHearingDef+temp_HearingDef+temp_HHearingDef]
		};
		
	case "Touch":
		{
		[temp_TouchDef=getProperty ("currentTouchDef")]
		[temp_HTouchDef=getProperty ("currentHTouchDef")]
		[temp_RTouchDef=getProperty ("currentRTouchDef")]
		[temp_HRTouchDef=getProperty ("currentHRTouchDef")]
		[rDef=temp_RTouchDef+temp_HRTouchDef]
		[tDef=temp_RTouchDef+temp_HRTouchDef+temp_TouchDef+temp_HTouchDef]
		};
		
	case "Olfactory":
		{
		[temp_SmellDef=getProperty ("currentSmellDef")]
		[temp_HSmellDef=getProperty ("currentHSmellDef")]
		[temp_RSmellDef=getProperty ("currentRSmellDef")]
		[temp_HRSmellDef=getProperty ("currentHRSmellDef")]
		[rDef=temp_RSmellDef+temp_HRSmellDef]
		[tDef=temp_RSmellDef+temp_HRSmellDef+temp_SmellDef+temp_HSmellDef]
		};
	
	case "Mental":
		{
		[temp_MDef=getProperty ("currentMDef")]
		[temp_HMDef=getProperty ("currentHMDef")]
		[temp_RMDef=getProperty ("currentRMDef")]
		[temp_HRMDef=getProperty ("currentHRMDef")]
		[rDef=temp_RMDef+temp_HRMDef]
		[tDef=temp_RMDef+temp_HRMDef+temp_MDef+temp_HMDef]
		};
	
	case "Power":
		{
		[temp_PowDef=getProperty ("currentPowDef")]
		[temp_HPowDef=getProperty ("currentHPowDef")]
		[temp_RPowDef=getProperty ("currentRPowDef")]
		[temp_HRPowDef=getProperty ("currentHRPowDef")]
		[rDef=temp_RPowDef+temp_HRPowDef]
		[tDef=temp_RPowDef+temp_HRPowDef+temp_PowDef+temp_HPowDef]
		};
	
	case "None":
		{
		[tDef=0]
		[rDef=0]
		}
	]

[h: adjStunDmg = round ((stunDmg - tDef)  * dmgMultiStun)]
[h, if (dmgType==0): adjBodyDmg = round ((bodyDmg - tDef)  * dmgMultiBody) ; adjBodyDmg = round ((bodyDmg - rDef)  * dmgMultiBody) ]

[h, if (adjBodyDmg < 0): adjBodyDmg=0]
[h, if (adjStunDmg < adjBodyDmg): adjStunDmg = adjBodyDmg]

[h: setProperty ("stunDamage", stunDamage+adjStunDmg)]
[h: setProperty ("bodyDamage", bodyDamage+adjBodyDmg)]


<b>Final Stun Damage: [adjStunDmg]
<br>Final Body Damage: [adjBodyDmg]
<br>
<font size=4><b>Damage Applied</b></font>
<br>
[h, if (dmgType==0): bleedThreshhold=bodyDamage-6 ; bleedThreshhold=bodyDamage]
[h, if (bleedThreshhold <0): bleedThreshhold=0]

[if (useBleed==1), CODE:
	{
	[h: bleedAmount= tbl ("Bleeding", bleedThreshhold)]
	[h: setProperty ("bleedDamage", bleedAmount)]
	};{ [h: bleedAmount=0] }]

[if (useBleed==1 && bleedAmount >0), CODE:{ [h: setState ("bleeding", 1)] [r:"<br>"+token.name+" is bleeding. Damage will start next Segment 1."] }; {}]

<!--IF STUNNING RULES ARE USED, SETS STUNNED STATUS IF STUN DAMAGE EXCEEDS CON SCORE-->

[h, if (adjStunDmg > currentCon && useStunned==1), CODE: 
	{
	[stunMessage="<br>"+token.name+" is Stunned"]
	[setState ("stunned", 1)]
	};
	{
	[stunMessage=""]
	}
]
[r: stunMessage]
[h, if (currentStun <=0), CODE:
	{
	[uncMessage="<br>"+token.name+" is Unconscious"]
	[h: setState ("unconscious", 1)]
	};
	{
	[uncMessage=""]
	}
]
[r: uncMessage]

<br>
[h, if (currentBody <= 0), CODE:
	{
	[dieMessage="<br>"+token.name+" is Dying"]
	[h: setState ("dieing", 1)]
	};
	{
	[dieMessage=""]
	}
]

[r: dieMessage]

[if (showHeader==0), CODE: {}; {[r, macro ("CharacterSheetHeader@Lib:Combat"): getSelected()]} ]

OptionW
Giant
Posts: 102
Joined: Tue May 29, 2012 10:07 pm

Re: Hero 6th Edition Framework

Post by OptionW »

Thanks again, the Combat luck now works with it. However...I just discovered the Damage Reduction, Armor Piercing and Penetrating are also not working on the Quick Apply Damage. thanks


OptionW
Last edited by OptionW on Thu Dec 05, 2013 2:56 am, edited 1 time in total.

OptionW
Giant
Posts: 102
Joined: Tue May 29, 2012 10:07 pm

Re: Hero 6th Edition Framework

Post by OptionW »

sorry for this post..i just edited and added the rest on the last post

User avatar
nolgroth
Dragon
Posts: 441
Joined: Fri Sep 21, 2007 6:10 pm

Re: Hero 6th Edition Framework

Post by nolgroth »

OptionW wrote:However...I just discovered the Damage Reduction, Armor Piercing and Penetrating are also not working on the Quick Apply Damage. thanks
OptionW
I see that. It isn't so much that they are not working, but the macro does not differentiate between normal and hardened defenses. I am not able to figure out why Damage Reduction is not working for you. I just tested it and was able to get the numbers correctly output. Are you thinking Damage Negation?

EDIT: Getting Hardened Defenses versus Penetrating/Piercing attacks in the main attack sequence was very trick and relied upon having the number of levels of Hardened verses P/P figured out in advance. I'm a little mentally fatigued today, so it might take a while to figure out.

OptionW
Giant
Posts: 102
Joined: Tue May 29, 2012 10:07 pm

Re: Hero 6th Edition Framework

Post by OptionW »

Ah, I somehow forgot this was the quick way. I thought the bottom part of apply damage was only for killing attacks. I did not use the radial buttons for .5 damage, I thought it would take it from the Defense Builder.

So currently I don't use Hardened defense. I'm a bit confused on what you had said about the Armor Piercing and Pen damages. If I'm thinking correctly you wouldn't need to worry about multiple Hardened and Armor Piercing and Pen damages. Just Armor Piercing and Pen. If the target has more hardened than AP or Pen, just don't click the Armor Piercing radial button or Pen Button, as it just negates the effect of AP or Pen. (this probably doesn't make much sense ..lol ..its late.) Thanks for looking into this for me. (for Pen damage...if you can just put in a part that doesn't use defenses .... like PD/ED/MD/Power/"None" .


OptionW

User avatar
nolgroth
Dragon
Posts: 441
Joined: Fri Sep 21, 2007 6:10 pm

Re: Hero 6th Edition Framework

Post by nolgroth »

It just occurs to me that Penetrating attacks require individual dice rolls to count the body of. As such, I don't think that Penetrating is necessary for this macro. I mean, Penetrating versus the appropriate defense can almost be calculated on the fly.

OptionW
Giant
Posts: 102
Joined: Tue May 29, 2012 10:07 pm

Re: Hero 6th Edition Framework

Post by OptionW »

Yeah, I agree. Im just looking for a Armor Piercing solution now :-)

OptionW

User avatar
nolgroth
Dragon
Posts: 441
Joined: Fri Sep 21, 2007 6:10 pm

Re: Hero 6th Edition Framework

Post by nolgroth »

I have Armor Piercing figured out. Seems to be working anyway.

Penetrating (which I want to include since the macro applies damage) is giving me many more issues. I will look more into it tomorrow.

OptionW
Giant
Posts: 102
Joined: Tue May 29, 2012 10:07 pm

Re: Hero 6th Edition Framework

Post by OptionW »

I was thinking, since its a quick apply damage...you could imput a box titled No Normal Defense..and we would just imput the number that automatically gets through all Defenses.

User avatar
nolgroth
Dragon
Posts: 441
Joined: Fri Sep 21, 2007 6:10 pm

Re: Hero 6th Edition Framework

Post by nolgroth »

OptionW wrote:I was thinking, since its a quick apply damage...you could imput a box titled No Normal Defense..and we would just imput the number that automatically gets through all Defenses.
There already is one called None. That applies 0 defense against the incoming damage.

I figured out Penetrating (I think). Initial tests seem to indicate that it works. I got slammed with work stuff this weekend, so if it doesn't work quite right, let me know. As a temporary solution, in the event it doesn't work, just input the amount of damage done after appropriate defenses and click on the None box.

Code: Select all

[h: cLuck=getProperty ("CombatLuck")]
[h: getProperty ("currentCon")]
[h: useBleed=getLibProperty ("useBleeding", "Lib:Combat")]
[h: useStunned=getLibProperty ("useStunned", "Lib:Combat")]
[h: tNS=getProperty ("takesNoStun")]
[h: dNB=getProperty ("doesNotBleed")]
[h: cBS=getProperty ("cannotBeStunned")] 



[h,if (dNB==1): useBleed=0]
[h,if (cBS==1): useStunned=0]

[h: damage = input (
	"defType|PD, ED, Sight, Hearing, Touch, Olfactory, Mental, Power, None|Type of Attack|RADIO|VALUE=STRING ORIENT=H",
	"dmgType|Normal, Killing|Type of Damage|RADIO|SELECT=1 ORIENT=H",
	"stunDmg|0|Input Stun Damage Taken (use positive numbers)",
	"bodyDmg|0|Input Body Damage Taken (use positive numbers)",
	"penetrating|0|Check is attack is Penetrating|CHECK",
	"armorPiercing|0|Check if attack is Armor Piercing|CHECK",
	"ignoreCL||Do not apply Combat Luck|CHECK",
	"dmgMultiStun|0.25, 0.5, 0.75, 1, 1.5, 2|Stun Damage Multiple|RADIO|ORIENT=H SELECT=3 VALUE=STRING",
	"dmgMultiBody|0.25, 0.5, 0.75, 1, 1.5, 2|Body Damage Multiple|RADIO|ORIENT=H SELECT=3 VALUE=STRING",
	"showHeader|0|Update/Show Character Sheet Header|CHECK"
	)
]

[h: abort (damage)]


[h: appCL = ABS(ignoreCL -1)]

[h, switch (defType), CODE:

	case "PD":
		{
		[temp_PD=getProperty ("currentPD")]
		[temp_PD=round (temp_PD/(armorPiercing+1))]
		[temp_HPD=getProperty ("currentHPD")]
		[temp_RPD=getProperty ("currentRPD")]
		[temp_RPD=round (temp_RPD/(armorPiercing+1))]
		[temp_HRPD=getProperty ("currentHRPD")]
		[temp_HRPD=temp_HRPD+(cLuck*3)]
		[rDef=temp_RPD+temp_HRPD]
		[tDef=temp_RPD+temp_HRPD+temp_PD+temp_HPD]
		[rhDef=temp_HRPD]
		[thrDef=temp_HPD + temp_HRPD]
		};
		
	case "ED":
		{
		[temp_ED=getProperty ("currentED")]
		[temp_ED=round (temp_ED/(armorPiercing+1))]
		[temp_HED=getProperty ("currentHED")]
		[temp_RED=getProperty ("currentRED")]
		[temp_RED=round (temp_RED/(armorPiercing+1))]
		[temp_HRED=getProperty ("currentHRED")]
		[temp_HRED=temp_HRED+(cLuck*3)]
		[rDef=temp_RED+temp_HRED]
		[tDef=temp_RED+temp_HRED+temp_ED+temp_HED]
		[rhDef=temp_HRED]
		[thrDef=temp_HED + tempHRED]
		};
	
	case "Sight":
		{
		[temp_SightDef=getProperty ("currentSightDef")]
		[temp_SightDef=round (temp_SightDef/(armorPiercing+1))]
		[temp_HSightDef=getProperty ("currentHSightDef")]
		[temp_RSightDef=getProperty ("currentRSightDef")]
		[temp_RSightDef=round (temp_RSightDef/(armorPiercing+1))]
		[temp_HRSightDef=getProperty ("currentHRSightDef")]
		[rDef=temp_RSightDef+temp_HRSightDef]
		[tDef=temp_RSightDef+temp_HRSightDef+temp_SightDef+temp_HSightDef]
		[rhDef=temp_HRSightDef]
		[thrDef=temp_HSightDef + tempHRSightDef]
		};
		
	case "Hearing":
		{
		[temp_HearingDef=getProperty ("currentHearingDef")]
		[temp_HearingDef=round (temp_HearingDef/(armorPiercing+1))]
		[temp_HHearingDef=getProperty ("currentHHearingDef")]
		[temp_RHearingDef=getProperty ("currentRHearingDef")]
		[temp_RHearingDef=round (temp_RHearingDef/(armorPiercing+1))]
		[temp_HRHearingDef=getProperty ("currentHRHearingDef")]
		[rDef=temp_RHearingDef+temp_HRHearingDef]
		[tDef=temp_RHearingDef+temp_HRHearingDef+temp_HearingDef+temp_HHearingDef]
		[rhDef=temp_HRHearingDef]
		[thrDef=temp_HHearingDef + tempHRHearingDef]
		};
		
	case "Touch":
		{
		[temp_TouchDef=getProperty ("currentTouchDef")]
		[temp_TouchDef=round (temp_TouchDef/(armorPiercing+1))]
		[temp_HTouchDef=getProperty ("currentHTouchDef")]
		[temp_RTouchDef=getProperty ("currentRTouchDef")]
		[temp_RTouchDef=round (temp_RTouchDef/(armorPiercing+1))]
		[temp_HRTouchDef=getProperty ("currentHRTouchDef")]
		[rDef=temp_RTouchDef+temp_HRTouchDef]
		[tDef=temp_RTouchDef+temp_HRTouchDef+temp_TouchDef+temp_HTouchDef]
		[rhDef=temp_HRTouchDef]
		[thrDef=temp_HTouchDef + tempHRTouchDef]
		};
		
	case "Olfactory":
		{
		[temp_SmellDef=getProperty ("currentSmellDef")]
		[temp_SmellDef=round (temp_SmellDef/(armorPiercing+1))]
		[temp_HSmellDef=getProperty ("currentHSmellDef")]
		[temp_RSmellDef=getProperty ("currentRSmellDef")]
		[temp_RSmellDef=round (temp_ESmellDef/(armorPiercing+1))]
		[temp_HRSmellDef=getProperty ("currentHRSmellDef")]
		[rDef=temp_RSmellDef+temp_HRSmellDef]
		[tDef=temp_RSmellDef+temp_HRSmellDef+temp_SmellDef+temp_HSmellDef]
		[rhDef=temp_HRSmellDef]
		[thrDef=temp_HSmellDef + tempHRSmellDef]
		};
	
	case "Mental":
		{
		[temp_MDef=getProperty ("currentMDef")]
		[temp_MDef=round (temp_MDef/(armorPiercing+1))]
		[temp_HMDef=getProperty ("currentHMDef")]
		[temp_RMDef=getProperty ("currentRMDef")]
		[temp_RMDef=round (temp_RMDef/(armorPiercing+1))]
		[temp_HRMDef=getProperty ("currentHRMDef")]
		[rDef=temp_RMDef+temp_HRMDef]
		[tDef=temp_RMDef+temp_HRMDef+temp_MDef+temp_HMDef]
		[rhDef=temp_HRMDef]
		[thrDef=temp_HMDef + tempHRMDef]
		};
	
	case "Power":
		{
		[temp_PowDef=getProperty ("currentPowDef")]
		[temp_PowDef=round (temp_PowDef/(armorPiercing+1))]
		[temp_HPowDef=getProperty ("currentHPowDef")]
		[temp_RPowDef=getProperty ("currentRPowDef")]
		[temp_RPowDef=round (temp_RPowDef/(armorPiercing+1))]
		[temp_HRPowDef=getProperty ("currentHRPowDef")]
		[rDef=temp_RPowDef+temp_HRPowDef]
		[tDef=temp_RPowDef+temp_HRPowDef+temp_PowDef+temp_HPowDef]
		[rhDef=temp_HRPowDef]
		[thrDef=temp_HPowDef + tempHRPowDef]
		};
	
	case "None":
		{
		[tDef=0]
		[rDef=0]
		[rhDef=0]
		[thrDef=0]
		}
	]


[h, if (penetrating==1 && dmgType==0), CODE: { [adjStunDmg=floor ((stunDmg-thrDef) *dmgMultiStun)] [adjBodyDmg=floor ((bodyDmg-thrDef) * dmgMultiBody)] }; {}]
[h, if (penetrating==1 && dmgType==1), CODE: { [adjStunDmg=floor ((stunDmg-thrDef) *dmgMultiStun)] [adjBodyDmg=floor ((bodyDmg-rhDef) * dmgMultiBody)] }; {}]

[h, if (penetrating==0 && dmgType==1), CODE: { [adjStunDmg = round ((stunDmg - tDef)  * dmgMultiStun)] [adjBodyDmg=round ((bodyDmg - rDef)  * dmgMultiBody)] }; {}]
[h, if (penetrating==0 && dmgType==0), CODE: { [adjStunDmg = round ((stunDmg - tDef)  * dmgMultiStun)] [adjBodyDmg=round ((bodyDmg - tDef)  * dmgMultiBody)] }; {}]

[h, if (adjBodyDmg < 0): adjBodyDmg=0]
[h, if (adjStunDmg < adjBodyDmg): adjStunDmg = adjBodyDmg]

[h: setProperty ("stunDamage", stunDamage+adjStunDmg)]
[h: setProperty ("bodyDamage", bodyDamage+adjBodyDmg)]


<b>Final Stun Damage: [adjStunDmg]
<br>Final Body Damage: [adjBodyDmg]
<br>
<font size=4><b>Damage Applied</b></font>
<br>
[h, if (dmgType==0): bleedThreshhold=bodyDamage-6 ; bleedThreshhold=bodyDamage]
[h, if (bleedThreshhold <0): bleedThreshhold=0]

[if (useBleed==1), CODE:
	{
	[h: bleedAmount= tbl ("Bleeding", bleedThreshhold)]
	[h: setProperty ("bleedDamage", bleedAmount)]
	};{ [h: bleedAmount=0] }]

[if (useBleed==1 && bleedAmount >0), CODE:{ [h: setState ("bleeding", 1)] [r:"<br>"+token.name+" is bleeding. Damage will start next Segment 1."] }; {}]

<!--IF STUNNING RULES ARE USED, SETS STUNNED STATUS IF STUN DAMAGE EXCEEDS CON SCORE-->

[h, if (adjStunDmg > currentCon && useStunned==1), CODE: 
	{
	[stunMessage="<br>"+token.name+" is Stunned"]
	[setState ("stunned", 1)]
	};
	{
	[stunMessage=""]
	}
]
[r: stunMessage]
[h, if (currentStun <=0), CODE:
	{
	[uncMessage="<br>"+token.name+" is Unconscious"]
	[h: setState ("unconscious", 1)]
	};
	{
	[uncMessage=""]
	}
]
[r: uncMessage]

<br>
[h, if (currentBody <= 0), CODE:
	{
	[dieMessage="<br>"+token.name+" is Dying"]
	[h: setState ("dieing", 1)]
	};
	{
	[dieMessage=""]
	}
]

[r: dieMessage]

[if (showHeader==0), CODE: {}; {[r, macro ("CharacterSheetHeader@Lib:Combat"): getSelected()]} ]

Post Reply

Return to “Campaign Frameworks”