-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathP_Strawman.cs
More file actions
111 lines (107 loc) · 3.54 KB
/
P_Strawman.cs
File metadata and controls
111 lines (107 loc) · 3.54 KB
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
102
103
104
105
106
107
108
109
110
111
using System;
using FunkEngine;
using Godot;
public partial class P_Strawman : EnemyPuppet
{
public static new readonly string LoadPath =
"res://Scenes/Puppets/Enemies/Strawman/Strawman.tscn";
private static Toriel _tutorialInstance;
public override void _Ready()
{
CurrentHealth = 40;
MaxHealth = 40;
BaseMoney = 1;
base._Ready();
BattleEvents = new EnemyEffect[]
{
new EnemyEffect(
this,
BattleEffectTrigger.OnBattleStart,
1,
(e, eff, val) =>
{
_tutorialInstance = Toriel.AttachNewToriel(e.BD);
_tutorialInstance.IntroDialogue();
}
),
new EnemyEffect(
this,
BattleEffectTrigger.OnDamageInstance,
2,
(e, eff, val) =>
{
if (e is not BattleDirector.Harbinger.OnDamageInstanceArgs dArgs)
return;
if (
dArgs.Dmg.Target == dArgs.BD.Player
&& dArgs.Dmg.Target.GetCurrentHealth() <= dArgs.Dmg.Damage + 1
)
{
dArgs.Dmg.Target.Heal(999);
if (eff.Value == 0)
return;
_tutorialInstance.NoDying();
eff.Value--;
}
}
),
new EnemyEffect(
this,
BattleEffectTrigger.OnLoop,
1,
(e, eff, val) =>
{
if (e is not BattleDirector.Harbinger.LoopEventArgs lArgs)
return;
if (lArgs.Loop == 1)
{
_tutorialInstance.LoopDialogue();
}
}
),
new EnemyEffect(
this,
BattleEffectTrigger.NoteHit,
1,
(e, eff, val) =>
{
if (eff.Value == 0)
return;
if (e is not BattleDirector.Harbinger.NoteHitArgs nArgs)
return;
if (!nArgs.BD.NPB.CanPlaceNote() || TimeKeeper.LastBeat.Loop < 1)
return;
eff.Value = 0;
_tutorialInstance.PlaceDialogue1();
}
),
new EnemyEffect(
this,
BattleEffectTrigger.NotePlaced,
1,
(e, eff, val) =>
{
_tutorialInstance.CallDeferred(nameof(_tutorialInstance.OnPlaceDialogue1));
}
),
new EnemyEffect(
this,
BattleEffectTrigger.OnDamageInstance,
1,
(e, eff, val) =>
{
if (e is not BattleDirector.Harbinger.OnDamageInstanceArgs dArgs)
return;
if (
dArgs.Dmg.Target == this
&& dArgs.Dmg.Target.GetCurrentHealth() <= dArgs.Dmg.Damage
)
{
SaveSystem.UpdateConfig(SaveSystem.ConfigSettings.FirstTime, false);
SteamWhisperer.PopAchievement("tutorial");
}
}
),
};
}
}