From 524611166b76ef98a83b2bb7d9a23e67c409549a Mon Sep 17 00:00:00 2001 From: bgkillas Date: Thu, 5 Dec 2024 10:43:18 -0500 Subject: [PATCH] dont allow wands to be unusable when dropping from someone with higher frame number then you --- quant.ew/files/core/inventory_helper.lua | 6 ++++++ quant.ew/files/system/notplayer_ai/notplayer_ai.lua | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/quant.ew/files/core/inventory_helper.lua b/quant.ew/files/core/inventory_helper.lua index 5e1375d3..27da4c1c 100644 --- a/quant.ew/files/core/inventory_helper.lua +++ b/quant.ew/files/core/inventory_helper.lua @@ -81,6 +81,12 @@ end function inventory_helper.deserialize_single_item(item_data) local x, y = item_data[2], item_data[3] local item = util.deserialize_entity(item_data[1], x, y) + local ability = ComponentGetValue2(item, "AbilityComponent") + if ability ~= nil then + ComponentSetValue2(ability, "mNextFrameUsable", 0) + ComponentSetValue2(ability, "mCastDelayStartFrame", 0) + ComponentSetValue2(ability, "mReloadNextFrameUsable", 0) + end if item_data.shop_info ~= nil then local item_cost_component = util.get_or_create_component(item, "ItemCostComponent") diff --git a/quant.ew/files/system/notplayer_ai/notplayer_ai.lua b/quant.ew/files/system/notplayer_ai/notplayer_ai.lua index 229ae567..9885a993 100644 --- a/quant.ew/files/system/notplayer_ai/notplayer_ai.lua +++ b/quant.ew/files/system/notplayer_ai/notplayer_ai.lua @@ -60,7 +60,7 @@ local water_mats = {"water", "swamp", "water_swamp", "water_salt", "blood", "mud local ignore_spell = {"ANTIHEAL", "BLACK_HOLE", "BLACK_HOLE_DEATH_TRIGGER", "POWERDIGGER", "DIGGER", "PIPE_BOMB", "PIPE_BOMB_DEATH_TRIGGER", "GRENADE_LARGE", "CRUMBLING_EARTH", "HEAL_BULLET", "FISH", "TELEPORT_PROJECTILE_CLOSER", "TELEPORT_PROJECTILE_STATIC", "SWAPPER_PROJECTILE", "TELEPORT_PROJECTILE", "TELEPORT_PROJECTILE_SHORT", "WHITE_HOLE", "CESSATION", "ADD_TRIGGER", "ADD_TIMER", "ADD_DEATH_TRIGGER", "DIVIDE_2", "DIVIDE_3", "DIVIDE_4", "DIVIDE_10", "GAMMA", "MU", "ALPHA", "OMEGA", "PHI", "SIGMA", "TAU", "SUMMON_PORTAL", "DUPLICATE", - "IF_PROJECTILE", "IF_HP", "IF_ENEMY", "IF_HALF", "IF_ELSE", "IF_END", "ALL_SPELLS", "SUMMON_ROCK", "SUMMON_EGG", "SUMMON_HOLLOW_EGG", "PEBBLE", "COMMON_GRUB"} + "IF_PROJECTILE", "IF_HP", "IF_ENEMY", "IF_HALF", "IF_ELSE", "IF_END", "ALL_SPELLS", "SUMMON_ROCK", "SUMMON_EGG", "SUMMON_HOLLOW_EGG", "PEBBLE", "COMMON_GRUB", "TORCH", "TORCH_ELECTRIC"} local function get_potions_of_type(type) local potions = {}