]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add working itemdrop nade, stable code idea for the sake of Mario's thread in the...
authorLegendaryGuard <rootuser999@gmail.com>
Tue, 2 Mar 2021 13:15:11 +0000 (14:15 +0100)
committerLegendaryGuard <rootuser999@gmail.com>
Tue, 2 Mar 2021 13:15:11 +0000 (14:15 +0100)
gfx/hud/default/nade_armorize.tga [deleted file]
gfx/hud/luma/nade_armorize.tga [deleted file]
qcsrc/common/mutators/mutator/nades/nades.qc
qcsrc/common/mutators/mutator/nades/nades.qh

diff --git a/gfx/hud/default/nade_armorize.tga b/gfx/hud/default/nade_armorize.tga
deleted file mode 100644 (file)
index 2d16014..0000000
Binary files a/gfx/hud/default/nade_armorize.tga and /dev/null differ
diff --git a/gfx/hud/luma/nade_armorize.tga b/gfx/hud/luma/nade_armorize.tga
deleted file mode 100644 (file)
index 7588761..0000000
Binary files a/gfx/hud/luma/nade_armorize.tga and /dev/null differ
index 8da019a99daea99e00c80d3269ed705b7e9a3760..f69b75f40453933d1775c86aff1417616961aa6c 100644 (file)
@@ -723,39 +723,8 @@ void nade_veil_boom(entity this)
        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: try to spawn armor shards instead a orb
-//try with this: if not, look crates code and napalm nade code
-void nade_itemdrop_dropitem(entity e, vector org, entity itm)
-{
-       Item_SetLoot(e, true);
-       e.reset = SUB_Remove;
-       e.noalign = true;
-       StartItem(e, itm);
-       e.gravity = 1;
-       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);
-}
-
-void nade_itemdrop_dropping(vector org)
-{
-       //TODO: Do like a machine spouting constantly with limited time 01-03-2021
-       int itemcount = autocvar_g_nades_itemdrop_lifetime;
-       for(int j = 0; j < itemcount; ++j)
-       {
-               entity e = spawn();
-               e.spawnfunc_checked = true;
-               nade_itemdrop_dropitem(e, org, ((random() > 0.5) ? ITEM_ArmorSmall : ITEM_ArmorSmall));
-       }
-}
-
-void nade_dropitem_boom(entity this)
-{
-       nade_itemdrop_dropping(this.origin);
-}
-
-/*COMMENTED FUNCTIONS TO DO SOMETHING
+//TODO: rename in gfx/hud/luma/nade_itemdrop.tga from nade_armorize.tga 02-03-2021
+//TODO: rename itemdrop nade name to emerald nade 02-03-2021
 void nade_itemdrop_dropitem(entity e, vector org, entity itm)
 {
        Item_SetLoot(e, true);
@@ -771,12 +740,13 @@ void nade_itemdrop_dropitem(entity e, vector org, entity itm)
 
 void nade_itemdrop_dropping(vector org)
 {
+       //TODO: Add random item: any ammo type, armor, health, ... 02-03-2012
        int itemcount = autocvar_g_nades_itemdrop_spawncount;
        for(int j = 0; j < itemcount; ++j)
        {
                entity e = spawn();
                e.spawnfunc_checked = true;
-               nade_itemdrop_dropitem(e, org, ((random() > 0.5) ? ITEM_ArmorSmall : ITEM_ArmorSmall));
+               nade_itemdrop_dropitem(e, org, ((random() > 0.5) ? ITEM_ArmorSmall : ITEM_HealthSmall));
        }
 }
 
@@ -806,6 +776,8 @@ void dropitem_ball_think(entity this)
 
        this.angles = vectoangles(this.velocity);
 
+       nade_itemdrop_dropping(this.origin);
+
        this.nextthink = time + 0.1;
 }
 
@@ -825,7 +797,7 @@ void nade_dropitem_ball(entity this)
        setorigin(proj, this.origin);
        setthink(proj, dropitem_ball_think);
        proj.nextthink = time;
-       proj.effects = EF_LOWPRECISION | EFFECT_EXPLOSION_SMALL;
+       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;
@@ -901,8 +873,8 @@ void nade_dropitem_boom(entity this)
        fountain.nade_special_time = time;
        setsize(fountain, '-16 -16 -16', '16 16 16');
        CSQCProjectile(fountain, true, PROJECTILE_NAPALM_FOUNTAIN, true);
-       nade_itemdrop_dropping(this.origin);
-}*/
+       nade_itemdrop_dropping(fountain.origin);
+}
 
 /***********************************************************************************/
 //LegendGuard develops ammo nade 13-02-2021
index 627fa1c5e2560cbe4c543cbd52757ab94fa17de4..a0f5b315edbdbffc2778e68af795c8708f5fade9 100644 (file)
@@ -69,12 +69,12 @@ float autocvar_g_nades_armorize_rate = 30;
 float autocvar_g_nades_armorize_friend = 1;
 float autocvar_g_nades_armorize_foe = -2;*/
 float autocvar_g_nades_itemdrop_lifetime = 5; //LegendGuard adds new nade cvars 28-02-2021
-float autocvar_g_nades_itemdrop_spawncount = 3;
-/*float autocvar_g_nades_itemdrop_ball_spread = 0.5;
-float autocvar_g_nades_itemdrop_ball_lifetime = 4;
+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 = 4;*/
+float autocvar_g_nades_itemdrop_fountain_lifetime = 1; //if much time, fountain will remain
 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;