set g_nades_nade_radius 300
set g_nades_nade_force 650
set g_nades_nade_newton_style 0 "nade velocity: 0 is absolute, 1 is relative (takes into account player velocity), 2 is something in between"
-set g_nades_nade_type 1 "Type of the off-hand grenade. 1:normal 2:napalm 3:ice 4:translocate 5:spawn 6:heal 7:pokenade 8:entrap 9:veil, 10:ammo, 11:darkness"
+set g_nades_nade_type 1 "Type of the off-hand grenade. 0:random 1:normal 2:napalm 3:ice 4:translocate 5:spawn 6:heal 7:pokenade 8:entrap 9:veil, 10:ammo, 11:darkness"
seta cl_nade_timer 1 "show a visual timer for nades, 1 = only circle, 2 = circle with text"
-seta cl_nade_type 3 "selected type of the off-hand grenade. 1:normal 2:napalm 3:ice 4:translocate 5:spawn 6:heal 7:pokenade 8:entrap 9:veil 10:ammo 11:darkness"
+seta cl_nade_type 3 "selected type of the off-hand grenade. 0:random 1:normal 2:napalm 3:ice 4:translocate 5:spawn 6:heal 7:pokenade 8:entrap 9:veil 10:ammo 11:darkness"
seta cl_pokenade_type "zombie" "monster to spawn"
// ------------
//
set g_nades_bonus 0 "Enable bonus grenades"
set g_nades_bonus_client_select 0 "Allow client side selection of bonus nade type"
-set g_nades_bonus_type 2 "Type of the bonus grenade. 1:normal 2:napalm 3:ice 4:translocate 5:spawn 6:heal 7:pokenade 8:entrap 9:veil 10:ammo 11:darkness"
+set g_nades_bonus_type 2 "Type of the bonus grenade. 0:random 1:normal 2:napalm 3:ice 4:translocate 5:spawn 6:heal 7:pokenade 8:entrap 9:veil 10:ammo 11:darkness"
set g_nades_bonus_onstrength 1 "Always give bonus grenades to players that have the strength powerup"
set g_nades_bonus_max 3 "Maximum number of bonus grenades"
set g_nades_bonus_only 0 "Disallow regular nades, only bonus nades can be used"
float bonusNades = STAT(NADE_BONUS);
float bonusProgress = STAT(NADE_BONUS_SCORE);
float bonusType = STAT(NADE_BONUS_TYPE);
- Nade def = REGISTRY_GET(Nades, bonusType);
- vector nadeColor = def.m_color;
- string nadeIcon = def.m_icon;
+ Nade def = REGISTRY_GET(Nades, max(1, bonusType));
+ string nadeIcon = def.m_icon; // use the Normal Nade icon for the random nade, and draw it as rainbow
+ vector nadeColor;
+ if(bonusType)
+ nadeColor = def.m_color;
+ else
+ {
+ nadeColor.x = time % (M_PI * 2);
+ nadeColor.y = 1;
+ nadeColor.z = 1;
+ nadeColor = hsv_to_rgb(nadeColor);
+ }
vector iconPos, textPos;
drawstring_aspect(textPos, ftos(bonusNades), vec2((2/3) * mySize.x, mySize.y), '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
if(draw_expanding)
- drawpic_aspect_skin_expanding(iconPos, nadeIcon, '1 1 0' * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, expand_time);
+ drawpic_aspect_skin_expanding(iconPos, nadeIcon, '1 1 0' * mySize.y, (bonusType ? '1 1 1' : nadeColor), panel_fg_alpha, DRAWFLAG_NORMAL, expand_time);
- drawpic_aspect_skin(iconPos, nadeIcon, '1 1 0' * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawpic_aspect_skin(iconPos, nadeIcon, '1 1 0' * mySize.y, (bonusType ? '1 1 1' : nadeColor), panel_fg_alpha, DRAWFLAG_NORMAL);
}
}
#endif
n.pokenade_type = pntype;
- Nade def = REGISTRY_GET(Nades, max(1, ntype));
+ if(ntype == 0) // random nade
+ ntype = floor(random() * (REGISTRY_COUNT(Nades) - 1)) + 1;
+ Nade def = REGISTRY_GET(Nades, ntype);
if(def == NADE_TYPE_Null)
def = NADE_TYPE_NORMAL;
switch (cl_ntype)
{
+ case 0: return 0; // random nade
CL_NADE_TYPE_CHECK(NADE_TYPE_NAPALM, autocvar_g_nades_napalm);
CL_NADE_TYPE_CHECK(NADE_TYPE_ICE, autocvar_g_nades_ice);
CL_NADE_TYPE_CHECK(NADE_TYPE_TRANSLOCATE, autocvar_g_nades_translocate);
player.pokenade_type = autocvar_g_nades_pokenade_monster_type;
}
- STAT(NADE_BONUS_TYPE, player) = bound(1, STAT(NADE_BONUS_TYPE, player), Nades_COUNT);
+ STAT(NADE_BONUS_TYPE, player) = bound(0, STAT(NADE_BONUS_TYPE, player), REGISTRY_COUNT(Nades));
if(STAT(NADE_BONUS_SCORE, player) >= 0 && autocvar_g_nades_bonus_score_max)
nades_GiveBonus(player, time_score / autocvar_g_nades_bonus_score_max);