-
Notifications
You must be signed in to change notification settings - Fork 1
/
items.rkt
872 lines (829 loc) · 33.8 KB
/
items.rkt
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
#lang racket
(require "combat.rkt")
(require 2htdp/image)
(provide (all-defined-out))
;; Functions for item use animation
(define (use-consumable-1 i)
(append
(list
(place-image i 400 480
(bitmap/file "blankbackground.png"))
(place-image i 400 440
(bitmap/file "blankbackground.png"))
(place-image i 400 400
(bitmap/file "blankbackground.png"))
(place-image i 400 360
(bitmap/file "blankbackground.png"))
(place-image i 400 320
(bitmap/file "blankbackground.png"))
(place-image i 400 280
(bitmap/file "blankbackground.png"))
(place-image i 400 240
(bitmap/file "blankbackground.png"))
(place-image i 400 225
(bitmap/file "blankbackground.png"))
(place-image i 400 225
(bitmap/file "blankbackground.png"))
(place-image i 400 225
(bitmap/file "blankbackground.png")))
(draw-bubble 40 (make-posn 400 225) i)
(draw-bubble 40 (make-posn 400 225) i)))
(define (use-consumable-2 i)
(append
(list
(place-image i 400 480
(bitmap/file "blankbackground.png"))
(place-image i 400 440
(bitmap/file "blankbackground.png"))
(place-image i 400 400
(bitmap/file "blankbackground.png"))
(place-image i 400 360
(bitmap/file "blankbackground.png"))
(place-image i 400 320
(bitmap/file "blankbackground.png"))
(place-image i 400 280
(bitmap/file "blankbackground.png"))
(place-image i 400 240
(bitmap/file "blankbackground.png"))
(place-image i 400 225
(bitmap/file "blankbackground.png"))
(place-image i 400 225
(bitmap/file "blankbackground.png"))
(place-image i 400 225
(bitmap/file "blankbackground.png")))
(draw-bubble 40 (make-posn 400 225) i)
(draw-bubble 40 (make-posn 400 225) i)
(draw-bubble 40 (make-posn 400 225) i)))
(define (use-consumable-3 i)
(append
(list
(place-image i 400 480
(bitmap/file "blankbackground.png"))
(place-image i 400 440
(bitmap/file "blankbackground.png"))
(place-image i 400 400
(bitmap/file "blankbackground.png"))
(place-image i 400 360
(bitmap/file "blankbackground.png"))
(place-image i 400 320
(bitmap/file "blankbackground.png"))
(place-image i 400 280
(bitmap/file "blankbackground.png"))
(place-image i 400 240
(bitmap/file "blankbackground.png"))
(place-image i 400 225
(bitmap/file "blankbackground.png"))
(place-image i 400 225
(bitmap/file "blankbackground.png"))
(place-image i 400 225
(bitmap/file "blankbackground.png")))
(draw-bubble 40 (make-posn 400 225) i)
(draw-bubble 40 (make-posn 400 225) i)
(draw-bubble 40 (make-posn 400 225) i)
(draw-bubble 40 (make-posn 400 225) i)))
(define (npc-use-consumable-1 i)
(append
(list
(place-image i 400 480
(bitmap/file "blankbackground.png"))
(place-image i 400 440
(bitmap/file "blankbackground.png"))
(place-image i 400 400
(bitmap/file "blankbackground.png"))
(place-image i 400 360
(bitmap/file "blankbackground.png"))
(place-image i 400 320
(bitmap/file "blankbackground.png"))
(place-image i 400 280
(bitmap/file "blankbackground.png"))
(place-image i 400 240
(bitmap/file "blankbackground.png"))
(place-image i 400 225
(bitmap/file "blankbackground.png"))
(place-image i 400 225
(bitmap/file "blankbackground.png"))
(place-image i 400 225
(bitmap/file "blankbackground.png")))
(draw-npc-bubble 40 (make-posn 400 225) i)
(draw-npc-bubble 40 (make-posn 400 225) i)))
(define (npc-use-consumable-2 i)
(append
(list
(place-image i 400 480
(bitmap/file "blankbackground.png"))
(place-image i 400 440
(bitmap/file "blankbackground.png"))
(place-image i 400 400
(bitmap/file "blankbackground.png"))
(place-image i 400 360
(bitmap/file "blankbackground.png"))
(place-image i 400 320
(bitmap/file "blankbackground.png"))
(place-image i 400 280
(bitmap/file "blankbackground.png"))
(place-image i 400 240
(bitmap/file "blankbackground.png"))
(place-image i 400 225
(bitmap/file "blankbackground.png"))
(place-image i 400 225
(bitmap/file "blankbackground.png"))
(place-image i 400 225
(bitmap/file "blankbackground.png")))
(draw-npc-bubble 40 (make-posn 400 225) i)
(draw-npc-bubble 40 (make-posn 400 225) i)
(draw-npc-bubble 40 (make-posn 400 225) i)))
(define (npc-use-consumable-3 i)
(append
(list
(place-image i 400 480
(bitmap/file "blankbackground.png"))
(place-image i 400 440
(bitmap/file "blankbackground.png"))
(place-image i 400 400
(bitmap/file "blankbackground.png"))
(place-image i 400 360
(bitmap/file "blankbackground.png"))
(place-image i 400 320
(bitmap/file "blankbackground.png"))
(place-image i 400 280
(bitmap/file "blankbackground.png"))
(place-image i 400 240
(bitmap/file "blankbackground.png"))
(place-image i 400 225
(bitmap/file "blankbackground.png"))
(place-image i 400 225
(bitmap/file "blankbackground.png"))
(place-image i 400 225
(bitmap/file "blankbackground.png")))
(draw-npc-bubble 40 (make-posn 400 225) i)
(draw-npc-bubble 40 (make-posn 400 225) i)
(draw-npc-bubble 40 (make-posn 400 225) i)
(draw-npc-bubble 40 (make-posn 400 225) i)))
(define (draw-bubble n p i)
(cond
[(= (posn-x p) 680) empty]
[else
(cons
(place-image i 400 225
(place-image (scale .5 (bitmap/file "bubble.png"))
(posn-x p) (posn-y p)
(bitmap/file "blankbackground.png")))
(draw-bubble n (make-posn
(+ (posn-x p) n)
(posn-y p)) i))]))
(define (draw-npc-bubble n p i)
(cond
[(<= (posn-x p) 120) empty]
[else
(cons
(place-image i 400 225
(place-image (scale .5 (bitmap/file "bubble.png"))
(posn-x p) (posn-y p)
(bitmap/file "blankbackground.png")))
(draw-npc-bubble n (make-posn
(- (posn-x p) n)
(posn-y p)) i))]))
(define (flip-everything l)
(cond
[(empty? l) empty]
[(cons? l)
(cons (flip-horizontal (first l))
(flip-everything (rest l)))]))
;; Consumables -------------------------------------------------------------------------------------------
;; player ---------------------------------------------
(define HEALING-1
(new consumable%
[name "Potion_of_Minor_Healing"]
[description "Restores 20 points of HP"]
[image (scale .7 (bitmap/file "health1.png"))]
[value 5]
[effect (lambda (c)
(new player%
[name (send c get-name)] [health (if (>= (+ (send c get-health) 20) (send c get-max-health))
(send c get-max-health) (+ 2 (send c get-health)))]
[max-health (send c get-max-health)] [base-agility (send c get-base-agility)]
[agility (send c get-agility)] [base-strength (send c get-base-strength)]
[strength (send c get-strength)] [spells (send c get-spells)]
[character-inventory (send c get-inventory)] [weakness (send c get-weakness)]
[resistance (send c get-resistance)] [animation (send c get-animation)]
[position (send c get-position)] [map-animation (send c get-map-animation)]
[dir (send c get-dir)] [level (send c get-level)] [max-mp (send c get-max-mp)]
[mp (send c get-mp)] [current-xp (send c get-current-xp)]))]
[animation (use-consumable-1 (scale .7 (bitmap/file "health1.png")))]
[number 1]))
(define HEALING-2
(new consumable%
[name "Potion_of_Moderate_Healing"]
[description "Restores 50 points of HP"]
[image (scale .7 (bitmap/file "health2.png"))]
[value 20]
[effect (lambda (c)
(new player%
[name (send c get-name)] [health (if (>= (+ (send c get-health) 50) (send c get-max-health))
(send c get-max-health) (+ 50 (send c get-health)))]
[max-health (send c get-max-health)] [base-agility (send c get-base-agility)]
[agility (send c get-agility)] [base-strength (send c get-base-strength)]
[strength (send c get-strength)] [spells (send c get-spells)]
[character-inventory (send c get-inventory)] [weakness (send c get-weakness)]
[resistance (send c get-resistance)] [animation (send c get-animation)]
[position (send c get-position)] [map-animation (send c get-map-animation)]
[dir (send c get-dir)] [level (send c get-level)] [max-mp (send c get-max-mp)]
[mp (send c get-mp)] [current-xp (send c get-current-xp)]))]
[animation (use-consumable-2 (scale .7 (bitmap/file "health2.png")))]
[number 1]))
(define HEALING-3
(new consumable%
[name "Potion_of_Ultimate_Healing"]
[description "Fully restores health"]
[image (scale .7 (bitmap/file "health3.png"))]
[value 100]
[effect (lambda (c)
(new player%
[name (send c get-name)] [health (send c get-max-health)]
[max-health (send c get-max-health)] [base-agility (send c get-base-agility)]
[agility (send c get-agility)] [base-strength (send c get-base-strength)]
[strength (send c get-strength)] [spells (send c get-spells)]
[character-inventory (send c get-inventory)] [weakness (send c get-weakness)]
[resistance (send c get-resistance)] [animation (send c get-animation)]
[position (send c get-position)] [map-animation (send c get-map-animation)]
[dir (send c get-dir)] [level (send c get-level)] [max-mp (send c get-max-mp)]
[mp (send c get-mp)] [current-xp (send c get-current-xp)]))]
[animation (use-consumable-3 (scale .7 (bitmap/file "health3.png")))]
[number 1]))
(define MP-1
(new consumable%
[name "Minor_MP_Potion"]
[description "Restores 5 points of MP"]
[image (scale .7 (bitmap/file "mp1.png"))]
[value 10]
[effect (lambda (c)
(new player%
[name (send c get-name)] [health (send c get-health)]
[max-health (send c get-max-health)] [base-agility (send c get-base-agility)]
[agility (send c get-agility)] [base-strength (send c get-base-strength)]
[strength (send c get-strength)] [spells (send c get-spells)]
[character-inventory (send c get-inventory)] [weakness (send c get-weakness)]
[resistance (send c get-resistance)] [animation (send c get-animation)]
[position (send c get-position)] [map-animation (send c get-map-animation)]
[dir (send c get-dir)] [level (send c get-level)] [max-mp (send c get-max-mp)]
[mp (if (>= (+ (send c get-mp) 5) (send c get-max-mp))
(send c get-max-mp) (+ 5 (send c get-mp)))]
[current-xp (send c get-current-xp)]))]
[animation (use-consumable-1 (scale .7 (bitmap/file "mp1.png")))]
[number 1]))
(define MP-2
(new consumable%
[name "MP_Potion"]
[description "Restores 15 points of MP"]
[image (scale .7 (bitmap/file "mp2.png"))]
[value 40]
[effect (lambda (c)
(new player%
[name (send c get-name)] [health (send c get-health)]
[max-health (send c get-max-health)] [base-agility (send c get-base-agility)]
[agility (send c get-agility)] [base-strength (send c get-base-strength)]
[strength (send c get-strength)] [spells (send c get-spells)]
[character-inventory (send c get-inventory)] [weakness (send c get-weakness)]
[resistance (send c get-resistance)] [animation (send c get-animation)]
[position (send c get-position)] [map-animation (send c get-map-animation)]
[dir (send c get-dir)] [level (send c get-level)] [max-mp (send c get-max-mp)]
[mp (if (>= (+ (send c get-mp) 15) (send c get-max-mp))
(send c get-max-mp) (+ 15 (send c get-mp)))]
[current-xp (send c get-current-xp)]))]
[animation (use-consumable-2 (scale .7 (bitmap/file "mp2.png")))]
[number 1]))
(define MP-3
(new consumable%
[name "MP_Potion"]
[description "Fully restores MP"]
[image (scale .7 (bitmap/file "mp3.png"))]
[value 80]
[effect (lambda (c)
(new player%
[name (send c get-name)] [health (send c get-health)]
[max-health (send c get-max-health)] [base-agility (send c get-base-agility)]
[agility (send c get-agility)] [base-strength (send c get-base-strength)]
[strength (send c get-strength)] [spells (send c get-spells)]
[character-inventory (send c get-inventory)] [weakness (send c get-weakness)]
[resistance (send c get-resistance)] [animation (send c get-animation)]
[position (send c get-position)] [map-animation (send c get-map-animation)]
[dir (send c get-dir)] [level (send c get-level)] [max-mp (send c get-max-mp)]
[mp (send c get-max-mp)]
[current-xp (send c get-current-xp)]))]
[animation (use-consumable-3 (scale .7 (bitmap/file "mp3.png")))]
[number 1]))
(define NOB-CURE
(new consumable%
[name "Noble_Cure"]
[description "Restores 50 HP and 15 MP"]
[image (scale .7 (bitmap/file "cure1.png"))]
[value 200]
[effect (lambda (c)
(new player%
[name (send c get-name)] [health (if (>= (+ (send c get-health) 50) (send c get-max-health))
(send c get-max-health) (+ 50 (send c get-health)))]
[max-health (send c get-max-health)] [base-agility (send c get-base-agility)]
[agility (send c get-agility)] [base-strength (send c get-base-strength)]
[strength (send c get-strength)] [spells (send c get-spells)]
[character-inventory (send c get-inventory)] [weakness (send c get-weakness)]
[resistance (send c get-resistance)] [animation (send c get-animation)]
[position (send c get-position)] [map-animation (send c get-map-animation)]
[dir (send c get-dir)] [level (send c get-level)] [max-mp (send c get-max-mp)]
[mp (if (>= (+ (send c get-mp) 15) (send c get-max-mp))
(send c get-max-mp) (+ 15 (send c get-mp)))]
[current-xp (send c get-current-xp)]))]
[animation (use-consumable-3 (scale .7 (bitmap/file "cure1.png")))]
[number 1]))
(define DIV-CURE
(new consumable%
[name "Divine_Cure"]
[description "Fully restores HP and MP"]
[image (scale .7 (bitmap/file "cure2.png"))]
[value 500]
[effect (lambda (c)
(new player%
[name (send c get-name)] [health (send c get-max-health)]
[max-health (send c get-max-health)] [base-agility (send c get-base-agility)]
[agility (send c get-agility)] [base-strength (send c get-base-strength)]
[strength (send c get-strength)] [spells (send c get-spells)]
[character-inventory (send c get-inventory)] [weakness (send c get-weakness)]
[resistance (send c get-resistance)] [animation (send c get-animation)]
[position (send c get-position)] [map-animation (send c get-map-animation)]
[dir (send c get-dir)] [level (send c get-level)] [max-mp (send c get-max-mp)]
[mp (send c get-max-mp)]
[current-xp (send c get-current-xp)]))]
[animation (use-consumable-3 (scale .7 (bitmap/file "cure2.png")))]
[number 1]))
(define MYS
(new consumable%
[name "Mystery_Liquid"]
[description "???"]
[image (scale .7 (bitmap/file "mystery.png"))]
[value 150]
[effect (lambda (c)
(new player%
[name (send c get-name)] [health (random (send c get-max-health))]
[max-health (send c get-max-health)] [base-agility (send c get-base-agility)]
[agility (send c get-agility)] [base-strength (send c get-base-strength)]
[strength (send c get-strength)] [spells (send c get-spells)]
[character-inventory (send c get-inventory)] [weakness (send c get-weakness)]
[resistance (send c get-resistance)] [animation (send c get-animation)]
[position (send c get-position)] [map-animation (send c get-map-animation)]
[dir (send c get-dir)] [level (send c get-level)] [max-mp (send c get-max-mp)]
[mp (random (send c get-max-mp))]
[current-xp (send c get-current-xp)]))]
[animation (use-consumable-3 (scale .7 (bitmap/file "cure2.png")))]
[number 1]))
(define STRENGTH-P
(new consumable%
[name "Strength_Potion"]
[description "Temporarily increases your strength"]
[image (scale .7 (bitmap/file "strength.png"))]
[value 100]
[effect (lambda (c)
(new player%
[name (send c get-name)] [health (send c get-health)]
[max-health (send c get-max-health)] [base-agility (send c get-base-agility)]
[agility (send c get-agility)] [base-strength (send c get-base-strength)]
[strength (+ (round (* .1 (send c get-strength))) (send c get-strength))] [spells (send c get-spells)]
[character-inventory (send c get-inventory)] [weakness (send c get-weakness)]
[resistance (send c get-resistance)] [animation (send c get-animation)]
[position (send c get-position)] [map-animation (send c get-map-animation)]
[dir (send c get-dir)] [level (send c get-level)] [max-mp (send c get-max-mp)]
[mp (send c get-mp)]
[current-xp (send c get-current-xp)]))]
[animation (use-consumable-1 (scale .7 (bitmap/file "strength.png")))]
[number 1]))
(define AGILITY-P
(new consumable%
[name "Agility_Potion"]
[description "Temporarily increases your agility"]
[image (scale .7 (bitmap/file "agility.png"))]
[value 100]
[effect (lambda (c)
(new player%
[name (send c get-name)] [health (send c get-health)]
[max-health (send c get-max-health)] [base-agility (send c get-base-agility)]
[agility (+ (round (* .1 (send c get-agility))) (send c get-agility))]
[base-strength (send c get-base-strength)]
[strength (send c get-strength)] [spells (send c get-spells)]
[character-inventory (send c get-inventory)] [weakness (send c get-weakness)]
[resistance (send c get-resistance)] [animation (send c get-animation)]
[position (send c get-position)] [map-animation (send c get-map-animation)]
[dir (send c get-dir)] [level (send c get-level)] [max-mp (send c get-max-mp)]
[mp (send c get-mp)]
[current-xp (send c get-current-xp)]))]
[animation (use-consumable-1 (scale .7 (bitmap/file "agility.png")))]
[number 1]))
(define MAGIC-POTION
(new consumable%
[name "MagicPotion"]
[description "Fully restores MP."]
[image (bitmap/file "magic-potion.gif")]
[value 10]
[effect (lambda (c)
(new player%
[name (send c get-name)] [health (send c get-health)]
[max-health (send c get-max-health)] [base-agility (send c get-base-agility)]
[agility (send c get-agility)] [base-strength (send c get-base-strength)]
[strength (send c get-strength)] [spells (send c get-spells)]
[character-inventory (send c get-inventory)] [weakness (send c get-weakness)]
[resistance (send c get-resistance)] [animation (send c get-animation)]
[position (send c get-position)] [map-animation (send c get-map-animation)]
[dir (send c get-dir)] [level (send c get-level)] [max-mp (send c get-max-mp)]
[mp (send c get-max-mp)] [current-xp (send c get-current-xp)]))]
[animation (use-consumable-1 (bitmap/file "magic-potion.gif"))]
[number 3]))
(define HEALING-POTION
(new consumable%
[name "HealthPotion"]
[description "+ 25 health"]
[image (bitmap/file "health-potion.gif")]
[value 10]
[effect (lambda (c)
(new player%
[name (send c get-name)] [health (if (>= (+ (send c get-health) 25) (send c get-max-health))
(send c get-max-health) (+ 25 (send c get-health)))]
[max-health (send c get-max-health)] [base-agility (send c get-base-agility)]
[agility (send c get-agility)] [base-strength (send c get-base-strength)]
[strength (send c get-strength)] [spells (send c get-spells)]
[character-inventory (send c get-inventory)] [weakness (send c get-weakness)]
[resistance (send c get-resistance)] [animation (send c get-animation)]
[position (send c get-position)] [map-animation (send c get-map-animation)]
[dir (send c get-dir)] [level (send c get-level)] [max-mp (send c get-max-mp)]
[mp (send c get-mp)] [current-xp (send c get-current-xp)]))]
[animation (use-consumable-1 (bitmap/file "health-potion.gif"))]
[number 3]))
;; npc ---------------------------------------------
(define HEALING-PHILTER
(new consumable%
[name "HealingPhilter"]
[description "Fully restores health"]
[image (square 20 'solid 'white)]
[value 10]
[effect (lambda (c)
(new npc%
[name (send c get-name)] [health (send c get-max-health)]
[max-health (send c get-max-health)] [base-agility (send c get-base-agility)]
[agility (send c get-agility)] [base-strength (send c get-base-strength)]
[strength (send c get-strength)] [spells (send c get-spells)]
[character-inventory (send c get-inventory)] [weakness (send c get-weakness)]
[resistance (send c get-resistance)] [animation (send c get-animation)]
[position (send c get-position)] [dir (send c get-dir)] [diologue (send c get-diologue)]
[map-animation (send c get-map-animation)] [xp-award (send c get-xp-award)]))]
[animation (npc-use-consumable-3 (bitmap/file "health-potion.gif"))]
[number 1]))
;; Weapons ------------------------------------------------------------------------------------------------
(define WALKING-STICK
(new weapon%
[name "Walking_Stick"]
[description "Not really a weapon"]
[value 1]
[weapon-damage 1]
[weapon-accuracy .95]
[type 'wood]
[image (square 20 'solid 'white)]))
(define PRACTICE-SWORD
(new weapon%
[name "Practice_Sword"]
[description "A wooden practice sword"]
[value 10]
[weapon-damage 5]
[weapon-accuracy .95]
[type 'wood]
[image (square 20 'solid 'white)]))
(define OASIS-BLADE
(new weapon%
[name "Oasis_Blade"]
[description "A dagger forged from a farming implement"]
[value 25]
[weapon-damage 10]
[weapon-accuracy .95]
[type 'metal]
[image (square 20 'solid 'white)]))
(define JANBIYA
(new weapon%
[name "Janbiya"]
[description "A deadly curved dagger"]
[value 50]
[weapon-damage 15]
[weapon-accuracy .95]
[type 'metal]
[image (square 20 'solid 'white)]))
(define SWORD-CANE
(new weapon%
[name "Sword-Cane"]
[description "A small sword hidden in a cane"]
[value 150]
[weapon-damage 25]
[weapon-accuracy .95]
[type 'metal]
[image (square 20 'solid 'white)]))
(define MACHETE
(new weapon%
[name "Machete"]
[description "A heavy steel machete"]
[value 250]
[weapon-damage 35]
[weapon-accuracy .8]
[type 'metal]
[image (square 20 'solid 'white)]))
(define SWORD
(new weapon%
[name "Steel_Sword"]
[description "A sturdy one-handed steel sword."]
[value 500]
[weapon-damage 50]
[weapon-accuracy .9]
[type 'metal]
[image (square 20 'solid 'white)]))
(define KATANA
(new weapon%
[name "Katana"]
[description "A long curved sword"]
[value 750]
[weapon-damage 70]
[weapon-accuracy .85]
[type 'metal]
[image (square 20 'solid 'white)]))
(define CLAYMORE
(new weapon%
[name "Claymore"]
[description "A really big sword"]
[value 1000]
[weapon-damage 100]
[weapon-accuracy .8]
[type 'metal]
[image (square 20 'solid 'white)]))
(define STAFF
(new weapon%
[name "WoodStaff"]
[description "A flimsy wooden quarterstaff."]
[value 10]
[weapon-damage 5]
[weapon-accuracy 1]
[type 'wood]
[image (square 20 'solid 'white)]))
;; Armor -------------------------------------------------------------------------------------------------
(define PLAIN-HAT
(new equipment%
[name "Plain_Hat"]
[description "An unasuming felt hat"]
[image (circle 20 'solid 'white)]
[value 5]
[defence 1]
[equipment-portion 'h]))
(define FANCY-HAT
(new equipment%
[name "Fancy_Hat"]
[description "An fancy hat with a fether"]
[image (circle 20 'solid 'white)]
[value 100]
[defence 20]
[equipment-portion 'h]))
(define RUSTY-HELM
(new equipment%
[name "Rusty_Helm"]
[description "An old, rusty greathelm"]
[image (scale .7 (bitmap/file "steel-helm.png"))]
[value 500]
[defence 30]
[equipment-portion 'h]))
(define STEEL-HELM
(new equipment%
[name "Steel_Helm"]
[description "A heavy steel greathelm"]
[image (scale .7 (bitmap/file "steel-helm.png"))]
[value 750]
[defence 50]
[equipment-portion 'h]))
(define SMILING-MASK
(new equipment%
[name "Smiling_Mask"]
[description "A wooden mask with a smiling face"]
[image (square 20 'solid 'black)]
[value 5]
[defence 1]
[equipment-portion 'h]))
(define NEUTRAL-MASK
(new equipment%
[name "Neutral_Mask"]
[description "A wooden mask with a neutral face"]
[image (square 20 'solid 'black)]
[value 5]
[defence 1]
[equipment-portion 'h]))
(define FROWNING-MASK
(new equipment%
[name "Scowling_Mask"]
[description "A wooden mask with a frowning face"]
[image (scale .7 (bitmap/file "mask1.png"))]
[value 5]
[defence 1]
[equipment-portion 'h]))
(define HELMET
(new equipment%
[name "SteelHelmet"]
[description "A sturdy steel helmet"]
[image (circle 10 'solid 'gray)]
[value 50]
[defence 10]
[equipment-portion 'h]))
(define HAT
(new equipment%
[name "WoolHat"]
[description "A warm woolen hat"]
[image (circle 10 'solid 'gray)]
[value 5]
[defence 1]
[equipment-portion 'h]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define COAT
(new equipment%
[name "Fantasy_Trenchcoat"]
[description "Now you look like a detective"]
[image (scale .7 (bitmap/file "coat.png"))]
[value 20]
[defence 1]
[equipment-portion 'b]))
(define DRESS
(new equipment%
[name "Fancy_Dress"]
[description "A fancy and expensive dress"]
[image (circle 10 'solid 'gray)]
[value 200]
[defence 5]
[equipment-portion 'b]))
(define RUSTY-MAIL
(new equipment%
[name "Chain_Mail"]
[description "Old, rusty chain mail"]
[image (scale .7 (bitmap/file "mail.png"))]
[value 250]
[defence 25]
[equipment-portion 'b]))
(define MAIL
(new equipment%
[name "Chain_Mail"]
[description "Strong steel chain mail"]
[image (scale .7 (bitmap/file "mail.png"))]
[value 500]
[defence 50]
[equipment-portion 'b]))
(define RUSTY-BRESTPLATE
(new equipment%
[name "Rusty_Brestplate"]
[description "An old, rusty brestplate"]
[image (scale .7 (bitmap/file "steel-brestplate.png"))]
[value 750]
[defence 70]
[equipment-portion 'b]))
(define STEEL-BRESTPLATE
(new equipment%
[name "Steel_Brestplate"]
[description "A sturdy steel brestplate"]
[image (scale .7 (bitmap/file "steel-brestplate.png"))]
[value 1000]
[defence 100]
[equipment-portion 'b]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define BOOTS
(new equipment%
[name "Leather_Boots"]
[description "Good for keeping your feet dry"]
[image (circle 10 'solid 'gray)]
[value 20]
[defence 1]
[equipment-portion 'l]))
(define MAGIC-SHOES
(new equipment%
[name "Magic_Shoes"]
[description "They defend your feet with magic"]
[image (scale .7 (bitmap/file "shoe.png"))]
[value 100]
[defence 15]
[equipment-portion 'l]))
(define RUSTY-GRIEVES
(new equipment%
[name "Rusty_Iron_Grieves"]
[description "Rusty grieves made of iron"]
[image (scale .7 (bitmap/file "grievs.png"))]
[value 200]
[defence 20]
[equipment-portion 'l]))
(define IRON-GRIEVES
(new equipment%
[name "Iron_Grieves"]
[description "Grieves made of iron"]
[image (scale .7 (bitmap/file "grievs.png"))]
[value 300]
[defence 30]
[equipment-portion 'l]))
(define STEEL-BOOTS
(new equipment%
[name "SteelBoots"]
[description "Surprisingly heavy"]
[image (scale .7 (bitmap/file "steel-boots.png"))]
[value 500]
[defence 40]
[equipment-portion 'l]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define MITTENS
(new equipment%
[name "Fuzzy_Mittens"]
[description "Good for snowball fights"]
[image (scale .7 (bitmap/file "mittens.png"))]
[value 20]
[defence 1]
[equipment-portion 'a]))
(define GLOVES
(new equipment%
[name "Leather_Gloves"]
[description "Thick leather gloves"]
[image (scale .7 (bitmap/file "gloves.png"))]
[value 50]
[defence 5]
[equipment-portion 'a]))
(define RUSTY-GAUNTLETS
(new equipment%
[name "Rusty_Gauntlets"]
[description "Old, rusty steel gauntlets"]
[image (scale .7 (bitmap/file "gauntlets.png"))]
[value 300]
[defence 25]
[equipment-portion 'a]))
(define GAUNTLETS
(new equipment%
[name "Steel_Gauntlets"]
[description "Sturdy steel gauntlets"]
[image (scale .7 (bitmap/file "gauntlets.png"))]
[value 500]
[defence 40]
[equipment-portion 'a]))
;; Gold --------------------------------------------------------------------------------------------------
;; add-gold number --> makes n many gold
(define (add-gold n)
(new gold%
[name "Gold"]
[description "The coin of the relm."]
[image (circle 10 'solid 'gold)]
[value 0]
[number n]))
;; --------------------------------------------------------------------------------------------------------
(define ITEM-DIRECTORY
(list
;; weapons
WALKING-STICK
PRACTICE-SWORD
OASIS-BLADE
JANBIYA
SWORD-CANE
MACHETE
SWORD
KATANA
CLAYMORE
STAFF
;; consumables
HEALING-1
HEALING-2
HEALING-3
MP-1
MP-2
MP-3
AGILITY-P
STRENGTH-P
MYS
NOB-CURE
DIV-CURE
MAGIC-POTION
HEALING-POTION
;; head armor
PLAIN-HAT
FANCY-HAT
RUSTY-HELM
STEEL-HELM
HAT
HELMET
SMILING-MASK
NEUTRAL-MASK
FROWNING-MASK
;; body armor
COAT
DRESS
RUSTY-MAIL
MAIL
RUSTY-BRESTPLATE
STEEL-BRESTPLATE
;; arm armor
MITTENS
GLOVES
RUSTY-GAUNTLETS
GAUNTLETS
;; leg armor
BOOTS
MAGIC-SHOES
RUSTY-GRIEVES
IRON-GRIEVES
STEEL-BOOTS
;; misc (not gold)
))