@@ -16,6 +16,21 @@ class Travel_To {
16
16
var requires_chains;
17
17
}
18
18
19
+ def refusing_business(t_game) {
20
+ return t_game.get_flag("christian_shared_verse")
21
+ && t_game.get_flag("have_spread_rumors")
22
+ && !t_game.get_flag("did_say_something_nice")
23
+ && !t_game.get_flag("did_not_respond");
24
+ }
25
+
26
+ def did_make_all_responses(t_game) {
27
+ return t_game.get_flag("have_talked_to_Twin2") && t_game.get_flag("have_talked_to_YoungEntrepeneur");
28
+ }
29
+
30
+ def did_say_something_nice(t_game) {
31
+ return t_game.get_flag("did_say_something_nice")
32
+ }
33
+
19
34
def travel_to(t_loc, t_game) {
20
35
var has_offroad_tires = t_game.get_flag("has_offroad_tires");
21
36
var has_tire_chains = t_game.get_flag("has_tire_chains");
@@ -45,7 +60,7 @@ def sell(string t_thing, int t_price, t_game, t_game_time, t_simulation_time, t_
45
60
t_game.show_message_box("You don't have any ${t_thing} to sell.");
46
61
}
47
62
48
- show_shop_menu(t_game, t_game_time, t_simulation_time, t_bread, t_meat, t_vegetables, t_wood);
63
+ show_shop_menu(t_game, false, t_game_time, t_simulation_time, t_bread, t_meat, t_vegetables, t_wood);
49
64
}
50
65
51
66
def do_purchase(t_game, int t_price)
@@ -76,17 +91,23 @@ def buy(string t_thing, int t_price, t_game, t_game_time, t_simulation_time, t_b
76
91
}
77
92
}
78
93
79
- show_shop_menu(t_game, t_game_time, t_simulation_time, t_bread, t_meat, t_vegetables, t_wood);
94
+ show_shop_menu(t_game, false, t_game_time, t_simulation_time, t_bread, t_meat, t_vegetables, t_wood);
80
95
}
81
96
82
- def show_shop_menu(t_game, t_game_time, t_simulation_time, int t_bread, int t_meat, int t_vegetables, int t_wood)
97
+ def show_shop_menu(t_game, t_sensitive, t_game_time, t_simulation_time, int t_bread, int t_meat, int t_vegetables, int t_wood)
83
98
{
84
99
var bread = t_game.get_value("bread");
85
100
var meat = t_game.get_value("meat");
86
101
var vegetables = t_game.get_value("vegetables");
87
102
var wood = t_game.get_value("wood");
88
103
var money = t_game.get_value("money");
89
104
105
+
106
+ if (t_sensitive && refusing_business(t_game)) {
107
+ t_game.show_message_box("This location is refusing to do business with you because of your rumor spreading");
108
+ return;
109
+ }
110
+
90
111
var actions =
91
112
[
92
113
Game_Action("Sell Bread $${t_bread} (have: ${bread})",
@@ -130,7 +151,7 @@ def show_shop_menu(t_game, t_game_time, t_simulation_time, int t_bread, int t_me
130
151
} else {
131
152
t_game.show_message_box("You already own tire chains.");
132
153
}
133
- show_shop_menu(t_game, t_game_time, t_simulation_time, t_bread, t_meat, t_vegetables, t_wood);
154
+ show_shop_menu(t_game, false, t_game_time, t_simulation_time, t_bread, t_meat, t_vegetables, t_wood);
134
155
}),
135
156
Game_Action("Buy off-road tires ($500)",
136
157
fun[t_bread, t_meat, t_vegetables, t_wood](t_game_time, t_simulation_time, t_game){
@@ -141,7 +162,7 @@ def show_shop_menu(t_game, t_game_time, t_simulation_time, int t_bread, int t_me
141
162
} else {
142
163
t_game.show_message_box("You already own off-road tires.");
143
164
}
144
- show_shop_menu(t_game, t_game_time, t_simulation_time, t_bread, t_meat, t_vegetables, t_wood);
165
+ show_shop_menu(t_game, false, t_game_time, t_simulation_time, t_bread, t_meat, t_vegetables, t_wood);
145
166
}),
146
167
Game_Action("Done ($${money} avail) / (${meat+wood+vegetables+bread}/5 cargo)", fun(t_game_time, t_simulation_time, t_game) {})
147
168
@@ -209,6 +230,9 @@ var game_creator = fun(game) {
209
230
var glennhaven = Tile_Map(game, "resources/Maps/glennhaven.json", []);
210
231
glennhaven.add_enter_action(
211
232
fun(t_game) {
233
+ if (refusing_business(t_game)) {
234
+ t_game.show_message_box("We've decided to stop doing business with you because of your rumor spreading.");
235
+ }
212
236
t_game.teleport_to_tile(9, 4);
213
237
}
214
238
);
@@ -227,7 +251,30 @@ var game_creator = fun(game) {
227
251
[Answer("YoungEntrepeneur", "Hi! Welcome to Glenn Haven.\nI've just opened up shop here.\nI think you'll like our prices on bread!")],
228
252
fun(t_game_time, t_simulation_time, t_game, t_obj){ true },
229
253
fun(t_game_time, t_simulation_time, t_game, t_obj){ }
254
+ ),
255
+ Question("<spread rumors about competitor>",
256
+ [Answer("YoungEntrepeneur", "That's not a very nice thing to say...")],
257
+ fun(t_game_time, t_simulation_time, t_game, t_obj){
258
+ t_game.get_flag("have_talked_to_christian_about_rumors") && !t_game.get_flag("have_talked_to_YoungEntrepeneur"); },
259
+ fun(t_game_time, t_simulation_time, t_game, t_obj){
260
+ t_game.set_flag("have_talked_to_YoungEntrepeneur", true); t_game.set_flag("have_spread_rumors", true); }
261
+ ),
262
+ Question("<say something nice about competitor>",
263
+ [Answer("YoungEntrepeneur", "That's good to hear.")],
264
+ fun(t_game_time, t_simulation_time, t_game, t_obj){
265
+ t_game.get_flag("have_talked_to_christian_about_rumors") && !t_game.get_flag("have_talked_to_YoungEntrepeneur"); },
266
+ fun(t_game_time, t_simulation_time, t_game, t_obj){
267
+ t_game.set_flag("have_talked_to_YoungEntrepeneur", true); t_game.set_flag("have_said_something_nice", true); }
268
+ ),
269
+ Question("<say nothing about competitor>",
270
+ [],
271
+ fun(t_game_time, t_simulation_time, t_game, t_obj){
272
+ t_game.get_flag("have_talked_to_christian_about_rumors") && !t_game.get_flag("have_talked_to_YoungEntrepeneur"); },
273
+ fun(t_game_time, t_simulation_time, t_game, t_obj){
274
+ t_game.set_flag("have_talked_to_YoungEntrepeneur", true); t_game.set_flag("did_not_respond", true); }
230
275
)
276
+
277
+
231
278
]);
232
279
233
280
@@ -248,7 +295,7 @@ var game_creator = fun(game) {
248
295
),
249
296
Object_Action("Shop",
250
297
fun(t_game_time, t_simulation_time, t_game, t_obj){
251
- show_shop_menu(t_game, t_game_time, t_simulation_time, 80, 112, 85, 100);
298
+ show_shop_menu(t_game, true, t_game_time, t_simulation_time, 80, 112, 85, 100);
252
299
}
253
300
)
254
301
];
@@ -289,10 +336,35 @@ var game_creator = fun(game) {
289
336
var Christian_conversation_tree =
290
337
Conversation([
291
338
Question("Hello",
292
- [Answer("Christian", "Hi! Welcome to Glenn Haven.\nI've just opened up shop here.\nI think you'll like our prices on bread! ")],
339
+ [Answer("Christian", "Hi! Welcome to Fairview. ")],
293
340
fun(t_game_time, t_simulation_time, t_game, t_obj){ true },
294
341
fun(t_game_time, t_simulation_time, t_game, t_obj){ }
295
- )
342
+ ),
343
+ Question("Rumors",
344
+ [Answer("Christian", "Yes, I've heard the rumors too."),
345
+ Answer("Christian", "It's an unfortunate way to do business.")],
346
+ fun(t_game_time, t_simulation_time, t_game, t_obj){ t_game.get_flag("have_been_notified_of_rumors"); },
347
+ fun(t_game_time, t_simulation_time, t_game, t_obj){ }
348
+ ),
349
+ Question("What should I do?",
350
+ [Answer("Christian", "Don't retaliate. Rumor mongering is not the best way to do business.")],
351
+ fun(t_game_time, t_simulation_time, t_game, t_obj){ t_game.get_flag("have_been_notified_of_rumors"); },
352
+ fun(t_game_time, t_simulation_time, t_game, t_obj){ t_game.set_flag("have_talked_to_christian_about_rumors", true); }
353
+ ),
354
+ Question("What now?",
355
+ [Answer("Christian", "Romans 12:19 says, 'Friends, do not avenge yourselves;\ninstead, leave room for His wrath.\nFor it is written: Vengeance belongs to Me;\nI will repay, says the Lord.'"),
356
+ Answer("Christian", "I hope you didn't decide to take matters into your own hands.\nThat rarely works out well.")],
357
+ fun(t_game_time, t_simulation_time, t_game, t_obj){ did_make_all_responses(t_game); },
358
+ fun(t_game_time, t_simulation_time, t_game, t_obj){ t_game.set_flag("christian_shared_verse", true); }
359
+ ),
360
+ Question("Note",
361
+ [Answer("Christian", "Romans 12:19 says, 'Friends, do not avenge yourselves;\ninstead, leave room for His wrath.\nFor it is written: Vengeance belongs to Me;\nI will repay, says the Lord.'"),
362
+ Answer("Christian", "This you already know."),
363
+ Answer("Christian", "Romans 12:20 goes on to say 'But If your enemy is hungry,\nfeed him. If he is thirsty, give him something to drink.\nFor in so doing\nyou will be heaping fiery coals on his head.'"),
364
+ Answer("Christian", "This is the lesson you've learned today.")],
365
+ fun(t_game_time, t_simulation_time, t_game, t_obj){ t_game.get_flag("saw_note") },
366
+ fun(t_game_time, t_simulation_time, t_game, t_obj){ t_game.set_flag("christian_shared_second_verse", true); }
367
+ )
296
368
]);
297
369
298
370
var Christian_actions = fun[Christian_conversation_tree](t_game_time, t_simulation_time, t_game, t_obj){
@@ -311,7 +383,7 @@ var game_creator = fun(game) {
311
383
),
312
384
Object_Action("Shop",
313
385
fun(t_game_time, t_simulation_time, t_game, t_obj){
314
- show_shop_menu(t_game, t_game_time, t_simulation_time, 95, 100, 85, 93);
386
+ show_shop_menu(t_game, false, t_game_time, t_simulation_time, 95, 100, 85, 93);
315
387
}
316
388
)
317
389
];
@@ -336,26 +408,57 @@ var game_creator = fun(game) {
336
408
);
337
409
338
410
var mineralville = Tile_Map(game, "resources/Maps/mineralville.json", []);
411
+
412
+ var OldMan_conversation_tree =
413
+ Conversation([
414
+ Question("Rumors",
415
+ [Answer("OldMan", "You must be the new trader in town.\nYour competitor has been saying unflattering things about you."),
416
+ Answer("OldMan", "But you seem like a nice person... I'm not sure I believe them.")],
417
+ fun(t_game_time, t_simulation_time, t_game, t_obj){ true },
418
+ fun(t_game_time, t_simulation_time, t_game, t_obj){ t_game.set_flag("have_been_notified_of_rumors", true); }
419
+ ),
420
+ Question("What should I do?",
421
+ [Answer("OldMan", "Well, if it were me, I'd start spreading rumors of my own about them!\nYou have to fight for what you get.")],
422
+ fun(t_game_time, t_simulation_time, t_game, t_obj){ true },
423
+ fun(t_game_time, t_simulation_time, t_game, t_obj){ }
424
+ ),
425
+ Question("Note?",
426
+ [Answer("OldMan", "There's a note here from your competitor."),
427
+ Answer("OldMan", "It says he's sorry for starting those rumors about you, and promises to set things right")],
428
+ fun(t_game_time, t_simulation_time, t_game, t_obj) { !t_game.get_flag("saw_note") && did_make_all_responses(t_game) && did_say_something_nice(t_game) },
429
+ fun(t_game_time, t_simulation_time, t_game, t_obj) { t_game.set_flag("saw_note", true); }
430
+ ),
431
+ Question("Share bible verses you've learned.",
432
+ [Answer("OldMan", "Well that is interesting...")],
433
+ fun(t_game_time, t_simulation_time, t_game, t_obj) { t_game.get_flag("christian_shared_second_verse") },
434
+ fun(t_game_time, t_simulation_time, t_game, t_obj) { }
435
+ )
436
+ ]);
437
+
339
438
mineralville.add_enter_action(
340
- fun(t_game) {
341
- t_game.teleport_to_tile(9, 4);
439
+ fun[OldMan_conversation_tree](t_game) {
440
+ t_game.teleport_to_tile(2, 5);
441
+
442
+ if (!t_game.get_flag("have_been_notified_of_rumors")) {
443
+ t_game.show_message_box("You see an old man who has the look of someone who has\nspent many years living in a remote\nmountain town.");
444
+ t_game.show_message_box("OldMan: There's the person I've been hearing so much about!");
445
+ }
446
+
447
+ if (!t_game.get_flag("saw_note") && did_make_all_responses(t_game) && did_say_something_nice(t_game))
448
+ {
449
+ t_game.show_message_box("There's a note over here for you");
450
+ }
342
451
}
343
452
);
453
+
344
454
mineralville.set_collision_action("ExitSquare",
345
455
fun(t_game_time, t_simulation_time, t_game, t_obj, t_sprite) {
346
456
t_game.enter_map("world");
347
457
t_game.teleport_to_tile(14,5);
348
458
}
349
459
);
350
460
351
- var OldMan_conversation_tree =
352
- Conversation([
353
- Question("Hello",
354
- [Answer("OldMan", "Hi! Welcome to Glenn Haven.\nI've just opened up shop here.\nI think you'll like our prices on bread!")],
355
- fun(t_game_time, t_simulation_time, t_game, t_obj){ true },
356
- fun(t_game_time, t_simulation_time, t_game, t_obj){ }
357
- )
358
- ]);
461
+
359
462
360
463
var OldMan_actions = fun[OldMan_conversation_tree](t_game_time, t_simulation_time, t_game, t_obj){
361
464
return [
@@ -373,7 +476,7 @@ var game_creator = fun(game) {
373
476
),
374
477
Object_Action("Shop",
375
478
fun(t_game_time, t_simulation_time, t_game, t_obj){
376
- show_shop_menu(t_game, t_game_time, t_simulation_time, 100, 125, 95, 70);
479
+ show_shop_menu(t_game, false, t_game_time, t_simulation_time, 100, 125, 95, 70);
377
480
}
378
481
)
379
482
];
@@ -399,6 +502,9 @@ var game_creator = fun(game) {
399
502
var camp = Tile_Map(game, "resources/Maps/camp.json", []);
400
503
camp.add_enter_action(
401
504
fun(t_game) {
505
+ if (refusing_business(t_game)) {
506
+ t_game.show_message_box("We've decided to stop doing business with you because of your rumor spreading.");
507
+ }
402
508
t_game.teleport_to_tile(9, 4);
403
509
}
404
510
);
@@ -415,12 +521,34 @@ var game_creator = fun(game) {
415
521
[Answer("Twin1", "Hi! Welcome to Glenn Haven.\nI've just opened up shop here.\nI think you'll like our prices on bread!")],
416
522
fun(t_game_time, t_simulation_time, t_game, t_obj){ true },
417
523
fun(t_game_time, t_simulation_time, t_game, t_obj){ }
524
+ ),
525
+ Question("<spread rumors about competitor>",
526
+ [Answer("Twin2", "That's not a very nice thing to say...")],
527
+ fun(t_game_time, t_simulation_time, t_game, t_obj){
528
+ t_game.get_flag("have_talked_to_christian_about_rumors") && !t_game.get_flag("have_talked_to_Twin2"); },
529
+ fun(t_game_time, t_simulation_time, t_game, t_obj){
530
+ t_game.set_flag("have_talked_to_Twin2", true); t_game.set_flag("have_spread_rumors", true); }
531
+ ),
532
+ Question("<say something nice about competitor>",
533
+ [Answer("Twin2", "That's good to hear.")],
534
+ fun(t_game_time, t_simulation_time, t_game, t_obj){
535
+ t_game.get_flag("have_talked_to_christian_about_rumors") && !t_game.get_flag("have_talked_to_Twin2"); },
536
+ fun(t_game_time, t_simulation_time, t_game, t_obj){
537
+ t_game.set_flag("have_talked_to_Twin2", true); t_game.set_flag("have_said_something_nice", true); }
538
+ ),
539
+ Question("<say nothing about competitor>",
540
+ [],
541
+ fun(t_game_time, t_simulation_time, t_game, t_obj){
542
+ t_game.get_flag("have_talked_to_christian_about_rumors") && !t_game.get_flag("have_talked_to_Twin2"); },
543
+ fun(t_game_time, t_simulation_time, t_game, t_obj){
544
+ t_game.set_flag("have_talked_to_Twin2", true); t_game.set_flag("did_not_respond", true); }
418
545
)
546
+
419
547
]);
420
548
421
549
422
550
def camp_shop(t_game_time, t_simulation_time, t_game, t_obj) {
423
- show_shop_menu(t_game, t_game_time, t_simulation_time, 115, 147, 104, 84);
551
+ show_shop_menu(t_game, true, t_game_time, t_simulation_time, 115, 147, 104, 84);
424
552
}
425
553
426
554
var Twin1_actions = fun[Twin_conversation_tree](t_game_time, t_simulation_time, t_game, t_obj){
@@ -483,7 +611,7 @@ var game_creator = fun(game) {
483
611
484
612
game.add_start_action(
485
613
fun(t_game) {
486
- t_game.set_value("money", 500 );
614
+ t_game.set_value("money", 1000 );
487
615
var money = t_game.get_value("money");
488
616
t_game.show_message_box("Welcome to the game!\nYou have ${money} to start with.\nUse it wisely.");
489
617
t_game.add_queued_action(
0 commit comments