1 local cabo
= {-15,-15,-15,-15+10}
2 local cabo2
= {-15+1,-15+1,-15+1,-15+10+1}
3 local cano
= {-15,-15+10,-45,-15+10}
4 local cano2
= {-15+1,-15+10+1,-45+1,-15+10+1}
6 math
.randomseed( os
.time() )
8 function randomspread(spread
)
9 return math
.random()*2*spread
-spread
14 righthand
= {-30,-15+10},
23 whenfire
= function (x
,y
,angle
,w
)
28 angle
= angle
+randomspread(0.2),
44 function addXY(x
,y
,...)
55 function mulXY(x
,y
,...)
67 local rainbowcolors
= {{221,0,0},
75 rainbowcolors
[i
][1] = rainbowcolors
[i
][1]/255
76 rainbowcolors
[i
][2] = rainbowcolors
[i
][2]/255
77 rainbowcolors
[i
][3] = rainbowcolors
[i
][3]/255
80 local rainbowsprite
= {}
81 local rainbowsegments
= 40
82 local rainbowsize
= 400
83 local rainbowheight
= 30
84 for i
= 1, rainbowsegments
do
86 rainbowsprite
[#rainbowsprite
+1] = Line
{
87 (i
/rainbowsegments
)*rainbowsize
,
88 math
.sin((i
/rainbowsegments
)*math
.pi
)*-rainbowheight
+j
,
89 ((i
+1)/rainbowsegments
)*rainbowsize
,
90 math
.sin(((i
+1)/rainbowsegments
)*math
.pi
)*-rainbowheight
+j
,
91 color
= rainbowcolors
[j
],
104 whenfire
= function (x
,y
,angle
,w
)
105 local peitox
= math
.cos(angle
)*x
-math
.sin(angle
)*y
--desfaz todo o calculo que eh feito pra ajuste de tip... mas vale apena :D
106 local peitoy
= math
.sin(angle
)*x
+math
.cos(angle
)*y
110 if math
.abs(angle
) < math
.pi
/2 then
114 for i
= 1, #rainbowsprite
do
116 rainbowsprite
[i
][1]*dir
+add
,
118 rainbowsprite
[i
][3]*dir
+add
,
120 color
= rainbowsprite
[i
].color
137 flamethrower
= Weapon
{
138 name
= "Flamethrower",
139 righthand
= {-20,-13},
140 lefthand
= {-25,-10},
143 sprite
= {addXY(-10,0,
144 Line
{-20,-15,-20,-15+10},
145 Line
{-20,-15,-35,-15},
146 Line
{-35,-15,-35,-15+10},
147 Line
{-5,-15,-15,-15+10},
148 Line
{-5-8,-15+8,-5-8,-15},
149 Line
{-15,-15+10,-50,-15+10},
150 Line
{-40,-15+10,-50,-15},
151 Line
{-50,-15,-65,-15},
152 Line
{-65,-15,-65,-10},
153 Line
{-60,-15+6,-60,-15+13},
154 Line
{-50,-15+6,-60,-15+6},
155 Line
{-50,-15+13,-60,-15+13},
156 Line
{-50,-15+6,-50,-15+13}
159 whenfire
= function (x
,y
,angle
,w
)
160 red
= {math
.random()/4+0.75,math
.random()/3,0}
161 for i
= 1,math
.random(4) do
162 local flametip
= math
.random()*4
163 local flamesprite
= {mulXY(3,4,
164 Line
{flametip
,0,0,2,color
= red
},
165 Line
{0,2,0,3,color
= red
},
166 Line
{0,3,1,4,color
= red
},
167 Line
{1,4,3,4,color
= red
},
168 Line
{3,4,4,3,color
= red
},
169 Line
{4,3,4,2,color
= red
},
170 Line
{4,2,flametip
,0,color
= red
}
176 angle
= angle
+math
.sin(t
)*0.6+randomspread(0.4),
179 duration
= 500+math
.random(500)-250,
180 sprite
= flamesprite
,