1 #appendto Dialogue
2
3 /* Rocky dialogue */
4
Dlg_Rocky_1(object clonk)5 func Dlg_Rocky_1(object clonk)
6 {
7 if (clonk->FindContents(Axe))
8 {
9 MessageBox("$Rocky3$", clonk, clonk); // he's dnd
10 StopDialogue();
11 SetDialogueProgress(1);
12 }
13 else
14 {
15 MessageBox("$Rocky1$", clonk, clonk); // u got axe?
16 }
17 return true;
18 }
19
Dlg_Rocky_2(object clonk)20 func Dlg_Rocky_2(object clonk)
21 {
22 MessageBox("$Rocky2$", clonk, dlg_target); // check lorry
23 StopDialogue();
24 SetDialogueProgress(1);
25 return true;
26 }
27
28
29 // post attack dialogue
Dlg_Rocky_100(object clonk)30 func Dlg_Rocky_100(object clonk)
31 {
32 MessageBox("$Rocky100$", clonk, clonk); // u can stop
33 return true;
34 }
35
Dlg_Rocky_101(object clonk)36 func Dlg_Rocky_101(object clonk)
37 {
38 MessageBox("$Rocky101$", clonk, dlg_target); // stfu. must work.
39 StopDialogue();
40 SetDialogueProgress(101);
41 return true;
42 }
43
44 // Generic call on every dlg message of Rocky
Dlg_Rocky(object clonk)45 func Dlg_Rocky(object clonk)
46 {
47 // Only if Clonk is actually talking
48 if (clonk->FindContents(Axe)) return false;
49 // Yield animation
50 if (this.anim) dlg_target->StopAnimation(this.anim);
51 this.anim = 0;
52 this.anim_continue_frame = FrameCounter() + 50;
53 return false; // do call specific functions
54 }
55
56
57 /* NPC animations */
58
59 static const Rocky_Pickaxe_SwingTime = 60;
60
Dlg_Rocky_Init(object clonk)61 func Dlg_Rocky_Init(object clonk)
62 {
63 // Big pickaxe!
64 var pickaxe = clonk->FindContents(Pickaxe);
65 if (!pickaxe) pickaxe = clonk->CreateContents(Pickaxe);
66 pickaxe.GetCarryTransform = Dialogue.Inventory_GetCarryTransform; // defined in Newton's dialogue
67 var h_scale = 2000;
68 pickaxe.ExtraTransform = Trans_Scale(h_scale,h_scale,h_scale);
69 clonk.pickaxe_particle = new Particles_Glimmer() { Size = PV_Linear(5, 0) };
70 // Pickaxeing animation
71 AddEffect("RockyPickaxeing", clonk, 1, Rocky_Pickaxe_SwingTime, this);
72 return true;
73 }
74
FxRockyPickaxeingTimer(object c,proplist fx,int time)75 func FxRockyPickaxeingTimer(object c, proplist fx, int time)
76 {
77 if (FrameCounter() < this.anim_continue_frame) { fx.phase=false; return FX_OK; }
78 c->SetDir(DIR_Right);
79 var len = c->GetAnimationLength("StrikePickaxe");
80 this.anim = c->PlayAnimation("StrikePickaxe", CLONK_ANIM_SLOT_Arms, Anim_Linear(0,0,len, Rocky_Pickaxe_SwingTime, ANIM_Remove));
81 c->Sound("Objects::Pickaxe::Clang?");
82 var x = (c->GetDir()*2-1) * 9;
83 var y = 9;
84 c->CreateParticle("StarSpark", x,y, PV_Random(-20, 20), PV_Random(-20, 20), 20, c.pickaxe_particle, Random(10)+3);
85 return FX_OK;
86 }
87