2 local w
= regweapon(t
.righthand
[1],t
.righthand
[2],
3 t
.lefthand
[1],t
.lefthand
[2],
6 regfirefunction(w
,t
.whenfire
)
7 for i
= 1, #t
.sprite
do
8 regspriteline(w
,t
.sprite
[i
][1],t
.sprite
[i
][2],t
.sprite
[i
][3],t
.sprite
[i
][4],
9 t
.sprite
[i
].color
[1],t
.sprite
[i
].color
[2],t
.sprite
[i
].color
[3])
11 local minX
, minY
, maxX
, maxY
= math
.huge
, math
.huge
, -math
.huge
, -math
.huge
12 for i
= 1, #t
.sprite
do
13 minX
= math
.min(minX
, t
.sprite
[i
][1], t
.sprite
[i
][3])
14 minY
= math
.min(minY
, t
.sprite
[i
][2], t
.sprite
[i
][4])
15 maxX
= math
.max(maxX
, t
.sprite
[i
][1], t
.sprite
[i
][3])
16 maxY
= math
.max(maxY
, t
.sprite
[i
][2], t
.sprite
[i
][4])
18 regcollision(t
.name
, minX
, minY
, minX
, maxY
)
19 regcollision(t
.name
, minX
, minY
, maxX
, minY
)
20 regcollision(t
.name
, maxX
, maxY
, minX
, maxY
)
21 regcollision(t
.name
, maxX
, maxY
, maxX
, minY
)
26 if t
.color
== nil then
32 function default(t
,k
,v
)
39 default(t
,"gravity",0)
40 default(t
,"duration",3000)
42 local s
= createshot(t
.x
,t
.y
,t
.angle
,t
.duration
,t
.weapon
,t
.gravity
,t
.speed
,t
.damage
)
43 for i
= 1, #t
.sprite
do
44 regspritelineshot(s
,t
.sprite
[i
][1],t
.sprite
[i
][2],t
.sprite
[i
][3],t
.sprite
[i
][4],
45 t
.sprite
[i
].color
[1],t
.sprite
[i
].color
[2],t
.sprite
[i
].color
[3])