Just want to now if what I'm doing isn't wrong:
Please, somebody can confirm me that this will not make any issue?
this is a timer that I've put in the init.lua
it has to start when one champion (or more) is wearing a complete armor set, and play a breathing sound.
Code: Select all
--- timer hev suit
{
class = "Timer",
name = "breathetimer",
timerInterval = 5,
onActivate = function(self)
playSound("breathe")
end,
enabled = false,
},
when the full suit is equipped, the timer is activated in the onRecomputeStats function.
when this item is removed (or one of the other item of the set), it stop the timer and remove the waterbreathing condition, in the onUnequipItem function.
Code: Select all
defineObject{
name = "hev_cuirass",
baseObject = "base_item",
components = {
{
class = "Model",
model = "mod_assets/models/hev_chest.fbx",
offset = vec(0, 0.1, 0),
},
{
class = "Item",
uiName = "HEV Body MK3",
description = "Nothing can tell what is the use of this mysterious stuff.",
armorSet = "hev",
armorSetPieces = 5,
gfxIndex = 150,
gfxAtlas = "mod_assets/textures/oliveitem.tga",
weight = 4.0,
traits = { "chest_armor" },
onUnequipItem=function(self,champion,slot)
if slot==4 then
party.breathetimer:disable()
champion:removeCondition("water_breathing")
end
end
},
{
class = "EquipmentItem",
protection = 5,
onRecomputeStats = function(self, champion)
if champion:isArmorSetEquipped("hev") then
champion:addStatModifier("resist_cold", 200)
champion:addStatModifier("resist_poison", 200)
champion:addStatModifier("resist_fire", 200)
champion:addStatModifier("resist_shock", 200)
champion:setConditionValue("water_breathing", 600)
party.breathetimer:enable()
--GameMode.fadeOut(0x00CC00,600)
end
end,
},
},
}I want something, like green, transparent, that comes in fullscreen when the set is equipped.
