From 933516972183da81f141808caacf476ca2a13260 Mon Sep 17 00:00:00 2001 From: div0 Date: Thu, 18 May 2006 20:17:40 +0000 Subject: [PATCH] -campaign_mapcfgname[], +campaign_gametype[], +campaign_mapname[], +nexdm20 git-svn-id: svn://svn.icculus.org/nexuiz/trunk@1414 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/maps/campaign.txt | 51 ++++++++++++----------- data/menuqc/custom/campaign.qc | 4 +- data/qcsrc/server/gamec/campaign.c | 8 ++-- data/qcsrc/server/gamec/campaign_common.h | 3 +- data/qcsrc/server/gamec/campaign_file.c | 22 ++++++---- data/qcsrc/server/gamec/campaign_setup.c | 13 ++++-- 6 files changed, 59 insertions(+), 42 deletions(-) diff --git a/data/maps/campaign.txt b/data/maps/campaign.txt index b487d0846..e178680b0 100644 --- a/data/maps/campaign.txt +++ b/data/maps/campaign.txt @@ -1,25 +1,26 @@ -// mapcfgname bots skill frag mutator-sets description long description -dm_nexdm01 1 0 10 "" "Basement" "One player, one bot. Will you pass the initial test?" -dm_nexdm05 2 0 10 "" "Downer" "What could be worse than one bot... TWO BOTS!" -dm_nexdm08 2 1 10 "" "Glow Arena" "Yes, these things do glow. Do not forget to hit your enemies..." -dm_nexdm06 3 1 10 "" "Starship" "Pink ZOMGWTFBBQ" -dm_nexdm03 3 2 10 "g_vampire 1" "The Slime Pit" "Note that slime does hurt. +++ Win FREE HEALTH by shooting enemies! (Vampire mutator)" -tdm_nexdm11 3 0 15 "" "Team DM on Toxic" "MORE GREEN STUFF! YEAH! +++ And note: you have one teammate." -tdm_nexdm07 3 1 20 "" "Team DM on DSI" "Did you know? +++ Team mates have a TEAM MATE bubble above their heads." -dom_nexdm02 3 0 200 "" "Domination on Bleach" "Take and hold the control points. The more your team holds, the better you score." -dom_nexdm04 3 1 200 "" "Domination on Skyway" "Find the following items: Rocket launcher, Megahealth, Strength." -ctf_tznex01 3 1 60 "" "CTF on Bloody Tower" "Here's some other small CTF map... with obvious defense points. Will you make it past the bots?" -ctf_nexctf01 3 1 60 "" "CTF on Basement" "This map is a variant of the first map you played. +++ Note that defending this flag isn't easy." -dm_nexdm14 2 -1 10 "g_minstagib 1" "MinstaGib on Soylent Space" "MinstaGib: all you have is a sniper gun with integrated laser. Use it." -dm_nexdm09 3 1 15 "g_nixnex 1" "NixNex DM on Aneurism" "No-items-Nexuiz: everyone has the same weapon as the others. Weapons are cycled in regular intervals." -dm_nexdm12 2 2 10 "g_rocketarena 1" "RL arena on Evil Space" "Just rocket launchers... +++ You will LOVE that." -dm_nexdm16 5 1 15 "g_grappling_hook 1" "Hook on Silver City" "Play with the grappling hook! +++ Hint: default binding is E." -dm_nexdm10 5 0 15 "g_laserguided_missile 1; g_rocketarena 1" "LG missiles on StormKeep" "Laser guided missiles - toggle laser using altfire." -dm_nexdmextra1 1 0 10 "g_cloaked 1" "Cloaked DM on Q1Dm6 remake" "Watch out, everyone is partially invisible!" -dm_nexdm15 5 1 15 "" "Oilrig" "Bots... bots... bots..." -dom_nexdm17 5 1 250 "" "Domination on Diesel Power" "Control points... control points... control points..." -ctf_nexctf02 5 0 60 "" "CTF on Running Man" "Some larger CTF map. Will you find home?" -dm_nexdmextra2 1 1 10 "g_footsteps 1" "1on1 on Aggressor" "One on one. +++ Who will win? +++ To make it easier, you can hear footsteps." -dm_nexdm18_1on1remix 1 2 10 "" "1on1 on Running Man" "Now how well will you do without footsteps?" -ctf_nexdm13 3 1 80 "g_minstagib 1" "MinstaGib CTF on Dismal" "You can have both of them! +++ MinstaGib AND CTF! +++ Warning: it's quite evil." -lms_nexdm19 3 3 9 "" "LMS on Blood Prison" "Last Man Standing: you have nine lives. +++ Make something out of it!" +// game mapname bots skill frag mutator-sets description long description +dm nexdm01 1 0 10 "" "Basement" "One player, one bot. Will you pass the initial test?" +dm nexdm05 2 0 10 "" "Downer" "What could be worse than one bot... TWO BOTS!" +dm nexdm08 2 1 10 "" "Glow Arena" "Yes, these things do glow. Do not forget to hit your enemies..." +dm nexdm06 3 1 10 "" "Starship" "Pink ZOMGWTFBBQ" +dm nexdm03 3 2 10 "g_vampire 1" "The Slime Pit" "Note that slime does hurt. +++ Win FREE HEALTH by shooting enemies! (Vampire mutator)" +tdm nexdm11 3 0 15 "" "Team DM on Toxic" "MORE GREEN STUFF! YEAH! +++ And note: you have one teammate." +tdm nexdm07 3 1 20 "" "Team DM on DSI" "Did you know? +++ Team mates have a TEAM MATE bubble above their heads." +dom nexdm02 3 0 200 "" "Domination on Bleach" "Take and hold the control points. The more your team holds, the better you score." +dom nexdm04 3 1 200 "" "Domination on Skyway" "Find the following items: Rocket launcher, Megahealth, Strength." +ctf tznex01 3 1 60 "" "CTF on Bloody Tower" "Here's some other small CTF map... with obvious defense points. Will you make it past the bots?" +ctf nexctf01 3 1 60 "" "CTF on Basement" "This map is a variant of the first map you played. +++ Note that defending this flag isn't easy." +dm nexdm12 2 1 10 "" "Evil Space" "Like the void?" +dm nexdm14 2 -1 10 "g_minstagib 1" "MinstaGib on Soylent Space" "MinstaGib: all you have is a sniper gun with integrated laser. Use it." +dm nexdm09 3 1 15 "g_nixnex 1" "NixNex DM on Aneurism" "No-items-Nexuiz: everyone has the same weapon as the others. Weapons are cycled in regular intervals." +dm nexdm20 2 2 10 "g_rocketarena 1" "RL arena on Farewell" "Just rocket launchers... +++ You will LOVE that." +dm nexdm16 5 1 15 "g_grappling_hook 1" "Hook on Silver City" "Play with the grappling hook! +++ Hint: default binding is E." +dm nexdm10 5 0 15 "g_laserguided_missile 1; g_rocketarena 1" "LG missiles on StormKeep" "Laser guided missiles - toggle laser using altfire." +dm nexdmextra1 1 0 10 "g_cloaked 1" "Cloaked DM on Q1Dm6 remake" "Watch out, everyone is partially invisible!" +dm nexdm15 5 1 15 "" "Oilrig" "Bots... bots... bots..." +dom nexdm17 5 1 250 "" "Domination on Diesel Power" "Control points... control points... control points..." +ctf nexctf02 5 0 60 "" "CTF on Running Man" "Some larger CTF map. Will you find home?" +dm nexdmextra2 1 1 10 "g_footsteps 1" "1on1 on Aggressor" "One on one. +++ Who will win? +++ To make it easier, you can hear footsteps." +dm nexdm18_1on1remix 1 2 10 "" "1on1 on Running Man" "Now how well will you do without footsteps?" +ctf nexdm13 3 1 80 "g_minstagib 1" "MinstaGib CTF on Dismal" "You can have both of them! +++ MinstaGib AND CTF! +++ Warning: it's quite evil." +lms nexdm19 3 3 9 "" "LMS on Blood Prison" "Last Man Standing: you have nine lives. +++ Make something out of it!" diff --git a/data/menuqc/custom/campaign.qc b/data/menuqc/custom/campaign.qc index 71b288fa0..9e56cd74c 100644 --- a/data/menuqc/custom/campaign.qc +++ b/data/menuqc/custom/campaign.qc @@ -20,7 +20,9 @@ void Campaign_DumpLevels() print("Level "); print(ftos(i + campaign_offset)); print(": "); - print(campaign_mapcfgname[i]); + print(campaign_gametype[i]); + print("_"); + print(campaign_mapname[i]); print(" - "); print(campaign_shortdesc[i]); print("\n"); diff --git a/data/qcsrc/server/gamec/campaign.c b/data/qcsrc/server/gamec/campaign.c index 2953dc39e..1fffd9f64 100644 --- a/data/qcsrc/server/gamec/campaign.c +++ b/data/qcsrc/server/gamec/campaign.c @@ -101,10 +101,12 @@ string GetMapname(); void() CampaignPostInit = { // now some sanity checks - string thismapname; + string thismapname, wantedmapname; thismapname = GetMapname(); - if(campaign_mapcfgname[0] != thismapname) - return CampaignBailout(strcat("wrong map: ", campaign_mapcfgname[0], " != ", thismapname)); + wantedmapname = campaign_gametype[0]; + wantedmapname = strcat(wantedmapname, "_", campaign_mapname[0]); + if(wantedmapname != thismapname) + return CampaignBailout(strcat("wrong map: ", wantedmapname, " != ", thismapname)); cvar_set("fraglimit", ftos(campaign_fraglimit[0])); cvar_set("timelimit", "0"); } diff --git a/data/qcsrc/server/gamec/campaign_common.h b/data/qcsrc/server/gamec/campaign_common.h index 217c8bcfb..04d2d12a5 100644 --- a/data/qcsrc/server/gamec/campaign_common.h +++ b/data/qcsrc/server/gamec/campaign_common.h @@ -5,7 +5,8 @@ // each i-th array element corresponds to the list entry campaign_offset+i float campaign_entries; float campaign_offset; -string campaign_mapcfgname[CAMPAIGN_MAX_ENTRIES]; +string campaign_gametype[CAMPAIGN_MAX_ENTRIES]; +string campaign_mapname[CAMPAIGN_MAX_ENTRIES]; float campaign_bots[CAMPAIGN_MAX_ENTRIES]; float campaign_botskill[CAMPAIGN_MAX_ENTRIES]; float campaign_fraglimit[CAMPAIGN_MAX_ENTRIES]; diff --git a/data/qcsrc/server/gamec/campaign_file.c b/data/qcsrc/server/gamec/campaign_file.c index a52071094..6a078edf0 100644 --- a/data/qcsrc/server/gamec/campaign_file.c +++ b/data/qcsrc/server/gamec/campaign_file.c @@ -7,6 +7,7 @@ float CampaignFile_Load(float offset, float n) float fh; float lineno; float entlen; + float i; string l; if(n > CAMPAIGN_MAX_ENTRIES) @@ -27,16 +28,18 @@ float CampaignFile_Load(float offset, float n) if(lineno >= offset) { entlen = tokenize(l); - if(entlen != 7) + if(entlen != 8) error("syntax error in campaign file"); - campaign_mapcfgname[campaign_entries] = strzone(argv(0)); - campaign_bots[campaign_entries] = stof(argv(1)); - campaign_botskill[campaign_entries] = stof(argv(2)); - campaign_fraglimit[campaign_entries] = stof(argv(3)); - campaign_mutators[campaign_entries] = strzone(argv(4)); - campaign_shortdesc[campaign_entries] = strzone(argv(5)); - campaign_longdesc[campaign_entries] = strzone(argv(6)); + i = 0; + campaign_gametype[campaign_entries] = strzone(argv(i++)); + campaign_mapname[campaign_entries] = strzone(argv(i++)); + campaign_bots[campaign_entries] = stof(argv(i++)); + campaign_botskill[campaign_entries] = stof(argv(i++)); + campaign_fraglimit[campaign_entries] = stof(argv(i++)); + campaign_mutators[campaign_entries] = strzone(argv(i++)); + campaign_shortdesc[campaign_entries] = strzone(argv(i++)); + campaign_longdesc[campaign_entries] = strzone(argv(i++)); campaign_entries = campaign_entries + 1; if(campaign_entries >= n) @@ -55,7 +58,8 @@ void CampaignFile_Unload() float i; for(i = 0; i < campaign_entries; ++i) { - strunzone(campaign_mapcfgname[i]); + strunzone(campaign_gametype[i]); + strunzone(campaign_mapname[i]); strunzone(campaign_mutators[i]); strunzone(campaign_shortdesc[i]); strunzone(campaign_longdesc[i]); diff --git a/data/qcsrc/server/gamec/campaign_setup.c b/data/qcsrc/server/gamec/campaign_setup.c index b19b7e95d..2cbde0517 100644 --- a/data/qcsrc/server/gamec/campaign_setup.c +++ b/data/qcsrc/server/gamec/campaign_setup.c @@ -3,7 +3,14 @@ void CampaignSetup(float n) localcmd("exec game_reset.cfg\n"); localcmd("exec mutator_reset.cfg\n"); localcmd("set g_campaign 1\n"); - localcmd(strcat("set _campaign_index ", ftos(campaign_offset + n), "\n")); - localcmd(strcat(campaign_mutators[n], "\n")); - localcmd(strcat("exec maps/", campaign_mapcfgname[n], ".mapcfg\n")); + localcmd("set _campaign_index "); + localcmd(ftos(campaign_offset + n)); + localcmd("\n"); + localcmd(campaign_mutators[n]); + localcmd("\n"); + localcmd("exec maps/"); // can't use strcat here in current fteqcc + localcmd(campaign_gametype[n]); + localcmd("_"); + localcmd(campaign_mapname[n]); + localcmd(".mapcfg\n"); } -- 2.39.2