Advertisement
Guest User

Untitled

a guest
Oct 4th, 2015
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. function init()
  2. dayTemp = effect.configParameter("pl_tempCoreDay", 0)
  3. dayTemp = dayTemp + (status.stat("protection") * 0.1)
  4. dropTemp = 0
  5. timer_1 = 5
  6. world.logInfo("Initalizing Planetcore")
  7.  
  8. end
  9.  
  10. function update(dt)
  11. timer_1 = timer_1 - dt
  12. if timer_1 <= 0 then
  13.  
  14. if status.resource("coreTemp") > dayTemp then
  15. dropTemp = dropTemp - 2
  16. status.modifyResource("coreTemp", dropTemp)
  17. world.logInfo("Drop Temp "..dropTemp)
  18. end
  19. applySE()
  20. world.logInfo("Current Temperature "..tostring(status.resource("coreTemp")))
  21. timer_1 = 5
  22. end
  23. end
  24.  
  25. function applySE()
  26. world.logInfo("applySE Activated")
  27. if status.resource("coreTemp") <= 29 and status.resource("coreTemp") >= 20 then
  28. status.addEphemeralEffect("chillyCore")
  29. world.logInfo("Added chillyCore ")
  30. end
  31. if status.resource("coreTemp") <= 19 and status.resource("coreTemp") >= 10 then
  32. status.addEphemeralEffect("coldCore")
  33. world.logInfo("Added coldCore ")
  34. end
  35. if status.resource("coreTemp") <= 9 and status.resource("coreTemp") >= 0 then
  36. status.addEphemeralEffect("freezingCore")
  37. world.logInfo("Added freezingCore ")
  38. end
  39. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement