-
Notifications
You must be signed in to change notification settings - Fork 0
/
feet.cs
101 lines (92 loc) · 2.87 KB
/
feet.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
using Godot;
using System;
using ld47;
public class feet : Area2D
{
[Export] private bool oneandonly = false;
[Export] private Texture text;
private int dialogPos = 1;
// Declare member variables here. Examples:
// private int a = 2;
// private string b = "text";
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
}
private void enableMe()
{
Owner.GetNode<Sprite>("Control/Panel/Panel/portrait").Visible = true;
Owner.GetNode<Sprite>("Control/Panel/Panel/portraitnpc").Visible = false;
}
private void enableNpc()
{
Owner.GetNode<Sprite>("Control/Panel/Panel/portrait").Visible = false;
Owner.GetNode<Sprite>("Control/Panel/Panel/portraitnpc").Visible = true;
}
public override void _PhysicsProcess(float delta)
{
if (Input.IsActionJustPressed("action") && GetNode<State>("/root/State").HasState(Statetype.SLEEP_TALK))
{
if (GetOverlappingBodies().Count > 0)
{
Owner.GetNode<Panel>("Control/Panel").Visible = true;
Owner.GetNode<Sprite>("Control/Panel/Panel/portraitnpc").Texture = text;
if (oneandonly)
{
switch (dialogPos)
{
case 1:
GetNode<SignalManager>("/root/SignalManager").EmitSignal("BlockMovement");
enableMe();
Owner.GetNode<RichTextLabel>("Control/Panel/Panel/RichTextLabel").BbcodeText =
"There you are, i heard you have a pocket knife, can i borrow it";
break;
case 2:
enableNpc();
Owner.GetNode<RichTextLabel>("Control/Panel/Panel/RichTextLabel").BbcodeText =
"Shhht don't give me away";
break;
case 3:
enableMe();
Owner.GetNode<RichTextLabel>("Control/Panel/Panel/RichTextLabel").BbcodeText =
"Please it is a mather of live and death";
break;
case 4:
enableMe();
Owner.GetNode<RichTextLabel>("Control/Panel/Panel/RichTextLabel").BbcodeText =
"Wow that is a big knife, thanks";
break;
case 5:
Owner.GetNode<RichTextLabel>("Control/Panel/Panel/RichTextLabel").BbcodeText =
"Wow that is a big knife, thanks";
Owner.GetNode<Panel>("Control/Panel").Visible = false;
GetNode<SignalManager>("/root/SignalManager").EmitSignal("UnBlockMovement");
GetNode<State>("/root/State").AddState(Statetype.HAS_TOOL);
break;
}
}
else
{
switch (dialogPos)
{
case 1:
GetNode<SignalManager>("/root/SignalManager").EmitSignal("BlockMovement");
enableMe();
Owner.GetNode<RichTextLabel>("Control/Panel/Panel/RichTextLabel").BbcodeText =
"He is not here";
break;
case 2:
GetNode<SignalManager>("/root/SignalManager").EmitSignal("UnBlockMovement");
Owner.GetNode<Panel>("Control/Panel").Visible = true;
break;
}
}
dialogPos++;
}
}
}
private void _on_Area2D_body_entered(object body)
{
// Replace with function body.
}
}