System Heal

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
JASS:
/*
 
    Heal v2.0.0
        by kingking
    
    - Library that transforms healing into a breeze, allowing full control on healing.
    
    CreateHealType()-> HealType
    ~ Generate a heal type.
    
    HealUnit(unit a, unit b,real,HealType)
    ~ Heal the unit + fire event.
    ~ Unit a -> Healer
    ~ Unit b -> Target
    
    RegisterHealEvent(trigger,integer)
    ~ trigger - Trigger to be registered, integer - priority
    
    UnregisterHealEvent(trigger)
    ~ trigger - Trigger to be registered
    
    RegisterHealUnitEvent(trigger,unit,integer)
    ~ trigger - Trigger to be registered, unit - healer, integer - priority
    ~ Fires if the unit heals anything.
    
    UnregisterHealUnitEvent(trigger,unit)
    ~ trigger - Trigger to be registered, unit - healer
    
    RegisterUnitHealedEvent(trigger,unit,integer)
    ~ trigger - Trigger to be registered, unit - healed, integer - priority
    ~ Fires if the unit is healed by anything.
    
    UnregisterUnitHealedEvent(trigger,unit)
    ~ trigger - Trigger to be registered, unit - healed
    
    GetHealAmount() -> real
    ~ Get the amount of healing at the moment.
    
    SetHealAmount(real)
    ~ Update the amount of healing.
    
    GetHealType()-> HealType
    ~ Get the type of healing.
    
    GetHealer() -> unit
    ~ Get healer.
    
    GetHealedUnit()-> unit
    ~ Get healed unit.
    
    Requires : A vJass complier
*/
library Heal
    
    struct HealType extends array
    endstruct
    
    globals
        HealType HEAL_TYPE_NORMAL=1
        private integer HealTypeCount=1
        private real Final=0.0
        private unit Healer=null
        private unit Target=null
        private HealType CurrHealType=1
        private key GenericCallback
        private key HealUnitCallback
        private key UnitHealedCallback
        private integer array TrigType
        private unit array HealedUnitList
        private unit array HealerList
        private trigger array Trig
        private integer array Next
        private integer array Prev
        private integer array Priority
        private integer array IndexStack
        private integer IndexStackMax=0
        private integer IndexMax=0
    endglobals
    
    function CreateHealType takes nothing returns HealType
        set HealTypeCount=HealTypeCount+1
        return HealTypeCount
    endfunction
    
    function GetHealer takes nothing returns unit
        return Healer
    endfunction
    
    function GetHealedUnit takes nothing returns unit
        return Target
    endfunction
    
    function GetHealType takes nothing returns HealType
        return CurrHealType
    endfunction
    
    function GetHealAmount takes nothing returns real
        return Final
    endfunction
    
    function SetHealAmount takes real r returns nothing
        set Final=r
    endfunction
    
    private function FireEvent takes unit healer, unit target, real amount, HealType htype returns nothing
        local unit oldhealer=Healer
        local unit oldtarget=Target
        local real oldamount=Final
        local HealType oldhealtype=CurrHealType
        local integer i=Next[0]
        local boolean ToFire
        set Healer=healer
        set Target=target
        set Final=amount
        set CurrHealType=htype
        loop
        exitwhen i==0
            set ToFire=false
            if TrigType<i>==GenericCallback then
                set ToFire=true
            elseif TrigType<i>==HealUnitCallback and HealerList<i>==healer then
                set ToFire=true
            elseif TrigType<i>==UnitHealedCallback and HealedUnitList<i>==target then
                set ToFire=true
            endif
            if ToFire==true and IsTriggerEnabled(Trig<i>) and TriggerEvaluate(Trig<i>) then
                call TriggerExecute(Trig<i>)
            endif
            set i=Next<i>
        endloop
        if Final&gt;amount then
            call SetWidgetLife(target,GetWidgetLife(target)+(Final-amount))
        elseif Final&lt;amount and Final&gt;=0.0 then
            call SetWidgetLife(target,GetWidgetLife(target)-(amount-Final))
        endif
        set Healer=oldhealer
        set Target=oldtarget
        set Final=oldamount
        set CurrHealType=oldhealtype
        set oldhealer=null
        set oldtarget=null
    endfunction
    
    function HealUnit takes unit healer, unit target, real amount, HealType htype returns nothing
        local real result
        if GetWidgetLife(target)&gt;.405 then
            set result=GetWidgetLife(target)+amount
            call SetWidgetLife(target,result)
            call FireEvent(healer,target,amount,htype)
        endif
    endfunction
    
    function RegisterHealEvent takes trigger trig, integer prio returns nothing
        local integer head
        local integer i
        local boolean isAdded
        if trig!=null then
            if IndexStackMax==0 then
                set IndexMax=IndexMax+1
                set i=IndexMax
            else
                set i=IndexStack[IndexStackMax]
                set IndexStackMax=IndexStackMax-1
            endif
            set Trig<i>=trig
            set Priority<i>=prio
            set TrigType<i>=GenericCallback
            set isAdded=false
            set head=Next[0]
            loop
                if prio&gt;Priority[head] then
                    set Next[Prev[head]]=i
                    set Prev<i>=Prev[head]
                    set Next<i>=head
                    set Prev[head]=i
                    set isAdded=true
                    set head=Prev[0]
                endif
                set head=Next[head]
            exitwhen head==0
            endloop
            if isAdded==false then
                set Next[Prev[head]]=i
                set Prev<i>=Prev[head]
                set Next<i>=head
                set Prev[head]=i
            endif
        endif
    endfunction
    
    function UnregisterHealEvent takes trigger trig returns nothing
        local integer i=Next[0]
        loop
        exitwhen i==0
            if Trig<i>==trig and TrigType<i>==GenericCallback then
                set Next[Prev<i>]=Next<i>
                set Prev[Next<i>]=Prev<i>
                set IndexStackMax=IndexStackMax+1                
                set IndexStack[IndexStackMax]=i
                return
            endif
            set i=Next<i>
        endloop
    endfunction
    
    function RegisterHealUnitEvent takes trigger trig, unit u, integer prio returns nothing
        local integer head
        local integer i
        local boolean isAdded
        if trig!=null then
            if IndexStackMax==0 then
                set IndexMax=IndexMax+1
                set i=IndexMax
            else
                set i=IndexStack[IndexStackMax]
                set IndexStackMax=IndexStackMax-1
            endif
            set Trig<i>=trig
            set Priority<i>=prio
            set TrigType<i>=HealUnitCallback
            set HealerList<i>=u
            set isAdded=false
            set head=Next[0]
            loop
                if prio&gt;Priority[head] then
                    set Next[Prev[head]]=i
                    set Prev<i>=Prev[head]
                    set Next<i>=head
                    set Prev[head]=i
                    set isAdded=true
                    set head=Prev[0]
                    set isAdded=true
                endif
                set head=Next[head]
            exitwhen head==0
            endloop
            if isAdded==false then
                set Next[Prev[head]]=i
                set Prev<i>=Prev[head]
                set Next<i>=head
                set Prev[head]=i
            endif
        endif
    endfunction
    
    function UnregisterHealUnitEvent takes trigger trig, unit u returns nothing
        local integer i=Next[0]
        loop
        exitwhen i==0
            if Trig<i>==trig and HealerList<i>==u then
                set Next[Prev<i>]=Next<i>
                set Prev[Next<i>]=Prev<i>
                set HealerList<i>=null
                set IndexStackMax=IndexStackMax+1                
                set IndexStack[IndexStackMax]=i
                return
            endif
            set i=Next<i>
        endloop
    endfunction
    
    function RegisterUnitHealedEvent takes trigger trig, unit u, integer prio returns nothing
        local integer head
        local integer i
        local boolean isAdded
        if trig!=null then
            if IndexStackMax==0 then
                set IndexMax=IndexMax+1
                set i=IndexMax
            else
                set i=IndexStack[IndexStackMax]
                set IndexStackMax=IndexStackMax-1
            endif
            set Trig<i>=trig
            set Priority<i>=prio
            set TrigType<i>=UnitHealedCallback
            set HealedUnitList<i>=u
            set isAdded=false
            set head=Next[0]
            loop
                if prio&gt;Priority[head] then
                    set Next[Prev[head]]=i
                    set Prev<i>=Prev[head]
                    set Next<i>=head
                    set Prev[head]=i
                    set isAdded=true
                    set head=Prev[0]
                    set isAdded=true
                endif
                set head=Next[head]
            exitwhen head==0
            endloop
            if isAdded==false then
                set Next[Prev[head]]=i
                set Prev<i>=Prev[head]
                set Next<i>=head
                set Prev[head]=i
            endif
        endif
    endfunction
    
    function UnregisterUnitHealedEvent takes trigger trig, unit u returns nothing
        local integer i=Next[0]
        loop
        exitwhen i==0
            if Trig<i>==trig and HealedUnitList<i>==u then
                set Next[Prev<i>]=Next<i>
                set Prev[Next<i>]=Prev<i>
                set HealedUnitList<i>=null
                set IndexStackMax=IndexStackMax+1                
                set IndexStack[IndexStackMax]=i
                return
            endif
            set i=Next<i>
        endloop
    endfunction
    
endlibrary
</i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i>


Heal
v1.0.0 - Release
v1.0.1 - Changed Healable from a boolean into an integer stack.
v1.0.2 - Changed Healable to Heal_Block/Heal_BlockAll.
v1.0.3 - Fixed bug that caused the system ignore the amount of healing.
v1.0.4 - Added heal type, it is useful for spell making.
v1.0.5 - Fixed heal type's bug. Changed Heal_GetTriggerUnit() to Heal_Target().
v1.0.6 - Removed useless parameter in Heal_BlockAll(). Fixed block healing code.
v1.0.7 - Moved initializer into module to fix bug (Heal_RegisterEvent did not work in struct initializers) which is caused by jasshelper.
v1.0.8 - Removed stack, replaced with local variables. A little efficiency gain in getting source/target/amount/type and adding block. Removed the usage of UnitAlive to avoid problem from map optimizer.
v2.0.0 - Rewrote whole library from scratch. Added prioritized event firing, ability to register heal events for particular unit, and modify amount of healing. Heal can never be done so easily before this!
 

Attachments

  • Heal.w3x
    31.9 KB · Views: 671
You have gone way overboard. You took a simple function that should maybe be attached to an event and turned it into a mess.

Make it cleaner. Make it faster. Make it sane.

Edit:

This is the kind of thing I want to see.
JASS:
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::\\
//:: Heal                                                                           ::\\
//::                                                                                ::\\
//:: by your friendly neighborhood Sickle.                                          ::\\
//::                                                                                ::\\
//:: What?                                                                          ::\\
//::   1. Heal lets you heal units using a certain function.                        ::\\
//::   2. It is recommended that all healing in your map be done with this function.::\\
//::                                                                                ::\\
//:: Why?                                                                           ::\\
//::   1. Heal fires an event when a unit is healed.                                ::\\
//::   2. It provides a clean, standard healing function.                           ::\\
//::   3. Why should I need another reason?                                         ::\\
//::                                                                                ::\\
//:: How?                                                                           ::\\
//::   These functions are available to you.                                        ::\\
//::                                                                                ::\\
//::     Heal(unit toHeal, real amount) returns nothing                             ::\\
//::       This function heals the unit for the given amount and fires an event.    ::\\
//::                                                                                ::\\
//::     GetHealedUnit(nothing) returns unit                                        ::\\
//::       This function returns the unit healed in the event.                      ::\\
//::                                                                                ::\\
//::     GetHealAmount(nothing) returns real                                        ::\\
//::       This function returns how much a unit was healed for.                    ::\\
//::                                                                                ::\\
//::     TriggerRegisterHealEvent(trigger whichTrigger) returns nothing             ::\\
//::       This function causes the trigger to fire when a unit is healed via Heal. ::\\
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::\\

library Heal requires Event

globals
    private unit u = null
    private Event e
    private real r = 0
endglobals

function TriggerRegisterHealEvent takes trigger t returns nothing
    call e.register(t)
endfunction

function GetHealedUnit takes nothing returns unit
    return u
endfunction

function GetHealAmount takes nothing returns real
    return r
endfunction

native UnitAlive takes unit id returns boolean

function Heal takes unit lu, real lr returns nothing
    if not UnitAlive(lu) then
       return
    endif
    set r = lr
    set u = lu
    call SetWidgetLife(lu, GetWidgetLife(lu) + lr)
    call e.fire()
    set r = 0
    set u = null
endfunction

private struct Sickle extends array
static method onInit takes nothing returns nothing
    set e = Event.create()
endmethod
endstruct

endlibrary


Edit II: Maybe, just maybe, this.
JASS:
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::\\
//:: Heal                                                                           ::\\
//::                                                                                ::\\
//:: by your friendly neighborhood Sickle.                                          ::\\
//::                                                                                ::\\
//:: What?                                                                          ::\\
//::   1. Heal lets you heal units using a certain function.                        ::\\
//::   2. It is recommended that all healing in your map be done with this function.::\\
//::                                                                                ::\\
//:: Why?                                                                           ::\\
//::   1. Heal fires an event when a unit is healed.                                ::\\
//::   2. It provides a clean, standard healing function.                           ::\\
//::   3. Why should I need another reason?                                         ::\\
//::                                                                                ::\\
//:: How?                                                                           ::\\
//::   These functions are available to you.                                        ::\\
//::                                                                                ::\\
//::     Heal(unit toHeal, real amount) returns nothing                             ::\\
//::       This function heals the unit for the given amount and fires an event.    ::\\
//::                                                                                ::\\
//::     HealEx(unit healer, unit toHeal, real amount) returns nothing              ::\\
//::       This function heals the unit for the given amount and fires an event.    ::\\
//::                                                                                ::\\
//::     GetHealedUnit(nothing) returns unit                                        ::\\
//::       This function returns the unit healed in the event.                      ::\\
//::                                                                                ::\\
//::     GetHealer(nothing) returns unit                                            ::\\
//::       This function returns the healer (if any) in the event.                  ::\\
//::                                                                                ::\\
//::     GetHealAmount(nothing) returns real                                        ::\\
//::       This function returns how much a unit was healed for.                    ::\\
//::                                                                                ::\\
//::     TriggerRegisterHealEvent(trigger whichTrigger) returns nothing             ::\\
//::       This function causes the trigger to fire when a unit is healed via Heal. ::\\
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::\\

library Heal requires Event

globals
    private unit u = null
    private unit h = null
    private Event e
    private real r = 0
endglobals

function TriggerRegisterHealEvent takes trigger t returns nothing
    call e.register(t)
endfunction

function GetHealedUnit takes nothing returns unit
    return u
endfunction

function GetHealAmount takes nothing returns real
    return r
endfunction

function GetHealer takes nothing returns unit
    return h
endfunction

native UnitAlive takes unit id returns boolean

function Heal takes unit lu, real lr returns nothing
    if not UnitAlive(lu) then
       return
    endif
    set r = lr
    set u = lu
    call SetWidgetLife(lu, GetWidgetLife(lu) + lr)
    call e.fire()
    set r = 0
    set u = null
endfunction

function HealEx takes unit lh, unit lu, real lr returns nothing
    if not UnitAlive(lu) then
       return
    endif
    set r = lr
    set u = lu
    set h = lh
    call SetWidgetLife(lu, GetWidgetLife(lu) + lr)
    call e.fire()
    set r = 0
    set u = null
    set lh = null
endfunction

private struct Sickle extends array
static method onInit takes nothing returns nothing
    set e = Event.create()
endmethod
endstruct

endlibrary
 
He is going to use his version of Heal to crush your map by making the functionality of GetWidgetLife > .405 fails. :p
 
Here. Let me fix that then. Import this and find and replace GetWidgetLife(u) > .405 with IsUnitAlive(u). Alternatively, I updated my script.

JASS:
library IsUnitAlive

native UnitAlive takes unit id returns boolean

function IsUnitAlive takes unit u returns boolean
    return UnitAlive(u)
endfunction

function IsUnitDead takes unit u returns boolean
    return not UnitAlive(u)
endfunction

endlibrary
 
JASS:
library HealCrusher initializer Init requires Heal
    
    private function Cond takes nothing returns boolean
        call Heal(GetHealedUnit(),100.)
        return false
    endfunction
    
    private function Init takes nothing returns nothing
          local trigger trig = CreateTrigger()
          call TriggerRegisterHealEvent(trig)
          call TriggerAddCondition(trig,Condition(function Cond))
    endfunction
endlibrary

Put this library into a map.
Make a healing spell with your library, then cast it. See what happen.

JASS:
library HealCrusher initializer Init requires Heal
    
    private function Cond takes nothing returns boolean
        call HealUnit(Heal_GetSource(),Heal_GetTriggerUnit(),100.)
        return false
    endfunction
    
    private function Init takes nothing returns nothing
          local trigger trig = CreateTrigger()
          call Heal_RegisterEvent(trig)
          call TriggerAddCondition(trig,Condition(function Cond))
    endfunction
endlibrary

Use this with my library. Test the spell. Compare them.
 
Whoop dee doo. Yours works recursively. Somewhat.

I could achieve what your system does with a single check. But that would be stupid. Recursive healing is madness.
 
Yes. I know.

His is recursively defined. Somewhat.

I could add a single check and mine is fixed.
 
Somethign like this is indeed useful, since it makes it easy to create for example some buff types that make unit unhealable or something, or some thingies that incerease healing done or whatever.

But its so simple, that it might be easier for user to make it himself. Dont really know.
 
// Questions : UnitDamageTarget does healing
// effect when negative damage amount is used
// as arguement. Why we need to use this?
//
// Truth : UnitDamageTarget works but it is not
// detectable by EVENT_UNIT_DAMAGED.

Uh, what? Negative target damage only works with spell-type damage (otherwise is 0) and can be detected by EVENT_UNIT_DAMAGED just fine.
 
Uh, what? Negative target damage only works with spell-type damage (otherwise is 0) and can be detected by EVENT_UNIT_DAMAGED just fine.
Oh, ya. Forget to update it, it works just fine.

However, some damage detection systems do GetEventDamage() > 0. filtration before executing triggers.
 
However, some damage detection systems does GetEventDamage() > 0. filtration before executing triggers.
Post in the threads of such systems and complain. I don't think we have any at TheHelper.
JASS:
Heal_Enable(unit, flag)

Heal_Bock(amount) makes much more sense, because it can be totally conditional.
 
Heal_Bock(amount) makes much more sense, because it can be totally conditional.
Okay. :)
 
Just a few things I noticed:
JASS:
//  Heal_Unit(healer, target, amount)
Should be "HealUnit"?
JASS:
            if life == maxlife then
                return false//If target has full hp, no healing is done.
            else
                set amount = maxlife - life //if current hp + amount &gt; max hp, set amount to max hp - current hp.
                call SetWidgetLife(target,life + amount)
            endif
This ends up fully healing regardless of the amount used in the function call. Add a hp check, perhaps?
EDIT: Just tested it without the maxlife-life line and it worked fine. Is there any reason for it to be in at all?
 
Hmmm. Nice system. Just what I needed for a spell... XD

May I suggest a "Heal over time" function?
 
@Advice D.
Should be "HealUnit"?
That was a typo. >< My bad.

This ends up fully healing regardless of the amount used in the function call. Add a hp check, perhaps?
EDIT: Just tested it without the maxlife-life line and it worked fine. Is there any reason for it to be in at all?

I will look into it. :p

@XeNiM666
3 flavors here for you to choose. :)

JASS:
/////////////////////////////////////////////////////////////
//
//                  Timed Healing (Blue)
//                        v1.0.0
//  
//                  An add-on for Heal.
//
//     It enables &quot;healing over time&quot; can be done easily.
//
//  Functions provided :
//  TimedHealUnit(healer,target,amount,period,duration,effect)
//
//  Info :
//  Blue   : Uses KT2
//  Red    : Uses T32 (For speed freaks)
//  Purple : Uses TimerUtils (For those who does not like KT2)
//
//  Blue and Purple flavor are able to deal with any period.
//  Red flavor is only able to heal every .03125 (T32&#039;s period)
//////////////////////////////////////////////////////////////
library_once TimedHealing requires Heal, KT

    private struct Data
        unit healer
        unit target
        real amount
        real tick
        effect eff
        
        method onDestroy takes nothing returns nothing
            call DestroyEffect(.eff)
            set .eff = null
        endmethod
        
    endstruct
    
    private function Handler takes nothing returns boolean
        local Data d = KT_GetData()
        if d.tick &gt; 0 then
            set d.tick = d.tick - 1
            if HealUnit(d.healer,d.target,d.amount) == false then
                call d.destroy()
                return true
            endif
            return false
        endif
        call d.destroy()
        return true
    endfunction

    function TimedHealUnit takes unit healer, unit target, real totalAmount, real period, real duration, effect eff returns nothing
        local Data d = Data.create()
        set d.healer = healer
        set d.target = target
        set d.tick = R2I(duration / period)
        set d.amount = totalAmount / period
        set d.eff = eff
        call KT_Add(function Handler,d,period)
    endfunction
endlibrary


JASS:
/////////////////////////////////////////////////////////////
//
//                  Timed Healing (Red)
//                        v1.0.0
//  
//                  An add-on for Heal.
//
//     It enables &quot;healing over time&quot; can be done easily.
//
//  Functions provided :
//  TimedHealUnit(healer,target,amount,period,duration,effect)
//
//  Info :
//  Blue   : Uses KT2
//  Red    : Uses T32 (For speed freaks)
//  Purple : Uses TimerUtils (For those who does not like KT2)
//
//  Blue and Purple flavor are able to deal with any period.
//  Red flavor is only able to heal every .03125 (T32&#039;s period)
//////////////////////////////////////////////////////////////
library_once TimedHealing requires Heal, T32

    private struct Data
        unit healer
        unit target
        real amount
        real tick
        effect eff
        
        method onDestroy takes nothing returns nothing
            call DestroyEffect(.eff)
            set .eff = null
        endmethod
        
        method periodic takes nothing returns nothing
            if .tick &gt;= T32_Tick then
                if HealUnit(.healer,.target,.amount) == false then
                    call .destroy()
                    call .stopPeriodic()
                endif
            else
                call .destroy()
                call .stopPeriodic()
            endif
        endmethod
        
        implement T32x
        
        static method add takes unit healer, unit target, real totalAmount, real duration, effect eff returns nothing
            local thistype this  = thistype.create()
            set .healer = healer
            set .target = target
            set .tick = T32_Tick + R2I(duration / T32_PERIOD)
            set .amount = totalAmount / T32_PERIOD
            set .eff = eff
            call .startPeriodic()
        endmethod
    endstruct

    function TimedHealUnit takes unit healer, unit target, real totalAmount, real duration, effect eff returns nothing
        call Data.add(healer,target,totalAmount,duration,eff)
    endfunction
endlibrary


JASS:
/////////////////////////////////////////////////////////////
//
//                  Timed Healing (Purple)
//                        v1.0.0
//  
//                  An add-on for Heal.
//
//     It enables &quot;healing over time&quot; can be done easily.
//
//  Functions provided :
//  TimedHealUnit(healer,target,amount,period,duration,effect)
//
//  Info :
//  Blue   : Uses KT2
//  Red    : Uses T32 (For speed freaks)
//  Purple : Uses TimerUtils (For those who does not like KT2)
//
//  Blue and Purple flavor are able to deal with any period.
//  Red flavor is only able to heal every .03125 (T32&#039;s period)
//////////////////////////////////////////////////////////////
library_once TimedHealing requires Heal, TimerUtils

    private struct Data
        unit healer
        unit target
        real amount
        real tick
        effect eff
        timer t
        
        method onDestroy takes nothing returns nothing
            call ReleaseTimer(.t)
            call DestroyEffect(.eff)
            set .eff = null
        endmethod
        
    endstruct
    
    private function Handler takes nothing returns boolean
        local Data d = GetTimerData(GetExpiredTimer())
        if d.tick &gt; 0 then
            set d.tick = d.tick - 1
            if HealUnit(d.healer,d.target,d.amount) == false then
                call d.destroy()
            endif
            return false
        endif
        call d.destroy()
        return true
    endfunction

    function TimedHealUnit takes unit healer, unit target, real totalAmount, real period, real duration, effect eff returns nothing
        local Data d = Data.create()
        set d.healer = healer
        set d.target = target
        set d.tick = R2I(duration / period)
        set d.amount = totalAmount / period
        set d.eff = eff
        set d.t = NewTimer()
        call SetTimerData(d.t,d)
        call TimerStart(d.t,period,true,function Handler)
    endfunction
endlibrary


Update :
v1.0.3 released. Credits to Advice D. for finding out the bug.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    alternatively if you not making at least 23 an hour you could work in an Aldi warehouse
  • Varine Varine:
    Yeah I've been thinking about using AI for shit. I'm on vacation next week so I'm going to spend some time reorganizing everything and getting all my shit back in order
  • Varine Varine:
    lol I technically make less than 23 right now because I'm on salary and am there all the time, but it's a lot more than a normal wage still. I also have a meeting soon to renegotiate my pay because I want about a 25% increase to account for what I'm actually doing or a re-evaluation of our duties so that that my responsibilities are more in line with my pay. Depending on how that goes I'm prepared to give notice and move on, I don't mind taking less money so I'd have time for the rest of my life, but I'd rather they just fucking pay me enough to justify the commitment on my end. Plus right now I hold pretty much all the cards since I'm the only one actually qualified for my position.
    +1
  • Varine Varine:
    The other chef was there before me and got his position by virtue of being the only adult when the old general manager got married and didn't want to deal with the kitchen all the time, and happened to be in the position when the GM quit. New GM is fine with front of house but doesn't know enough about the kitchen side to really do anything or notice that I'm the one primarily maintaining it. Last time I left they hired like 3 people to replace me and there was still a noticeable drop in quality, so I got offered like 6 dollars an hour more and a pretty significant summer bonus to come back
  • Varine Varine:
    So honestly even if I leave I think it would last a couple of months until it's obvious that I am not exactly replaceable and then I would be in an even better position.
  • Varine Varine:
    But as of right now I have two other job offers that are reasonably close to what my hourly equivalency would be, and I would probably have more time for my other projects. The gap would be pretty easy to fill up if I had time to do my side jobs. I use to do some catering and private events, personal lessons, consultations, ect, and I charge like 120 an hour for those. But they aren't consistent enough for a full time job, too small of a town. And I'm not allowed to move for another year until my probation is over
  • Varine Varine:
    I guess I could get it transferred, but that seems like a hassle.
  • Varine Varine:
    Plus I have a storage room full of broken consoles I need to fix. I need to build a little reflow oven so I can manufacture some mod chips still, but it'll get there.
    +1
  • Varine Varine:
    I would like to get out of cooking in general at some point in the next ten years, but for the time being I can make decent money and pump that into savings. I've been taking some engineering classes online, but those aren't exactly career oriented at the moment, but I think getting into electronic or computer engineering of some sort would be ideal. I'm just going to keep taking some classes here and there until there's one that I am really into.
    +2
  • The Helper The Helper:
    There is money in fixing and reselling consoles. Problem is people know that so they are doing it
  • The Helper The Helper:
    If you can find a source of broken consoles though you can make money fixing them - sometimes some big money
  • Varine Varine:
    I was buying them on Ebay, but it's pretty competitive, so more recently I've just been telling the thrift stores to call me and I will come take all their electronics they can't sell. I've volunteered there before and people use them like a dump sometimes, and so they just have a massive amount of broken shit they throw away
  • Varine Varine:
    The local GoodWill was pretty into it, surprisingly the animal shelter store was not. The lady I talked to there seemed to think I was trying to steal stuff or something, she wasn't very nice about it. Like I'm just trying to stop you having to throw a bunch of electronics away, if you can sell it great. I'd probably pay you for the broken shit too if you wanted
  • Varine Varine:
    Then I make posts on Facebook yard sale pages sometimes saying I want your old electronics, but Facebook being Facebook people on there are also wary about why I want it, then want a bunch of money like it's going to be very worth it
  • Varine Varine:
    Sooner than later I'm going to get my archives business going a little more. I need some office space that is kind of hard to get at the moment, but without it, I have to be like "Yeah so go ahead and just leave your family heirlooms and hundred year old photographs here at my shitty apartment and give me a thousand dollars, and next month I'll give you a thumb drive. I promise I'll take care of them!"
    +1
  • Varine Varine:
    I can do some things with them at their home, but when people have thousands of slides and very delicate newspaper clippings and things, not really practical. I
  • Varine Varine:
    I would be there for days, even with my camera set up slides can take a long time, and if they want perfect captures I really need to use my scanners that are professionally made for that. My camera rig works well for what it is, but for enlargements and things it's not as good.
  • Varine Varine:
    I've only had a couple clients with that so far, though. I don't have a website or anything yet though.
  • Varine Varine:
    Console repair can be worthwhile, but it's also not a thing I can do at scale in my house. I just don't have room for the equipment. I need an office that I can segregate out for archival and then electronic restoration.
  • Varine Varine:
    But in order for that to be real, I need more time, and for more time I need to work less, and to work less I need a different job, and for a different job I need more money to fall back on so that I can make enough to just pay like, rent and utilities and use my savings to find these projects
    +1
  • Varine Varine:
    Another couple years. I just need to take it slow and it'll get there.
  • jonas jonas:
    any chance to get that stolen money back?
  • jonas jonas:
    Maybe you can do console repair just as a side thing, especially if there's so much competition business might be slow. Or do you need a lot of special equipment for that?
  • jonas jonas:
    I recently bought a used sauna and the preowner told me some component is broken, I took a look and it was just a burnt fuse, really cheap to fix. I was real proud of my self since I usually have two left hands for this kinda stuff :p
  • tom_mai78101 tom_mai78101:
    I am still playing Shapez 2. What an awful thing to happen, Varine, and hopefully everything has been sorted out soon. Always use multi-factor authentication whenever you have the opportunity to do so.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top