|
598 | 598 | icon_state = "pocketcat" |
599 | 599 | item_state = "pocketcat" |
600 | 600 | body_parts_covered = CHEST|GROIN|LEGS|FEET|ARMS |
| 601 | + |
| 602 | +/obj/item/clothing/suit/unalivevest |
| 603 | + name = "explosive vest" |
| 604 | + desc = "An autolocking, voice activated suicide vest. The electronics inside are so crude it only functions in inclusive mode. Once it's on, it can never be removed." |
| 605 | + icon_state = "unalive-vest" |
| 606 | + item_state = "reactiveoff" |
| 607 | + blood_overlay_type = "armor" |
| 608 | + flags_1 = HEAR_1 |
| 609 | + resistance_flags = LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF //stop trying to get it off |
| 610 | + var/listening = FALSE |
| 611 | + var/activation_phrase = "" |
| 612 | + var/active = FALSE |
| 613 | + |
| 614 | + //explosion control vars |
| 615 | + var/weak = 4 |
| 616 | + var/medium = 2 |
| 617 | + var/heavy = 1 |
| 618 | + |
| 619 | +/obj/item/clothing/suit/unalivevest/ex_act(severity, target) |
| 620 | + . = ..() |
| 621 | + Explode() |
| 622 | + |
| 623 | +/obj/item/clothing/suit/unalivevest/AltClick(mob/user) |
| 624 | + if(!user.canUseTopic(src, BE_CLOSE)) |
| 625 | + return |
| 626 | + if(activation_phrase) |
| 627 | + say("Activation phrase already set.") |
| 628 | + return |
| 629 | + say("Now recording.") |
| 630 | + listening = TRUE |
| 631 | + |
| 632 | +/obj/item/clothing/suit/unalivevest/Hear(message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans, list/message_mods) |
| 633 | + . = ..() |
| 634 | + if(speaker == src) |
| 635 | + return |
| 636 | + if(listening) |
| 637 | + activation_phrase = raw_message |
| 638 | + listening = FALSE |
| 639 | + say("Activation message is '[activation_phrase]'.", message_language) |
| 640 | + else |
| 641 | + if(activation_phrase && findtext(raw_message, activation_phrase)) |
| 642 | + Explode() |
| 643 | + |
| 644 | +/obj/item/clothing/suit/unalivevest/mob_can_equip(mob/M, mob/living/equipper, slot, disable_warning = FALSE, bypass_equip_delay_self = FALSE) |
| 645 | + if(listening || !activation_phrase) |
| 646 | + to_chat(equipper, span_warning("Set the activation phrase first!")) |
| 647 | + return FALSE |
| 648 | + return ..() |
| 649 | + |
| 650 | +/obj/item/clothing/suit/unalivevest/equipped(mob/user, slot, initial = FALSE) |
| 651 | + . = ..() |
| 652 | + if((slot & slot_flags)) |
| 653 | + to_chat(user, span_danger("You hear the vest click as it locks around your torso!")) |
| 654 | + ADD_TRAIT(src, TRAIT_NODROP, CURSED_ITEM_TRAIT(type)) |
| 655 | + RegisterSignal(user, COMSIG_MOB_UNEQUIPPED_ITEM, PROC_REF(Explode)) |
| 656 | + |
| 657 | +/obj/item/clothing/suit/unalivevest/proc/Explode() |
| 658 | + if(active) |
| 659 | + return |
| 660 | + active = TRUE |
| 661 | + explosion(src, heavy, medium, weak, weak, flame_range = weak) |
| 662 | + if(isliving(loc)) |
| 663 | + var/mob/living/L = loc |
| 664 | + L.gib(no_brain = TRUE, no_items = TRUE) |
| 665 | + qdel(src) |
0 commit comments