From: Lyberta Date: Fri, 26 May 2017 21:48:01 +0000 (+0300) Subject: Survival: Updated to new Player Templates API. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a6dd7af0833c04a142d8f5e75600bcc2f128daf8;p=xonotic%2Fxonotic-data.pk3dir.git Survival: Updated to new Player Templates API. --- diff --git a/qcsrc/server/mutators/mutator/gamemode_survival.qc b/qcsrc/server/mutators/mutator/gamemode_survival.qc index 856d2e6ee..0efbe9de5 100644 --- a/qcsrc/server/mutators/mutator/gamemode_survival.qc +++ b/qcsrc/server/mutators/mutator/gamemode_survival.qc @@ -867,8 +867,8 @@ void Surv_UpdateAliveStats() /// \return No return. void Surv_UpdateDefenderHealthStat() { - float maxhealth = surv_numdefenders * (PlayerTemplate_GetFloatCvar( - "surv_defender", "start_health") + PlayerTemplate_GetFloatCvar( + float maxhealth = surv_numdefenders * (PlayerTemplate_GetFloatValue( + "surv_defender", "start_health") + PlayerTemplate_GetFloatValue( "surv_defender", "start_armor")); float totalhealth = 0; FOREACH_CLIENT(IS_PLAYER(it), @@ -1267,8 +1267,8 @@ void Surv_RoundStart() NULL, surv_attackerteam, it, surv_attack_sprite, false, RADARICON_OBJECTIVE); WaypointSprite_UpdateMaxHealth(it.surv_attack_sprite, - PlayerTemplate_GetFloatCvar("surv_defender", - "start_health") + PlayerTemplate_GetFloatCvar( + PlayerTemplate_GetFloatValue("surv_defender", + "start_health") + PlayerTemplate_GetFloatValue( "surv_defender", "start_armor")); WaypointSprite_UpdateHealth(it.surv_attack_sprite, it.health + it.armorvalue); diff --git a/survival.cfg b/survival.cfg index 55af9c904..6cbb32237 100644 --- a/survival.cfg +++ b/survival.cfg @@ -25,15 +25,15 @@ set g_surv_attacker_force_overkill_models 0 "Whether to force overkill player mo set g_surv_defender_force_overkill_models 1 "Whether to force overkill player models for defenders" set g_surv_cannon_fodder_force_overkill_models 0 "Whether to force overkill player models for cannon fodder" -set g_player_template_surv_attacker_start_health 100 "How much health do attackers get during spawn" -set g_player_template_surv_attacker_start_armor 0 "How much armor do attackers get during spawn" +set g_player_template_surv_attacker_start_health "default" "How much health do attackers get during spawn" +set g_player_template_surv_attacker_start_armor "default" "How much armor do attackers get during spawn" set g_player_template_surv_attacker_unlimited_ammo 1 "Whether to give attackers unlimited ammo" -set g_player_template_surv_attacker_start_ammo_shells 0 "How many shells do attackers get during spawn" -set g_player_template_surv_attacker_start_ammo_bullets 0 "How many bullets do attackers get during spawn" -set g_player_template_surv_attacker_start_ammo_rockets 0 "How many rockets do attackers get during spawn" -set g_player_template_surv_attacker_start_ammo_cells 0 "How many cells do attackers get during spawn" -set g_player_template_surv_attacker_default_start_weapons 1 "Whether to give attackers default start weapons" -set g_player_template_surv_attacker_start_weapons "" "Which weapons do attackers get during spawn" +set g_player_template_surv_attacker_start_ammo_shells "default" "How many shells do attackers get during spawn" +set g_player_template_surv_attacker_start_ammo_bullets "default" "How many bullets do attackers get during spawn" +set g_player_template_surv_attacker_start_ammo_rockets "default" "How many rockets do attackers get during spawn" +set g_player_template_surv_attacker_start_ammo_cells "default" "How many cells do attackers get during spawn" +set g_player_template_surv_attacker_default_start_weapons "default" "Whether to give attackers default start weapons" +set g_player_template_surv_attacker_start_weapons "default" "Which weapons do attackers get during spawn" set g_player_template_surv_attacker_num_random_start_weapons 2 "Number of weapons that can be randomly given to attackers during spawn" set g_player_template_surv_attacker_random_start_weapons "machinegun mortar electro crylink vortex hagar devastator" "Weapons that can be randomly given to attackers during spawn" @@ -49,15 +49,15 @@ set g_player_template_surv_defender_start_weapons "okshotgun okmachinegun okvort set g_player_template_surv_defender_num_random_start_weapons 0 "Number of weapons that can be randomly given to defenders during spawn" set g_player_template_surv_defender_random_start_weapons "" "Weapons that can be randomly given to defenders during spawn" -set g_player_template_surv_cannon_fodder_start_health 100 "How much health does cannon fodder get during spawn" -set g_player_template_surv_cannon_fodder_start_armor 0 "How much armor does cannon fodder get during spawn" +set g_player_template_surv_cannon_fodder_start_health "default" "How much health does cannon fodder get during spawn" +set g_player_template_surv_cannon_fodder_start_armor "default" "How much armor does cannon fodder get during spawn" set g_player_template_surv_cannon_fodder_unlimited_ammo 1 "Whether to give cannon fodder unlimited ammo" -set g_player_template_surv_cannon_fodder_start_ammo_shells 0 "How many shells does cannon fodder get during spawn" -set g_player_template_surv_cannon_fodder_start_ammo_bullets 0 "How many bullets does cannon fodder get during spawn" -set g_player_template_surv_cannon_fodder_start_ammo_rockets 0 "How many rockets does cannon fodder get during spawn" -set g_player_template_surv_cannon_fodder_start_ammo_cells 0 "How many cells does cannon fodder get during spawn" -set g_player_template_surv_cannon_fodder_default_start_weapons 1 "Whether to give cannon fodder default start weapons" -set g_player_template_surv_cannon_fodder_start_weapons "" "Which weapons does cannon fodder get during spawn" +set g_player_template_surv_cannon_fodder_start_ammo_shells "default" "How many shells does cannon fodder get during spawn" +set g_player_template_surv_cannon_fodder_start_ammo_bullets "default" "How many bullets does cannon fodder get during spawn" +set g_player_template_surv_cannon_fodder_start_ammo_rockets "default" "How many rockets does cannon fodder get during spawn" +set g_player_template_surv_cannon_fodder_start_ammo_cells "default" "How many cells does cannon fodder get during spawn" +set g_player_template_surv_cannon_fodder_default_start_weapons "default" "Whether to give cannon fodder default start weapons" +set g_player_template_surv_cannon_fodder_start_weapons "default" "Which weapons does cannon fodder get during spawn" set g_player_template_surv_cannon_fodder_num_random_start_weapons 2 "Number of weapons that can be randomly given to cannon fodder during spawn" set g_player_template_surv_cannon_fodder_random_start_weapons "machinegun mortar electro crylink vortex hagar devastator" "Weapons that can be randomly given to cannon fodder during spawn" @@ -95,14 +95,14 @@ set g_surv_defender_pickup_cells_mega 50 "How many cells do defenders get when t set g_surv_attacker_damage_score 0.025 "How much score attackers gain per 1 point of damage" -set g_player_template_surv_attacker_attack_scale 1 "How much attackers damage others. Higher values mean more damage" -set g_player_template_surv_attacker_defense_scale 1 "How much attackers get damaged. Higher values mean less damage" +set g_player_template_surv_attacker_attack_scale "default" "How much attackers damage others. Higher values mean more damage" +set g_player_template_surv_attacker_defense_scale "default" "How much attackers get damaged. Higher values mean less damage" set g_player_template_surv_defender_attack_scale 1 "How much defenders damage others. Higher values mean more damage" set g_player_template_surv_defender_defense_scale 2 "How much defenders get damaged. Higher values mean less damage" -set g_player_template_surv_cannon_fodder_attack_scale 1 "How much cannon fodder damages others. Higher values mean more damage" -set g_player_template_surv_cannon_fodder_defense_scale 1 "How much cannon fodder gets damaged. Higher values mean less damage" +set g_player_template_surv_cannon_fodder_attack_scale "default" "How much cannon fodder damages others. Higher values mean more damage" +set g_player_template_surv_cannon_fodder_defense_scale "default" "How much cannon fodder gets damaged. Higher values mean less damage" set g_surv_attacker_frag_score 10 "How much score attackers get for fragging defenders"