1.ħÕÈÎÞÏÞʹÓãºÓüÇʱ¾´ò¿ªÓÎϷĿ¼\\data\\scripts\\prefabs\\staff.luaÎļþ£¬½«ÏÂÁÐÄÚÈÝ£º
inst:AddComponent("finiteuses") inst.components.finiteuses:SetOnFinished( onfinished )
inst.components.finiteuses:SetMaxUses(TUNING.FIRESTAFF_USES) inst.components.finiteuses:SetUses(TUNING.FIRESTAFF_USES)
inst.components.finiteuses:SetMaxUses(TUNING.ICESTAFF_USES) inst.components.finiteuses:SetUses(TUNING.ICESTAFF_USES)
inst.components.finiteuses:SetMaxUses(TUNING.TELESTAFF_USES) inst.components.finiteuses:SetUses(TUNING.TELESTAFF_USES)
inst.components.finiteuses:SetMaxUses(TUNING.YELLOWSTAFF_USES) inst.components.finiteuses:SetUses(TUNING.YELLOWSTAFF_USES)
ÐÞ¸ÄΪÒÔÏÂÄÚÈÝ£¨¼´ÔÚÿ¾äÇ°Ãæ¼Ó--£©£º
--inst:AddComponent("finiteuses")
--inst.components.finiteuses:SetOnFinished( onfinished )
--inst.components.finiteuses:SetMaxUses(TUNING.FIRESTAFF_USES) --inst.components.finiteuses:SetUses(TUNING.FIRESTAFF_USES)
--inst.components.finiteuses:SetMaxUses(TUNING.ICESTAFF_USES) --inst
.components.finiteuses:SetUses(TUNING.ICESTAFF_USES)
--inst.components.finiteuses:SetMaxUses(TUNING.TELESTAFF_USES) --inst.components.finiteuses:SetUses(TUNING.TELESTAFF_USES)
--inst.components.finiteuses:SetMaxUses(TUNING.YELLOWSTAFF_USES) --inst.components.finiteuses:SetUses(TUNING.YELLOWSTAFF_USES)
2.»¤Éí·ûÎÞÏÞʹÓãºÓüÇʱ¾´ò¿ªÓÎϷĿ¼\\data\\scripts\\prefabs\\amulet.luaÎļþ£¬½«ÏÂÁÐÄÚÈÝ£º
inst.components.finiteuses:Use(1)
amulet.components.finiteuses:Use(1)
inst:AddComponent("finiteuses") inst.components.finiteuses:SetOnFinished( onfinished )
inst.components.finiteuses:SetMaxUses(TUNING.REDAMULET_USES) inst.components.finiteuses:SetUses(TUNING.REDAMULET_USES)
inst:AddComponent("finiteuses") inst.components.finiteuses:SetOnFinished( onfinished )
inst.components.finiteuses:SetMaxUses(TUNING.ORANGEAMULET_USES) inst.components.finiteuses:SetUses(TUNING.ORANGEAMULET_USES)
ÐÞ¸ÄΪÒÔÏÂÄÚÈÝ£¨¼´ÔÚÿ¾äÇ°Ãæ¼Ó--£©£º
--inst.components.finiteuses:Use(1)
--amulet.components.finiteuses:Use(1)
--inst:AddComponent("finiteuses")
--inst.components.finiteuses:SetOnFinished( onfinished )
--inst.components.finiteuses:SetMaxUses(TUNING.REDAMULET_USES) --inst.components.finiteuses:SetUses(TUNING.REDAMULET_USES)
--inst:AddComponent("finiteuses")
--inst.components.finiteuses:SetOnFinished( onfinished )
--inst.components.finiteuses:SetMaxUses(TUNING.ORANGEAMULET_USES) --inst.components.finiteuses:SetUses(TUNING.ORANGEAMULET_USES)
½«ÏÂÁÐÄÚÈÝ£º
inst.components.fueled:DoDelta(-(inst.components.fueled.maxfuel * 0.03))
inst.components.fueled:StartConsuming()
inst.components.fueled:StopConsuming()
inst.components.fueled:StartConsuming()
inst.components.fueled:StopConsuming()
inst:AddComponent("fueled")
inst.components.fueled.fueltype = "MAGIC"
inst.components.fueled:InitializeFuelLevel(TUNING.BLUEAMULET_FUEL) inst.components.fueled:SetDepletedFn(onfinished)
inst:AddComponent("fueled")
inst.components.fueled.fueltype = "MAGIC"
inst.components.fueled:InitializeFuelLevel(TUNING.PURPLEAMULET_FUEL) inst.components.fueled:SetDepletedFn(onfinished)
ÐÞ¸ÄΪÒÔÏÂÄÚÈÝ£¨¼´ÔÚÿ¾äÇ°Ãæ¼Ó--£©£º
--inst.components.fueled:DoDelta(-(inst.components.fueled.maxfuel * 0.03))
--inst.components.fueled:StartConsuming()
--inst.components.fueled:StopConsuming()
--inst.components.fueled:StartConsuming()
--inst.components.fueled:StopConsuming()
--inst:AddComponent("fueled")
--inst.components.fueled.fueltype = "MAGIC" --inst.components.fueled:InitializeFuelLevel(TUNING.BLUEAM
ULET_FUEL)
--inst.components.fueled:SetDepletedFn(onfinished)
--inst:AddComponent("fueled")
--inst.components.fueled.fueltype = "MAGIC"
--inst.components.fueled:InitializeFuelLevel(TUNING.PURPLEAMULET_FUEL) --inst.components.fueled:SetDepletedFn(onfinished)
¼´¿ÉÈÃħÕÈ¡¢»¤Éí·ûÎÞÏÞʹÓÃ
ÈýÊ®Æß.³ÈÉ«»¤Éí·ûÎüÈ¡ÎïÆ·¼ÓËÙ¡¢·¶Î§¼Ó´ó£¬²»ÎüÏÝÚå
ÓüÇʱ¾´ò¿ªÓÎϷĿ¼\\data\\scripts\\prefabs\\amulet.luaÎļþ£¬
1.ÎüÈ¡ÎïÆ·¼ÓËÙ£º½«inst.task = inst:DoPeriodicTask(TUNING.ORANGEAMULET_ICD, function() pickup(inst, owner) end)Ìæ»»ÎªÒÔÏÂÄÚÈÝ£º
inst.task = inst:DoPeriodicTask(TUNING.ORANGEAMULET_ICD*.1, function() pickup(inst, owner) end)
¼´¿É¼Ó¿ìÎüÈ¡ÎïÆ·ËÙ¶È10±¶
2.ÎüÈ¡ÎïÆ··¶Î§¼Ó´ó£º½«
local ents = TheSim:FindEntities(pt.x, pt.y, pt.z, TUNING.ORANGEAMULET_RANGE*5)
¼´¿ÉÈÃÎüÈ¡·¶Î§¼Ó´ó5±¶
3.²»ÎüÏÝÚ壺½«v.components.inventoryitem:IsHeld() thenÌæ»»ÎªÒÔÏÂÄÚÈÝ£º
v.components.inventoryitem:IsHeld() and not v:HasTag("trap") then
¼´¿ÉÈóÈÉ«»¤Éí·û²»ÎüÏÝÚ壬°üÀ¨ÑÀ³ÝÏÝÚå¡¢²¶ÄñÏÝÚå¡¢ÍÃÏÝÚå
ÈýÊ®°Ë.ÑÀ³ÝÏÝÚå×Ô¶¯ÖØÖã¨1ÃëºóÖØÖã©
ÓüÇʱ¾´ò¿ªÓÎϷĿ¼\\data\\scripts\\prefabs\\trap_teeth.luainst.components.finiteuses:Use(1)µÄÏÂÒ»ÐвåÈëÏÂÁÐÄÚÈÝ£º end
if inst.components.mine then
inst:DoTaskInTime(1, function() inst.components.mine:Reset() end )
¼´¿ÉÈÃÑÀ³ÝÏÝÚåÔÚ´¥·¢ºó1ÃëÖÓ×Ô¶¯ÖØÖá£ÐÞ¸ÄÆäÖеÄ1ΪÈÎÒâÊý×Ö£¬¼´¿ÉÉèÖü¸ÃëÖÓ×Ô¶¯ÖØÖá£Õâ²»ÊÇÎÒÑо¿µÄ£¬ÊDZðÈËMODµÄ³É¹û£¬Ö»ÊÇÒòΪ¸üÐÂÓÎÏ·ºóÔMOD²»ÄÜÓ㬲ŰÑÐ޸ķ½·¨¹«²¼³öÀ´£¬ÒÔ·½±ã´ó¼Ò
ÈýÊ®¾Å.«δµ³ö´ßÃßÇú£¨ÔÚЯ´øµÄ«ÎÉϰ´Êó±êÓÒ¼ü£¬¿É´ßÃß¶¯Î
ÓüÇʱ¾´ò¿ªÓÎϷĿ¼\\data\\scripts\\prefabs\\cutreeds.luainst:AddComponent("inventoryitem")µÄÏÂÒ»ÐвåÈëÒÔÏÂÄÚÈÝ£º
inst:AddTag("flute")
local function HearPanFlute(inst, musician, instrument) if inst.components.sleeper then
Îļþ£¬ÔÚÎļþ£¬ÔÚ
local ents = TheSim:FindEntities(pt.x, pt.y, pt.z,
TUNING.ORANGEAMULET_RANGE)Ìæ»»ÎªÒÔÏÂÄÚÈÝ£º
Ïà¹ØÍÆ¼ö£º