X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmutators%2Fmutator%2Finstagib%2Fsv_instagib.qc;h=616a05da3c93e9c77294028f469ae9a1c649a9ce;hp=c21623f0e5e12d0bb63d96644e4d4e6a22441f1a;hb=d01c567581179df7cc68bcdc8dce58efad911bc4;hpb=6860495bd0cb15353c11be01ad03f052c34b9536 diff --git a/qcsrc/common/mutators/mutator/instagib/sv_instagib.qc b/qcsrc/common/mutators/mutator/instagib/sv_instagib.qc index c21623f0e..616a05da3 100644 --- a/qcsrc/common/mutators/mutator/instagib/sv_instagib.qc +++ b/qcsrc/common/mutators/mutator/instagib/sv_instagib.qc @@ -19,19 +19,23 @@ float autocvar_g_instagib_speed_highspeed; REGISTER_MUTATOR(mutator_instagib, autocvar_g_instagib && !g_nexball) { - MUTATOR_ONADD - { - ITEM_VaporizerCells.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED; - } - MUTATOR_ONROLLBACK_OR_REMOVE - { - ITEM_VaporizerCells.spawnflags |= ITEM_FLAG_MUTATORBLOCKED; - } + MUTATOR_ONADD + { + ITEM_VaporizerCells.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED; + ITEM_Invisibility.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED; + ITEM_Speed.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED; + } + MUTATOR_ONROLLBACK_OR_REMOVE + { + ITEM_VaporizerCells.spawnflags |= ITEM_FLAG_MUTATORBLOCKED; + ITEM_Invisibility.spawnflags |= ITEM_FLAG_MUTATORBLOCKED; + ITEM_Speed.spawnflags |= ITEM_FLAG_MUTATORBLOCKED; + } } void instagib_invisibility(entity this) { - this.strength_finished = autocvar_g_balance_powerup_strength_time; + this.strength_finished = autocvar_g_instagib_invisibility_time; StartItem(this, ITEM_Invisibility); } @@ -42,7 +46,7 @@ void instagib_extralife(entity this) void instagib_speed(entity this) { - this.invincible_finished = autocvar_g_balance_powerup_invincible_time; + this.invincible_finished = autocvar_g_instagib_speed_time; StartItem(this, ITEM_Speed); } @@ -80,59 +84,59 @@ void instagib_ammocheck(entity this) this.instagib_needammo = true; if (hp <= 5) { - Damage(this, this, this, 5, DEATH_NOAMMO.m_id, this.origin, '0 0 0'); + Damage(this, this, this, 5, DEATH_NOAMMO.m_id, DMG_NOWEP, this.origin, '0 0 0'); Send_Notification(NOTIF_ONE, this, MSG_ANNCE, ANNCE_INSTAGIB_TERMINATED); } else if (hp <= 10) { - Damage(this, this, this, 5, DEATH_NOAMMO.m_id, this.origin, '0 0 0'); + Damage(this, this, this, 5, DEATH_NOAMMO.m_id, DMG_NOWEP, this.origin, '0 0 0'); Send_Notification(NOTIF_ONE, this, MSG_ANNCE, ANNCE_NUM_1); } else if (hp <= 20) { - Damage(this, this, this, 10, DEATH_NOAMMO.m_id, this.origin, '0 0 0'); + Damage(this, this, this, 10, DEATH_NOAMMO.m_id, DMG_NOWEP, this.origin, '0 0 0'); Send_Notification(NOTIF_ONE, this, MSG_ANNCE, ANNCE_NUM_2); } else if (hp <= 30) { - Damage(this, this, this, 10, DEATH_NOAMMO.m_id, this.origin, '0 0 0'); + Damage(this, this, this, 10, DEATH_NOAMMO.m_id, DMG_NOWEP, this.origin, '0 0 0'); Send_Notification(NOTIF_ONE, this, MSG_ANNCE, ANNCE_NUM_3); } else if (hp <= 40) { - Damage(this, this, this, 10, DEATH_NOAMMO.m_id, this.origin, '0 0 0'); + Damage(this, this, this, 10, DEATH_NOAMMO.m_id, DMG_NOWEP, this.origin, '0 0 0'); Send_Notification(NOTIF_ONE, this, MSG_ANNCE, ANNCE_NUM_4); } else if (hp <= 50) { - Damage(this, this, this, 10, DEATH_NOAMMO.m_id, this.origin, '0 0 0'); + Damage(this, this, this, 10, DEATH_NOAMMO.m_id, DMG_NOWEP, this.origin, '0 0 0'); Send_Notification(NOTIF_ONE, this, MSG_ANNCE, ANNCE_NUM_5); } else if (hp <= 60) { - Damage(this, this, this, 10, DEATH_NOAMMO.m_id, this.origin, '0 0 0'); + Damage(this, this, this, 10, DEATH_NOAMMO.m_id, DMG_NOWEP, this.origin, '0 0 0'); Send_Notification(NOTIF_ONE, this, MSG_ANNCE, ANNCE_NUM_6); } else if (hp <= 70) { - Damage(this, this, this, 10, DEATH_NOAMMO.m_id, this.origin, '0 0 0'); + Damage(this, this, this, 10, DEATH_NOAMMO.m_id, DMG_NOWEP, this.origin, '0 0 0'); Send_Notification(NOTIF_ONE, this, MSG_ANNCE, ANNCE_NUM_7); } else if (hp <= 80) { - Damage(this, this, this, 10, DEATH_NOAMMO.m_id, this.origin, '0 0 0'); + Damage(this, this, this, 10, DEATH_NOAMMO.m_id, DMG_NOWEP, this.origin, '0 0 0'); Send_Notification(NOTIF_ONE, this, MSG_ANNCE, ANNCE_NUM_8); } else if (hp <= 90) { Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_INSTAGIB_FINDAMMO); - Damage(this, this, this, 10, DEATH_NOAMMO.m_id, this.origin, '0 0 0'); + Damage(this, this, this, 10, DEATH_NOAMMO.m_id, DMG_NOWEP, this.origin, '0 0 0'); Send_Notification(NOTIF_ONE, this, MSG_ANNCE, ANNCE_NUM_9); } else { Send_Notification(NOTIF_ONE_ONLY, this, MSG_MULTI, MULTI_INSTAGIB_FINDAMMO); - Damage(this, this, this, 10, DEATH_NOAMMO.m_id, this.origin, '0 0 0'); + Damage(this, this, this, 10, DEATH_NOAMMO.m_id, DMG_NOWEP, this.origin, '0 0 0'); } } this.instagib_nextthink = time + 1; @@ -174,6 +178,11 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, MakePlayerObserver) instagib_stop_countdown(player); } +MUTATOR_HOOKFUNCTION(mutator_instagib, ForbidRandomStartWeapons) +{ + return true; +} + MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerSpawn) { entity player = M_ARGV(0, entity); @@ -244,14 +253,13 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerPowerups) } } -.float stat_sv_maxspeed; - -MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerPhysics) +MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerPhysics_UpdateStats) { entity player = M_ARGV(0, entity); + // these automatically reset, no need to worry if(player.items & ITEM_Speed.m_itemid) - player.stat_sv_maxspeed = player.stat_sv_maxspeed * autocvar_g_instagib_speed_highspeed; + STAT(MOVEVARS_HIGHSPEED, player) *= autocvar_g_instagib_speed_highspeed; } MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerDamage_SplitHealthArmor) @@ -383,7 +391,7 @@ void replace_with_insta_cells(entity item) { entity e = new(item_vaporizer_cells); setorigin(e, item.origin); - e.noalign = item.noalign; + e.noalign = Item_ShouldKeepPosition(item); e.cnt = item.cnt; e.team = item.team; e.spawnfunc_checked = true;