Corentin Cailleaud
commited on
Commit
·
a6ea729
1
Parent(s):
c92198d
cubzh.lua
CHANGED
@@ -25,6 +25,9 @@ end
|
|
25 |
easy_onboarding.next = function(self)
|
26 |
steps[currentStep].stop(self, stopCallbackData)
|
27 |
currentStep = currentStep + 1
|
|
|
|
|
|
|
28 |
stopCallbackData = steps[currentStep].start(self, currentStep)
|
29 |
end
|
30 |
|
@@ -513,7 +516,7 @@ local skills = {
|
|
513 |
print("Can't find npc")
|
514 |
return
|
515 |
end
|
516 |
-
dialog:create(action.content, npc.avatar)
|
517 |
print(string.format("%s: %s", npc.name, action.content))
|
518 |
end,
|
519 |
action_format_str = "{protagonist_name} said '{content}' to {target_name}",
|
@@ -530,13 +533,13 @@ local skills = {
|
|
530 |
return
|
531 |
end
|
532 |
local npc = client:getNpc(action.character_id)
|
533 |
-
dialog:create("I'm going to " .. targetName, npc.avatar)
|
534 |
print(string.format("%s: %s", npc.name, "I'm going to " .. targetName))
|
535 |
local origin = Map:WorldToBlock(npc.object.Position)
|
536 |
local destination = Map:WorldToBlock(targetPosition) + Number3(math.random(-1, 1), 0, math.random(-1, 1))
|
537 |
local canMove = pathfinding:moveObjectTo(npc.object, origin, destination)
|
538 |
if not canMove then
|
539 |
-
dialog:create("I can't go there", npc.avatar)
|
540 |
return
|
541 |
end
|
542 |
end,
|
@@ -553,7 +556,7 @@ local skills = {
|
|
553 |
return
|
554 |
end
|
555 |
|
556 |
-
dialog:create("<Greets you warmly!>", npc.avatar)
|
557 |
print(string.format("%s: %s", npc.name, "<Greets you warmly!>"))
|
558 |
|
559 |
npc.avatar.Animations.SwingRight:Play()
|
@@ -571,7 +574,7 @@ local skills = {
|
|
571 |
return
|
572 |
end
|
573 |
|
574 |
-
dialog:create("<Jumps in the air!>", npc.avatar)
|
575 |
print(string.format("%s: %s", npc.name, "<Jumps in the air!>"))
|
576 |
|
577 |
npc.object.avatarContainer.Physics = PhysicsMode.Dynamic
|
@@ -593,7 +596,7 @@ local skills = {
|
|
593 |
return
|
594 |
end
|
595 |
|
596 |
-
dialog:create("I'm following you", npc.avatar)
|
597 |
print(string.format("%s: %s", npc.name, "I'm following you"))
|
598 |
|
599 |
followHandler = pathfinding:followObject(npc.object, Player)
|
@@ -618,11 +621,11 @@ local skills = {
|
|
618 |
end
|
619 |
|
620 |
require("explode"):shapes(npc.avatar)
|
621 |
-
dialog:create("*boom*", npc.avatar)
|
622 |
--print(string.format("%s: %s", npc.name, "EXPLODING"))
|
623 |
npc.avatar.IsHidden = true
|
624 |
Timer(5, function()
|
625 |
-
dialog:create("Aaaaand... I'm back!", npc.avatar)
|
626 |
npc.avatar.IsHidden = false
|
627 |
end)
|
628 |
end,
|
@@ -641,7 +644,7 @@ local skills = {
|
|
641 |
shape.Scale = 4
|
642 |
Player:EquipRightHand(shape)
|
643 |
|
644 |
-
dialog:create("Here is an apple for you!", npc.avatar)
|
645 |
end,
|
646 |
action_format_str = "{protagonist_name} gave you a piece of bread!"
|
647 |
},
|
@@ -654,7 +657,7 @@ local skills = {
|
|
654 |
if not npc then print("Can't find npc") return end
|
655 |
|
656 |
npc.object.Scale = npc.object.Scale * 2
|
657 |
-
dialog:create("I am taller than you now!", npc.avatar)
|
658 |
end,
|
659 |
action_format_str = "{protagonist_name} doubled his height!"
|
660 |
},--]]
|
@@ -675,7 +678,7 @@ local skills = {
|
|
675 |
end)
|
676 |
Player:EquipHat(obj)
|
677 |
end)
|
678 |
-
dialog:create("Let's get the party started!", npc.avatar)
|
679 |
end,
|
680 |
action_format_str = "{protagonist_name} gave you a piece of bread!",
|
681 |
},
|
@@ -691,7 +694,7 @@ local skills = {
|
|
691 |
end
|
692 |
|
693 |
local squirrel = spawnSquirrelAbovePlayer(Player)
|
694 |
-
dialog:create("Wooh, squirrel!", npc.avatar)
|
695 |
-- make it disappear after a while
|
696 |
Timer(5, function()
|
697 |
squirrel:RemoveFromParent()
|
|
|
25 |
easy_onboarding.next = function(self)
|
26 |
steps[currentStep].stop(self, stopCallbackData)
|
27 |
currentStep = currentStep + 1
|
28 |
+
if not steps[currentStep] then
|
29 |
+
return
|
30 |
+
end
|
31 |
stopCallbackData = steps[currentStep].start(self, currentStep)
|
32 |
end
|
33 |
|
|
|
516 |
print("Can't find npc")
|
517 |
return
|
518 |
end
|
519 |
+
dialog:create(action.content, npc.avatar.Head)
|
520 |
print(string.format("%s: %s", npc.name, action.content))
|
521 |
end,
|
522 |
action_format_str = "{protagonist_name} said '{content}' to {target_name}",
|
|
|
533 |
return
|
534 |
end
|
535 |
local npc = client:getNpc(action.character_id)
|
536 |
+
dialog:create("I'm going to " .. targetName, npc.avatar.Head)
|
537 |
print(string.format("%s: %s", npc.name, "I'm going to " .. targetName))
|
538 |
local origin = Map:WorldToBlock(npc.object.Position)
|
539 |
local destination = Map:WorldToBlock(targetPosition) + Number3(math.random(-1, 1), 0, math.random(-1, 1))
|
540 |
local canMove = pathfinding:moveObjectTo(npc.object, origin, destination)
|
541 |
if not canMove then
|
542 |
+
dialog:create("I can't go there", npc.avatar.Head)
|
543 |
return
|
544 |
end
|
545 |
end,
|
|
|
556 |
return
|
557 |
end
|
558 |
|
559 |
+
dialog:create("<Greets you warmly!>", npc.avatar.Head)
|
560 |
print(string.format("%s: %s", npc.name, "<Greets you warmly!>"))
|
561 |
|
562 |
npc.avatar.Animations.SwingRight:Play()
|
|
|
574 |
return
|
575 |
end
|
576 |
|
577 |
+
dialog:create("<Jumps in the air!>", npc.avatar.Head)
|
578 |
print(string.format("%s: %s", npc.name, "<Jumps in the air!>"))
|
579 |
|
580 |
npc.object.avatarContainer.Physics = PhysicsMode.Dynamic
|
|
|
596 |
return
|
597 |
end
|
598 |
|
599 |
+
dialog:create("I'm following you", npc.avatar.Head)
|
600 |
print(string.format("%s: %s", npc.name, "I'm following you"))
|
601 |
|
602 |
followHandler = pathfinding:followObject(npc.object, Player)
|
|
|
621 |
end
|
622 |
|
623 |
require("explode"):shapes(npc.avatar)
|
624 |
+
dialog:create("*boom*", npc.avatar.Head)
|
625 |
--print(string.format("%s: %s", npc.name, "EXPLODING"))
|
626 |
npc.avatar.IsHidden = true
|
627 |
Timer(5, function()
|
628 |
+
dialog:create("Aaaaand... I'm back!", npc.avatar.Head)
|
629 |
npc.avatar.IsHidden = false
|
630 |
end)
|
631 |
end,
|
|
|
644 |
shape.Scale = 4
|
645 |
Player:EquipRightHand(shape)
|
646 |
|
647 |
+
dialog:create("Here is an apple for you!", npc.avatar.Head)
|
648 |
end,
|
649 |
action_format_str = "{protagonist_name} gave you a piece of bread!"
|
650 |
},
|
|
|
657 |
if not npc then print("Can't find npc") return end
|
658 |
|
659 |
npc.object.Scale = npc.object.Scale * 2
|
660 |
+
dialog:create("I am taller than you now!", npc.avatar.Head)
|
661 |
end,
|
662 |
action_format_str = "{protagonist_name} doubled his height!"
|
663 |
},--]]
|
|
|
678 |
end)
|
679 |
Player:EquipHat(obj)
|
680 |
end)
|
681 |
+
dialog:create("Let's get the party started!", npc.avatar.Head)
|
682 |
end,
|
683 |
action_format_str = "{protagonist_name} gave you a piece of bread!",
|
684 |
},
|
|
|
694 |
end
|
695 |
|
696 |
local squirrel = spawnSquirrelAbovePlayer(Player)
|
697 |
+
dialog:create("Wooh, squirrel!", npc.avatar.Head)
|
698 |
-- make it disappear after a while
|
699 |
Timer(5, function()
|
700 |
squirrel:RemoveFromParent()
|