From: LegendaryGuard <rootuser999@gmail.com>
Date: Sun, 14 Mar 2021 15:29:24 +0000 (+0100)
Subject: Rename itemdrop nade to emerald nade by Mario's suggestion and a bit of effect enhanc... 
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a6ede18f3930ee325bc70fb104ce72b0d1f04667;p=xonotic%2Fxonotic-data.pk3dir.git

Rename itemdrop nade to emerald nade by Mario's suggestion and a bit of effect enhancement
---

diff --git a/gfx/hud/default/nade_dark.tga b/gfx/hud/default/nade_dark.tga
index 8803e29bc..112ddcb86 100644
Binary files a/gfx/hud/default/nade_dark.tga and b/gfx/hud/default/nade_dark.tga differ
diff --git a/gfx/hud/default/nade_emerald.tga b/gfx/hud/default/nade_emerald.tga
new file mode 100644
index 000000000..86c3d99e7
Binary files /dev/null and b/gfx/hud/default/nade_emerald.tga differ
diff --git a/gfx/hud/default/nade_itemdrop.tga b/gfx/hud/default/nade_itemdrop.tga
deleted file mode 100644
index 2d1601412..000000000
Binary files a/gfx/hud/default/nade_itemdrop.tga and /dev/null differ
diff --git a/gfx/hud/luma/nade_emerald.tga b/gfx/hud/luma/nade_emerald.tga
new file mode 100644
index 000000000..7588761b9
Binary files /dev/null and b/gfx/hud/luma/nade_emerald.tga differ
diff --git a/gfx/hud/luma/nade_itemdrop.tga b/gfx/hud/luma/nade_itemdrop.tga
deleted file mode 100644
index 7588761b9..000000000
Binary files a/gfx/hud/luma/nade_itemdrop.tga and /dev/null differ
diff --git a/qcsrc/common/mutators/mutator/nades/nades.inc b/qcsrc/common/mutators/mutator/nades/nades.inc
index dc3a331ff..ae69d682b 100644
--- a/qcsrc/common/mutators/mutator/nades/nades.inc
+++ b/qcsrc/common/mutators/mutator/nades/nades.inc
@@ -94,14 +94,14 @@ REGISTER_NADE(VEIL) {
 #endif
 }
 
-//LegendGuard writes Itemdrop nade code 01-03-2021
-REGISTER_NADE(ITEMDROP) {
+//LegendGuard writes Emerald nade code 01-03-2021
+REGISTER_NADE(EMERALD) {
     this.m_color = '0.33 1 0.66';
-    this.m_name = _("Itemdrop grenade");
-    this.m_icon = "nade_itemdrop";
+    this.m_name = _("Emerald grenade");
+    this.m_icon = "nade_emerald";
 #ifdef GAMEQC
-    NADE_PROJECTILE(0, PROJECTILE_NADE_ITEMDROP, EFFECT_NADE_TRAIL_GREEN);
-    NADE_PROJECTILE(1, PROJECTILE_NADE_ITEMDROP_BURN, EFFECT_NADE_TRAIL_BURN_GREEN);
+    NADE_PROJECTILE(0, PROJECTILE_NADE_EMERALD, EFFECT_NADE_TRAIL_GREEN);
+    NADE_PROJECTILE(1, PROJECTILE_NADE_EMERALD_BURN, EFFECT_NADE_TRAIL_BURN_GREEN);
 #endif
 }
 
diff --git a/qcsrc/common/mutators/mutator/nades/nades.qc b/qcsrc/common/mutators/mutator/nades/nades.qc
index e3c21ebb9..e6fd3c1b3 100644
--- a/qcsrc/common/mutators/mutator/nades/nades.qc
+++ b/qcsrc/common/mutators/mutator/nades/nades.qc
@@ -585,8 +585,6 @@ entity nades_spawn_orb(entity own, entity realown, vector org, float orb_ltime,
 
 	setthink(orb, nades_orb_think);
 	orb.nextthink = time;
-	
-	LOG_INFOF("orb.nexttime = ^3%f", orb.nextthink);
 
 	return orb;
 }
@@ -722,10 +720,10 @@ void nade_veil_boom(entity this)
 	settouch(orb, nade_veil_touch);
 	orb.colormod = NADE_TYPE_VEIL.m_color;
 }
-/**************LEGENDGUARD NEW NADES: ARMORIZE, AMMO AND DARK NADES functions "cl_nade_type 10", "cl_nade_type 11" and "cl_nade_type 12" *** //more ideas: SPAWNING MINI SPIDERS NADE, SPARKING NADE ***********************/
-//TODO: rename in gfx/hud/luma/nade_itemdrop.tga from nade_armorize.tga 02-03-2021
-//TODO: Mario suggests to rename itemdrop nade name to "emerald" nade 02-03-2021
-void nade_itemdrop_dropitem(entity e, vector org, entity itm)
+/**************LEGENDGUARD NEW NADES: EMERALD, AMMO AND DARK NADES functions "cl_nade_type 10", "cl_nade_type 11" and "cl_nade_type 12" *** //more ideas: SPAWNING MINI SPIDERS NADE, SPARKING NADE ***********************/
+//TODO: rename in gfx/hud/luma/nade_emerald.tga from nade_armorize.tga 02-03-2021
+// Mario suggests to rename itemdrop nade name to "emerald" nade 02-03-2021
+void nade_emerald_dropitem(entity e, vector org, entity itm)
 {
 	Item_SetLoot(e, true);
 	e.reset = SUB_Remove;
@@ -735,15 +733,15 @@ void nade_itemdrop_dropitem(entity e, vector org, entity itm)
 	setorigin(e, org);
 	e.velocity = randomvec() * 175 + '0 0 325';
 	e.item_spawnshieldtime = time + 0.7;
-	SUB_SetFade(e, time + autocvar_g_nades_itemdrop_lifetime, 1);
+	SUB_SetFade(e, time + autocvar_g_nades_emerald_lifetime, 1);
 }
 
-void nade_itemdrop_dropping(vector org)
+void nade_emerald_dropping(vector org)
 {
 	//look in qcsrc/server/items/items.qc
 	//ITEM_Shells; ITEM_Bullets; ITEM_Rockets; ITEM_Cells; ITEM_Plasma; ITEM_JetpackFuel;
 	//ITEM_Strength; ITEM_Shield
-	int itemcount = autocvar_g_nades_itemdrop_spawncount;
+	int itemcount = autocvar_g_nades_emerald_spawncount;
 	for(int j = 0; j < itemcount; ++j)
 	{
 		entity e = spawn();
@@ -756,30 +754,30 @@ void nade_itemdrop_dropping(vector org)
 		if (a > b)
 		{
 			if (a > 0.5)
-				nade_itemdrop_dropitem(e, org, ((random() > 0.5) ? ITEM_ArmorSmall : ITEM_HealthSmall));
+				nade_emerald_dropitem(e, org, ((random() > 0.5) ? ITEM_ArmorSmall : ITEM_HealthSmall));
 			else
-				nade_itemdrop_dropitem(e, org, ((random() > 0.5) ? ITEM_Shells : ITEM_Bullets));
+				nade_emerald_dropitem(e, org, ((random() > 0.5) ? ITEM_Shells : ITEM_Bullets));
 		}
 		else if (c > d)
 		{
 			if (c > 0.5)
-				nade_itemdrop_dropitem(e, org, ((random() > 0.5) ? ITEM_Shells : ITEM_Bullets));
+				nade_emerald_dropitem(e, org, ((random() > 0.5) ? ITEM_Shells : ITEM_Bullets));
 			else
-				nade_itemdrop_dropitem(e, org, ((random() > 0.5) ? ITEM_Rockets : ITEM_Cells));
+				nade_emerald_dropitem(e, org, ((random() > 0.5) ? ITEM_Rockets : ITEM_Cells));
 		}
-		else if (autocvar_g_nades_itemdrop_powerupjetpackdrop)
+		else if (autocvar_g_nades_emerald_powerupjetpackdrop)
 		{
 			if (a < 0.5)
-				nade_itemdrop_dropitem(e, org, ((random() > 0.5) ? ITEM_Jetpack : ITEM_JetpackFuel));
+				nade_emerald_dropitem(e, org, ((random() > 0.5) ? ITEM_Jetpack : ITEM_JetpackFuel));
 			else
-				nade_itemdrop_dropitem(e, org, ((random() > 0.5) ? ITEM_Shield : ITEM_Strength));
+				nade_emerald_dropitem(e, org, ((random() > 0.5) ? ITEM_Shield : ITEM_Strength));
 		}
 		else
 			return;
 	}
 }
 
-void dropitem_ball_think(entity this)
+void emerald_ball_think(entity this)
 {
 	if(round_handler_IsActive())
 	if(!round_handler_IsRoundStarted())
@@ -805,12 +803,12 @@ void dropitem_ball_think(entity this)
 
 	this.angles = vectoangles(this.velocity);
 
-	nade_itemdrop_dropping(this.origin);
+	nade_emerald_dropping(this.origin);
 
 	this.nextthink = time + 0.1;
 }
 
-void nade_dropitem_ball(entity this)
+void nade_emerald_ball(entity this)
 {
 	entity proj;
 	vector kick;
@@ -824,16 +822,16 @@ void nade_dropitem_ball(entity this)
 	proj.scale = 1;//0.5;
 	setsize(proj, '-4 -4 -4', '4 4 4');
 	setorigin(proj, this.origin);
-	setthink(proj, dropitem_ball_think);
+	setthink(proj, emerald_ball_think);
 	proj.nextthink = time;
 	proj.effects = EF_LOWPRECISION;
 
-	kick.x =(random() - 0.5) * 2 * autocvar_g_nades_itemdrop_ball_spread;
-	kick.y = (random() - 0.5) * 2 * autocvar_g_nades_itemdrop_ball_spread;
-	kick.z = (random()/2+0.5) * autocvar_g_nades_itemdrop_ball_spread;
+	kick.x =(random() - 0.5) * 2 * autocvar_g_nades_emerald_ball_spread;
+	kick.y = (random() - 0.5) * 2 * autocvar_g_nades_emerald_ball_spread;
+	kick.z = (random()/2+0.5) * autocvar_g_nades_emerald_ball_spread;
 	proj.velocity = kick;
 
-	proj.pushltime = time + autocvar_g_nades_itemdrop_ball_lifetime;
+	proj.pushltime = time + autocvar_g_nades_emerald_ball_lifetime;
 
 	proj.angles = vectoangles(proj.velocity);
 	proj.flags = FL_PROJECTILE;
@@ -845,7 +843,7 @@ void nade_dropitem_ball(entity this)
 }
 
 
-void dropitem_fountain_think(entity this)
+void emerald_fountain_think(entity this)
 {
 	if(round_handler_IsActive())
 	if(!round_handler_IsRoundStarted())
@@ -874,17 +872,17 @@ void dropitem_fountain_think(entity this)
 	this.nextthink = time + 0.1;
 	if(time >= this.nade_special_time)
 	{
-		this.nade_special_time = time + autocvar_g_nades_itemdrop_fountain_delay;
-		nade_dropitem_ball(this);
+		this.nade_special_time = time + autocvar_g_nades_emerald_fountain_delay;
+		nade_emerald_ball(this);
 	}
 }
 
-void nade_dropitem_boom(entity this)
+void nade_emerald_boom(entity this)
 {
-	for (int c = 0; c < autocvar_g_nades_itemdrop_ball_count; c++)
-		nade_dropitem_ball(this);
+	for (int c = 0; c < autocvar_g_nades_emerald_ball_count; c++)
+		nade_emerald_ball(this);
 
-	entity fountain = new(nade_dropitem_fountain);
+	entity fountain = new(nade_emerald_fountain);
 	fountain.owner = this.owner;
 	fountain.realowner = this.realowner;
 	fountain.origin = this.origin;
@@ -892,17 +890,31 @@ void nade_dropitem_boom(entity this)
 	IL_PUSH(g_projectiles, fountain);
 	IL_PUSH(g_bot_dodge, fountain);
 	setorigin(fountain, fountain.origin);
-	setthink(fountain, dropitem_fountain_think);
+	setthink(fountain, emerald_fountain_think);
 	fountain.nextthink = time;
-	fountain.ltime = time + autocvar_g_nades_itemdrop_fountain_lifetime;
+	fountain.ltime = time + autocvar_g_nades_emerald_fountain_lifetime;
 	fountain.pushltime = fountain.ltime;
 	fountain.team = this.team;
+	
+	//nade model maintaining
+	setmodel(fountain, MDL_PROJECTILE_GRENADE);
+	entity timer = new(nade_timer);
+	setmodel(timer, MDL_NADE_TIMER);
+	setattachment(timer, fountain, "");
+	timer.colormap = this.colormap;
+	timer.glowmod = this.glowmod;
+	setthink(timer, nade_timer_think);
+	timer.nextthink = time;
+	timer.wait = fountain.ltime;
+	timer.owner = fountain;
+	timer.skin = 10;
+	
 	set_movetype(fountain, MOVETYPE_TOSS);
 	fountain.bot_dodge = true;
 	fountain.nade_special_time = time;
 	setsize(fountain, '-16 -16 -16', '16 16 16');
-	CSQCProjectile(fountain, true, PROJECTILE_NAPALM_FOUNTAIN, true);
-	nade_itemdrop_dropping(fountain.origin);
+	CSQCProjectile(fountain, true, PROJECTILE_NADE_EMERALD_BURN, true);
+	nade_emerald_dropping(fountain.origin);
 }
 
 /***********************************************************************************/
@@ -1048,7 +1060,7 @@ void nade_dark_touch(entity this, entity toucher)
 			tint_alpha = 0.25;
 			if(!STAT(DARK_ORB, show_tint))
 			{
-				toucher.nade_veil_prevalpha = toucher.alpha;
+				toucher.nade_dark_prevalpha = toucher.alpha;
 				toucher.alpha = 1;
 			}
 		}
@@ -1061,6 +1073,16 @@ void nade_dark_touch(entity this, entity toucher)
 				dark_damage(this, autocvar_g_nades_dark_radius, autocvar_g_nades_dark_damage);
 			}
 		}
+
+		if(time >= this.nade_special_time)
+		{
+			this.nade_special_time = time + 0.7;
+			Send_Effect(EFFECT_SMOKE_SMALL, this.origin, '0 0 0', 1);
+			//EFFECT_SMOKE_LARGE is like a small white smoke
+			//Send_Effect(EFFECT_SMOKE_LARGE, this.origin, '0 0 0', 1);
+		}
+		Send_Effect(EFFECT_SMOKE_SMALL, this.origin, randomvec(), 1);
+
 		STAT(DARK_ORB, show_tint) = time + 0.1;
 		STAT(DARK_ORB_ALPHA, show_tint) = tint_alpha * (this.ltime - time) / this.orb_lifetime;
 	}
@@ -1119,7 +1141,7 @@ void nade_boom(entity this)
 			expef = EFFECT_SPAWN_NEUTRAL;
 			break;
 		
-		case NADE_TYPE_ITEMDROP: //LegendGuard adds nade case 11-02-2021
+		case NADE_TYPE_EMERALD: //LegendGuard adds nade case 11-02-2021
 			nade_blast = false;
 			expef = EFFECT_EXPLOSION_SMALL;
 			break;
@@ -1166,7 +1188,7 @@ void nade_boom(entity this)
 		case NADE_TYPE_MONSTER: nade_monster_boom(this); break;
 		case NADE_TYPE_ENTRAP: nade_entrap_boom(this); break;
 		case NADE_TYPE_VEIL: nade_veil_boom(this); break;
-		case NADE_TYPE_ITEMDROP: nade_dropitem_boom(this); break; //LegendGuard adds the register of new nade 11-02-2021
+		case NADE_TYPE_EMERALD: nade_emerald_boom(this); break; //LegendGuard adds the register of new nade 11-02-2021
 		case NADE_TYPE_AMMO: nade_ammo_boom(this); break; //LegendGuard adds the register of new nade 13-02-2021
 		case NADE_TYPE_DARK: nade_dark_boom(this); break; //LegendGuard adds the register of new nade 08-02-2021
 	}
diff --git a/qcsrc/common/mutators/mutator/nades/nades.qh b/qcsrc/common/mutators/mutator/nades/nades.qh
index ec88d0025..6ce5580d5 100644
--- a/qcsrc/common/mutators/mutator/nades/nades.qh
+++ b/qcsrc/common/mutators/mutator/nades/nades.qh
@@ -64,14 +64,14 @@ float autocvar_g_nades_entrap_radius = 500;
 float autocvar_g_nades_entrap_time = 10;
 float autocvar_g_nades_veil_time = 8;
 float autocvar_g_nades_veil_radius = 300;
-float autocvar_g_nades_itemdrop_lifetime = 5; //LegendGuard adds new nade cvars 28-02-2021
-float autocvar_g_nades_itemdrop_spawncount = 1;
-float autocvar_g_nades_itemdrop_ball_spread = 0.5;
-float autocvar_g_nades_itemdrop_ball_lifetime = 1; //if much time, many items will spawn
-float autocvar_g_nades_itemdrop_fountain_delay = 5;
-float autocvar_g_nades_itemdrop_ball_count = 3;
-float autocvar_g_nades_itemdrop_fountain_lifetime = 1; //if much time, fountain will remain
-bool autocvar_g_nades_itemdrop_powerupjetpackdrop = 0;
+float autocvar_g_nades_emerald_lifetime = 5; //LegendGuard adds new nade cvars 28-02-2021
+float autocvar_g_nades_emerald_spawncount = 1;
+float autocvar_g_nades_emerald_ball_spread = 0.5;
+float autocvar_g_nades_emerald_ball_lifetime = 1; //if much time, many items will spawn
+float autocvar_g_nades_emerald_fountain_delay = 5;
+float autocvar_g_nades_emerald_ball_count = 3;
+float autocvar_g_nades_emerald_fountain_lifetime = 1; //if much time, fountain will remain
+bool autocvar_g_nades_emerald_powerupjetpackdrop = 0;
 float autocvar_g_nades_ammo_time = 5; //LegendGuard adds new nade cvars 13-02-2021
 float autocvar_g_nades_ammo_rate = 30;
 float autocvar_g_nades_ammo_friend = 1;
@@ -101,8 +101,8 @@ const int PROJECTILE_NADE_ENTRAP = 84;
 const int PROJECTILE_NADE_ENTRAP_BURN = 85;
 const int PROJECTILE_NADE_VEIL = 86;
 const int PROJECTILE_NADE_VEIL_BURN = 87;
-const int PROJECTILE_NADE_ITEMDROP = 88; //LegendGuard adds new nade MACROS 11-02-2021
-const int PROJECTILE_NADE_ITEMDROP_BURN = 89;
+const int PROJECTILE_NADE_EMERALD = 88; //LegendGuard adds new nade MACROS 11-02-2021
+const int PROJECTILE_NADE_EMERALD_BURN = 89;
 const int PROJECTILE_NADE_AMMO = 90; //LegendGuard adds new nade MACROS 13-02-2021
 const int PROJECTILE_NADE_AMMO_BURN = 91;
 const int PROJECTILE_NADE_DARK = 92; //LegendGuard adds new nade MACROS 08-02-2021