From 2894798bf0166d4d637bfdf359984580dabb4816 Mon Sep 17 00:00:00 2001 From: datlo Date: Sun, 30 Dec 2018 17:36:27 +0000 Subject: [PATCH] add magical var to clothing, remove istype checks on spellcast --- code/datums/spell.dm | 23 ++++++++++--------- code/modules/clothing/clothing.dm | 1 + code/modules/clothing/shoes/magboots.dm | 1 + code/modules/clothing/shoes/miscellaneous.dm | 1 + code/modules/clothing/spacesuits/hardsuit.dm | 10 ++++---- code/modules/clothing/spacesuits/plasmamen.dm | 2 ++ code/modules/clothing/suits/wiz_robe.dm | 8 ++++++- 7 files changed, 29 insertions(+), 17 deletions(-) diff --git a/code/datums/spell.dm b/code/datums/spell.dm index cc29da42a43..b1def4dda4b 100644 --- a/code/datums/spell.dm +++ b/code/datums/spell.dm @@ -141,14 +141,14 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin var/obj/effect/proc_holder/spell/noclothes/clothes_spell = locate() in (user.mob_spell_list | (user.mind ? user.mind.spell_list : list())) if((ishuman(user) && clothes_req) && !istype(clothes_spell))//clothes check var/mob/living/carbon/human/H = user - if(!istype(H.wear_suit, /obj/item/clothing/suit/wizrobe) && !istype(H.wear_suit, /obj/item/clothing/suit/space/hardsuit/wizard) && !istype(H.wear_suit, /obj/item/clothing/suit/space/eva/plasmaman/wizard)) - to_chat(user, "I don't feel strong enough without my robe.") + var/obj/item/clothing/robe = H.wear_suit + var/obj/item/clothing/hat = H.head + var/obj/item/clothing/shoes = H.shoes + if(!robe || !hat || !shoes) + to_chat(user, "Your outfit isn't complete, You should put on your robe and wizard hat, aswell as sandals.") return 0 - if(!istype(H.shoes, /obj/item/clothing/shoes/sandal) && !istype(H.shoes, /obj/item/clothing/shoes/magboots/wizard)) - to_chat(user, "I don't feel strong enough without my sandals.") - return 0 - if(!istype(H.head, /obj/item/clothing/head/wizard) && !istype(H.head, /obj/item/clothing/head/helmet/space/hardsuit/wizard) && !istype(H.head, /obj/item/clothing/head/helmet/space/eva/plasmaman/wizard)) - to_chat(user, "I don't feel strong enough without my hat.") + if(!robe.magical || !hat.magical || !shoes.magical) + to_chat(user, "Your outfit isn't magical enough, You should put on your robe and wizard hat, aswell as your sandals.") return 0 else if(!ishuman(user)) if(clothes_req || human_req) @@ -459,11 +459,12 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin var/clothcheck = locate(/obj/effect/proc_holder/spell/noclothes) in user.mob_spell_list var/clothcheck2 = user.mind && (locate(/obj/effect/proc_holder/spell/noclothes) in user.mind.spell_list) if(clothes_req && !clothcheck && !clothcheck2) //clothes check - if(!istype(H.wear_suit, /obj/item/clothing/suit/wizrobe) && !istype(H.wear_suit, /obj/item/clothing/suit/space/hardsuit/wizard) && !istype(H.wear_suit, /obj/item/clothing/suit/space/eva/plasmaman/wizard)) + var/obj/item/clothing/robe = H.wear_suit + var/obj/item/clothing/hat = H.head + var/obj/item/clothing/shoes = H.shoes + if(!robe || !hat || !shoes) return 0 - if(!istype(H.shoes, /obj/item/clothing/shoes/sandal) && !istype(H.shoes, /obj/item/clothing/shoes/magboots/wizard)) - return 0 - if(!istype(H.head, /obj/item/clothing/head/wizard) && !istype(H.head, /obj/item/clothing/head/helmet/space/hardsuit/wizard) && !istype(H.head, /obj/item/clothing/head/helmet/space/eva/plasmaman/wizard)) + if(!robe.magical || !hat.magical || !shoes.magical) return 0 else if(clothes_req || human_req) diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 855c092f3ae..484151de797 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -28,6 +28,7 @@ var/toggle_cooldown = null var/cooldown = 0 var/species_disguise = null + var/magical = FALSE //BS12: Species-restricted clothing check. /obj/item/clothing/mob_can_equip(M as mob, slot) diff --git a/code/modules/clothing/shoes/magboots.dm b/code/modules/clothing/shoes/magboots.dm index 8cfcb2b1c5f..ed4471d7b7c 100644 --- a/code/modules/clothing/shoes/magboots.dm +++ b/code/modules/clothing/shoes/magboots.dm @@ -79,6 +79,7 @@ obj/item/clothing/shoes/magboots/syndie/advance //For the Syndicate Strike Team magboot_state = "wizmag" slowdown_active = SHOES_SLOWDOWN //wiz hardsuit already slows you down, no need to double it magpulse_name = "gripping ability" + magical = TRUE /obj/item/clothing/shoes/magboots/wizard/attack_self(mob/user) if(user) diff --git a/code/modules/clothing/shoes/miscellaneous.dm b/code/modules/clothing/shoes/miscellaneous.dm index 607b67ccfb4..ffe4ba0fdbc 100644 --- a/code/modules/clothing/shoes/miscellaneous.dm +++ b/code/modules/clothing/shoes/miscellaneous.dm @@ -44,6 +44,7 @@ icon_state = "wizard" strip_delay = 50 put_on_delay = 50 + magical = TRUE /obj/item/clothing/shoes/sandal/marisa desc = "A pair of magic, black shoes." diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm index ba61c78b368..3e36db94d18 100644 --- a/code/modules/clothing/spacesuits/hardsuit.dm +++ b/code/modules/clothing/spacesuits/hardsuit.dm @@ -339,7 +339,7 @@ linkedsuit = loc /obj/item/clothing/head/helmet/space/hardsuit/syndi/attack_self(mob/user) - + if(!linkedsuit) to_chat(user, "You must attach the helmet to a syndicate hardsuit to toggle combat mode!") return @@ -479,15 +479,15 @@ icon_state = "hardsuit0-wiz" item_state = "wiz_helm" item_color = "wiz" - unacidable = 1 //No longer shall our kind be foiled by lone chemists with spray bottles! + unacidable = TRUE //No longer shall our kind be foiled by lone chemists with spray bottles! armor = list(melee = 40, bullet = 40, laser = 40, energy = 20, bomb = 35, bio = 100, rad = 50) heat_protection = HEAD //Uncomment to enable firesuit protection max_heat_protection_temperature = FIRE_IMMUNITY_HELM_MAX_TEMP_PROTECT - unacidable = 1 species_fit = list("Grey") sprite_sheets = list( "Grey" = 'icons/mob/species/grey/helmet.dmi' ) + magical = TRUE /obj/item/clothing/suit/space/hardsuit/wizard icon_state = "hardsuit-wiz" @@ -495,13 +495,13 @@ desc = "A bizarre gem-encrusted suit that radiates magical energies." item_state = "wiz_hardsuit" w_class = WEIGHT_CLASS_NORMAL - unacidable = 1 + unacidable = TRUE armor = list(melee = 40, bullet = 40, laser = 40, energy = 20, bomb = 35, bio = 100, rad = 50) allowed = list(/obj/item/teleportation_scroll,/obj/item/tank) heat_protection = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS //Uncomment to enable firesuit protection max_heat_protection_temperature = FIRE_IMMUNITY_SUIT_MAX_TEMP_PROTECT - unacidable = 1 sprite_sheets = null + magical = TRUE //Medical hardsuit /obj/item/clothing/head/helmet/space/hardsuit/medical diff --git a/code/modules/clothing/spacesuits/plasmamen.dm b/code/modules/clothing/spacesuits/plasmamen.dm index 23f99ec24c2..76ab623081f 100644 --- a/code/modules/clothing/spacesuits/plasmamen.dm +++ b/code/modules/clothing/spacesuits/plasmamen.dm @@ -403,8 +403,10 @@ /obj/item/clothing/suit/space/eva/plasmaman/wizard name = "robed plasmaman suit" icon_state = "plasmamanWizardBlue_suit" + magical = TRUE /obj/item/clothing/head/helmet/space/eva/plasmaman/wizard name = "wizard hat" icon_state = "plasmamanWizardBlue_helmet0" base_state = "plasmamanWizardBlue_helmet" + magical = TRUE diff --git a/code/modules/clothing/suits/wiz_robe.dm b/code/modules/clothing/suits/wiz_robe.dm index aa547bf6e4c..b3f55aed84a 100644 --- a/code/modules/clothing/suits/wiz_robe.dm +++ b/code/modules/clothing/suits/wiz_robe.dm @@ -10,6 +10,7 @@ //Not given any special protective value since the magic robes are full-body protection --NEO strip_delay = 50 put_on_delay = 50 + magical = TRUE /obj/item/clothing/head/wizard/red name = "red wizard hat" @@ -35,6 +36,7 @@ gas_transfer_coefficient = 1 permeability_coefficient = 1 armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0) + magical = FALSE /obj/item/clothing/head/wizard/marisa name = "Witch Hat" @@ -67,6 +69,7 @@ strip_delay = 50 put_on_delay = 50 burn_state = FIRE_PROOF + magical = TRUE /obj/item/clothing/suit/wizrobe/red name = "red wizard robe" @@ -120,6 +123,7 @@ armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0) unacidable = 0 burn_state = FLAMMABLE + magical = FALSE /obj/item/clothing/head/wizard/marisa/fake name = "Witch Hat" @@ -130,6 +134,7 @@ armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0) unacidable = 0 burn_state = FLAMMABLE + magical = FALSE /obj/item/clothing/suit/wizrobe/marisa/fake name = "Witch Robe" @@ -140,4 +145,5 @@ permeability_coefficient = 1 armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0) unacidable = 0 - burn_state = FLAMMABLE \ No newline at end of file + burn_state = FLAMMABLE + magical = FALSE \ No newline at end of file