Skip to content

Commit 854faf9

Browse files
committed
SERVER: Wild West Implementation
1 parent ca7e372 commit 854faf9

12 files changed

Lines changed: 426 additions & 57 deletions

File tree

progs/ssqc.src

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ ai/dog_core.qc
8181
utilities/map_compatibility.qc
8282
gamemodes/gun_game.qc
8383
gamemodes/hardcore.qc
84+
gamemodes/wild_west.qc
8485
gamemodes/sticks_and_stones.qc
8586
gamemodes/core.qc
8687
#ifdef QUAKEC_TEST

source/client/hud.qc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,7 @@ void() HUD_Useprint =
10951095
usestring = "The Power must be Activated first";
10961096
break;
10971097
case 9://perk
1098-
usestring = strcat("Hold ",usespace, " to buy ", GetPerkName(useprint_weapon));
1098+
usestring = strcat("Hold ",usespace, " to buy ", GetItemName(useprint_weapon));
10991099
usecost = strcat("[Cost: ", ftos(useprint_cost), "]");
11001100
break;
11011101
case 10://turn on power

source/client/main.qc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,7 @@ noref void(float isnew) CSQC_Ent_Update =
460460
if (isnew == TRUE) {
461461
self.classname = "item_powerup";
462462
self.solid = SOLID_NOT;
463+
self.effects = EF_FULLBRIGHT;
463464
self.predraw = PU_PreDraw;
464465
self.drawmask = MASK_ENGINE;
465466
}
@@ -1183,6 +1184,12 @@ noref void() CSQC_Parse_Event =
11831184
date = "";
11841185
person = "";
11851186
break;
1187+
case GAMEMODE_WILDWEST:
1188+
chaptertitle = "WILD WEST";
1189+
location = "It's a stand-off!";
1190+
date = "";
1191+
person = "";
1192+
break;
11861193
default:
11871194
break;
11881195
}

source/menu/menu_gset.qc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ void() Menu_GameSettings =
112112
//case 1: gamemode_description = "Compete in Teams to outlive your opponents."; gamemode_string = "GRIEF"; break;
113113
case 2: gamemode_description = "Race to earn Score to cycle through Weaponry."; gamemode_string = "GUN GAME"; break;
114114
case 3: gamemode_description = "No HUD? Two Perks? 150% Item Cost? No Problem."; gamemode_string = "HARDCORE"; break;
115-
case 4: gamemode_description = "Fight like it's Western America in the 1910's."; gamemode_string = "WILD WEST"; break;
115+
case 4: gamemode_description = "Ole Fashioned stand-off between you and the Dead."; gamemode_string = "WILD WEST"; break;
116116
case 5: gamemode_description = "Knives-and-Nades only. Grenades Explode on Contact."; gamemode_string = "STICKS & STONES"; break;
117117
default: gamemode_description = "???"; break;
118118
}

source/server/ai/dog_core.qc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ void() Dog_Death_Tesla = {
226226
// TODO - place tesla spark correctly
227227
tesla_spark(self.origin);
228228

229-
if(rounds == dogRound && Remaining_Zombies == 0) {
229+
if(rounds == dogRound && Remaining_Zombies == 0 && cvar("sv_magic") != 0) {
230230
Spawn_Powerup(self.origin, PU_MAXAMMO);
231231
}
232232

source/server/ai/zombie_core.qc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1330,7 +1330,7 @@ void() Zombie_Death =
13301330

13311331
if(self.outside == false && self.electro_targeted == false)
13321332
{
1333-
if (totalpowerups < POWERUPS_PER_ROUND)
1333+
if (totalpowerups < POWERUPS_PER_ROUND && cvar("sv_magic") != 0)
13341334
{
13351335
if (total_powerup_points >= powerup_score_threshold)
13361336
{

source/server/entities/powerups.qc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ string(string file) PU_ResolveVOPath =
109109
case GAMEMODE_GUNGAME: path = strcat("sounds/modes/gungame/", file); break;
110110
case GAMEMODE_HARDCORE: path = strcat("sounds/modes/hardcore/", file); break;
111111
case GAMEMODE_STICKSNSTONES: path = strcat("sounds/modes/sticks/", file); break;
112+
case GAMEMODE_WILDWEST: path = strcat("sounds/modes/wildwest/", file); break;
112113
default: path = strcat("sounds/pu/", file); break;
113114
}
114115

@@ -918,9 +919,6 @@ float PU_SendEntity( entity ePVEnt, float flChanged ) {
918919
//
919920
void(vector where, float type) Spawn_Powerup =
920921
{
921-
if (cvar("sv_magic") == 0)
922-
return;
923-
924922
entity powerup;
925923
entity sparkle;
926924

source/server/gamemodes/core.qc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ void() Gamemode_Init =
6363
case GAMEMODE_GUNGAME: Gamemode_GunGame_Init(); break;
6464
case GAMEMODE_HARDCORE: Gamemode_Hardcore_Init(); break;
6565
case GAMEMODE_STICKSNSTONES: Gamemode_Sticks_Init(); break;
66+
case GAMEMODE_WILDWEST: Gamemode_WW_Init(); break;
6667
default: error("Received unrecognized gamemode."); break;
6768
}
6869
};
@@ -79,6 +80,7 @@ void() Gamemode_Frame =
7980
case GAMEMODE_GUNGAME: Gamemode_GunGame_Frame(); break;
8081
case GAMEMODE_HARDCORE: Gamemode_Hardcore_Frame(); break;
8182
case GAMEMODE_STICKSNSTONES: Gamemode_Sticks_Frame(); break;
83+
case GAMEMODE_WILDWEST: Gamemode_WW_Frame(); break;
8284
default: error("Received unrecognized gamemode."); break;
8385
}
8486

@@ -105,6 +107,7 @@ void() Gamemode_PlayerSpawn =
105107
case GAMEMODE_GUNGAME: Gamemode_GunGame_PlayerSpawn(); break;
106108
case GAMEMODE_HARDCORE: Gamemode_Hardcore_PlayerSpawn(); break;
107109
case GAMEMODE_STICKSNSTONES: Gamemode_Sticks_PlayerSpawn(); break;
110+
case GAMEMODE_WILDWEST: Gamemode_WW_PlayerSpawn(); break;
108111
default: error("Received unrecognized gamemode."); break;
109112
}
110113
};
@@ -166,6 +169,16 @@ float(float weapon, float ammo) Gamemode_GetWeaponAmmo =
166169
return ammo;
167170
};
168171

172+
float(float damage) Gamemode_GetWeaponDamage =
173+
{
174+
switch(current_gamemode) {
175+
case GAMEMODE_WILDWEST: return Gamemode_WW_GetWeaponDamage(damage);
176+
default: return damage;
177+
}
178+
179+
return damage;
180+
};
181+
169182
void(entity attacker, float death_style) Gamemode_DieHandler =
170183
{
171184
switch(current_gamemode) {

source/server/gamemodes/gun_game.qc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,16 @@ void() Gamemode_GunGame_PlayerPostThink =
173173
next_weapon = GetWeaponName(gungame_weapon_pool[self.gungame_weapon_idx + 1]);
174174
}
175175

176-
centerprint(self, sprintf("[%d/32]: %s\nNeed [%d] More Score to Advance\nNext Weapon: %s", self.gungame_weapon_idx + 1, GetWeaponName(gungame_weapon_pool[self.gungame_weapon_idx]), self.gungame_score_threshold - self.score, next_weapon));
176+
string centerprint_text = "";
177+
centerprint_text = strcat("[", ftos(self.gungame_weapon_idx + 1));
178+
centerprint_text = strcat(centerprint_text, "/32]: ");
179+
centerprint_text = strcat(centerprint_text, GetWeaponName(gungame_weapon_pool[self.gungame_weapon_idx]));
180+
centerprint_text = strcat(centerprint_text, "\nNeed [");
181+
centerprint_text = strcat(centerprint_text, ftos(self.gungame_score_threshold - self.score));
182+
centerprint_text = strcat(centerprint_text, "] More Score to Advance\nNext Weapon: ");
183+
centerprint_text = strcat(centerprint_text, next_weapon);
184+
185+
centerprint(self, centerprint_text);
177186
#endif // FTE
178187
};
179188

0 commit comments

Comments
 (0)