Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // TODO TO INSTALL MODULE: Include utils_h.fos right after the following 2 lines.
- // ----#include "_macros.fos"
- // ----#include "MsgStr.h"
- #include "utils_h.fos"
- // TODO TO INSTALL MODULE: Also comment out, or better, delete the following 2 lines below:
- import void VerboseAction(Critter& cr, string& text) from "utils";
- import void VerboseAction(Critter& cr, Critter& target, string& text) from "utils";
- // These 2 lines (above) are included in the utils_h.fos, so their import will be no longer needed.
- ...
- void UseDrug(Critter& cr, Item& drug) // Export
- {
- uint pid = drug.GetProtoId();
- SetDrug(cr, pid);
- _SubItem(drug, 1);
- // TODO TO INSTALL MODULE: Replace starts here, only the empty hypo needle randomization stays, everything else is not needed.
- if (pid == PID_STIMPAK || pid == PID_SUPER_STIMPAK)
- {
- // A floating text about heal amount will be displayed after heal amount calculation.
- if(cr.GetMapProtoId() != MAP_Arena)
- {
- if(Random(0, 1) == 0)
- cr.AddItem(PID_HYPODERMIC_NEEDLE, 1);
- }
- }
- // Replace ends here, the code below is the original.
- else if(pid == PID_CIGARETTES)
- {
- VerboseAction(cr, "lights a cigarette");
- cr.PlaySound("smoking.ogg", true);
- }
- ...
- else if(pid == PID_JET_ANTIDOTE)
- VerboseAction(cr, "drinks drug antidote");
- // adventurers
- // Here the old healing powder text is deleted including the whole if else line..
- else if(pid == PID_RAD_X)
- VerboseAction(cr, "swallows rad-x");
- ....
- //IN FUCNTION: void UseDrugOn(Critter& cr, Critter& onCr, Item& drug)
- ....
- _SubItem(drug, 1);
- // TODO TO INSTALL MODULE: Replace starts here, removed stuff for stimpack
- if (pid == PID_STIMPAK || pid == PID_SUPER_STIMPAK)
- {
- if(cr.GetMapProtoId() != MAP_Arena)
- {
- if(Random(0, 1) == 0)
- cr.AddItem(PID_HYPODERMIC_NEEDLE, 1);
- }
- }
- // replace ends here
- else if(pid == PID_RAD_X)
- VerboseAction(cr, onCr, "uses rad-x on TARGET");
- ....
- //IN FUNCTION: uint ProcessDrug(Critter& cr, uint16 drugPid, uint& rate)
- ....
- else if(stat == ST_CURRENT_HP)
- {
- if(amount > 0 && cr.Trait[TRAIT_CHEM_RESISTANT] != 0)
- amount /= 2;
- // TODO TO INSTALL MODULE: replace starts here: we calc the healed amount and use it a little bit later
- int healAmount = MIN(amount, cr.Stat[ST_MAX_LIFE] - cr.Stat[ST_CURRENT_HP]);
- cr.StatBase[ST_CURRENT_HP] = CLAMP(statVal + amount, -9999, cr.Stat[ST_MAX_LIFE]);
- if(amount < 0 && cr.Stat[ST_CURRENT_HP] < 0)
- cr.ToDead(Random(0, 1) == 0 ? ANIM2_DEAD_FRONT : ANIM2_DEAD_BACK, null); // buggy, make macro for safety
- // Show heal amount above head, but do not show 0 HP ticks form drugs. (Super Stimpacks)
- if (healAmount != 0)
- {
- FloatingHealTextByDrugPid(cr, healAmount, drugPid);
- }
- // replace ends here: the code below is form original
- }
- else if(stat == ST_POISONING_LEVEL)
- AffectPoison(cr, amount); //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement