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),
43 function addXY(x
,y
,...)
54 function mulXY(x
,y
,...)
66 local rainbowcolors
= {{221,0,0},
74 rainbowcolors
[i
][1] = rainbowcolors
[i
][1]/255
75 rainbowcolors
[i
][2] = rainbowcolors
[i
][2]/255
76 rainbowcolors
[i
][3] = rainbowcolors
[i
][3]/255
79 local rainbowsprite
= {}
80 local rainbowsegments
= 40
81 local rainbowsize
= 400
82 local rainbowheight
= 50
83 for i
= 1, rainbowsegments
do
85 rainbowsprite
[#rainbowsprite
+1] = Line
{
86 (i
/rainbowsegments
)*rainbowsize
,
87 math
.sin((i
/rainbowsegments
)*math
.pi
)*-rainbowheight
+j
,
88 ((i
+1)/rainbowsegments
)*rainbowsize
,
89 math
.sin(((i
+1)/rainbowsegments
)*math
.pi
)*-rainbowheight
+j
,
90 color
= rainbowcolors
[j
],
103 whenfire
= function (x
,y
,angle
,w
)
104 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
105 local peitoy
= math
.sin(angle
)*x
+math
.cos(angle
)*y
109 if math
.abs(angle
) < math
.pi
/2 then
113 for i
= 1, #rainbowsprite
do
115 rainbowsprite
[i
][1]*dir
+add
,
117 rainbowsprite
[i
][3]*dir
+add
,
119 color
= rainbowsprite
[i
].color
135 flamethrower
= Weapon
{
136 name
= "Flamethrower",
137 righthand
= {-20,-13},
138 lefthand
= {-25,-10},
141 sprite
= {addXY(-10,0,
142 Line
{-20,-15,-20,-15+10},
143 Line
{-20,-15,-35,-15},
144 Line
{-35,-15,-35,-15+10},
145 Line
{-5,-15,-15,-15+10},
146 Line
{-5-8,-15+8,-5-8,-15},
147 Line
{-15,-15+10,-50,-15+10},
148 Line
{-40,-15+10,-50,-15},
149 Line
{-50,-15,-65,-15},
150 Line
{-65,-15,-65,-10},
151 Line
{-60,-15+6,-60,-15+13},
152 Line
{-50,-15+6,-60,-15+6},
153 Line
{-50,-15+13,-60,-15+13},
154 Line
{-50,-15+6,-50,-15+13}
157 whenfire
= function (x
,y
,angle
,w
)
158 red
= {math
.random()/4+0.75,math
.random()/3,0}
159 for i
= 1,math
.random(4) do
160 local flametip
= math
.random()*4
161 local flamesprite
= {mulXY(3,4,
162 Line
{flametip
,0,0,2,color
= red
},
163 Line
{0,2,0,3,color
= red
},
164 Line
{0,3,1,4,color
= red
},
165 Line
{1,4,3,4,color
= red
},
166 Line
{3,4,4,3,color
= red
},
167 Line
{4,3,4,2,color
= red
},
168 Line
{4,2,flametip
,0,color
= red
}
174 angle
= angle
+math
.sin(t
)*0.6+randomspread(0.4),
177 duration
= 500+math
.random(500)-250,
179 sprite
= flamesprite
,