diff --git a/code/game/objects/items/weaponry.dm b/code/game/objects/items/weaponry.dm index e7a0adca85..34260eafe0 100644 --- a/code/game/objects/items/weaponry.dm +++ b/code/game/objects/items/weaponry.dm @@ -109,7 +109,8 @@ /obj/item/claymore/highlander/dropped(mob/living/user) user.remove_trait(TRAIT_IGNORESLOWDOWN, HIGHLANDER) - qdel(src) //If this ever happens, it's because you lost an arm + if(!QDELETED(src)) + qdel(src) //If this ever happens, it's because you lost an arm /obj/item/claymore/highlander/examine(mob/user) ..() diff --git a/code/modules/admin/verbs/onlyone.dm b/code/modules/admin/verbs/onlyone.dm index b2f8652948..7c9d89e88d 100644 --- a/code/modules/admin/verbs/onlyone.dm +++ b/code/modules/admin/verbs/onlyone.dm @@ -26,56 +26,4 @@ GLOBAL_VAR_INIT(highlander, FALSE) addtimer(CALLBACK(src, .proc/only_one), 420) /mob/living/carbon/human/proc/make_scottish() - mind.special_role = "highlander" - - dna.species.species_traits |= NOGUNS //nice try jackass - - var/datum/objective/steal/steal_objective = new - steal_objective.owner = mind - steal_objective.set_target(new /datum/objective_item/steal/nukedisc) - mind.objectives += steal_objective - - var/datum/objective/hijack/hijack_objective = new - hijack_objective.explanation_text = "Escape on the shuttle alone. Ensure that nobody else makes it out." - hijack_objective.owner = mind - mind.objectives += hijack_objective - - mind.add_antag_datum(/datum/antagonist/auto_custom) - - mind.announce_objectives() - - for(var/obj/item/I in get_equipped_items()) - qdel(I) - for(var/obj/item/I in held_items) - qdel(I) - equip_to_slot_or_del(new /obj/item/clothing/under/kilt/highlander(src), slot_w_uniform) - equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/captain(src), slot_ears) - equip_to_slot_or_del(new /obj/item/clothing/head/beret/highlander(src), slot_head) - equip_to_slot_or_del(new /obj/item/clothing/shoes/combat(src), slot_shoes) - equip_to_slot_or_del(new /obj/item/pinpointer/nuke(src), slot_l_store) - for(var/obj/item/pinpointer/nuke/P in src) - P.attack_self(src) - var/obj/item/card/id/W = new(src) - W.icon_state = "centcom" - W.access = get_all_accesses() - W.access += get_all_centcom_access() - W.assignment = "Highlander" - W.registered_name = real_name - W.flags_1 |= NODROP_1 - W.update_label(real_name) - equip_to_slot_or_del(W, slot_wear_id) - - var/obj/item/claymore/highlander/H1 = new(src) - if(!GLOB.highlander) - H1.admin_spawned = TRUE //To prevent announcing - put_in_hands(H1) - H1.pickup(src) //For the stun shielding - - var/obj/item/bloodcrawl/antiwelder = new(src) - antiwelder.name = "compulsion of honor" - antiwelder.desc = "You are unable to hold anything in this hand until you're the last one left!" - antiwelder.icon_state = "bloodhand_right" - put_in_hands(antiwelder) - - to_chat(src, "Your [H1.name] cries out for blood. Claim the lives of others, and your own will be restored!\n\ - Activate it in your hand, and it will lead to the nearest target. Attack the nuclear authentication disk with it, and you will store it.") + mind.add_antag_datum(/datum/antagonist/highlander) \ No newline at end of file diff --git a/code/modules/antagonists/highlander/highlander.dm b/code/modules/antagonists/highlander/highlander.dm new file mode 100644 index 0000000000..185bedba8f --- /dev/null +++ b/code/modules/antagonists/highlander/highlander.dm @@ -0,0 +1,85 @@ +/datum/antagonist/highlander + name = "highlander" + var/obj/item/claymore/highlander/sword + show_in_antagpanel = FALSE + show_name_in_check_antagonists = TRUE + +/datum/antagonist/highlander/apply_innate_effects(mob/living/mob_override) + var/mob/living/carbon/human/H = owner.current || mob_override + if(!istype(H)) + return + H.dna.species.species_traits |= NOGUNS //nice try jackass + +/datum/antagonist/highlander/remove_innate_effects(mob/living/mob_override) + var/mob/living/carbon/human/H = owner.current || mob_override + if(!istype(H)) + return + H.dna.species.species_traits &= ~NOGUNS + +/datum/antagonist/highlander/on_removal() + owner.objectives -= objectives + . = ..() + +/datum/antagonist/highlander/proc/forge_objectives() + var/datum/objective/steal/steal_objective = new + steal_objective.owner = owner + steal_objective.set_target(new /datum/objective_item/steal/nukedisc) + objectives += steal_objective + + var/datum/objective/hijack/hijack_objective = new + hijack_objective.explanation_text = "Escape on the shuttle alone. Ensure that nobody else makes it out." + hijack_objective.owner = owner + objectives += hijack_objective + + owner.objectives |= objectives + +/datum/antagonist/highlander/on_gain() + forge_objectives() + owner.special_role = "highlander" + give_equipment() + . = ..() + +/datum/antagonist/highlander/greet() + to_chat(owner, "Your [sword.name] cries out for blood. Claim the lives of others, and your own will be restored!\n\ + Activate it in your hand, and it will lead to the nearest target. Attack the nuclear authentication disk with it, and you will store it.") + + owner.announce_objectives() + +/datum/antagonist/highlander/proc/give_equipment() + var/mob/living/carbon/human/H = owner.current + if(!istype(H)) + return + + for(var/obj/item/I in H.get_equipped_items()) + qdel(I) + for(var/obj/item/I in H.held_items) + qdel(I) + H.equip_to_slot_or_del(new /obj/item/clothing/under/kilt/highlander(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/captain(H), slot_ears) + H.equip_to_slot_or_del(new /obj/item/clothing/head/beret/highlander(H), slot_head) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/combat(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/pinpointer/nuke(H), slot_l_store) + for(var/obj/item/pinpointer/nuke/P in H) + P.attack_self(H) + var/obj/item/card/id/W = new(H) + W.icon_state = "centcom" + W.access = get_all_accesses() + W.access += get_all_centcom_access() + W.assignment = "Highlander" + W.registered_name = H.real_name + W.flags_1 |= NODROP_1 + W.update_label(H.real_name) + H.equip_to_slot_or_del(W, slot_wear_id) + + sword = new(H) + if(!GLOB.highlander) + sword.admin_spawned = TRUE //To prevent announcing + sword.pickup(H) //For the stun shielding + H.put_in_hands(sword) + + + var/obj/item/bloodcrawl/antiwelder = new(H) + antiwelder.name = "compulsion of honor" + antiwelder.desc = "You are unable to hold anything in this hand until you're the last one left!" + antiwelder.icon_state = "bloodhand_right" + H.put_in_hands(antiwelder) \ No newline at end of file diff --git a/tgstation.dme b/tgstation.dme index 7926d78773..1473106833 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -1210,6 +1210,7 @@ #include "code\modules\antagonists\devil\true_devil\_true_devil.dm" #include "code\modules\antagonists\devil\true_devil\inventory.dm" #include "code\modules\antagonists\ert\ert.dm" +#include "code\modules\antagonists\highlander\highlander.dm" #include "code\modules\antagonists\monkey\monkey.dm" #include "code\modules\antagonists\morph\morph.dm" #include "code\modules\antagonists\morph\morph_antag.dm"