Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Crazyfear = Class(function(self, inst)
- self.inst = inst
- self.time_to_sad = 60
- self.inst:StartUpdatingComponent(self)
- self.sademote = nil
- self.isspeedy = false
- for k,v in pairs(EMOTES) do
- if v.command == "/sad" then self.sademote = v end
- end
- end)
- function Crazyfear:OnUpdate(dt)
- if self.inst.components.sanity and self.inst.components.sanity:GetPercent() < TUNING.WILLOW_LIGHTFIRE_SANITY_THRESH then
- if not self.isspeedy then
- self.isspeedy = true
- self.inst.components.locomotor.walkspeed = TUNING.WILSON_WALK_SPEED*2.00
- self.inst.components.locomotor.runspeed = TUNING.WILSON_RUN_SPEED*2.00
- self.inst.components.health:SetMaxHealth(300)
- end
- else
- if self.isspeedy then
- self.isspeedy = false
- self.inst.components.locomotor.walkspeed = TUNING.WILSON_WALK_SPEED*1.00
- self.inst.components.locomotor.runspeed = TUNING.WILSON_RUN_SPEED*1.00
- self.inst.components.health:SetMaxHealth(200)
- end
- end
- if self.inst.components.sanity and self.inst.components.sanity:GetPercent() < TUNING.WILLOW_LIGHTFIRE_SANITY_THRESH * 2 then
- self.time_to_sad = self.time_to_sad - dt
- if self.time_to_sad <= 0 then
- self.inst:PushEvent("emote", self.sademote)
- self.time_to_sad = 120*math.random()+120
- end
- end
- end
- return Crazyfear
Advertisement
Add Comment
Please, Sign In to add comment