]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Player templates: Updated to URS2.
authorLyberta <lyberta@lyberta.net>
Mon, 28 Aug 2017 06:40:07 +0000 (09:40 +0300)
committerLyberta <lyberta@lyberta.net>
Mon, 28 Aug 2017 06:40:07 +0000 (09:40 +0300)
player-template-example.cfg
qcsrc/server/playertemplates.qc

index b97e846110f61b8103d1e026f8a42e5e7a554275..408f18d69548340c19bf2602f72458c50b5153d5 100644 (file)
@@ -31,7 +31,7 @@ set g_player_template_example_drop_weapons "default" "Whether the player can dro
 // Variables in this section define what happens during item pickup.
 // Player can get health, armor and/or ammo on top of or instead of an item.
 // The format of the value is:
-// "<add|override> [health] [armor] [shells] [bullets] [rockets] [cells]"
+// "<add|override> [health] [armor] [shells] [bullets] [rockets] [cells] [plasma] [fuel]"
 // For example "add 50" will give 50 health and the original item.
 // "override 0 0 5" will give 5 shells instead of the item.
 set g_player_template_example_pickup_health_small "default" "What items does player get when they pickup small health"
index 865df428080daf517467372f67cdc42db516c7bf..65dbf39cedb65c889dc73cc0d1cfda69391a421c 100644 (file)
@@ -240,32 +240,42 @@ float PlayerTemplate_GivePlayerItem(entity player, string template,
                {
                        case 1:
                        {
-                               GivePlayerHealth(player, stof(argv(i)));
+                               GiveResource(player, RESOURCE_HEALTH, stof(argv(i)));
                                break;
                        }
                        case 2:
                        {
-                               GivePlayerArmor(player, stof(argv(i)));
+                               GiveResource(player, RESOURCE_ARMOR, stof(argv(i)));
                                break;
                        }
                        case 3:
                        {
-                               GivePlayerResource(player, RESOURCE_SHELLS, stof(argv(i)));
+                               GiveResource(player, RESOURCE_SHELLS, stof(argv(i)));
                                break;
                        }
                        case 4:
                        {
-                               GivePlayerResource(player, RESOURCE_BULLETS, stof(argv(i)));
+                               GiveResource(player, RESOURCE_BULLETS, stof(argv(i)));
                                break;
                        }
                        case 5:
                        {
-                               GivePlayerResource(player, RESOURCE_ROCKETS, stof(argv(i)));
+                               GiveResource(player, RESOURCE_ROCKETS, stof(argv(i)));
                                break;
                        }
                        case 6:
                        {
-                               GivePlayerResource(player, RESOURCE_CELLS, stof(argv(i)));
+                               GiveResource(player, RESOURCE_CELLS, stof(argv(i)));
+                               break;
+                       }
+                       case 7:
+                       {
+                               GiveResource(player, RESOURCE_PLASMA, stof(argv(i)));
+                               break;
+                       }
+                       case 8:
+                       {
+                               GiveResource(player, RESOURCE_FUEL, stof(argv(i)));
                                break;
                        }
                }
@@ -344,8 +354,7 @@ void PlayerTemplateHook_PlayerSpawn(entity player, string template)
        }
        if (!warmup_stage)
        {
-               GivePlayerRandomWeapons(player,
-                       PlayerTemplate_GetFloatValue(template,
+               GiveRandomWeapons(player, PlayerTemplate_GetFloatValue(template,
                        "random_start_weapons_count"),
                        PlayerTemplate_GetStringValue(template, "random_start_weapons"),
                        PlayerTemplate_GetFloatValue(template, "random_start_shells"),