set g_overkill 0 "enable overkill"
set g_overkill_powerups_replace 1
+set g_overkill_itemwaypoints 1
set g_overkill_filter_healthmega 0
set g_overkill_filter_armormedium 0
set g_overkill_filter_armorbig 0
bool autocvar_g_overkill_powerups_replace;
+bool autocvar_g_overkill_itemwaypoints = true;
+
bool autocvar_g_overkill_filter_healthmega;
bool autocvar_g_overkill_filter_armormedium;
bool autocvar_g_overkill_filter_armorbig;
}
}
+bool ok_HandleItemWaypoints(entity e)
+{
+ if(!autocvar_g_overkill_itemwaypoints)
+ return false; // don't handle it
+
+ switch(e.itemdef)
+ {
+ case ITEM_HealthMega: return true;
+ case ITEM_ArmorMedium: return true;
+ case ITEM_ArmorBig: return true;
+ case ITEM_ArmorMega: return true;
+ }
+
+ return false;
+}
+
+MUTATOR_HOOKFUNCTION(ok, Item_RespawnCountdown)
+{
+ entity item = M_ARGV(0, entity);
+ return ok_HandleItemWaypoints(item);
+}
+
+MUTATOR_HOOKFUNCTION(ok, Item_ScheduleRespawn)
+{
+ entity item = M_ARGV(0, entity);
+ return ok_HandleItemWaypoints(item);
+}
+
MUTATOR_HOOKFUNCTION(ok, FilterItem)
{
entity item = M_ARGV(0, entity);
this.count += 1;
if(this.count == 1)
{
- MUTATOR_CALLHOOK(Item_RespawnCountdown, string_null, '0 0 0');
do {
{
entity wi = Weapons_from(this.weapon);
}
}
} while (0);
+ bool mutator_returnvalue = MUTATOR_CALLHOOK(Item_RespawnCountdown, this);
if(this.waypointsprite_attached)
{
GameItem def = this.itemdef;
- if (Item_ItemsTime_SpectatorOnly(def))
+ if (Item_ItemsTime_SpectatorOnly(def) && !mutator_returnvalue)
WaypointSprite_UpdateRule(this.waypointsprite_attached, 0, SPRITERULE_SPECTATOR);
WaypointSprite_UpdateBuildFinished(this.waypointsprite_attached, time + ITEM_RESPAWN_TICKS);
}
void Item_ScheduleRespawnIn(entity e, float t)
{
// if the respawn time is longer than 10 seconds, show a waypoint, otherwise, just respawn normally
- if ((Item_ItemsTime_Allow(e.itemdef) || (e.weapons & WEPSET_SUPERWEAPONS)) && (t - ITEM_RESPAWN_TICKS) > 0)
+ if ((Item_ItemsTime_Allow(e.itemdef) || (e.weapons & WEPSET_SUPERWEAPONS) || MUTATOR_CALLHOOK(Item_ScheduleRespawn, e, t)) && (t - ITEM_RESPAWN_TICKS) > 0)
{
setthink(e, Item_RespawnCountdown);
e.nextthink = time + max(0, t - ITEM_RESPAWN_TICKS);
e.scheduledrespawntime = e.nextthink + ITEM_RESPAWN_TICKS;
e.count = 0;
- t = Item_ItemsTime_UpdateTime(e, e.scheduledrespawntime);
- Item_ItemsTime_SetTime(e, t);
- Item_ItemsTime_SetTimesForAllPlayers();
+ if(Item_ItemsTime_Allow(e.itemdef) || (e.weapons & WEPSET_SUPERWEAPONS))
+ {
+ t = Item_ItemsTime_UpdateTime(e, e.scheduledrespawntime);
+ Item_ItemsTime_SetTime(e, t);
+ Item_ItemsTime_SetTimesForAllPlayers();
+ }
}
else
{
const float ITEM_RESPAWN_TICKS = 10;
-#define ITEM_RESPAWNTIME(i) ((i).respawntime + (crandom() * (i).respawntimejitter))
+#define ITEM_RESPAWNTIME(i) ((i).respawntime + crandom() * (i).respawntimejitter)
// range: respawntime - respawntimejitter .. respawntime + respawntimejitter
-#define ITEM_RESPAWNTIME_INITIAL(i) (ITEM_RESPAWN_TICKS + (random() * ((i).respawntime + (i).respawntimejitter - ITEM_RESPAWN_TICKS)))
+#define ITEM_RESPAWNTIME_INITIAL(i) (ITEM_RESPAWN_TICKS + random() * ((i).respawntime + (i).respawntimejitter - ITEM_RESPAWN_TICKS))
// range: 10 .. respawntime + respawntimejitter
.float max_armorvalue;
/** called when an item is about to respawn */
#define EV_Item_RespawnCountdown(i, o) \
- /** item name */ i(string, MUTATOR_ARGV_0_string) \
- /**/ o(string, MUTATOR_ARGV_0_string) \
- /** item colour */ i(vector, MUTATOR_ARGV_1_vector) \
- /**/ o(vector, MUTATOR_ARGV_1_vector) \
+ /** item */ i(entity, MUTATOR_ARGV_0_entity) \
/**/
MUTATOR_HOOKABLE(Item_RespawnCountdown, EV_Item_RespawnCountdown);
/** player */ i(entity, MUTATOR_ARGV_0_entity) \
/**/
MUTATOR_HOOKABLE(HideTeamNagger, EV_HideTeamNagger);
+
+/** return true to show a waypoint while the item is spawning */
+#define EV_Item_ScheduleRespawn(i, o) \
+ /** item */ i(entity, MUTATOR_ARGV_0_entity) \
+ /** respawn time */ i(float, MUTATOR_ARGV_1_float) \
+ /**/
+MUTATOR_HOOKABLE(Item_ScheduleRespawn, EV_Item_ScheduleRespawn);