/
complite.nut
171 lines (144 loc) · 4.56 KB
/
complite.nut
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
// vim: set ts=4
// CompLite.nut (Confogl Mutation)
// Copyright (C) 2012 ProdigySim
// All rights reserved.
// =============================================================================
if(getroottable().rawin("CompLite"))
{
::CompLite.Globals.iRoundCount++;
Msg("CompLite starting round "+::CompLite.Utils.GetCurrentRound()+"\n");
::CompLite.Globals.GSM.Reset();
::CompLite.Globals.MapInfo.IdentifyMap(Entities);
Msg("Map is intro? "+::CompLite.Globals.MapInfo.isIntro+"\n");
DirectorOptions <- ::CompLite.ChallengeScript.DirectorOptions;
Update <- CompLite.ChallengeScript.Update;
return;
}
Msg("Activating Mutation CompLite v3.0\n");
::CompLite <- {
Globals = {
iRoundCount = 0
}
ChallengeScript = {
DirectorOptions = {
ActiveChallenge = 1
cm_ProhibitBosses = 0
cm_AllowPillConversion = 0
function AllowWeaponSpawn( classname )
{
return ::CompLite.Globals.GSM.OnAllowWeaponSpawn(classname);
}
function ConvertWeaponSpawn( classname )
{
return ::CompLite.Globals.GSM.OnConvertWeaponSpawn(classname);
}
function GetDefaultItem( idx )
{
return ::CompLite.Globals.GSM.OnGetDefaultItem(idx);
}
function ConvertZombieClass( id )
{
return ::CompLite.Globals.GSM.OnConvertZombieClass(id);
}
}
function Update()
{
::CompLite.Globals.Timer.Update();
::CompLite.Globals.FrameTimer.Update();
::CompLite.Globals.GSM.DoFrameUpdate();
}
}
}
DirectorOptions <- ::CompLite.ChallengeScript.DirectorOptions;
Update <- ::CompLite.ChallengeScript.Update;
IncludeScript("complite/gamestate_model.nut", ::CompLite);
IncludeScript("complite/globaltimers.nut", ::CompLite);
IncludeScript("complite/utils.nut", ::CompLite);
IncludeScript("complite/modules.nut", ::CompLite);
g_Timer <- ::CompLite.Globals.Timer <- CompLite.Timers.GlobalSecondsTimer()
g_FrameTimer <- ::CompLite.Globals.FrameTimer <- CompLite.Timers.GlobalFrameTimer()
g_MapInfo <- ::CompLite.Globals.MapInfo <- CompLite.Utils.MapInfo()
g_GSC <- ::CompLite.Globals.GSC <- CompLite.GameState.GameStateController()
g_GSM <- ::CompLite.Globals.GSM <- CompLite.GameState.GameStateModel(g_GSC, Director)
g_MobResetti <- ::CompLite.Globals.MobResetti <- CompLite.Utils.ZeroMobReset(Director, DirectorOptions, g_FrameTimer);
Modules <- ::CompLite.Modules;
g_MapInfo.IdentifyMap(Entities);
// Uncomment to add a debug event listener
//g_GSC.AddListener(Modules.MsgGSL());
g_GSC.AddListener(Modules.SpitterControl(Director, DirectorOptions));
g_GSC.AddListener(Modules.MobControl(g_MobResetti));
// Give out hunting rifles on non-intro maps.
// But limit them to 1 of each.
g_GSC.AddListener(Modules.HRControl(Entities, g_Timer));
g_GSC.AddListener(
Modules.BasicItemSystems(
// AllowWeaponSpawn Limits
// 0: Always remove
// >0: Keep the first n instances, delete others
// <-1: Delete the first n instances, keep others.
{
weapon_defibrillator = 0
weapon_grenade_launcher = 0
weapon_upgradepack_incendiary = 0
weapon_upgradepack_explosive = 0
weapon_chainsaw = 0
//weapon_molotov = 1
//weapon_pipe_bomb = 2
//weapon_vomitjar = 1
weapon_propanetank = 0
weapon_oxygentank = 0
weapon_rifle_m60 = 0
weapon_first_aid_kit = -5
upgrade_item = 0
},
// Conversion Rules
{
weapon_autoshotgun = "weapon_pumpshotgun_spawn"
weapon_shotgun_spas = "weapon_shotgun_chrome_spawn"
weapon_rifle = "weapon_smg_spawn"
weapon_rifle_desert = "weapon_smg_spawn"
weapon_rifle_sg552 = "weapon_smg_mp5_spawn"
weapon_rifle_ak47 = "weapon_smg_silenced_spawn"
weapon_hunting_rifle = "weapon_smg_silenced_spawn"
weapon_sniper_military = "weapon_shotgun_chrome_spawn"
weapon_sniper_awp = "weapon_shotgun_chrome_spawn"
weapon_sniper_scout = "weapon_pumpshotgun_spawn"
weapon_first_aid_kit = "weapon_pain_pills_spawn"
weapon_molotov = "weapon_molotov_spawn"
weapon_pipe_bomb = "weapon_pipe_bomb_spawn"
weapon_vomitjar = "weapon_vomitjar_spawn"
},
// Default item list
[
"weapon_pain_pills",
"weapon_pistol",
"weapon_hunting_rifle"
]
)
);
g_GSC.AddListener(
Modules.ItemControl(Entities,
// Roundstart Weapon removal list
// Limit to value
{
weapon_adrenaline_spawn = 1
weapon_pain_pills_spawn = 3
weapon_melee_spawn = 4
witch = 1
func_playerinfected_clip = 0
weapon_molotov_spawn = 1
weapon_pipe_bomb_spawn = 1
weapon_vomitjar_spawn = 1
},
// Set count to 1 on these
[
"weapon_adrenaline_spawn",
"weapon_pain_pills_spawn",
"weapon_melee_spawn",
"weapon_molotov_spawn",
"weapon_vomitjar_spawn",
"weapon_pipebomb_spawn"
]
)
);
Msg("GSC/M/L Script run.\n");