-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbase_script.lua
More file actions
112 lines (96 loc) · 3.52 KB
/
Copy pathbase_script.lua
File metadata and controls
112 lines (96 loc) · 3.52 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
function PrintRailgunParams()
print("Railgun Parameters:")
print(string.format("-Damage : %f", Bot.RailgunReload))
print(string.format("-Default Ammo : %u", Bot.RailgunDefaultAmmo))
print(string.format("-Reload Time : %f s", Bot.RailgunReload))
print(string.format("-Firing Period: %f s", Bot.RailgunRate))
print(string.format("-Shoot Spread : %f rad", Bot.RailgunSpread))
end
function PrintLauncherParams()
print("Launcher Parameters:")
print(string.format("-Damage : %f", Bot.LauncherReload))
print(string.format("-Default Ammo : %u", Bot.LauncherDefaultAmmo))
print(string.format("-Reload Time : %f s", Bot.LauncherReload))
print(string.format("-Firing Period: %f s", Bot.LauncherRate))
print(string.format("-Shoot Spread : %f rad", Bot.LauncherSpread))
print(string.format("-Rocket Speed : %f m/s", Bot.RocketSpeed))
end
function PrintWeaponParams()
PrintRailgunParams()
PrintLauncherParams()
end
function PrintBotParams()
print("Bot Parameters:")
print(string.format("-Default Health : %f", Bot.DefaultHealth))
print(string.format("-Default Armor : %f", Bot.DefaultArmor))
print(string.format("-Max Speed : %f m/s", Bot.MaxSpeed))
print(string.format("-Max Steering Force : %f ", Bot.MaxForce))
print(string.format("-Weapon Swap Time : %f s", Bot.SwapSpeed))
end
function PrintBotProperties(bot)
print(string.format("-Health/Armor: %f/%f",bot.Health, bot.Armor))
print(string.format("-Currently %s", BotStateName[bot.State]))
print(string.format("-Current Weapon: %s", WeaponName[bot.CurrentWeapon]))
print(string.format("-Ammo RG, RL: %u/%u, %u/%u", bot.RGLoadedAmmo, bot.RGSpareAmmo, bot.RLLoadedAmmo, bot.RLSpareAmmo))
if bot.IsSwappingWeapon then print("-Bot is swapping weapon.") end
if bot.IsSwappingWeapon then
print("-Bot is reloading weapon.")
print("-Remaining RG Reload Time: %f s", bot.RGReloadTime)
print("-Remaining RL Reload Time: %f s", bot.RLReloadTime)
end
end
function PrintItemParams()
print(string.format("-Item respawn time : %f", Items.RespawnTime))
print(string.format("-Health Pack Value : %f", HealthPack.Value))
print(string.format("-Armor Pack Value : %f", ArmorPack.Value))
print(string.format("-Railgun Ammo Value : %u", RailgunAmmo.Value))
print(string.format("-Launcher Ammo Value: %u", LauncherAmmo.Value))
end
function TableInvert(t)
local inverted = {}
for key, value in pairs(t) do
inverted[value] = key
end
return inverted
end
BotStateName = TableInvert(BotState)
WeaponName = TableInvert(CurrentWeapon)
ItemName = TableInvert(ItemType)
function PrintAllBots()
for index, bot in ipairs(Bots) do
print("Bot " .. index)
PrintBotProperties(bot)
end
end
function ForAllBots(fun, ...)
for index, bot in ipairs(Bots) do
fun(bot, unpack(arg))
end
end
function ResetRailgun()
Bot.RailgunReload = 10
Bot.RailgunDamage = 100
Bot.RailgunSpread = 0.05
Bot.RailgunRate = 1.5
Bot.RailgunDefaultAmmo = 5
RailgunAmmo.Value = 5
end
function ResetLauncher()
Bot.LauncherReload = 5
Bot.LauncherDamage = 165
Bot.LauncherSpread = 0.05
Bot.LauncherRate = 1
Bot.LauncherDefaultAmmo = 15
Bot.RocketSpeed = 5
LauncherAmmo.Value = 15
end
function ResetBot()
Bot.DefaultHealth = 100
Bot.DefaultArmor = 250
Bot.MaxSpeed = 3
Bot.MaxForce = 15
Bot.SwapSpeed = 3
Item.RespawnTime = 15
HealthPack.Value = 50
ArmorPack.Value = 50
end