From: Lyberta Date: Wed, 31 Oct 2018 22:40:59 +0000 (+0300) Subject: Merge branch 'master' into Lyberta/GunGame X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7730016ead81ff7164134a0371e97f1bbe27955d;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'master' into Lyberta/GunGame --- 7730016ead81ff7164134a0371e97f1bbe27955d diff --cc gamemodes-server.cfg index d609e5fc0,57c9f7b70..e4ff94822 --- a/gamemodes-server.cfg +++ b/gamemodes-server.cfg @@@ -28,7 -28,7 +28,8 @@@ alias sv_hook_gamestart_ct alias sv_hook_gamestart_ka alias sv_hook_gamestart_ft alias sv_hook_gamestart_inv + alias sv_hook_gamestart_duel +alias sv_hook_gamestart_gg alias sv_hook_gamerestart alias sv_hook_gameend @@@ -198,13 -198,13 +200,20 @@@ set g_inv_respawn_delay_large_count set g_inv_respawn_delay_max 0 set g_inv_respawn_waves 0 set g_inv_weapon_stay 0 + set g_duel_respawn_delay_small 0 + set g_duel_respawn_delay_small_count 0 + set g_duel_respawn_delay_large 0 + set g_duel_respawn_delay_large_count 0 + set g_duel_respawn_delay_max 0 + set g_duel_respawn_waves 0 + set g_duel_weapon_stay 0 +set g_gg_respawn_delay_small 0 +set g_gg_respawn_delay_small_count 0 +set g_gg_respawn_delay_large 0 +set g_gg_respawn_delay_large_count 0 +set g_gg_respawn_delay_max 0 +set g_gg_respawn_waves 0 +set g_gg_weapon_stay 0 // ========= @@@ -533,9 -536,9 +545,16 @@@ set g_invasion_teams 0 "number of team set g_invasion_team_spawns 1 "use team spawns in teamplay invasion mode" set g_invasion_type 0 "type of invasion mode - 0: round-based, 1: hunting, 2: complete the stage (note: use mapinfo to set this)" + // ====== + // duel + // ====== + set g_duel 0 "Duel: frag the opponent more in a one versus one arena battle" + //set g_duel_warmup 180 "Have a short warmup period before beginning the actual duel" + set g_duel_with_powerups 0 "Enable powerups to spawn in the duel gamemode" ++ +// ========= +// gungame +// ========= +set g_gg 0 "GunGame: Kill players with all weapons. One weapon at a time." +set g_gg_weapons "vortex mortar machinegun hagar arc electro devastator crylink shotgun blaster" +set g_gg_kills_per_weapon 3 "Number of kills needed to advance to the next weapon" diff --cc qcsrc/common/gamemodes/gamemode/_mod.inc index 01a5a060c,a33ec87a0..bb6eb0ea3 --- a/qcsrc/common/gamemodes/gamemode/_mod.inc +++ b/qcsrc/common/gamemodes/gamemode/_mod.inc @@@ -6,8 -6,8 +6,9 @@@ #include #include #include + #include #include +#include #include #include #include diff --cc qcsrc/common/gamemodes/gamemode/_mod.qh index 8ddd27c59,ffd71d59d..2ddcc0d1f --- a/qcsrc/common/gamemodes/gamemode/_mod.qh +++ b/qcsrc/common/gamemodes/gamemode/_mod.qh @@@ -6,8 -6,8 +6,9 @@@ #include #include #include + #include #include +#include #include #include #include diff --cc qcsrc/common/mapinfo.qh index 1f632859c,6fbb7ce89..399d1d05c --- a/qcsrc/common/mapinfo.qh +++ b/qcsrc/common/mapinfo.qh @@@ -480,29 -583,27 +583,50 @@@ CLASS(Invasion, Gametype ENDCLASS(Invasion) REGISTER_GAMETYPE(INVASION, NEW(Invasion)); + CLASS(Duel, Gametype) + INIT(Duel) + { + this.gametype_init(this, _("Duel"),"duel","g_duel",false,true,"","timelimit=10 pointlimit=0 leadlimit=0",_("Fight in a one versus one arena battle to decide the winner")); + } + METHOD(Duel, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter)) + { + return (diameter < 16384); + } + METHOD(Duel, m_isForcedSupported, bool(Gametype this)) + { + // force all DM maps to work in duel?! + // TODO: we should really check the size of maps, some DM maps do not work for duel! + if(!(MapInfo_Map_supportedGametypes & this.m_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DEATHMATCH.m_flags)) + return true; + return false; + } + ENDCLASS(Duel) + REGISTER_GAMETYPE(DUEL, NEW(Duel)); + #define g_duel IS_GAMETYPE(DUEL) + +//============================================================================= + +#ifdef CSQC +void HUD_Mod_GG(vector pos, vector mySize); +#endif +CLASS(GunGame, Gametype) + INIT(GunGame) + { - this.gametype_init(this, _("GunGame"), "gg", "g_gg", false, "", "timelimit=20", _("Kill players with all weapons. One weapon at a time")); ++ this.gametype_init(this, _("GunGame"), "gg", "g_gg", false, true, "", "timelimit=20", _("Kill players with all weapons. One weapon at a time")); + } + METHOD(GunGame, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter)) + { + return true; + } +#ifdef CSQC + ATTRIB(GunGame, m_modicons, void(vector pos, vector mySize), HUD_Mod_GG); +#endif +ENDCLASS(GunGame) +REGISTER_GAMETYPE(GUNGAME, NEW(GunGame)); +#define g_gg IS_GAMETYPE(GUNGAME) + +//============================================================================= + const int MAPINFO_FEATURE_WEAPONS = 1; // not defined for instagib-only maps const int MAPINFO_FEATURE_VEHICLES = 2; const int MAPINFO_FEATURE_TURRETS = 4; diff --cc qcsrc/common/notifications/all.qh index 5a254efdd,6cbf91cc9..969b6b36c --- a/qcsrc/common/notifications/all.qh +++ b/qcsrc/common/notifications/all.qh @@@ -431,10 -432,9 +432,10 @@@ string BUFF_NAME(int i) ARG_CASE(ARG_CS_SV, "spree_end", (autocvar_notification_show_sprees ? notif_arg_spree_inf(-1, "", "", f1) : "")) \ ARG_CASE(ARG_CS_SV, "spree_lost", (autocvar_notification_show_sprees ? notif_arg_spree_inf(-2, "", "", f1) : "")) \ ARG_CASE(ARG_CS_SV, "item_wepname", Weapons_from(f1).m_name) \ + ARG_CASE(ARG_CS_SV, "item_wepname2", Weapons_from(f2).m_name) \ ARG_CASE(ARG_CS_SV, "item_buffname", BUFF_NAME(f1)) \ ARG_CASE(ARG_CS_SV, "f3buffname", BUFF_NAME(f3)) \ - ARG_CASE(ARG_CS_SV, "item_wepammo", (s1 != "" ? sprintf(_(" with %s"), s1) : "")) \ + ARG_CASE(ARG_CS_SV, "item_wepammo", (f2 > 0 ? notif_arg_item_wepammo(f1, f2) : "")) \ ARG_CASE(ARG_DC, "item_centime", ftos(autocvar_notification_item_centerprinttime)) \ ARG_CASE(ARG_SV, "death_team", Team_ColoredFullName(f1)) \ ARG_CASE(ARG_CS, "death_team", Team_ColoredFullName(f1 - 1)) \ diff --cc qcsrc/menu/xonotic/util.qc index 97b878fc8,e99449112..eb9697d6c --- a/qcsrc/menu/xonotic/util.qc +++ b/qcsrc/menu/xonotic/util.qc @@@ -689,7 -689,7 +689,8 @@@ float updateCompression( GAMETYPE(MAPINFO_TYPE_NEXBALL) \ GAMETYPE(MAPINFO_TYPE_ONSLAUGHT) \ GAMETYPE(MAPINFO_TYPE_ASSAULT) \ + GAMETYPE(MAPINFO_TYPE_GUNGAME) \ + /* GAMETYPE(MAPINFO_TYPE_DUEL) */ \ /* GAMETYPE(MAPINFO_TYPE_INVASION) */ \ /**/ diff --cc qcsrc/server/g_world.qc index df12edd5b,522f4f041..408f590d4 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@@ -265,9 -265,9 +265,10 @@@ void cvar_changes_init( BADCVAR("g_dm"); BADCVAR("g_domination"); BADCVAR("g_domination_default_teams"); + BADCVAR("g_duel"); BADCVAR("g_freezetag"); BADCVAR("g_freezetag_teams"); + BADCVAR("g_gg"); BADCVAR("g_invasion_teams"); BADCVAR("g_invasion_type"); BADCVAR("g_jailbreak");