FANDOM


Created by Taz.

Using "RC_Core.rcm"
; testingrc1 1.26
; Date/Time: 6:24:39 PM on 5/21/2009
; By Tazco on NADDAZ

Function Main()
Player = Actor()
PlayerMaxHP% = MaxAttribute(Player, "Health")
PlayerHP% = Attribute(Player, "Health")

 CurrPHunger% = Attribute(Player, "Hunger")
 CurrMaxPHunger% = MaxAttribute(Player, "Hunger")

    
 
 If (PlayerHP >= PlayerMaxHP) And (CurrPHunger >= CurrMaxPHunger) 
  
      OutPut(Player, "You dont need that right now", 200, 45, 32)
    Return
 
 EndIf
 
         If (PlayerHP >= PlayerMaxHP) And (CurrPHunger <= CurrMaxPHunger) 
        ;Give player hunger incress.
        CurrPHunger% = Attribute(Player, "Hunger")
        TotHungerToGive% = CurrPHunger + 250
        SetAttribute(Player, "Hunger", TotHungerToGive)
        Return
         EndIf
         
         
 If (PlayerHP <= PlayerMaxHP) And (CurrPHunger >= CurrMaxPHunger) 
 OutPut(Player, "You sit and eat a Farmers Meal", 0, 200, 40)
 GiveItem(Player, "Farmers Meal", - 1)
 
 AnimateActor(Player, "Sit down", 1.7)
 
 
 Ticks% = 6 ;total ticks of health
 
 Repeat
 
 Tothealth% = Attribute(Player, "Health")
 totPlayerMaxHP% = MaxAttribute(Player, "Health")
 DoEvents(1)
 
 NewHp% = Attribute(Player, "Health") + 65 ;tick health amount
 
 AnimateActor(Player, "Sit idle", .05, 1)
   
 
 TickChance% = Rnd(1, 32)
 
 If (TickChance = 1)
 NewHp% = Attribute(Player, "Health") + Rnd(3, 5) ;tick health amount
 TotalHp% = NewHp
 SetAttribute(Player, "Health", TotalHp) ;give player health per tick
 EndIf
 
 
 
 If (Tothealth >= totPlayermaxhp)
     AnimateActor(Player, "Standup", 1)
    Ticks% = 0
 EndIf  
 
 Until (Tothealth = totPlayermaxhp)
 
 AddActorEffect(Player, "Well Fed + 3 Strength", "Strength", 3, 20000, 257)
 
 
 Return
 EndIf
 
 End Function