来自https://github.com/laytya/LazyScript/commit/0e3e5dbc6a2fca7f38a9b3c209ecc19325a8b170
自定义判断战士是否装备盾牌
-- checks to see if a shield is equipped (get from Zorlen) function lazyWarrior.masks.isShieldEquipped() local slot = GetInventorySlotInfo("SecondaryHandSlot") local link = GetInventoryItemLink("player", slot) if link then local id, name = lazyScript.IdAndNameFromLink(link) local _, _, _, _, _, itemSubType = GetItemInfo(id) if itemSubType == ITEM_SUBTYPE_SHIELDS then if GetInventoryItemBroken("player", slot) then return false end return true end end return false end function lazyScript.bitParsers.ifShieldEquipped(bit, actions, masks) if (not lazyScript.rebit(bit, "^if(Not)?ShieldEquipped$")) then return false end local negate = lazyScript.negate1() table.insert(masks, lazyScript.negWrapper(lazyWarrior.masks.isShieldEquipped, negate)) return true end
- 本文固定链接: https://www.fengshen.cn/2023/10/lazyscript自定义判断范例/gameofwind/
- 转载请注明: fengshen 发表于 Dream of Wind | 一梦风神
觉得文章有用,微信打赏一元。
