From 929ad35e68958e61d3ff3a21d523ea2086aa32db Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Fri, 3 Sep 2010 02:27:04 +0300 Subject: [PATCH] Implement RPG / Free Roam gametype. Next step is to remove scoring under this type (since that is its purpose). Also make voretown a map of this gametype --- data/defaultVoretournament.cfg | 3 +++ data/maps/voretown.mapinfo | 12 ++++-------- data/qcsrc/common/constants.qh | 1 + data/qcsrc/common/mapinfo.qc | 8 +++++++- data/qcsrc/common/mapinfo.qh | 3 ++- data/qcsrc/common/util.qc | 1 + data/qcsrc/menu/voret/dialog_multiplayer_create.c | 6 ++++++ .../menu/voret/dialog_multiplayer_create_mapinfo.c | 12 ++++++++---- data/qcsrc/server/defs.qh | 2 +- data/qcsrc/server/g_world.qc | 1 + data/qcsrc/server/teamplay.qc | 8 ++++++++ 11 files changed, 42 insertions(+), 15 deletions(-) diff --git a/data/defaultVoretournament.cfg b/data/defaultVoretournament.cfg index a09426e3..e8435615 100644 --- a/data/defaultVoretournament.cfg +++ b/data/defaultVoretournament.cfg @@ -605,6 +605,9 @@ set g_race_teams 0 "when 2, 3, or 4, the race is played as a team game (the team // cts set g_cts 0 "CTS: complete the stage" +// rpg +set g_rpg 0 "RPG: RolePlay / Free Roam gametype" + // server game balance settings // powerup balance settings // weapon balance settings follow diff --git a/data/maps/voretown.mapinfo b/data/maps/voretown.mapinfo index 9b603f73..5a3b9018 100644 --- a/data/maps/voretown.mapinfo +++ b/data/maps/voretown.mapinfo @@ -1,10 +1,6 @@ -title Gallery -description A medieval themed picture gallery +title Vore Town +description A medieval temple author MirceaKitsune //cdtrack stone_fortress -type dm 30 20 -settemp_for_type all g_start_weapon_grabber 0 -settemp_for_type all bot_nofire 1 -settemp_for_type all sv_gravity 400 -settemp_for_type all bot_number 7 -//hidden +has weapons +type rpg 20 \ No newline at end of file diff --git a/data/qcsrc/common/constants.qh b/data/qcsrc/common/constants.qh index b31aa984..74307aef 100644 --- a/data/qcsrc/common/constants.qh +++ b/data/qcsrc/common/constants.qh @@ -37,6 +37,7 @@ const float GAME_ONSLAUGHT = 9; const float GAME_RACE = 10; const float GAME_CTS = 11; const float GAME_CA = 12; +const float GAME_RPG = 13; const float AS_STRING = 1; const float AS_INT = 2; diff --git a/data/qcsrc/common/mapinfo.qc b/data/qcsrc/common/mapinfo.qc index be281a57..7f8c04ec 100644 --- a/data/qcsrc/common/mapinfo.qc +++ b/data/qcsrc/common/mapinfo.qc @@ -390,7 +390,7 @@ void _MapInfo_Map_ApplyGametype(string s, float pWantedType, float pThisType) if(!(pThisType & pWantedType)) return; - if(pWantedType == MAPINFO_TYPE_ASSAULT || pWantedType == MAPINFO_TYPE_ONSLAUGHT || pWantedType == MAPINFO_TYPE_RACE || pWantedType == MAPINFO_TYPE_CTS) // these modes don't use fraglimit + if(pWantedType == MAPINFO_TYPE_ASSAULT || pWantedType == MAPINFO_TYPE_ONSLAUGHT || pWantedType == MAPINFO_TYPE_RACE || pWantedType == MAPINFO_TYPE_CTS || pWantedType == MAPINFO_TYPE_RPG) // these modes don't use fraglimit { cvar_set("fraglimit", "0"); } @@ -470,6 +470,7 @@ float MapInfo_Type_FromString(string t) else if(t == "ons") return MAPINFO_TYPE_ONSLAUGHT; else if(t == "rc") return MAPINFO_TYPE_RACE; else if(t == "cts") return MAPINFO_TYPE_CTS; + else if(t == "rpg") return MAPINFO_TYPE_RPG; else if(t == "all") return MAPINFO_TYPE_ALL; else return 0; } @@ -655,6 +656,7 @@ float MapInfo_Get_ByName(string pFilename, float pAllowGenerate, float pGametype if(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_RACE) fputs(fh, "type rc 20 5 7 15\n"); if(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_ONSLAUGHT) fputs(fh, "type ons 20\n"); if(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_CTS) fputs(fh, "type cts 20 -1\n"); + if(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_RPG) fputs(fh, "type rpg -1\n"); fh2 = fopen(strcat("scripts/", pFilename, ".arena"), FILE_READ); if(fh2 >= 0) @@ -916,6 +918,8 @@ float MapInfo_CurrentGametype() return MAPINFO_TYPE_RACE; else if(cvar("g_cts")) return MAPINFO_TYPE_CTS; + else if(cvar("g_rpg")) + return MAPINFO_TYPE_RPG; else return MAPINFO_TYPE_DEATHMATCH; } @@ -955,6 +959,7 @@ string MapInfo_GetGameTypeCvar(float t) case MAPINFO_TYPE_ONSLAUGHT: return "g_onslaught"; case MAPINFO_TYPE_RACE: return "g_race"; case MAPINFO_TYPE_CTS: return "g_cts"; + case MAPINFO_TYPE_RPG: return "g_rpg"; default: return ""; } } @@ -974,6 +979,7 @@ void MapInfo_SwitchGameType(float t) cvar_set("g_onslaught", (t == MAPINFO_TYPE_ONSLAUGHT) ? "1" : "0"); cvar_set("g_race", (t == MAPINFO_TYPE_RACE) ? "1" : "0"); cvar_set("g_cts", (t == MAPINFO_TYPE_CTS) ? "1" : "0"); + cvar_set("g_rpg", (t == MAPINFO_TYPE_RPG) ? "1" : "0"); } void MapInfo_LoadMap(string s) diff --git a/data/qcsrc/common/mapinfo.qh b/data/qcsrc/common/mapinfo.qh index 784c67a9..ccb32361 100644 --- a/data/qcsrc/common/mapinfo.qh +++ b/data/qcsrc/common/mapinfo.qh @@ -10,7 +10,8 @@ float MAPINFO_TYPE_ARENA = 256; float MAPINFO_TYPE_KEYHUNT = 512; float MAPINFO_TYPE_CTS = 1024; float MAPINFO_TYPE_CA = 2048; -float MAPINFO_TYPE_ALL = 4096; // this has to include all above bits +float MAPINFO_TYPE_RPG = 4096; +float MAPINFO_TYPE_ALL = 8192; // this has to include all above bits float MAPINFO_FEATURE_WEAPONS = 1; // not defined for minstagib-only maps diff --git a/data/qcsrc/common/util.qc b/data/qcsrc/common/util.qc index dc22dfcd..3e2f269f 100644 --- a/data/qcsrc/common/util.qc +++ b/data/qcsrc/common/util.qc @@ -467,6 +467,7 @@ string GametypeNameFromType(float g) else if (g == GAME_ASSAULT) return "as"; else if (g == GAME_RACE) return "rc"; else if (g == GAME_CTS) return "cts"; + else if (g == GAME_RPG) return "rpg"; return "dm"; } diff --git a/data/qcsrc/menu/voret/dialog_multiplayer_create.c b/data/qcsrc/menu/voret/dialog_multiplayer_create.c index a015ff24..35104ffa 100644 --- a/data/qcsrc/menu/voret/dialog_multiplayer_create.c +++ b/data/qcsrc/menu/voret/dialog_multiplayer_create.c @@ -63,6 +63,12 @@ void fillVoretServerCreateTab(entity me) if(e.checked) e0 = NULL; me.TD(me, 1, me.columns / n, e = makeVoretGametypeButton(1, "g_onslaught", "Onslaught")); if(e.checked) e0 = NULL; + me.TR(me); + me.TD(me, 1, 0.5, me.playerNameLabel = makeVoretTextLabel(0, "Other:")); + me.playerNameLabelAlpha = me.playerNameLabel.alpha; + n = 1; + me.TD(me, 1, me.columns / n, e = makeVoretGametypeButton(1, "g_rpg", "Role Play")); + if(e.checked) e0 = NULL; if(e0) { //print("NO CHECK\n"); diff --git a/data/qcsrc/menu/voret/dialog_multiplayer_create_mapinfo.c b/data/qcsrc/menu/voret/dialog_multiplayer_create_mapinfo.c index d4051076..b640ee86 100644 --- a/data/qcsrc/menu/voret/dialog_multiplayer_create_mapinfo.c +++ b/data/qcsrc/menu/voret/dialog_multiplayer_create_mapinfo.c @@ -26,6 +26,7 @@ CLASS(VoretMapInfoDialog) EXTENDS(VoretDialog) ATTRIB(VoretMapInfoDialog, typeOnslaughtLabel, entity, NULL) ATTRIB(VoretMapInfoDialog, typeRaceLabel, entity, NULL) ATTRIB(VoretMapInfoDialog, typeCTSLabel, entity, NULL) + ATTRIB(VoretMapInfoDialog, typeRPGLabel, entity, NULL) ATTRIB(VoretMapInfoDialog, currentMapIndex, float, 0) ATTRIB(VoretMapInfoDialog, currentMapBSPName, string, string_null) @@ -79,6 +80,7 @@ void loadMapInfoVoretMapInfoDialog(entity me, float i, entity mlb) me.typeOnslaughtLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_ONSLAUGHT); me.typeRaceLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_RACE); me.typeCTSLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_CTS); + me.typeRPGLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_RPG); MapInfo_ClearTemps(); } @@ -120,10 +122,10 @@ void fillVoretMapInfoDialog(entity me) me.typeLMSLabel = e; me.TD(me, 1, wgt, e = makeVoretTextLabel(0, "Arena")); me.typeArenaLabel = e; - me.TR(me); - me.TDempty(me, 0.2); me.TD(me, 1, wgt, e = makeVoretTextLabel(0, "Domination")); me.typeDominationLabel = e; + me.TR(me); + me.TDempty(me, 0.2); me.TD(me, 1, wgt, e = makeVoretTextLabel(0, "Key Hunt")); me.typeKeyHuntLabel = e; me.TD(me, 1, wgt, e = makeVoretTextLabel(0, "CTF")); @@ -132,14 +134,16 @@ void fillVoretMapInfoDialog(entity me) me.typeCALabel = e; me.TD(me, 1, wgt, e = makeVoretTextLabel(0, "Assault")); me.typeAssaultLabel = e; - me.TR(me); - me.TDempty(me, 0.2); me.TD(me, 1, wgt, e = makeVoretTextLabel(0, "Onslaught")); me.typeOnslaughtLabel = e; + me.TR(me); + me.TDempty(me, 0.2); me.TD(me, 1, wgt, e = makeVoretTextLabel(0, "Race")); me.typeRaceLabel = e; me.TD(me, 1, wgt, e = makeVoretTextLabel(0, "CTS")); me.typeCTSLabel = e; + me.TD(me, 1, wgt, e = makeVoretTextLabel(0, "RPG")); + me.typeRPGLabel = e; me.gotoRC(me, me.rows - 2, 0); me.TD(me, 1, me.columns, e = makeVoretTextLabel(0.5, "")); diff --git a/data/qcsrc/server/defs.qh b/data/qcsrc/server/defs.qh index 352162d9..7953f822 100644 --- a/data/qcsrc/server/defs.qh +++ b/data/qcsrc/server/defs.qh @@ -19,7 +19,7 @@ float require_spawnfunc_prefix; // if this float exists, only functions with spa float ctf_score_value(string parameter); -float g_dm, g_domination, g_ctf, g_tdm, g_keyhunt, g_onslaught, g_assault, g_arena, g_ca, g_lms, g_race, g_cts; +float g_dm, g_domination, g_ctf, g_tdm, g_keyhunt, g_onslaught, g_assault, g_arena, g_ca, g_lms, g_race, g_cts, g_rpg; float g_cloaked, g_footsteps, g_jump_grunt, g_midair, g_norecoil, g_vampire, g_bloodloss; float g_warmup_limit; float g_warmup_allguns; diff --git a/data/qcsrc/server/g_world.qc b/data/qcsrc/server/g_world.qc index badb765a..12b021af 100644 --- a/data/qcsrc/server/g_world.qc +++ b/data/qcsrc/server/g_world.qc @@ -330,6 +330,7 @@ void cvar_changes_init() BADCVAR("g_race"); BADCVAR("g_cts"); BADCVAR("g_tdm"); + BADCVAR("g_rpg"); BADCVAR("teamplay"); // long diff --git a/data/qcsrc/server/teamplay.qc b/data/qcsrc/server/teamplay.qc index 1bdef27d..4f5dbaa5 100644 --- a/data/qcsrc/server/teamplay.qc +++ b/data/qcsrc/server/teamplay.qc @@ -95,6 +95,7 @@ void WriteGameCvars() cvar_set("g_onslaught", ftos(g_onslaught)); cvar_set("g_race", ftos(g_race)); cvar_set("g_cts", ftos(g_cts)); + cvar_set("g_rpg", ftos(g_rpg)); } void ReadGameCvars() @@ -119,6 +120,7 @@ void ReadGameCvars() found += (g_onslaught = (!found && (prev != GAME_ONSLAUGHT) && cvar("g_onslaught"))); found += (g_race = (!found && (prev != GAME_RACE) && cvar("g_race"))); found += (g_cts = (!found && (prev != GAME_CTS) && cvar("g_cts"))); + found += (g_rpg = (!found && (prev != GAME_RPG) && cvar("g_rpg"))); if(found) break; @@ -343,6 +345,12 @@ void InitGameplayMode() leadlimit_override = 0; } + if(g_rpg) + { + game = GAME_RPG; + gamemode_name = "Role Play"; + } + if(teams_matter) entcs_init(); -- 2.39.2