]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix their waypoints
authorTimePath <andrew.hardaker1995@gmail.com>
Mon, 24 Aug 2015 04:24:28 +0000 (14:24 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Mon, 24 Aug 2015 04:24:28 +0000 (14:24 +1000)
qcsrc/client/waypointsprites.qc
qcsrc/common/items/item.qh
qcsrc/common/items/item/armor.qc
qcsrc/common/items/item/health.qc
qcsrc/common/items/item/jetpack.qc
qcsrc/common/items/item/powerup.qc
qcsrc/server/t_items.qc

index 40fc56a413d49d2417638b4a9a7c20f431ff698e..8c7c54af2d682f7e9e68ba1d6a2f48e0e45c83ad 100644 (file)
@@ -170,19 +170,17 @@ float spritelookupblinkvalue(string s)
        if(get_weaponinfo(stof(substring(s, 4, strlen(s)))).spawnflags & WEP_FLAG_SUPERWEAPON)
                return 2;
 
+       FOREACH(ITEMS, it.m_waypoint == s, LAMBDA(
+               return it.m_waypointblink;
+       ));
+
        switch(s)
        {
                case "ons-cp-atck":      return 2;
                case "ons-cp-dfnd":      return 0.5;
-               case "item_health_mega": return 2;
-               case "item_armor_large": return 2;
                case "item-invis":       return 2;
                case "item-extralife":   return 2;
                case "item-speed":       return 2;
-               case "item-strength":    return 2;
-               case "item-shield":      return 2;
-               case "item-fuelregen":   return 2;
-               case "item-jetpack":     return 2;
                case "tagged-target":    return 2;
                default:                 return 1;
        }
@@ -253,15 +251,9 @@ string spritelookuptext(string s)
                case "dom-blue": return _("Control point");
                case "dom-yellow": return _("Control point");
                case "dom-pink": return _("Control point");
-               case "item_health_mega": return _("Mega health");
-               case "item_armor_large": return _("Large armor");
                case "item-invis": return _("Invisibility");
                case "item-extralife": return _("Extra life");
                case "item-speed": return _("Speed");
-               case "item-strength": return _("Strength");
-               case "item-shield": return _("Shield");
-               case "item-fuelregen": return _("Fuel regen");
-               case "item-jetpack": return _("Jet Pack");
                case "frozen": return _("Frozen!");
                case "tagged-target": return _("Tagged");
                case "vehicle": return _("Vehicle");
index 16db39728561035115b66942a4620ae25b51458a..6e566f6cc106b5e369427705d67e164d581a8312 100644 (file)
@@ -7,6 +7,9 @@ CLASS(GameItem, Object)
     ATTRIB(GameItem, m_id, int, 0)
     ATTRIB(GameItem, m_name, string, string_null)
     ATTRIB(GameItem, m_icon, string, string_null)
+    ATTRIB(GameItem, m_color, vector, '1 1 1')
+    ATTRIB(GameItem, m_waypoint, string, string_null)
+    ATTRIB(GameItem, m_waypointblink, int, 1)
     METHOD(GameItem, display, void(entity this, void(string name, string icon) returns)) {
         returns(this.m_name, this.m_icon ? sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.m_icon) : string_null);
     }
index a4fa605740f75e8e5f821752b50495d32d7bb8f2..43fc3283f6826e2b9c0001b1ba9ac8c47685e7a6 100644 (file)
@@ -34,6 +34,8 @@ REGISTER_ITEM(ArmorLarge, Armor) {
     this.m_sound                =   "misc/armor17_5.wav";
     this.m_name                 =   "50 Armor";
     this.m_icon                 =   "armor";
+    this.m_color                =   '0 1 0';
+    this.m_waypoint             =   _("Large armor");
 #ifdef SVQC
     this.m_botvalue             =   20000; // FIXME: higher than BOT_PICKUP_RATING_HIGH?
     this.m_itemid               =   IT_ARMOR;
@@ -47,6 +49,9 @@ REGISTER_ITEM(ArmorMega, Armor) {
     this.m_sound                =   "misc/armor25.wav";
     this.m_name                 =   "100 Armor";
     this.m_icon                 =   "item_large_armor";
+    this.m_color                =   '0 1 0';
+    this.m_waypoint             =   _("Mega armor");
+    this.m_waypointblink        =   2;
 #ifdef SVQC
     this.m_botvalue             =   BOT_PICKUP_RATING_HIGH;
     this.m_itemid               =   IT_ARMOR;
index dded21951f8b255c312bc74897405b7603a99848..823c81288bf061e82ff18a2c93656394556165aa 100644 (file)
@@ -34,6 +34,8 @@ REGISTER_ITEM(HealthLarge, Health) {
     this.m_sound                =   "misc/mediumhealth.wav";
     this.m_name                 =   "50 Health";
     this.m_icon                 =   "health";
+    this.m_color                =   '1 0 0';
+    this.m_waypoint             =   _("Large health");
 #ifdef SVQC
     this.m_botvalue             =   BOT_PICKUP_RATING_MID;
     this.m_itemid               =   IT_25HP;
@@ -47,6 +49,9 @@ REGISTER_ITEM(HealthMega, Health) {
     this.m_sound                =   "misc/megahealth.wav";
     this.m_name                 =   "100 Health";
     this.m_icon                 =   "item_mega_health";
+    this.m_color                =   '1 0 0';
+    this.m_waypoint             =   _("Mega health");
+    this.m_waypointblink        =   2;
 #ifdef SVQC
     this.m_botvalue             =   BOT_PICKUP_RATING_HIGH;
     this.m_itemid               =   IT_HEALTH;
index 856704dd840e4c4964a2b3867c7ce091ac83d931..dcc16b6e42b83e7225cc8386b9553a3966533c66 100644 (file)
@@ -10,6 +10,9 @@ REGISTER_ITEM(Jetpack, Powerup) {
     this.m_model                =   "models/items/g_jetpack.md3";
     this.m_name                 =   "Jet pack";
     this.m_icon                 =   "jetpack";
+    this.m_color                =   '0.5 0.5 0.5';
+    this.m_waypoint             =   _("Jet Pack");
+    this.m_waypointblink        =   2;
 #ifdef SVQC
     this.m_botvalue             =   BOT_PICKUP_RATING_LOW;
     this.m_itemid               =   IT_JETPACK;
@@ -31,6 +34,9 @@ REGISTER_ITEM(JetpackRegen, Pickup) {
     this.m_model                =   "models/items/g_fuelregen.md3";
     this.m_name                 =   "Fuel regenerator";
     this.m_icon                 =   "fuelregen";
+    this.m_color                =   '1 0.5 0';
+    this.m_waypoint             =   _("Fuel regen");
+    this.m_waypointblink        =   2;
 #ifdef SVQC
     this.m_botvalue             =   BOT_PICKUP_RATING_LOW;
     this.m_itemflags            =   FL_POWERUP;
index fe325821189cc2d682b27a3aaba974a9bc4c2431..6d38d63748ade1574275618e675de84eed34af17 100644 (file)
@@ -5,16 +5,22 @@
 .int m_itemid;
 #endif
 REGISTER_ITEM(Strength, Powerup) {
-    this.m_model    =   "models/items/g_strength.md3";
-    this.m_sound    =   "misc/powerup.wav";
-    this.m_name     =   "Strength Powerup";
-    this.m_icon     =   "strength";
-    this.m_itemid   =   IT_STRENGTH;
+    this.m_model            =   "models/items/g_strength.md3";
+    this.m_sound            =   "misc/powerup.wav";
+    this.m_name             =   "Strength Powerup";
+    this.m_icon             =   "strength";
+    this.m_color            =   '0 0 1';
+    this.m_waypoint         =   _("Strength");
+    this.m_waypointblink    =   2;
+    this.m_itemid           =   IT_STRENGTH;
 }
 REGISTER_ITEM(Shield, Powerup) {
-    this.m_model    =   "models/items/g_invincible.md3";
-    this.m_sound    =   "misc/powerup_shield.wav";
-    this.m_name     =   "Shield";
-    this.m_icon     =   "shield";
-    this.m_itemid   =   IT_INVINCIBLE;
+    this.m_model            =   "models/items/g_invincible.md3";
+    this.m_sound            =   "misc/powerup_shield.wav";
+    this.m_name             =   "Shield";
+    this.m_icon             =   "shield";
+    this.m_color            =   '1 0 1';
+    this.m_waypoint         =   _("Shield");
+    this.m_waypointblink    =   2;
+    this.m_itemid           =   IT_INVINCIBLE;
 }
index 406f8ec33741db433d10f6bfd42d0fa58639235e..e281cfacf604d6bb1b405f488c2ec090dbd93e7f 100644 (file)
@@ -457,24 +457,13 @@ void Item_RespawnCountdown (void)
                self.count += 1;
                if(self.count == 1)
                {
-                       string name;
+                       string name = string_null;
                        vector rgb = '1 0 1';
-                       name = string_null;
-                       switch (self.items)
-                       {
-                               case ITEM_JetpackRegen.m_itemid: name = "item-fuelregen"; rgb = '1 0.5 0'; break;
-                               case ITEM_Jetpack.m_itemid:    name = "item-jetpack"; rgb = '0.5 0.5 0.5'; break;
-                               case ITEM_Strength.m_itemid:   name = "item-strength"; rgb = '0 0 1'; break;
-                               case ITEM_Shield.m_itemid: name = "item-shield"; rgb = '1 0 1'; break;
-                               case ITEM_HealthMega.m_itemid:
-                                       //if (self.classname == "item_health_mega")
-                                               {name = "item_health_mega"; rgb = '1 0 0';}
-                                       break;
-                               case ITEM_ArmorMega.m_itemid:
-                                       if (self.itemdef == ITEM_ArmorMega)
-                                               {name = "item_armor_large"; rgb = '0 1 0';}
-                                       break;
-                       }
+            entity e = self.itemdef;
+            if (e) {
+                name = e.m_waypoint;
+                rgb = e.m_color;
+            }
                        MUTATOR_CALLHOOK(Item_RespawnCountdown, name, rgb);
                        name = item_name;
                        rgb = item_color;