mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 19:22:56 +00:00
protean rig armor
This commit is contained in:
@@ -48,21 +48,22 @@ These should come standard with the Protean rigsuit, unless you want them to wor
|
|||||||
/obj/item/rig_module/protean/syphon/process()
|
/obj/item/rig_module/protean/syphon/process()
|
||||||
if(active)
|
if(active)
|
||||||
var/mob/living/carbon/human/H = holder.wearer
|
var/mob/living/carbon/human/H = holder.wearer
|
||||||
var/mob/living/carbon/human/P = holder?:myprotean?:humanform
|
var/mob/living/P = holder?:myprotean
|
||||||
if(H && P)
|
if(istype(H.species, /datum/species/protean))
|
||||||
|
to_chat(H, "<span class='warning'>Your Protean modules do not function on yourself.</span>")
|
||||||
|
deactivate(1)
|
||||||
|
else
|
||||||
|
P = P?:humanform
|
||||||
if((H.nutrition >= 100) && (P.nutrition <= 5000))
|
if((H.nutrition >= 100) && (P.nutrition <= 5000))
|
||||||
H.nutrition -= 10
|
H.nutrition -= 10
|
||||||
P.nutrition += 10
|
P.nutrition += 10
|
||||||
else
|
|
||||||
deactivate(1)
|
|
||||||
|
|
||||||
|
|
||||||
//This rig module allows a worn Protean to toggle and configure its armor settings.
|
//This rig module allows a worn Protean to toggle and configure its armor settings.
|
||||||
/obj/item/rig_module/protean/armor
|
/obj/item/rig_module/protean/armor
|
||||||
name = "Protean Adaptive Armor"
|
name = "Protean Adaptive Armor"
|
||||||
desc = "This should never be outside of a RIG."
|
desc = "This should never be outside of a RIG."
|
||||||
interface_name = "Protean Adaptive Armor"
|
interface_name = "Protean Adaptive Armor"
|
||||||
interface_desc = "Adjusts the proteans deployed armor values to fit the needs of the wearer. Incurs a slowdown penalty."
|
interface_desc = "Adjusts the proteans deployed armor values to fit the needs of the wearer. Incurs a slowdown penalty that scales with the amount of armor provided."
|
||||||
usable = 1
|
usable = 1
|
||||||
toggleable = 1
|
toggleable = 1
|
||||||
activate_string = "Enable Armor"
|
activate_string = "Enable Armor"
|
||||||
@@ -72,14 +73,11 @@ These should come standard with the Protean rigsuit, unless you want them to wor
|
|||||||
var/armor_weight_ratio = 0.01 //This amount of slowdown per 1% of armour. 3 slowdown at the max armour.
|
var/armor_weight_ratio = 0.01 //This amount of slowdown per 1% of armour. 3 slowdown at the max armour.
|
||||||
|
|
||||||
/obj/item/rig_module/protean/armor/engage()
|
/obj/item/rig_module/protean/armor/engage()
|
||||||
|
|
||||||
if(!..())
|
|
||||||
return 0
|
|
||||||
var/armor_chosen = input(usr, "Which armor to adjust?", "Protean Armor") as null|anything in armor_settings
|
var/armor_chosen = input(usr, "Which armor to adjust?", "Protean Armor") as null|anything in armor_settings
|
||||||
if(armor_chosen)
|
if(armor_chosen)
|
||||||
var/value = input(usr, "Set armour reduction value (Max of 60%)", "Protean Armor") as num
|
var/value = input(usr, "Set armour reduction value (Max of 60%)", "Protean Armor") as num
|
||||||
if(value)
|
if(value)
|
||||||
if((value > 60) && value <0)
|
if((value > 60) || (value < 0))
|
||||||
to_chat(usr, "<span class ='warning'>Invalid armor value. Can only be between 0-60</span>")
|
to_chat(usr, "<span class ='warning'>Invalid armor value. Can only be between 0-60</span>")
|
||||||
else
|
else
|
||||||
value = round(value)
|
value = round(value)
|
||||||
@@ -87,27 +85,44 @@ These should come standard with the Protean rigsuit, unless you want them to wor
|
|||||||
|
|
||||||
|
|
||||||
/obj/item/rig_module/protean/armor/activate()
|
/obj/item/rig_module/protean/armor/activate()
|
||||||
if(!..())
|
if(!..(1))
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
var/mob/living/carbon/human/H = holder.wearer
|
var/mob/living/carbon/human/H = holder.wearer
|
||||||
if(H)
|
if(H)
|
||||||
to_chat(usr, "<font color='blue'><b>You activate the suit's energy syphon.</b></font>")
|
var/list/temparmor = list("bio" = 100, "rad" = 100)
|
||||||
to_chat(H, "<span class='warning'>Your suit begins to sap at your own energy stores.</span>")
|
temparmor = armor_settings + temparmor
|
||||||
|
to_chat(usr, "<font color='blue'><b>You signal the suit to harden.</b></font>")
|
||||||
|
to_chat(H, "<span class='notice'>Your suit hardens in response to physical trauma.</span>")
|
||||||
|
holder.armor = temparmor.Copy()
|
||||||
|
for(var/obj/item/piece in list(holder.gloves,holder.helmet,holder.boots,holder.chest))
|
||||||
|
piece.armor = temparmor.Copy()
|
||||||
|
for(var/entry in armor_settings)
|
||||||
|
holder.slowdown += temparmor[entry]*armor_weight_ratio
|
||||||
|
message_admins(temparmor[entry])
|
||||||
|
//holder.slowdown -= (armor_weight_ratio*200)
|
||||||
active = 1
|
active = 1
|
||||||
else
|
else
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
/obj/item/rig_module/protean/armor/deactivate(var/forced)
|
/obj/item/rig_module/protean/armor/deactivate(var/forced)
|
||||||
if(!..())
|
if(!..(1))
|
||||||
return 0
|
return 0
|
||||||
if(forced)
|
if(forced)
|
||||||
|
holder.armor = list("melee" = 0, "bullet" = 0, "laser" = 0,"energy" = 0, "bomb" = 0, "bio" = 100, "rad" = 100)
|
||||||
|
for(var/obj/item/piece in list(holder.gloves,holder.helmet,holder.boots,holder.chest))
|
||||||
|
piece.armor = list("melee" = 0, "bullet" = 0, "laser" = 0,"energy" = 0, "bomb" = 0, "bio" = 100, "rad" = 100)
|
||||||
|
holder.slowdown = initial(slowdown)
|
||||||
active = 0
|
active = 0
|
||||||
return
|
return
|
||||||
var/mob/living/carbon/human/H = holder.wearer
|
var/mob/living/carbon/human/H = holder.wearer
|
||||||
if(H)
|
if(H)
|
||||||
to_chat(usr, "<font color='blue'><b>You deactivate the suit's energy syphon.</b></font>")
|
to_chat(usr, "<font color='blue'><b>You signal the suit to relax.</b></font>")
|
||||||
to_chat(H, "<span class='warning'>Your suit ceases from sapping your own energy.</span>")
|
to_chat(H, "<span class='warning'>Your suit softens.</span>")
|
||||||
|
holder.armor = list("melee" = 0, "bullet" = 0, "laser" = 0,"energy" = 0, "bomb" = 0, "bio" = 100, "rad" = 100)
|
||||||
|
for(var/obj/item/piece in list(holder.gloves,holder.helmet,holder.boots,holder.chest))
|
||||||
|
piece.armor = list("melee" = 0, "bullet" = 0, "laser" = 0,"energy" = 0, "bomb" = 0, "bio" = 100, "rad" = 100)
|
||||||
|
holder.slowdown = initial(slowdown)
|
||||||
active = 0
|
active = 0
|
||||||
else
|
else
|
||||||
return 0
|
return 0
|
||||||
@@ -115,12 +130,8 @@ These should come standard with the Protean rigsuit, unless you want them to wor
|
|||||||
/obj/item/rig_module/protean/armor/process()
|
/obj/item/rig_module/protean/armor/process()
|
||||||
if(active)
|
if(active)
|
||||||
var/mob/living/carbon/human/H = holder.wearer
|
var/mob/living/carbon/human/H = holder.wearer
|
||||||
var/mob/living/carbon/human/P = holder?:myprotean?:humanform
|
if(istype(H.species, /datum/species/protean))
|
||||||
if(H && P)
|
to_chat(H, "<span class='warning'>Your Protean modules do not function on yourself.</span>")
|
||||||
if((H.nutrition >= 100) && (P.nutrition <= 5000))
|
|
||||||
H.nutrition -= 10
|
|
||||||
P.nutrition += 10
|
|
||||||
else
|
|
||||||
deactivate(1)
|
deactivate(1)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
offline_slowdown = 0
|
offline_slowdown = 0
|
||||||
seal_delay = 1
|
seal_delay = 1
|
||||||
var/mob/living/myprotean
|
var/mob/living/myprotean
|
||||||
initial_modules = list(/obj/item/rig_module/protean/syphon)
|
initial_modules = list(/obj/item/rig_module/protean/syphon, /obj/item/rig_module/protean/armor)
|
||||||
|
|
||||||
helm_type = /obj/item/clothing/head/helmet/space/rig/protean //These are important for sprite pointers
|
helm_type = /obj/item/clothing/head/helmet/space/rig/protean //These are important for sprite pointers
|
||||||
boot_type = /obj/item/clothing/shoes/magboots/rig/protean
|
boot_type = /obj/item/clothing/shoes/magboots/rig/protean
|
||||||
|
|||||||
Reference in New Issue
Block a user