From: LegendaryGuard Date: Sat, 13 Feb 2021 19:34:30 +0000 (+0100) Subject: Adding some lacking LegendaryGuard stuff and registered z411's STATS, stabilizing... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=483a09345a62b0097b74d930c8d44a20ff1b8e84;p=xonotic%2Fxonotic-data.pk3dir.git Adding some lacking LegendaryGuard stuff and registered z411's STATS, stabilizing old inventory.qh --- diff --git a/bal-wep-mario.cfg b/bal-wep-mario.cfg index 1026700fc..753548eaa 100644 --- a/bal-wep-mario.cfg +++ b/bal-wep-mario.cfg @@ -398,6 +398,13 @@ set g_balance_devastator_guiderate 90 set g_balance_devastator_guideratedelay 0.01 set g_balance_devastator_guidestop 0 set g_balance_devastator_health 30 +set g_balance_devastator_homing_missile_speed 500 +set g_balance_devastator_homing_missile_speed_accel 1.025 +set g_balance_devastator_homing_missile_speed_accel2 1.05 +set g_balance_devastator_homing_missile_speed_decel 0.9 +set g_balance_devastator_homing_missile_speed_max 1000 +set g_balance_devastator_homing_missile_speed_turnrate 0.25 +set g_balance_devastator_homing_missile_active 0 set g_balance_devastator_lifetime 10 set g_balance_devastator_radius 110 set g_balance_devastator_refire 1.1 diff --git a/bal-wep-nexuiz25.cfg b/bal-wep-nexuiz25.cfg index d82db5a15..9981f1af7 100644 --- a/bal-wep-nexuiz25.cfg +++ b/bal-wep-nexuiz25.cfg @@ -398,6 +398,13 @@ set g_balance_devastator_guiderate 90 set g_balance_devastator_guideratedelay 0.01 set g_balance_devastator_guidestop 0 set g_balance_devastator_health 40 +set g_balance_devastator_homing_missile_speed 500 +set g_balance_devastator_homing_missile_speed_accel 1.025 +set g_balance_devastator_homing_missile_speed_accel2 1.05 +set g_balance_devastator_homing_missile_speed_decel 0.9 +set g_balance_devastator_homing_missile_speed_max 1000 +set g_balance_devastator_homing_missile_speed_turnrate 0.25 +set g_balance_devastator_homing_missile_active 0 set g_balance_devastator_lifetime 30 set g_balance_devastator_radius 150 set g_balance_devastator_refire 1 diff --git a/bal-wep-samual.cfg b/bal-wep-samual.cfg index 8a1e40c29..6a0b8e05d 100644 --- a/bal-wep-samual.cfg +++ b/bal-wep-samual.cfg @@ -398,6 +398,13 @@ set g_balance_devastator_guiderate 70 set g_balance_devastator_guideratedelay 0.01 set g_balance_devastator_guidestop 0 set g_balance_devastator_health 30 +set g_balance_devastator_homing_missile_speed 500 +set g_balance_devastator_homing_missile_speed_accel 1.025 +set g_balance_devastator_homing_missile_speed_accel2 1.05 +set g_balance_devastator_homing_missile_speed_decel 0.9 +set g_balance_devastator_homing_missile_speed_max 1000 +set g_balance_devastator_homing_missile_speed_turnrate 0.25 +set g_balance_devastator_homing_missile_active 0 set g_balance_devastator_lifetime 10 set g_balance_devastator_radius 110 set g_balance_devastator_refire 1.2 diff --git a/bal-wep-xdf.cfg b/bal-wep-xdf.cfg index 611f67bce..c63343e3a 100644 --- a/bal-wep-xdf.cfg +++ b/bal-wep-xdf.cfg @@ -398,6 +398,13 @@ set g_balance_devastator_guiderate 0 set g_balance_devastator_guideratedelay 999 set g_balance_devastator_guidestop 1 set g_balance_devastator_health 30 +set g_balance_devastator_homing_missile_speed 500 +set g_balance_devastator_homing_missile_speed_accel 1.025 +set g_balance_devastator_homing_missile_speed_accel2 1.05 +set g_balance_devastator_homing_missile_speed_decel 0.9 +set g_balance_devastator_homing_missile_speed_max 1000 +set g_balance_devastator_homing_missile_speed_turnrate 0.25 +set g_balance_devastator_homing_missile_active 0 set g_balance_devastator_lifetime 20 set g_balance_devastator_radius 110 set g_balance_devastator_refire 0.9 diff --git a/bal-wep-xonotic.cfg b/bal-wep-xonotic.cfg index 5f27b7ebf..8be5541db 100644 --- a/bal-wep-xonotic.cfg +++ b/bal-wep-xonotic.cfg @@ -398,6 +398,13 @@ set g_balance_devastator_guiderate 90 set g_balance_devastator_guideratedelay 0.01 set g_balance_devastator_guidestop 0 set g_balance_devastator_health 30 +set g_balance_devastator_homing_missile_speed 500 +set g_balance_devastator_homing_missile_speed_accel 1.025 +set g_balance_devastator_homing_missile_speed_accel2 1.05 +set g_balance_devastator_homing_missile_speed_decel 0.9 +set g_balance_devastator_homing_missile_speed_max 1000 +set g_balance_devastator_homing_missile_speed_turnrate 0.25 +set g_balance_devastator_homing_missile_active 0 set g_balance_devastator_lifetime 10 set g_balance_devastator_radius 110 set g_balance_devastator_refire 1.1 diff --git a/qcsrc/common/items/inventory.qh b/qcsrc/common/items/inventory.qh index f7f87d9da..62df6330e 100644 --- a/qcsrc/common/items/inventory.qh +++ b/qcsrc/common/items/inventory.qh @@ -37,18 +37,21 @@ STATIC_INIT(Inventory) #endif #ifdef CSQC -Inventory g_inventory; -void Inventory_remove(entity this) -{ - if(g_inventory == this) - g_inventory = NULL; -} +#include +Inventory g_inventory; +Inventory inventoryslots[255]; +float last_pickup_timer; +entity last_pickup_item; +int last_pickup_times; NET_HANDLE(ENT_CLIENT_INVENTORY, bool isnew) { make_pure(this); g_inventory = this; - this.entremove = Inventory_remove; + + float entnum = ReadByte() - 1; + inventoryslots[entnum] = this; + const int majorBits = Readbits(Inventory_groups_major); for (int i = 0; i < Inventory_groups_major; ++i) { if (!(majorBits & BIT(i))) { @@ -63,11 +66,31 @@ NET_HANDLE(ENT_CLIENT_INVENTORY, bool isnew) .int fld = inv_items[it.m_id]; int prev = this.(fld); int next = this.(fld) = ReadByte(); + + if(entnum == current_player) { + if(last_pickup_item != it) last_pickup_times = 0; + last_pickup_timer = timer; + last_pickup_item = it; + last_pickup_times++; + } + LOG_DEBUGF("%s: %.0f -> %.0f", it.m_name, prev, next); } } return true; } + +NET_HANDLE(TE_CSQC_WEAPONPICKUP, bool isnew) +{ + const Weapon it = REGISTRY_GET(Weapons, ReadByte()); + + if(last_pickup_item != it) last_pickup_times = 0; + last_pickup_timer = timer; + last_pickup_item = it; + last_pickup_times++; + + return true; +} #endif #ifdef SVQC @@ -141,12 +164,13 @@ bool Inventory_customize(entity this, entity client) void Inventory_new(PlayerState this) { Inventory inv = NEW(Inventory); - setcefc(inv, Inventory_customize); + if(!g_duel) setcefc(inv, Inventory_customize); Net_LinkEntity((inv.owner = this).inventory = inv, false, 0, Inventory_Send); } -void Inventory_delete(entity e) { delete(e.inventory); } +void Inventory_delete(entity e) { delete(e.inventory.inventory); delete(e.inventory); } void Inventory_update(entity e) { e.inventory.SendFlags = 0xFFFFFF; } + void Inventory_clear(entity store) { // NOTE: you will need to perform Inventory_update after this to update the storage entity @@ -157,6 +181,16 @@ void Inventory_clear(entity store) }); } +void Inventory_ClearAll() { + FOREACH_CLIENT(IS_PLAYER(it), { + entity store = PS(it); + FOREACH(Items, true, { + store.inventory.inv_items[it.m_id] = 0; + }); + Inventory_update(store); + }); +} + void InventoryStorage_attach(entity e) { e.inventory_store = NEW(Inventory); e.inventory_store.drawonlytoclient = e; } void InventoryStorage_delete(entity e) { delete(e.inventory_store); } #endif diff --git a/qcsrc/common/stats.qh b/qcsrc/common/stats.qh index f539f97a9..0215c8782 100644 --- a/qcsrc/common/stats.qh +++ b/qcsrc/common/stats.qh @@ -73,6 +73,15 @@ float W_WeaponRateFactor(entity this); float game_stopped; float game_starttime; //point in time when the countdown to game start is over float round_starttime; //point in time when the countdown to round start is over + +float overtime_starttime; // z411 point in time where first overtime started + +float checkrules_overtimesadded; // z411 add +float timeout_last; +float timeout_total_time; +bool game_timeout; + + bool autocvar_g_allow_oldvortexbeam; int autocvar_leadlimit; // TODO: world.qh can't be included here due to circular includes! @@ -81,6 +90,10 @@ int autocvar_leadlimit; #define autocvar_timelimit cvar("timelimit") #define autocvar_timelimit_override cvar("timelimit_override") #endif + +REGISTER_STAT(GAME_TIMEOUT, bool, game_timeout) //z411 registers STAT +REGISTER_STAT(TIMEOUT_LAST, float, timeout_last) + REGISTER_STAT(WEAPONRATEFACTOR, float, W_WeaponRateFactor(this)) REGISTER_STAT(GAME_STOPPED, int, game_stopped) REGISTER_STAT(GAMESTARTTIME, float, game_starttime) @@ -117,6 +130,9 @@ REGISTER_STAT(SECRETS_TOTAL, int, secrets_total) REGISTER_STAT(SECRETS_FOUND, int, secrets_found) REGISTER_STAT(RESPAWN_TIME, float) REGISTER_STAT(ROUNDSTARTTIME, float, round_starttime) + +REGISTER_STAT(OVERTIMESADDED, float, checkrules_overtimesadded) //z411 registers STAT + REGISTER_STAT(MONSTERS_TOTAL, int) REGISTER_STAT(MONSTERS_KILLED, int) REGISTER_STAT(BUFFS, int)