This commit is contained in:
Yoshax
2016-09-01 16:08:22 +01:00
parent 3d4d1d29ad
commit 7a71fe000b
2 changed files with 12 additions and 7 deletions

View File

@@ -1,14 +1,19 @@
//This is a generic proc that should be called by other ling armor procs to equip them.
/mob/proc/changeling_generic_armor(var/armor_type, var/helmet_type, var/boot_type)
var/datum/changeling/changeling = changeling_power(20,1,100,CONSCIOUS)
if(!changeling)
return
/mob/proc/changeling_generic_armor(var/armor_type, var/helmet_type, var/boot_type, var/chem_cost)
if(!ishuman(src))
return 0
var/mob/living/carbon/human/M = src
if(istype(M.wear_suit, armor_type) || istype(M.head, helmet_type) || istype(M.shoes, boot_type))
chem_cost = 0
var/datum/changeling/changeling = changeling_power(chem_cost, 1, 100, CONSCIOUS)
if(!changeling)
return
//First, check if we're already wearing the armor, and if so, take it off.
if(istype(M.wear_suit, armor_type) || istype(M.head, helmet_type) || istype(M.shoes, boot_type))
M.visible_message("<span class='warning'>[M] casts off their [M.wear_suit.name]!</span>",
@@ -39,7 +44,7 @@
var/obj/item/clothing/shoes/B = new boot_type(src)
src.equip_to_slot_or_del(B, slot_shoes)
src.mind.changeling.chem_charges -= 20
src.mind.changeling.chem_charges -= chem_cost
playsound(src, 'sound/effects/blobattack.ogg', 30, 1)
M.update_inv_wear_suit()
M.update_inv_head()

View File

@@ -9,7 +9,7 @@
/mob/proc/changeling_spacesuit()
set category = "Changeling"
set name = "Organic Space Suit (20)"
if(changeling_generic_armor(/obj/item/clothing/suit/space/changeling,/obj/item/clothing/head/helmet/space/changeling,/obj/item/clothing/shoes/magboots/changeling))
if(changeling_generic_armor(/obj/item/clothing/suit/space/changeling,/obj/item/clothing/head/helmet/space/changeling,/obj/item/clothing/shoes/magboots/changeling, 20))
return 1
return 0
@@ -25,7 +25,7 @@
set category = "Changeling"
set name = "Organic Spacearmor (20)"
if(changeling_generic_armor(/obj/item/clothing/suit/space/changeling/armored,/obj/item/clothing/head/helmet/space/changeling/armored,/obj/item/clothing/shoes/magboots/changeling/armored))
if(changeling_generic_armor(/obj/item/clothing/suit/space/changeling/armored,/obj/item/clothing/head/helmet/space/changeling/armored,/obj/item/clothing/shoes/magboots/changeling/armored, 20))
return 1
return 0