here is my finished (at the moment any way) code.
Code: Select all
[h: hp = getProperty("Vitality")]
[h: wnds=getProperty("Wounds")]
[h: input("dmg|0|Damge You have taken.")]
[h: hpremaining=hp-dmg]
[h: val = abs(hpremaining)]
[h: wndsrmning=wnds-val]
[r, if(hpremaining <= 0),CODE:
{
[r, if(wndsrmning>0),CODE:
{
[h: setProperty("Vitality", 0)]
[h: setProperty("Wounds", wndsrmning)]
<b>I have 0 Vitality and [t: wnds-val] Wounds left.</b><br>
};
{
[h: setProperty("Vitality", 0)]
[h: setProperty("Wounds", 0)]
<b> I HAVE DIED!!!!!!!!!!!</b><br>
}
]
};
{
[h: setProperty("Vitality", hpremaining)]
<b>I have [t: hp-dmg] Vitality left.</b><br>
}
]
I also created a macro for healing damage. Here it is.
Code: Select all
[h: hp = getProperty("Vitality")]
[h: maxhp = getProperty("MaxVitality")]
[h: wnds=getProperty("Wounds")]
[h: mxwnds=getProperty("MaxWounds")]
[h: input("heal|0|How much damage was healed.")]
[h: wndschk=wnds+heal]
[h: wndsoverhealchk=mxwnds-wnds]
[h: healchk=hp+heal]
[h: healvit=maxhp-hp]
[r, if(wnds < mxwnds), CODE:
{
[r, if(wndschk > mxwnds),CODE:
{
[h: setProperty("Wounds",mxwnds)]
[h: setProperty("Vitality",hp+wndsoverhealchk)]
<b>I have [t: hp+wndsoverhealchk] Vitality and [t: mxwnds] Wounds left.</b><br>
};
{
[h: setProperty("Wounds",wndschk)]
<b>I have 0 Vitality and [t: wnds=wnds+heal] Wounds left.</b><br>
}
]
};
{
[r, if(healchk>maxhp),CODE:
{
[h: setProperty("Vitality",maxhp)]
<b>I have [t: hp+healvit] Vitality and [t: mxwnds] Wounds left.</b><br>
};
{
[h: setProperty("Vitality",hp+heal)]
<b>I have [t: hp+heal] Vitality and [t: mxwnds] Wounds left.</b><br>
}
]
}
]
Thanks for everyone who helped me out as you can see I do learn from my mistakes. Even if it is just basic coding.
ralstad