Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- State{
- name = "play_flute",
- tags = { "doing", "playing" },
- onenter = function(inst)
- inst.components.locomotor:Stop()
- inst.AnimState:PlayAnimation("action_uniqueitem_pre")
- inst.AnimState:PushAnimation("flute", false)
- inst.AnimState:OverrideSymbol("pan_flute01", "pan_flute", "pan_flute01")
- inst.AnimState:Hide("ARM_carry")
- inst.AnimState:Show("ARM_normal")
- if inst.components.inventory.activeitem and inst.components.inventory.activeitem.components.instrument then
- inst.components.inventory:ReturnActiveItem()
- end
- end,
- timeline =
- {
- TimeEvent(30*FRAMES, function(inst)
- inst.SoundEmitter:PlaySound("dontstarve/wilson/flute_LP", "flute")
- inst:PerformBufferedAction()
- end),
- TimeEvent(85*FRAMES, function(inst)
- inst.SoundEmitter:KillSound("flute")
- end),
- },
- events =
- {
- EventHandler("animqueueover", function(inst)
- if inst.AnimState:AnimDone() then
- inst.sg:GoToState("idle")
- end
- end),
- },
- onexit = function(inst)
- inst.SoundEmitter:KillSound("flute")
- if inst.components.inventory:GetEquippedItem(EQUIPSLOTS.HANDS) then
- inst.AnimState:Show("ARM_carry")
- inst.AnimState:Hide("ARM_normal")
- end
- end,
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement