-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkeyStarPirate.lua
More file actions
46 lines (37 loc) · 1019 Bytes
/
Copy pathkeyStarPirate.lua
File metadata and controls
46 lines (37 loc) · 1019 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
local keyStarPirate = {}
local ship = require("ship")
local crit = 0.2
local dodge = 0.2
local armor = 2
local hp = 80
local numAmmo = 5
local function getUniqueGun(weapons)
local specialWeapons = {}
if not weapons["debuff"] then
table.insert(specialWeapons, "debuff")
end
if not weapons["crit"] then
table.insert(specialWeapons, "crit")
end
if not weapons["pierce"] then
table.insert(specialWeapons, "pierce")
end
local roll = math.random(1, table.getn(specialWeapons))
local receivedWeapon = specialWeapons[roll]
weapons[receivedWeapon] = true
end
local KeyStarPirate = {}
function KeyStarPirate:new()
print("New KeyStarPirate\n")
local weapons = {}
getUniqueGun(weapons)
getUniqueGun(weapons)
local o = ship.newShip(dodge, crit, armor, hp, numAmmo, weapons)
o.shipType = "keyStarPirate"
o.maxHp = hp
return o
end
function keyStarPirate.newKeyStarPirate()
return KeyStarPirate:new()
end
return keyStarPirate