From b469a975a924197ffa5e482f2ff89991f11760b4 Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Fri, 3 Jan 2020 04:33:33 +0000 Subject: [PATCH] Better campaign difficulty customization --- qcsrc/menu/xonotic/dialog_singleplayer.qc | 4 ++-- qcsrc/server/campaign.qc | 6 +----- xonotic-common.cfg | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/qcsrc/menu/xonotic/dialog_singleplayer.qc b/qcsrc/menu/xonotic/dialog_singleplayer.qc index dc39346aa..b2ae8c0ba 100644 --- a/qcsrc/menu/xonotic/dialog_singleplayer.qc +++ b/qcsrc/menu/xonotic/dialog_singleplayer.qc @@ -128,8 +128,8 @@ void XonoticSingleplayerDialog_fill(entity me) me.gotoRC(me, me.rows - 2, 0); me.TD(me, 1, 2, e = makeXonoticTextLabel(0.5, _("Campaign Difficulty:"))); me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "g_campaign_skill", "-2", ZCTX(_("CSKL^Easy")))); - me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "g_campaign_skill", "-1", ZCTX(_("CSKL^Medium")))); - me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "g_campaign_skill", "0", ZCTX(_("CSKL^Hard")))); + me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "g_campaign_skill", "0", ZCTX(_("CSKL^Medium")))); + me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "g_campaign_skill", "2", ZCTX(_("CSKL^Hard")))); me.TR(me); me.TD(me, 1, me.columns, e = makeXonoticButton(_("Start Singleplayer!"), '0 0 0')); e.onClick = CampaignList_LoadMap; diff --git a/qcsrc/server/campaign.qc b/qcsrc/server/campaign.qc index 76e2cdeb8..6fdb6d339 100644 --- a/qcsrc/server/campaign.qc +++ b/qcsrc/server/campaign.qc @@ -98,11 +98,7 @@ void CampaignPreInit() return; } - baseskill = autocvar_g_campaign_skill; - baseskill = baseskill + campaign_botskill[0]; - if(baseskill < 0) - baseskill = 0; - + baseskill = max(0, autocvar_g_campaign_skill + campaign_botskill[0]); campaign_forcewin = false; cvar_set("sv_public", "0"); diff --git a/xonotic-common.cfg b/xonotic-common.cfg index f44d9c96f..4fd0ee0c1 100644 --- a/xonotic-common.cfg +++ b/xonotic-common.cfg @@ -48,7 +48,7 @@ fs_empty_files_in_pack_mark_deletions 1 // makes patches able to delete files set g_campaign 0 set g_campaign_forceteam 0 "Forces the player to a given team in campaign mode, 1 = red, 2 = blue, 3 = yellow, 4 = pink" seta g_campaign_name "xonoticbeta" -seta g_campaign_skill -1 // -2 easy -1 medium 0 hard +seta g_campaign_skill 0 // -2 easy, 0 medium, 2 hard alias singleplayer_start "g_campaign_index 0; set scmenu_campaign_goto 0" alias singleplayer_continue "set scmenu_campaign_goto -1" -- 2.39.2