Advertisement
whitaleedee

feinixx

Oct 4th, 2014
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.64 KB | None | 0 0
  1. local x0 = 7
  2. local y0 = 1
  3. local feinixxColor = 512
  4. local fireColors = {2, 16, 16384}
  5. local amtFireColors = 3
  6. local onFire = {0, 0, 0, 0, 0, 0, 0}
  7. local catchFireWeight = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 4, 4, 5}
  8. local catchFireLen = 15
  9. local fireXPos = {1, 6, 12, 18, 24, 30, 36}
  10. local sleepTime = .2
  11. local stepDownBig = 10
  12. local stepDownSmall = 5
  13.  
  14. local m = peripheral.wrap("right")
  15. m.clear()
  16. m.setTextScale(.5)
  17.  
  18. function drawFeinixx()
  19. m.setTextColor(feinixxColor)
  20. m.setCursorPos(x0+1,y0+4)
  21. m.write(" ____")
  22. m.setCursorPos(x0+1,y0+5)
  23. m.write("| __| ___ ___ _ _ ___ __ ____ __")
  24. m.setCursorPos(x0+1,y0+6)
  25. m.write("| |_ | __||_ _| | \\| ||_ _| \\ \\/ /\\ \\/ /")
  26. m.setCursorPos(x0+1,y0+7)
  27. m.write("| _| | _| | | | .' | | | > < > <")
  28. m.setCursorPos(x0+1,y0+8)
  29. m.write("|_| |___||___| |_|\\_||___| /_/\\_\\/_/\\_\\ ")
  30. end
  31.  
  32. function drawFlame1(px, py)
  33. local ver = math.random(2)
  34. local col = math.random(amtFireColors)
  35. m.setTextColor(fireColors[col])
  36. if ver == 1 then
  37. m.setCursorPos(px+2,py)
  38. m.write(")")
  39. m.setCursorPos(px+1, py+1)
  40. m.write("/(")
  41. elseif ver == 2 then
  42. m.setCursorPos(px+2,py)
  43. m.write("(")
  44. m.setCursorPos(px+1, py+1)
  45. m.write(")\\ ")
  46. end
  47. m.setCursorPos(px+3, py+2)
  48. m.write(")")
  49. m.setTextColor(fireColors[(col+1)%amtFireColors])
  50. m.setCursorPos(px, py+2)
  51. m.write("(_)")
  52. end
  53.  
  54. function drawFlame2(px, py)
  55. local ver = math.random(2)
  56. local col = math.random(amtFireColors)
  57. m.setTextColor(fireColors[col])
  58. if ver == 1 then
  59. m.setCursorPos(px+2,py)
  60. m.write("(")
  61. m.setCursorPos(px+1, py+1)
  62. m.write(")\\ ")
  63. elseif ver == 2 then
  64. m.setCursorPos(px+2,py)
  65. m.write(")")
  66. m.setCursorPos(px+1, py+1)
  67. m.write("/(")
  68. end
  69. m.setCursorPos(px, py+2)
  70. m.write("(")
  71. m.setTextColor(fireColors[(col+1)%amtFireColors])
  72. m.setCursorPos(px+1, py+2)
  73. m.write("(_)")
  74. end
  75.  
  76. function drawFlame3(px, py)
  77. local ver = math.random(2)
  78. local col = math.random(amtFireColors)
  79. m.setTextColor(fireColors[col])
  80. if ver == 1 then
  81. m.setCursorPos(px+2,py)
  82. m.write("(")
  83. m.setCursorPos(px+1, py+1)
  84. m.write(")\\ ")
  85. elseif ver == 2 then
  86. m.setCursorPos(px+2,py)
  87. m.write(")")
  88. m.setCursorPos(px+1, py+1)
  89. m.write("/(")
  90. end
  91. m.setCursorPos(px, py+2)
  92. m.write("(())")
  93. m.setTextColor(fireColors[(col+1)%amtFireColors])
  94. m.setCursorPos(px+1, py+2)
  95. m.write("()")
  96. end
  97.  
  98. function drawBigFlame1(px, py)
  99. drawFlame1(px, py+2)
  100. drawFlame3(px, py)
  101. drawFlame1(px+2, py+1)
  102. end
  103.  
  104. function drawBigFlame2(px, py)
  105. drawFlame2(px+2, py+2)
  106. drawFlame3(px+2, py)
  107. drawFlame2(px, py+1)
  108. end
  109.  
  110. while true do
  111. m.clear()
  112. drawFeinixx()
  113. for k,v in pairs(onFire) do
  114. local stepDown = 0
  115. local vtemp = v
  116. if v == 0 then -- not on fire
  117. vtemp = catchFireWeight[math.random(catchFireLen)]
  118. end
  119. if v == 1 then --small fire
  120. drawFlame2(x0+fireXPos[k]+1, y0+3)
  121. if math.random(stepDownSmall)%stepDownSmall == 1 then stepDown = 1 end
  122. end
  123. if v == 2 then --small fire
  124. drawFlame1(x0+fireXPos[k]+1, y0+3)
  125. if math.random(stepDownSmall)%stepDownSmall == 1 then stepDown = math.random(2) end
  126. end
  127. if v == 3 then --small fire
  128. drawFlame3(x0+fireXPos[k]+1, y0+3)
  129. if math.random(stepDownSmall)%stepDownSmall == 1 then stepDown = math.random(3) end
  130. end
  131. if v == 4 then --big fire
  132. drawBigFlame1(x0+fireXPos[k], y0+1)
  133. if math.random(stepDownBig)%stepDownBig == 1 then stepDown = math.random(3) end
  134. end
  135. if v == 5 then --big fire
  136. drawBigFlame2(x0+fireXPos[k], y0+1)
  137. if math.random(stepDownBig)%stepDownBig == 1 then stepDown = math.random(3) end
  138. end
  139. onFire[k] = tonumber(vtemp)-tonumber(stepDown)
  140. end
  141. sleep(sleepTime)
  142. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement