ÁùÊ®Æß.×ÔÑø¸ßÄñ²»ÓÃιʳ£¨²»ÒªÓëι×ÔÑø¸ßÄñ²ú±ã±ãͬʱÐ޸ģ©
ÓüÇʱ¾´ò¿ªÓÎϷĿ¼\\data\\scripts\\prefabs\\smallbird.luaÎļþ£¬½«ÏÂÁÐÄÚÈÝ£º
inst:AddComponent("hunger")
inst.components.hunger:SetMax(TUNING.SMALLBIRD_HUNGER)
inst.components.hunger:SetRate(TUNING.SMALLBIRD_HUNGER/TUNING.SMALLBIRD_STARVE_TIME) inst.components.hunger:SetKillRate(TUNING.SMALLBIRD_HEALTH/TUNING.SMALLBIRD_STARVE_KILL_TIME)
inst.components.hunger:SetMax(TUNING.TEENBIRD_HUNGER)
inst.components.hunger:SetRate(TUNING.TEENBIRD_HUNGER/TUNING.TEENBIRD_STARVE_TIME) inst.components.hunger:SetKillRate(TUNING.TEENBIRD_HEALTH/TUNING.TEENBIRD_STARVE_KILL_TIME)
ÐÞ¸ÄΪ£º
--inst:AddComponent("hunger")
--inst.components.hunger:SetMax(TUNING.SMALLBIRD_HUNGER)
--inst.components.hunger:SetRate(TUNING.SMALLBIRD_HUNGER/TUNING.SMALLBIRD_STARVE_TIME)
--inst.components.hunger:SetKillRate(TUNING.SMALLBIRD_HEALTH/TUNING.SMALLBIRD_STARVE_KILL_TIME)
--inst.components.hunger:SetMax(TUNING.TEENBIRD_HUNGER)
--inst.components.hunger:SetRate(TUNING.TEENBIRD_HUNGER/TUNING.TEENBIRD_STARVE_TIME) --inst.components.hunger:SetKillRate(TUNING.TEENBIRD_HEALTH/TUNING.TEENBIRD_STARVE_KILL_TIME)
¼´¿ÉÈÃ×ÔÑø¸ßÄñ²»ÓÃιʳ
ÁùÊ®°Ë.ÑÀ³ÝÏÝÚå²»É˺¦×ÔÑø¸ßÄñ
ÓüÇʱ¾´ò¿ªÓÎϷĿ¼\\data\\scripts\\prefabs\\trap_teeth.luaÎļþ£¬½«if target thenÌ滻Ϊif target and not target:HasTag("smallbird") then¼´¿É
ÁùÊ®¾Å.Ö÷½Ç´øÈâ²»±»ÍÃÈ˹¥»÷
ÓüÇʱ¾´ò¿ªÓÎϷĿ¼\\data\\scripts\\prefabs\\bunnyman.lua
Îļþ£¬½«
if
guy:HasTag("player")Ì滻Ϊif guy:HasTag("monster")¼´¿É£¬×¢ÒâÌæ»»µÄÖ»ÊÇ
Ò»¾äÖеÄÒ»²¿·Ö£¬Óï¾äÆäËû²¿·Ö²»Òª¶¯
ÆßÊ®.ÖíÈËÓÀ¾Ã¸úËæ
ÓüÇʱ¾´ò¿ªÓÎϷĿ¼\\data\\scripts\\prefabs\\pigman.luaÎļþ£¬ 1.
--inst.components.follower:AddLoyaltyTime(item.components.edible:GetHunger() TUNING.PIG_LOYALTY_PER_HUNGER)
2.½«inst.components.follower.maxfollowtime = TUNING.PIG_LOYALTY_MAXTIMEÌ滻ΪÒÔÏÂÄÚÈÝ£º
--inst.components.follower.maxfollowtime = TUNING.PIG_LOYALTY_MAXTIME
¼´¿ÉÈÃÖíÈËÓÀ¾Ã¸úË棬¶öÁËÒ²²»»áÀ뿪¡£µ«ÍíÉÏÒ»ÑùÐèÒª¸øËüµã»ð£¬Ëü»á´ôÔÚ»ðÅÔ£¬µ½°×Ìì¼ÌÐø¸úËæ
Æßʮһ.ιÄñ·èÈâµÃ±¦Ê¯
ÓüÇʱ¾´ò¿ªÓÎϷĿ¼\\data\\scripts\\prefabs\\birdcage.luaÎļþ£¬
1.½«if item.prefab == "egg" or item.prefab == "bird_egg" or item.prefab == "rottenegg" or item.prefab == "monstermeat" thenÌ滻ΪÒÔÏÂÄÚÈÝ£º
if item.prefab == "egg" or item.prefab == "bird_egg" or item.prefab == "rottenegg" then
2.ÔÚinst:DoTaskInTime(60*FRAMES, function()µÄÏÂÒ»ÐвåÈëÒÔÏÂÄÚÈÝ£º
if item.prefab == "monstermeat" then
inst.components.lootdropper:SpawnLootPrefab("redgem") inst.components.lootdropper:SpawnLootPrefab("bluegem")
*
½«
inst.components.follower:AddLoyaltyTime(item.components.edible:GetHunger()
*
TUNING.PIG_LOYALTY_PER_HUNGER)Ì滻ΪÒÔÏÂÄÚÈÝ£º
inst.components.lootdropper:SpawnLootPrefab("orangegem") inst.components.lootdropper:SpawnLootPrefab("yellowgem") inst.components.lootdropper:SpawnLootPrefab("greengem") inst.components.lootdropper:SpawnLootPrefab("purplegem") end
¼´¿É¸øÄñÁýÖеÄÄñι·èÈâµÃ±¦Ê¯¡£ÐÞ¸ÄÆäÖÐredgem¡¢bluegem¡¢orangegem¡¢yellowgem¡¢greengem¡¢purplegem±¦Ê¯Ãû³ÆΪÆäËûÎïÆ·Ãû³Æ£¬¼´¿ÉιÄñ³Ô·èÈâµÃÆäËûÎïÆ·
ÆßÊ®¶þ.Å©ÌïÊÕ»ñ¸ü¶à²úÆ·
ÓüÇʱ¾´ò¿ªÓÎϷĿ¼\\data\\scripts\\components\\crop.luaÎļþ£¬½«ÒÔÏÂÄÚÈÝ£º
harvester.components.inventory:GiveItem(product) Ì滻Ϊ£º
harvester.components.inventory:GiveItem(SpawnPrefab(self.product_prefab)) harvester.components.inventory:GiveItem(SpawnPrefab(self.product_prefab)) harvester.components.inventory:GiveItem(SpawnPrefab(self.product_prefab))
¼´¿ÉÒ»´ÎÊÕ»ñ
ÆßÊ®Èý.Å©×÷Îï1Ã볤³öÀ´
1.ÓüÇʱ¾´ò¿ªÓÎϷĿ¼\\data\\scripts\\prefabs\\seeds.luainst.components.plantable.growtime
2.ÓüÇʱ¾´ò¿ªÓÎϷĿ¼\\data\\scripts\\prefabs\\veggies.luainst.components.plantable.growtime
¼´¿ÉÈÃËùÓÐÅ©×÷Îï1Ã볤³ö
ÆßÊ®ËÄ.ÁÀÈâÎÞÐèµÈ´ý£¨½«Èâ·ÅÔÚÁÀÈâ¼ÜÉϼ´¸É£©
=
TUNING.SEEDS_GROW_TIME
inst.components.plantable.growtime = TUNING.SEEDS_GROW_TIME*0
Îļþ£¬½«ÐÞ
¸Ä
Ϊ
=
TUNING.SEEDS_GROW_TIME
inst.components.plantable.growtime = TUNING.SEEDS_GROW_TIME*0
Îļþ£¬½«ÐÞ
¸Ä
Ϊ
3
¸ö²úÆ·£¬ÏëÊÕ»ñ¶àÉÙ£¬¾Í¸´ÖƶàÉÙÐÐ
harvester.components.inventory:GiveItem(SpawnPrefab(self.product_prefab))¼´¿É
1.ÓüÇʱ¾´ò¿ªÓÎϷĿ¼\\data\\scripts\\prefabs\\meats.luainst.components.dryable:SetDryTime(TUNING.DRY_FAST)inst.components.dryable:SetDryTime(TUNING.DRY_FAST*0) ½«
2.ÓüÇʱ¾´ò¿ªÓÎϷĿ¼\\data\\scripts\\prefabs\\fish.luainst.components.dryable:SetDryTime(TUNING.DRY_FAST)inst.components.dryable:SetDryTime(TUNING.DRY_FAST*0)
3.ÓüÇʱ¾´ò¿ªÓÎϷĿ¼\\data\\scripts\\prefabs\\froglegs.luainst.components.dryable:SetDryTime(TUNING.DRY_FAST)inst.components.dryable:SetDryTime(TUNING.DRY_FAST*0)
¼´¿ÉÁÀÈâÎÞÐèµÈ´ý£¬°üÀ¨ÈâÀà¡¢Óã¡¢ÍÜÍÈ
ÆßÊ®Îå.ÖóÒ»¹øÊÕ¶à¸öÁÏÀí
ÓüÇʱ¾´ò¿ªÓÎϷĿ¼\\data\\scripts\\components\\stewer.luaÎļþ£¬½«ÒÔÏÂÄÚÈÝ£º
if loot and loot.components.perishable then
loot.components.perishable:SetPercent( self.product_spoilage) end harvester.
components.inventory:GiveItem(loot, Vector3(TheSim:GetScreenPos(self.inst.Transform:GetWorldPosition()))) Ì滻Ϊ£º
local pt = Vector3(TheSim:GetScreenPos(self.inst.Transform:GetWorldPosition())) harvester.components.inventory:GiveItem(SpawnPrefab(self.product), nil, pt) harvester.components.inventory:GiveItem(SpawnPrefab(self.product), nil, pt) harvester.components.inventory:GiveItem(SpawnPrefab(self.product), nil, pt)
¼´¿ÉÖóÒ»¹øÊÕ
3
¸öÁÏÀí£¬ÏëÊÕ¶àÉÙ£¬¾Í¸´ÖƶàÉÙÐÐ
harvester.components.inventory:GiveItem(SpawnPrefab(self.product), nil, pt)¼´¿É
nil,
ÐÞ
Îļþ£¬½«¸Ä
Ϊ
ÐÞ
Îļþ£¬½«¸Ä
Ϊ
¹²
¶þ
¾ä
inst.components.dryable:SetDryTime(TUNING.DRY_MED)
ÐÞ
¸Ä
Ϊ
inst.components.dryable:SetDryTime(TUNING.DRY_MED*0)
ÐÞ
Îļþ£¬½«¹²Èý¾ä
¸Ä
Ϊ