SHARE
TWEET

TUT: HEAL TEXT - skills.fos

Slowhand-VI Jan 6th, 2016 91 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //IN FUNCTION: UseFirstAidOnCritter(Critter& cr, Critter& targetCr, Item@ item)
  2. ...
  3.     int curHp = targetCr.Stat[ST_CURRENT_HP];
  4.     int maxHp = targetCr.Stat[ST_MAX_LIFE];
  5.     if(curHp + heal > maxHp)
  6.         heal = maxHp - curHp;
  7.     targetCr.StatBase[ST_CURRENT_HP] += heal;
  8.     //  Start replacing the code from here: basically remove old floating text related.
  9.     //  Floating healing text.
  10.     if (isCritFailure)
  11.         FloatingHealText(targetCr, heal, HEAL_TEXT_REASON_FIRSTAID, SKILL_CHECK_FAILURE);
  12.     else if (isCritSuccess)
  13.         FloatingHealText(targetCr, heal, HEAL_TEXT_REASON_FIRSTAID, SKILL_CHECK_CRITICAL_SUCCESS);
  14.     else
  15.         FloatingHealText(targetCr, heal, HEAL_TEXT_REASON_FIRSTAID, SKILL_CHECK_SUCCESS);
  16.     //  Replace end, below this everything should be as the original source.
  17.     //  Message box texts.
  18.     cr.Say(SAY_NETMSG, "Hit Points +" + heal);
  19.     if(!is_self)
  20.         targetCr.Say(SAY_NETMSG, "Hit Points +" + heal);
  21.  
  22.     _SetTimeout(cr, TO_SK_FIRST_AID, FIRST_AID_TIMEOUT(cr));
  23. ...
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top