Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**<
- * Success type can be: failure, success, and critical success. Only use at First Aid.
- * The coloring of the heal above head will depends on it,
- * where critical success is the greenest and the critical failure is an ugly dark blueish green.
- * Reason type can be: First Aid, Weak healing powder, Healing powder, Stimpack, Super Stimpack, Hypo.
- * If the reason is no reason, then only the healing value is printed.
- * In the header all reasons can be disabled with setting IS_HEAL_TEXT_REASON_ENABLED to false.
- */
- void FloatingHealText(Critter& cr, int healAmount, int reason, int successType = SKILL_CHECK_SUCCESS)
- {
- string text;
- string reasonText = "";
- uint color = 0;
- switch (successType)
- {
- case SKILL_CHECK_CRITICAL_FAILURE:
- case SKILL_CHECK_FAILURE:
- color = COLOR_HEAL_TEXT_FAILURE;
- break;
- case SKILL_CHECK_SUCCESS:
- color = COLOR_HEAL_TEXT_SUCCESS;
- break;
- case SKILL_CHECK_CRITICAL_SUCCESS:
- color = COLOR_HEAL_TEXT_CRIT_SUCCESS;
- break;
- }
- if (IS_HEAL_TEXT_REASON_ENABLED)
- {
- switch (reason)
- {
- case HEAL_TEXT_REASON_FIRSTAID:
- reasonText = "FA";
- break;
- case HEAL_TEXT_REASON_WEAKHEALINGPOWDER:
- reasonText = "WP";
- break;
- case HEAL_TEXT_REASON_HEALINGPOWDER:
- reasonText = "HP";
- break;
- case HEAL_TEXT_REASON_STIMPACK:
- reasonText = "ST";
- break;
- case HEAL_TEXT_REASON_SUPERSTIMPACK:
- reasonText = "SS";
- break;
- case HEAL_TEXT_REASON_HYPO:
- reasonText = "Hypo";
- break;
- case HEAL_TEXT_REASON_NOREASON:
- reasonText = "";
- break;
- }
- }
- else
- {
- reasonText = "";
- }
- // Just in case critical failure hurts later.
- if(healAmount >= 0)
- text = "+ " + healAmount + " " + reasonText;
- else
- text = "- " + healAmount + " " + reasonText;
- MapMessageEx(FLOAT_ENFORCED, FLOAT_MODE_ALL, cr, text, cr.HexX, cr.HexY, 150, color, true, 0, 0, -40, -70);
- SayEx(SAYEX_VERBOSE_ACTION, cr, text);
- }
- void FloatingHealTextByDrugPid(Critter& cr, int healAmount, uint16 drugPid)
- {
- int reason = -1;
- switch (drugPid)
- {
- case PID_WEAK_HEALING_POWDER:
- reason = HEAL_TEXT_REASON_WEAKHEALINGPOWDER;
- break;
- case PID_HEALING_POWDER:
- reason = HEAL_TEXT_REASON_HEALINGPOWDER;
- break;
- case PID_STIMPAK:
- reason = HEAL_TEXT_REASON_STIMPACK;
- break;
- case PID_SUPER_STIMPAK:
- reason = HEAL_TEXT_REASON_SUPERSTIMPACK;
- break;
- case PID_HYPO:
- reason = HEAL_TEXT_REASON_HYPO;
- break;
- default:
- reason = HEAL_TEXT_REASON_NOREASON;
- }
- if (reason >= 0)
- {
- FloatingHealText(cr, healAmount, reason);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement