Skip to content

Commit 92da140

Browse files
committed
Some work on getting harry working a bit better.
1 parent 5930f78 commit 92da140

File tree

1 file changed

+23
-76
lines changed

1 file changed

+23
-76
lines changed

lib/domains/2.4.5/monsters/harry.c

+23-76
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,29 @@ void setup() {
2121
set_skill("combat/defense", 100);
2222
count = 0;
2323

24+
add_pattern("%s picks up %s.", "say Why did $1 take $2?");
25+
add_pattern("%s drops %s.", "say Why did $1 drop $2?");
26+
27+
/* These need to be checked */
28+
add_pattern("shut up", "say WHy do you want me to shut up?");
29+
add_pattern("Shut up", "say WHy do you want me to shut up?");
30+
add_pattern("%s sells", "say WHy did you sell $1?");
31+
add_pattern("%s attack", "say Why do you attack that $1?");
32+
add_pattern("%s left the game", "say Why did $1 quit the game?");
33+
add_pattern("is now level", "say How does it feel to now be level $2?");
34+
add_pattern("smiles", "smiles");
35+
add_pattern("happily", "smiles");
36+
add_pattern("%s arrives", "say Hello $1, nice to see you!");
37+
add_pattern("%s enters", "say Hello $1, nice to see you!");
38+
add_pattern("%s appears", "say Hello $1, nice to see you!");
39+
add_pattern("%s says:", "test_say");
40+
add_pattern("%s tells you:", "test_say");
41+
add_pattern("%s leaves %s", "go $2");
42+
add_pattern("%s gives you %s", "gives");
43+
add_pattern("%s gives you %s", "gives");
44+
2445
a_str = ({
25-
"say Don't hit men",
46+
"say Don't hit me!",
2647
"say That hurt!",
2748
"say Help, someone!",
2849
"say Why can't you go bullying elsewhere?",
@@ -58,66 +79,6 @@ private int is_harry(string str) {
5879
return lowercase(str) == "harry";
5980
}
6081

61-
/* XXX get harry from vill_road2.c Needs lots of work... */
62-
private void why_did(string str) {
63-
string who, what, tmp;
64-
65-
sscanf(str, "%s %s", who, what);
66-
if (is_harry(who)) {
67-
return;
68-
}
69-
if (sscanf(what, "sells %*s") == 1) {
70-
respond("say Why did you sell " + what);
71-
}
72-
if (sscanf(str, "%s attacks %s.", who, what) == 2) {
73-
respond("say Why does " + who + " attack " + what + "?");
74-
}
75-
if (sscanf(str, "%s left the game.", who) == 1) {
76-
respond("say Why did " + who + " quit the game ?");
77-
}
78-
if (sscanf(str, "%s takes %s.\n", who, what) == 2) {
79-
respond("say Why did " + who + " take " + what + " ?");
80-
}
81-
if (sscanf(what, "drops %s.", tmp) == 1) {
82-
respond("say Why did " + who + " drop " + tmp + "?");
83-
}
84-
}
85-
86-
private void how_does_it_feel(string str) {
87-
string who, what;
88-
sscanf(str, "%s %s", who, what);
89-
if (is_harry(who)) {
90-
return;
91-
}
92-
if (sscanf(str, "%s is now level %s.\n", who, what) == 2) {
93-
respond("say How does it feel, being of level " + what + " ?");
94-
}
95-
}
96-
97-
private void smiles(string str) {
98-
string who, what;
99-
100-
sscanf(str, "%s %s", who, what);
101-
if (is_harry(who)) {
102-
return;
103-
}
104-
if (check_verb(what, "smile") == 1) {
105-
respond("smile");
106-
}
107-
}
108-
109-
private void say_hello(string str) {
110-
string who, what;
111-
112-
sscanf(str, "%s %s", who, what);
113-
if (is_harry(who)) {
114-
return;
115-
}
116-
if (check_verb(what, "appears") == 1 || check_verb(what, "enters") == 1) {
117-
respond("say Hi " + who + ", nice to see you!");
118-
}
119-
}
120-
12182
private int contains(string needle, string hay) {
12283
return sscanf(hay, "%*s" + needle + "%*s") == 2;
12384
}
@@ -204,6 +165,7 @@ private void gives(string str) {
204165
} else {
205166
if (this_object()->present(what)) {
206167
who_obj = this_object()->query_environment()->present(who);
168+
207169
/* XXX sir, ma'am, creature... */
208170
respond("say Thank you very much, sir.");
209171
}
@@ -231,18 +193,3 @@ void do_extra_actions() {
231193
count = 0;
232194
}
233195
}
234-
235-
void outside_message(string str) {
236-
/* XXX some from these can be spoofed with player emotes... */
237-
if (is_fighting()) {
238-
return;
239-
}
240-
241-
str = ANSI_D->strip_colors(str);
242-
smiles(str);
243-
say_hello(str);
244-
why_did(str);
245-
follow(str);
246-
gives(str);
247-
handle_say(str);
248-
}

0 commit comments

Comments
 (0)