-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathtoys.dm
1817 lines (1573 loc) · 55.9 KB
/
toys.dm
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
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* Toys!
* Contains
* Balloons
* Fake singularity
* Toy gun
* Toy crossbow
* Toy swords
* Crayons
* Snap pops
* Mech prizes
* AI core prizes
* Toy codex gigas
* Skeleton toys
* Cards
* Toy nuke
* Fake meteor
* Foam armblade
* Toy big red button
* Beach ball
* Toy xeno
* Kitty toys!
* Snowballs
* Clockwork Watches
* Toy Daggers
* Turn Tracker
* ceremonial Rod of Asclepius
* cult sickles
*/
/obj/item/toy
throwforce = 0
throw_speed = 3
throw_range = 7
force = 0
/*
* Balloons
*/
/obj/item/toy/balloon
name = "water balloon"
desc = "A translucent balloon. There's nothing in it."
icon = 'icons/obj/toy.dmi'
icon_state = "waterballoon-e"
item_state = "balloon-empty"
/obj/item/toy/balloon/Initialize(mapload)
. = ..()
create_reagents(10)
/obj/item/toy/balloon/attack(mob/living/carbon/human/M, mob/user)
return
/obj/item/toy/balloon/afterattack(atom/A as mob|obj, mob/user, proximity)
. = ..()
if(!proximity)
return
if (istype(A, /obj/structure/reagent_dispensers))
var/obj/structure/reagent_dispensers/RD = A
if(RD.reagents.total_volume <= 0)
to_chat(user, span_warning("[RD] is empty."))
else if(reagents.total_volume >= 10)
to_chat(user, span_warning("[src] is full."))
else
A.reagents.trans_to(src, 10, transfered_by = user)
to_chat(user, span_notice("You fill the balloon with the contents of [A]."))
desc = "A translucent balloon with some form of liquid sloshing around in it."
update_appearance(UPDATE_ICON)
/obj/item/toy/balloon/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/reagent_containers/glass))
if(I.reagents)
if(I.reagents.total_volume <= 0)
to_chat(user, span_warning("[I] is empty."))
else if(reagents.total_volume >= 10)
to_chat(user, span_warning("[src] is full."))
else
desc = "A translucent balloon with some form of liquid sloshing around in it."
to_chat(user, span_notice("You fill the balloon with the contents of [I]."))
I.reagents.trans_to(src, 10, transfered_by = user)
update_appearance(UPDATE_ICON)
else if(I.is_sharp())
balloon_burst()
else
return ..()
/obj/item/toy/balloon/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(!..()) //was it caught by a mob?
balloon_burst(hit_atom)
/obj/item/toy/balloon/proc/balloon_burst(atom/AT)
if(reagents.total_volume >= 1)
var/turf/T
if(AT)
T = get_turf(AT)
else
T = get_turf(src)
T.visible_message(span_danger("[src] bursts!"),span_italics("You hear a pop and a splash."))
reagents.reaction(T)
for(var/atom/A in T)
reagents.reaction(A)
icon_state = "burst"
qdel(src)
/obj/item/toy/balloon/update_icon_state()
. = ..()
if(src.reagents.total_volume >= 1)
icon_state = "waterballoon"
item_state = "balloon"
else
icon_state = "waterballoon-e"
item_state = "balloon-empty"
/obj/item/toy/syndicateballoon
name = "syndicate balloon"
desc = "There is a tag on the back that reads \"FUK NT!11!\"."
throwforce = 0
throw_speed = 3
throw_range = 7
force = 0
icon = 'icons/obj/toy.dmi'
icon_state = "syndballoon"
item_state = "syndballoon"
lefthand_file = 'icons/mob/inhands/antag/balloons_lefthand.dmi'
righthand_file = 'icons/mob/inhands/antag/balloons_righthand.dmi'
w_class = WEIGHT_CLASS_BULKY
/obj/item/toy/mballoon
name = "toy mballoon"
desc = "A blue balloon, it looks.. mentory?"
throwforce = 0
throw_speed = 3
throw_range = 7
force = 0
icon = 'icons/obj/toy.dmi'
icon_state = "mballoon"
item_state = "mballoon"
lefthand_file = 'icons/mob/inhands/antag/balloons_lefthand.dmi'
righthand_file = 'icons/mob/inhands/antag/balloons_righthand.dmi'
w_class = WEIGHT_CLASS_BULKY
/obj/item/toy/syndicateballoon/pickup(mob/user)
. = ..()
if(user && user.mind && user.mind.has_antag_datum(/datum/antagonist, TRUE))
SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "badass_antag", /datum/mood_event/badass_antag)
/obj/item/toy/syndicateballoon/dropped(mob/user)
if(user)
SEND_SIGNAL(user, COMSIG_CLEAR_MOOD_EVENT, "badass_antag", /datum/mood_event/badass_antag)
. = ..()
/obj/item/toy/syndicateballoon/Destroy()
if(ismob(loc))
var/mob/M = loc
SEND_SIGNAL(M, COMSIG_CLEAR_MOOD_EVENT, "badass_antag", /datum/mood_event/badass_antag)
. = ..()
/*
* Fake singularity
*/
/obj/item/toy/spinningtoy
name = "gravitational singularity"
desc = "\"Singulo\" brand spinning toy."
icon = 'icons/obj/singularity.dmi'
icon_state = "singularity_s1"
/*
* Toy gun: Why isnt this an /obj/item/gun?
*/
/obj/item/toy/gun
name = "cap gun"
desc = "Looks almost like the real thing! Ages 8 and up. Please recycle in an autolathe when you're out of caps."
icon = 'icons/obj/guns/projectile.dmi'
icon_state = "revolver"
item_state = "gun"
lefthand_file = 'icons/mob/inhands/weapons/guns_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/guns_righthand.dmi'
flags_1 = CONDUCT_1
slot_flags = ITEM_SLOT_BELT
w_class = WEIGHT_CLASS_NORMAL
materials = list(/datum/material/iron=10, /datum/material/glass=10)
attack_verb = list("struck", "pistol whipped", "hit", "bashed")
var/bullets = 7
/obj/item/toy/gun/examine(mob/user)
. = ..()
. += "There [bullets == 1 ? "is" : "are"] [bullets] cap\s left."
/obj/item/toy/gun/attackby(obj/item/toy/ammo/gun/A, mob/user, params)
if(istype(A, /obj/item/toy/ammo/gun))
if (src.bullets >= 7)
to_chat(user, span_warning("It's already fully loaded!"))
return 1
if (A.amount_left <= 0)
to_chat(user, span_warning("There are no more caps!"))
return 1
if (A.amount_left < (7 - src.bullets))
src.bullets += A.amount_left
to_chat(user, span_notice("You reload [A.amount_left] cap\s."))
A.amount_left = 0
else
to_chat(user, span_notice("You reload [7 - src.bullets] cap\s."))
A.amount_left -= 7 - src.bullets
src.bullets = 7
A.update_appearance(UPDATE_ICON)
return 1
else
return ..()
/obj/item/toy/gun/afterattack(atom/target as mob|obj|turf|area, mob/user, flag)
. = ..()
if (flag)
return
if (!user.IsAdvancedToolUser())
to_chat(user, span_warning("You don't have the dexterity to do this!"))
return
src.add_fingerprint(user)
if (src.bullets < 1)
user.show_message(span_warning("*click*"), MSG_AUDIBLE)
playsound(src, 'sound/weapons/gun_dry_fire.ogg', 30, TRUE)
return
playsound(user, 'sound/weapons/gunshot.ogg', 100, 1)
src.bullets--
user.visible_message(span_danger("[user] fires [src] at [target]!"), \
span_danger("You fire [src] at [target]!"), \
span_italics("You hear a gunshot!"))
/obj/item/toy/ammo/gun
name = "capgun ammo"
desc = "Make sure to recycle the box in an autolathe when it gets empty."
icon = 'icons/obj/ammo.dmi'
icon_state = "357OLD-7"
w_class = WEIGHT_CLASS_TINY
materials = list(/datum/material/iron=10, /datum/material/glass=10)
var/amount_left = 7
/obj/item/toy/ammo/gun/update_icon_state()
. = ..()
icon_state = text("357OLD-[]", amount_left)
/obj/item/toy/ammo/gun/examine(mob/user)
. = ..()
. += "There [amount_left == 1 ? "is" : "are"] [amount_left] cap\s left."
/*
* Toy swords
*/
/obj/item/toy/sword
name = "toy sword"
desc = "A cheap, plastic replica of an energy sword. Realistic sounds! Ages 8 and up."
icon = 'icons/obj/weapons/energy.dmi'
icon_state = "sword0"
item_state = "sword0"
lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi'
var/active = 0
w_class = WEIGHT_CLASS_SMALL
attack_verb = list("attacked", "struck", "hit")
var/hacked = FALSE
var/saber_color = "blue"
/obj/item/toy/sword/attack_self(mob/user)
active = !( active )
if (active)
to_chat(user, span_notice("You extend the plastic blade with a quick flick of your wrist."))
playsound(user, 'sound/weapons/saberon.ogg', 20, 1)
icon_state = "sword[saber_color]"
item_state = "sword[saber_color]"
w_class = WEIGHT_CLASS_BULKY
else
to_chat(user, span_notice("You push the plastic blade back down into the handle."))
playsound(user, 'sound/weapons/saberoff.ogg', 20, 1)
icon_state = "sword0"
item_state = "sword0"
w_class = WEIGHT_CLASS_SMALL
add_fingerprint(user)
// Copied from /obj/item/melee/transforming/energy/sword/attackby
/obj/item/toy/sword/attackby(obj/item/W, mob/living/user, params)
if(istype(W, /obj/item/toy/sword))
if(HAS_TRAIT(W, TRAIT_NODROP) || HAS_TRAIT(src, TRAIT_NODROP))
to_chat(user, span_warning("\the [HAS_TRAIT(src, TRAIT_NODROP) ? src : W] is stuck to your hand, you can't attach it to \the [HAS_TRAIT(src, TRAIT_NODROP) ? W : src]!"))
return
else
to_chat(user, span_notice("You attach the ends of the two plastic swords, making a single double-bladed toy! You're fake-cool."))
var/obj/item/melee/dualsaber/toy/newSaber = new /obj/item/melee/dualsaber/toy(user.loc)
if(hacked) // That's right, we'll only check the "original" "sword".
newSaber.hacked = TRUE
newSaber.saber_color = "rainbow"
qdel(W)
qdel(src)
else if(W.tool_behaviour == TOOL_MULTITOOL)
if(!hacked)
hacked = TRUE
saber_color = "rainbow"
to_chat(user, span_warning("RNBW_ENGAGE"))
if(active)
icon_state = "swordrainbow"
user.update_inv_hands()
else
to_chat(user, span_warning("It's already fabulous!"))
else
return ..()
/*
* Foam armblade
*/
/obj/item/toy/foamblade
name = "foam armblade"
desc = "It says \"Sternside Changs #1 fan\" on it."
icon = 'icons/obj/toy.dmi'
icon_state = "foamblade"
item_state = "arm_blade"
lefthand_file = 'icons/mob/inhands/antag/changeling_lefthand.dmi'
righthand_file = 'icons/mob/inhands/antag/changeling_righthand.dmi'
attack_verb = list("pricked", "absorbed", "gored")
w_class = WEIGHT_CLASS_SMALL
resistance_flags = FLAMMABLE
/obj/item/toy/foamblade/light_eater
name = "foam armblade"
desc = "It says \"Nulton Dawns #1 fan\" on it."
icon = 'icons/obj/toy.dmi'
icon_state = "foamblade"
item_state = "light_eater"
lefthand_file = 'yogstation/icons/mob/inhands/antag/darkspawn_lefthand.dmi'
righthand_file = 'yogstation/icons/mob/inhands/antag/darkspawn_righthand.dmi'
attack_verb = list("eated", "absorbed", "slashed")
/obj/item/toy/foamblade/umbral_tendrils
name = "malformed foam mass"
desc = "A terrible defect produced by a foam armblade manufacturer."
icon = 'yogstation/icons/obj/darkspawn_items.dmi'
icon_state = "umbral_tendrils"
item_state = "umbral_tendrils"
lefthand_file = 'yogstation/icons/mob/inhands/antag/darkspawn_lefthand.dmi'
righthand_file = 'yogstation/icons/mob/inhands/antag/darkspawn_righthand.dmi'
attack_verb = list("devoured", "absorbed", "bludgeoned")
/obj/item/toy/foamblade/baseball
name = "toy baseball bat"
desc = "A colorful foam baseball bat. The label on the handle reads Donksoft."
icon = 'icons/obj/weapons/bat.dmi'
icon_state = "baseball_bat_donk"
item_state = "baseball_bat_donk"
lefthand_file = 'icons/mob/inhands/weapons/melee_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/melee_righthand.dmi'
attack_verb = list("beat", "smacked")
w_class = WEIGHT_CLASS_NORMAL
resistance_flags = FLAMMABLE
/obj/item/toy/foamblade/baseball/nerf
name = "antique toy baseball bat"
desc = "A colorful foam baseball bat. The label on the handle is almost rubbed off...\"nerf or nothing\"? what does that mean"
icon_state = "baseball_bat_toy"
item_state = "baseball_bat_plastic"
/obj/item/toy/windupToolbox
name = "windup toolbox"
desc = "A replica toolbox that rumbles when you turn the key."
icon_state = "his_grace"
item_state = "artistic_toolbox"
lefthand_file = 'icons/mob/inhands/equipment/toolbox_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/toolbox_righthand.dmi'
var/active = FALSE
icon = 'icons/obj/storage.dmi'
attack_verb = list("robusted")
/obj/item/toy/windupToolbox/attack_self(mob/user)
if(!active)
icon_state = "his_grace_awakened"
to_chat(user, span_warning("You wind up [src], it begins to rumble."))
active = TRUE
addtimer(CALLBACK(src, PROC_REF(stopRumble)), 600)
else
to_chat(user, "[src] is already active.")
/obj/item/toy/windupToolbox/proc/stopRumble()
icon_state = initial(icon_state)
active = FALSE
/*
* Subtype of Double-Bladed Energy Swords
*/
/obj/item/melee/dualsaber/toy
name = "double-bladed toy sword"
desc = "A cheap, plastic replica of TWO energy swords. Double the fun!"
force = 0
force_wielded = 0 // Why did someone make this a subtype of dualsabers
throwforce = 0
throw_speed = 3
throw_range = 5
attack_verb = list("attacked", "struck", "hit")
toy = TRUE
/*
* Subtype of Vxtvul Hammer
*/
/obj/item/melee/vxtvulhammer/toy
name = "toy sledgehammer"
desc = "A Donksoft motorized hammer with realistic flashing lights and speakers."
base_icon_state = "vxtvul_hammer"
throwforce = 0
resistance_flags = NONE
armour_penetration = 0
w_class = WEIGHT_CLASS_NORMAL
toy = TRUE
force = 0
force_wielded = 0
var/pirated = FALSE // knockoff brand!
/obj/item/melee/vxtvulhammer/toy/Initialize(mapload)
. = ..()
if(pirated || prob(10)) // man i got scammed!
pirated = TRUE
name = "toy pirate sledgehammer"
desc += " This one looks different from the ones you see on commercials..."
base_icon_state = "vxtvul_hammer_pirate"
icon_state = "[base_icon_state]0-0"
update_appearance(UPDATE_ICON)
/obj/item/melee/vxtvulhammer/toy/pirate
base_icon_state = "vxtvul_hammer_pirate"
pirated = TRUE
/obj/item/toy/katana
name = "replica katana"
desc = "Woefully underpowered in D20."
icon = 'icons/obj/weapons/longsword.dmi'
icon_state = "katana"
item_state = "katana"
lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi'
flags_1 = CONDUCT_1
slot_flags = ITEM_SLOT_BELT | ITEM_SLOT_BACK
force = 5
throwforce = 5
w_class = WEIGHT_CLASS_NORMAL
attack_verb = list("attacked", "slashed", "stabbed", "sliced")
hitsound = 'sound/weapons/bladeslice.ogg'
//singularity wakizashi
/obj/item/toy/katana/singulo_wakizashi
name = "replica singularity wakizashi"
desc = "The power of the singularity condensed into one short, cheap, and fake wakizashi!"
icon_state = "singulo_wakizashi"
item_state = "singulo_wakizashi"
force = 0 //sorry, no
throwforce = 0
lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi'
/*
* Snap pops
*/
/obj/item/toy/snappop
name = "snap pop"
desc = "Wow!"
icon = 'icons/obj/toy.dmi'
icon_state = "snappop"
w_class = WEIGHT_CLASS_TINY
var/ash_type = /obj/effect/decal/cleanable/ash
/obj/item/toy/snappop/Initialize(mapload)
. = ..()
var/static/list/loc_connections = list(
COMSIG_ATOM_ENTERED = PROC_REF(on_entered),
)
AddElement(/datum/element/connect_loc, loc_connections)
/obj/item/toy/snappop/proc/pop_burst(n=3, c=1)
var/datum/effect_system/spark_spread/s = new()
s.set_up(n, c, src)
s.start()
new ash_type(loc)
visible_message(span_warning("[src] explodes!"),
span_italics("You hear a snap!"))
playsound(src, 'sound/effects/snap.ogg', 50, 1)
qdel(src)
/obj/item/toy/snappop/fire_act(exposed_temperature, exposed_volume)
pop_burst()
/obj/item/toy/snappop/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(!..())
pop_burst()
/obj/item/toy/snappop/proc/on_entered(datum/source, atom/movable/H, ...)
if(ishuman(H) || issilicon(H)) //i guess carp and shit shouldn't set them off
var/mob/living/carbon/M = H
if(issilicon(H) || M.m_intent == MOVE_INTENT_RUN)
to_chat(M, span_danger("You step on the snap pop!"))
pop_burst(2, 0)
/obj/item/toy/snappop/phoenix
name = "phoenix snap pop"
desc = "Wow! And wow! And wow!"
ash_type = /obj/effect/decal/cleanable/ash/snappop_phoenix
/obj/effect/decal/cleanable/ash/snappop_phoenix
var/respawn_time = 300
/obj/effect/decal/cleanable/ash/snappop_phoenix/Initialize(mapload)
. = ..()
addtimer(CALLBACK(src, PROC_REF(respawn)), respawn_time)
/obj/effect/decal/cleanable/ash/snappop_phoenix/proc/respawn()
new /obj/item/toy/snappop/phoenix(get_turf(src))
qdel(src)
/*
* Mech prizes
*/
/obj/item/toy/prize
icon = 'icons/obj/toy.dmi'
icon_state = "ripleytoy"
var/timer = 0
var/cooldown = 30
var/quiet = 0
//all credit to skasi for toy mech fun ideas
/obj/item/toy/prize/attack_self(mob/user)
if(timer < world.time)
to_chat(user, span_notice("You play with [src]."))
timer = world.time + cooldown
if(!quiet)
playsound(user, 'sound/mecha/mechstep.ogg', 20, 1)
else
. = ..()
/obj/item/toy/prize/attack_hand(mob/user, modifiers)
. = ..()
if(.)
return
if(loc == user)
attack_self(user)
/obj/item/toy/prize/ripley
name = "toy Ripley"
desc = "Mini-Mecha action figure! Collect them all! 1/12."
/obj/item/toy/prize/fireripley
name = "toy firefighting Ripley"
desc = "Mini-Mecha action figure! Collect them all! 2/12."
icon_state = "fireripleytoy"
/obj/item/toy/prize/deathripley
name = "toy deathsquad Ripley"
desc = "Mini-Mecha action figure! Collect them all! 3/12."
icon_state = "deathripleytoy"
/obj/item/toy/prize/gygax
name = "toy Gygax"
desc = "Mini-Mecha action figure! Collect them all! 4/12."
icon_state = "gygaxtoy"
/obj/item/toy/prize/durand
name = "toy Durand"
desc = "Mini-Mecha action figure! Collect them all! 5/12."
icon_state = "durandprize"
/obj/item/toy/prize/honk
name = "toy H.O.N.K."
desc = "Mini-Mecha action figure! Collect them all! 6/12."
icon_state = "honkprize"
/obj/item/toy/prize/marauder
name = "toy Marauder"
desc = "Mini-Mecha action figure! Collect them all! 7/12."
icon_state = "marauderprize"
/obj/item/toy/prize/seraph
name = "toy Seraph"
desc = "Mini-Mecha action figure! Collect them all! 8/12."
icon_state = "seraphprize"
/obj/item/toy/prize/mauler
name = "toy Mauler"
desc = "Mini-Mecha action figure! Collect them all! 9/12."
icon_state = "maulerprize"
/obj/item/toy/prize/odysseus
name = "toy Odysseus"
desc = "Mini-Mecha action figure! Collect them all! 10/12."
icon_state = "odysseusprize"
/obj/item/toy/prize/phazon
name = "toy Phazon"
desc = "Mini-Mecha action figure! Collect them all! 11/12."
icon_state = "phazonprize"
/obj/item/toy/prize/reticence
name = "toy Reticence"
desc = "Mini-Mecha action figure! Collect them all! 12/12."
icon_state = "reticenceprize"
quiet = 1
/obj/item/toy/talking
name = "talking action figure"
desc = "A generic action figure modeled after nothing in particular."
icon = 'icons/obj/toy.dmi'
icon_state = "owlprize"
w_class = WEIGHT_CLASS_SMALL
var/cooldown = FALSE
var/messages = list("I'm super generic!", "Mathematics class is of variable difficulty!")
var/span = "danger"
var/recharge_time = 30
var/chattering = FALSE
var/phomeme
// Talking toys are language universal, and thus all species can use them
/obj/item/toy/talking/attack_alien(mob/user)
return attack_hand(user)
/obj/item/toy/talking/attack_self(mob/user)
if(!cooldown)
var/list/messages = generate_messages()
activation_message(user)
playsound(loc, 'sound/machines/click.ogg', 20, 1)
spawn(0)
for(var/message in messages)
toy_talk(user, message)
sleep(1 SECONDS)
cooldown = TRUE
spawn(recharge_time)
cooldown = FALSE
return
..()
/obj/item/toy/talking/proc/activation_message(mob/user)
user.visible_message(
span_notice("[user] pulls the string on \the [src]."),
span_notice("You pull the string on \the [src]."),
span_notice("You hear a string being pulled."))
/obj/item/toy/talking/proc/generate_messages()
return list(pick(messages))
/obj/item/toy/talking/proc/toy_talk(mob/user, message)
user.loc.visible_message("<span class='[span]'>[icon2html(src, viewers(user.loc))] [message]</span>")
if(chattering)
chatter(message, phomeme, user)
/*
* AI core prizes
*/
/obj/item/toy/talking/AI
name = "toy AI"
desc = "A little toy model AI core with real law announcing action!"
icon_state = "AI"
/obj/item/toy/talking/AI/generate_messages()
return list(generate_ion_law())
/obj/item/toy/talking/codex_gigas
name = "Toy Codex Gigas"
desc = "A tool to help you write fictional devils!"
icon = 'icons/obj/library.dmi'
icon_state = "demonomicon"
lefthand_file = 'icons/mob/inhands/misc/books_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/books_righthand.dmi'
w_class = WEIGHT_CLASS_SMALL
recharge_time = 60
/obj/item/toy/talking/codex_gigas/activation_message(mob/user)
user.visible_message(
span_notice("[user] presses the button on \the [src]."),
span_notice("You press the button on \the [src]."),
span_notice("You hear a soft click."))
/obj/item/toy/talking/codex_gigas/generate_messages()
var/datum/fakeDevil/devil = new
var/list/messages = list()
messages += "Some fun facts about: [devil.truename]"
messages += "[GLOB.lawlorify[LORE][devil.bane]]"
messages += "[GLOB.lawlorify[LORE][devil.obligation]]"
messages += "[GLOB.lawlorify[LORE][devil.ban]]"
messages += "[GLOB.lawlorify[LORE][devil.banish]]"
return messages
/obj/item/toy/talking/owl
name = "owl action figure"
desc = "An action figure modeled after 'The Owl', defender of justice."
icon_state = "owlprize"
messages = list("You won't get away this time, Griffin!", "Stop right there, criminal!", "Hoot! Hoot!", "I am the night!")
chattering = TRUE
phomeme = "owl"
/obj/item/toy/talking/griffin
name = "griffin action figure"
desc = "An action figure modeled after 'The Griffin', criminal mastermind."
icon_state = "griffinprize"
messages = list("You can't stop me, Owl!", "My plan is flawless! The vault is mine!", "Caaaawwww!", "You will never catch me!")
chattering = TRUE
phomeme = "griffin"
/*
|| A Deck of Cards for playing various games of chance ||
*/
/obj/item/toy/cards
resistance_flags = FLAMMABLE
max_integrity = 50
var/parentdeck = null
var/deckstyle = "nanotrasen"
var/card_hitsound = null
var/card_force = 0
var/card_throwforce = 0
var/card_throw_speed = 3
var/card_throw_range = 7
var/list/card_attack_verb = list("attacked")
/obj/item/toy/cards/suicide_act(mob/living/carbon/user)
user.visible_message(span_suicide("[user] is slitting [user.p_their()] wrists with \the [src]! It looks like [user.p_they()] [user.p_have()] a crummy hand!"))
playsound(src, 'sound/items/cardshuffle.ogg', 50, 1)
return BRUTELOSS
/obj/item/toy/cards/proc/apply_card_vars(obj/item/toy/cards/newobj, obj/item/toy/cards/sourceobj) // Applies variables for supporting multiple types of card deck
if(!istype(sourceobj))
return
/obj/item/toy/cards/deck
name = "deck of cards"
desc = "A deck of space-grade playing cards."
icon = 'icons/obj/toy.dmi'
deckstyle = "nanotrasen"
icon_state = "deck_nanotrasen_full"
w_class = WEIGHT_CLASS_SMALL
var/cooldown = 0
var/obj/machinery/computer/holodeck/holo = null // Holodeck cards should not be infinite
var/list/cards = list()
/obj/item/toy/cards/deck/Initialize(mapload)
. = ..()
populate_deck()
/obj/item/toy/cards/deck/proc/populate_deck()
icon_state = "deck_[deckstyle]_full"
for(var/i in 2 to 10)
cards += "[i] of Hearts"
cards += "[i] of Spades"
cards += "[i] of Clubs"
cards += "[i] of Diamonds"
cards += "King of Hearts"
cards += "King of Spades"
cards += "King of Clubs"
cards += "King of Diamonds"
cards += "Queen of Hearts"
cards += "Queen of Spades"
cards += "Queen of Clubs"
cards += "Queen of Diamonds"
cards += "Jack of Hearts"
cards += "Jack of Spades"
cards += "Jack of Clubs"
cards += "Jack of Diamonds"
cards += "Ace of Hearts"
cards += "Ace of Spades"
cards += "Ace of Clubs"
cards += "Ace of Diamonds"
//ATTACK HAND IGNORING PARENT RETURN VALUE
//ATTACK HAND NOT CALLING PARENT
/obj/item/toy/cards/deck/attack_hand(mob/user)
draw_card(user)
/obj/item/toy/cards/deck/proc/draw_card(mob/user, drawnumber = 1)//Person who draws the card, number of cards to be drawn
if(isliving(user))
var/mob/living/L = user
if(!(L.mobility_flags & MOBILITY_PICKUP))
return
var/choice = null
if(cards.len == 0)
to_chat(user, span_warning("There are no more cards to draw!"))
return
if (drawnumber == 1)
var/obj/item/toy/cards/singlecard/C = new(user.loc)
choice = cards[1]
user.visible_message("[user] draws a card from the deck.", span_notice("You draw a card from the deck."))
C.cardname = choice
if(holo)
holo.spawned += C // track them leaving the holodeck
C.parentdeck = src
C.apply_card_vars(C, src)
C.deckstyle = deckstyle
cards.Cut(1,2)
user.put_in_hands(C)
update_appearance(UPDATE_ICON)
C.interact(user)
else //if more than one card is drawn
var/obj/item/toy/cards/cardhand/H = new/obj/item/toy/cards/cardhand(user.drop_location())
user.visible_message("[user] draws [drawnumber] cards from the deck.", span_notice("You draw [drawnumber] cards from the deck."))
var/i
for (i=1,i<=drawnumber,i++)
H.currenthand+=cards[i]
if(holo)
holo.spawned += H // track them leaving the holodeck
H.parentdeck = src
H.deckstyle=deckstyle
src.cards.Cut(1,drawnumber+1)
user.put_in_hands(H)
update_appearance(UPDATE_ICON)
H.interact(user)
H.update_appearance(UPDATE_ICON)
/obj/item/toy/cards/deck/AltClick(mob/living/L)
if(!(L.mobility_flags & MOBILITY_PICKUP))
return
if(cards.len == 0)
to_chat(L, span_warning("There are no more cards to draw!"))
return
var/drawsize = input(L, "How many cards to draw? (1-[min(cards.len,10)])", "Cards") as null|num
if (drawsize && isnum(drawsize))
drawsize=clamp(drawsize,1,min(cards.len,10))
draw_card(L,drawsize)
/obj/item/toy/cards/deck/update_icon_state()
. = ..()
if(cards.len > 26)
icon_state = "deck_[deckstyle]_full"
else if(cards.len > 10)
icon_state = "deck_[deckstyle]_half"
else if(cards.len > 0)
icon_state = "deck_[deckstyle]_low"
else if(cards.len == 0)
icon_state = "deck_[deckstyle]_empty"
/obj/item/toy/cards/deck/examine(mob/user)
. = ..()
. += "<span class='notice'>This one contains [cards.len] cards.<span>"
. += "<span class='notice'>Alt-click the deck to draw multiple cards at once.<span>"
/obj/item/toy/cards/deck/attack_self(mob/user)
if(cooldown < world.time - 50)
cards = shuffle(cards)
playsound(src, 'sound/items/cardshuffle.ogg', 50, 1)
user.visible_message("[user] shuffles the deck.", span_notice("You shuffle the deck."))
cooldown = world.time
/obj/item/toy/cards/deck/attackby(obj/item/I, mob/living/user, params)
if(istype(I, /obj/item/toy/cards/singlecard))
var/obj/item/toy/cards/singlecard/SC = I
if(SC.parentdeck == src)
if(!user.temporarilyRemoveItemFromInventory(SC))
to_chat(user, span_warning("The card is stuck to your hand, you can't add it to the deck!"))
return
cards += SC.cardname
user.visible_message("[user] adds a card to the bottom of the deck.",span_notice("You add the card to the bottom of the deck."))
qdel(SC)
else
to_chat(user, span_warning("You can't mix cards from other decks!"))
update_appearance(UPDATE_ICON)
else if(istype(I, /obj/item/toy/cards/cardhand))
var/obj/item/toy/cards/cardhand/CH = I
if(CH.parentdeck == src)
if(!user.temporarilyRemoveItemFromInventory(CH))
to_chat(user, span_warning("The hand of cards is stuck to your hand, you can't add it to the deck!"))
return
cards += CH.currenthand
user.visible_message("[user] puts [user.p_their()] hand of cards in the deck.", span_notice("You put the hand of cards in the deck."))
qdel(CH)
else
to_chat(user, span_warning("You can't mix cards from other decks!"))
update_appearance(UPDATE_ICON)
else
return ..()
/obj/item/toy/cards/deck/MouseDrop(atom/over_object)
. = ..()
var/mob/living/M = usr
if(!istype(M) || !(M.mobility_flags & MOBILITY_PICKUP))
return
if(Adjacent(usr))
if(over_object == M && loc != M)
M.put_in_hands(src)
to_chat(usr, span_notice("You pick up the deck."))
else if(istype(over_object, /atom/movable/screen/inventory/hand))
var/atom/movable/screen/inventory/hand/H = over_object
if(M.putItemFromInventoryInHandIfPossible(src, H.held_index))
to_chat(usr, span_notice("You pick up the deck."))
else
to_chat(usr, span_warning("You can't reach it from here!"))
/obj/item/toy/cards/cardhand
name = "hand of cards"
desc = "A number of cards not in a deck, customarily held in ones hand."
icon = 'icons/obj/toy.dmi'
icon_state = "nanotrasen_hand2"
w_class = WEIGHT_CLASS_TINY
var/list/currenthand = list()
var/choice = null
/obj/item/toy/cards/cardhand/attack_self(mob/user)
var/list/handradial = list()
interact(user)
for(var/t in currenthand)
handradial[t] = image(icon = src.icon, icon_state = "sc_[t]_[deckstyle]")
if(usr.stat || !ishuman(usr))
return
var/mob/living/carbon/human/cardUser = usr
if(!(cardUser.mobility_flags & MOBILITY_USE))
return
var/O = src
var/choice = show_radial_menu(usr,src, handradial, custom_check = CALLBACK(src, PROC_REF(check_menu), user), radius = 36, require_near = TRUE)
if(!choice)
return FALSE
var/obj/item/toy/cards/singlecard/C = new/obj/item/toy/cards/singlecard(cardUser.loc)
currenthand -= choice
handradial -= choice
C.parentdeck = parentdeck
C.cardname = choice
C.apply_card_vars(C,O)
cardUser.put_in_hands(C)
cardUser.visible_message(span_notice("[cardUser] draws a card from [cardUser.p_their()] hand."), span_notice("You take the [C.cardname] from your hand."))
interact(cardUser)
update_appearance(UPDATE_ICON)
if(length(currenthand) == 1)
var/obj/item/toy/cards/singlecard/N = new/obj/item/toy/cards/singlecard(loc)
N.parentdeck = parentdeck
N.cardname = currenthand[1]
N.apply_card_vars(N,O)
qdel(src)
cardUser.put_in_hands(N)
cardUser.visible_message("[cardUser] also takes their last card and holds it.", span_notice("You also take [currenthand[1]] and hold it.")) //the outside world will now know when you break a 2 card hand into two separate cards. Useful for UNO but can be used by any card game
/obj/item/toy/cards/cardhand/attackby(obj/item/toy/cards/singlecard/C, mob/living/user, params)
if(istype(C))
if(C.parentdeck == src.parentdeck)
src.currenthand += C.cardname
user.visible_message("[user] adds a card to [user.p_their()] hand.", span_notice("You add the [C.cardname] to your hand."))
qdel(C)
interact(user)
update_appearance(UPDATE_ICON)
else
to_chat(user, span_warning("You can't mix cards from other decks!"))
else
return ..()
/obj/item/toy/cards/cardhand/attackby(obj/item/toy/cards/cardhand/C, mob/living/user, params) //Same as above, but for card hands!
if(istype(C))
if(C.parentdeck == src.parentdeck) //if the cards come from the same deck
var/i
for(i=1, i<=C.currenthand.len, i++)
src.currenthand += C.currenthand[i] //adds all the cards from the other hand to this one
user.visible_message("[user] adds the cards from [user.p_their()] hand to another, consolidating them.", span_notice("You add the cards from one hand to another."))
qdel(C)
interact(user)
update_appearance(UPDATE_ICON)
else
to_chat(user, span_warning("You can't mix cards from other decks!"))
else
return ..()
/obj/item/toy/cards/cardhand/apply_card_vars(obj/item/toy/cards/newobj,obj/item/toy/cards/sourceobj)
..()
newobj.deckstyle = sourceobj.deckstyle
newobj.icon_state = "[deckstyle]_hand2" // Another dumb hack, without this the hand is invisible (or has the default deckstyle) until another card is added.
newobj.card_hitsound = sourceobj.card_hitsound
newobj.card_force = sourceobj.card_force
newobj.card_throwforce = sourceobj.card_throwforce
newobj.card_throw_speed = sourceobj.card_throw_speed
newobj.card_throw_range = sourceobj.card_throw_range
newobj.card_attack_verb = sourceobj.card_attack_verb
newobj.resistance_flags = sourceobj.resistance_flags
///check_menu: Checks if we are allowed to interact with a radial menu
///Arguments:
///user The mob interacting with a menu
/obj/item/toy/cards/cardhand/proc/check_menu(mob/living/user)
if(!istype(user))
return FALSE
if(user.incapacitated())
return FALSE
return TRUE
/obj/item/toy/cards/cardhand/examine(mob/user)