diff --git a/code/game/objects/items/holy_armours.dm b/code/game/objects/items/holy_armours.dm index d9124b65e11d..da3f27dd970e 100644 --- a/code/game/objects/items/holy_armours.dm +++ b/code/game/objects/items/holy_armours.dm @@ -233,3 +233,208 @@ icon_state = "darktemplar-chaplain1" item_state = "darktemplar-chaplain1" armor = list(MELEE = 30, BULLET = 10, LASER = 15, ENERGY = 10, BOMB = 20, BIO = 60, RAD = 40, FIRE = 90, ACID = 80) + +/obj/item/storage/box/holy/flagelanteschains + name = "Flagenantes Kit" + +/obj/item/storage/box/holy/flagelanteschains/PopulateContents() + new /obj/item/clothing/suit/hooded/flagelantes_chains(src) + +/obj/item/clothing/suit/hooded/flagelantes_chains + name = "flagellant's chains" + desc = "Chains worn by those who wish to purify themselves through pain. They slow the wearer down initialy, but give divine haste the more pain they endure." + icon_state = "flagelantes_chains" + item_state = "flagelantes_chains" + armor = list(MELEE = -15, BULLET = -15, LASER = -15, ENERGY = -15, BOMB = -15, BIO = -15, RAD = 0, FIRE = 0, ACID = 0) + body_parts_covered = CHEST|GROIN|LEGS|ARMS + mutantrace_variation = MUTANTRACE_VARIATION //No leg squishing + resistance_flags = FIRE_PROOF | ACID_PROOF //No turning to ash/mush in the quest for pain + allowed = list(/obj/item/storage/book/bible, /obj/item/nullrod, /obj/item/reagent_containers/food/drinks/bottle/holywater, /obj/item/storage/fancy/candle_box, /obj/item/candle, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, /obj/item/tank/internals/ipc_coolant) + hoodtype = /obj/item/clothing/head/hooded/flagelantes_chains_hood + var/wrap = FALSE + var/obj/effect/abstract/particle_holder/flagelantes_effect + var/total_wounds + var/speed_message = FALSE + var/footstep = 1 + var/footstep_max = 2 + +/obj/item/clothing/suit/hooded/flagelantes_chains/equipped(mob/M, slot) + . = ..() + if(slot == ITEM_SLOT_OCLOTHING && iscarbon(M)) //Signals for sensing damage, healing, wounds, and movement + RegisterSignal(M, COMSIG_MOB_APPLY_DAMAGE, PROC_REF(handle_damage)) + RegisterSignal(M, COMSIG_MOB_APPLY_HEALING, PROC_REF(on_heal)) + RegisterSignal(M, COMSIG_CARBON_GAIN_WOUND, PROC_REF(handle_wound_add)) + RegisterSignal(M, COMSIG_CARBON_LOSE_WOUND, PROC_REF(handle_wound_remove)) + RegisterSignal(M, COMSIG_MOVABLE_MOVED, PROC_REF(on_mob_move)) + else + UnregisterSignal(M, list(COMSIG_MOB_APPLY_DAMAGE, COMSIG_MOB_APPLY_HEALING, COMSIG_CARBON_GAIN_WOUND, COMSIG_CARBON_LOSE_WOUND, COMSIG_MOVABLE_MOVED)) + +/obj/item/clothing/suit/hooded/flagelantes_chains/dropped(mob/M) + . = ..() + UnregisterSignal(M, list(COMSIG_MOB_APPLY_DAMAGE, COMSIG_MOB_APPLY_HEALING, COMSIG_CARBON_GAIN_WOUND, COMSIG_CARBON_LOSE_WOUND, COMSIG_MOVABLE_MOVED)) + REMOVE_TRAIT(M, TRAIT_IGNOREDAMAGESLOWDOWN, type) + total_wounds = 0 + slowdown = 0 + if(flagelantes_effect) + QDEL_NULL(flagelantes_effect) + +/obj/item/clothing/suit/hooded/flagelantes_chains/ToggleHood() //So people can't just quickly wear it whenever they want to + var/mob/living/carbon/human/H = src.loc + if(wrap) //Make sure they're not already trying to wear it + to_chat(H, span_warning("You're already wrapping the chains around yourself!.")) + return + else if(!suittoggled) + if(H.wear_suit != src) + to_chat(H, span_warning("You must be wearing [src] to put up the hood!")) + return + if(H.head) + to_chat(H, span_warning("You're already wearing something on your head!")) + return + to_chat(H, span_notice("You start wrapping the chains around yourself.")) + H.visible_message(span_warning("[H] starts wrapping [src] around themselves!")) + playsound(get_turf(src), 'sound/spookoween/chain_rattling.ogg', 10, TRUE, -1) + wrap = TRUE + if(!do_after(H, 3 SECONDS, H)) + wrap = FALSE + H.balloon_alert(H, "You were interupted!") + return //Stop it from completing if they move + if(ishuman(src.loc)) + if(H.equip_to_slot_if_possible(hood,ITEM_SLOT_HEAD,0,0,1)) + suittoggled = TRUE + src.icon_state = "[initial(icon_state)]_t" + H.update_inv_wear_suit() + for(var/X in actions) + var/datum/action/A = X + A.build_all_button_icons() + ADD_TRAIT(H, TRAIT_IGNOREDAMAGESLOWDOWN, type)// Ignore damage slowdown + change_slowdown(H, slowdown) //Change clothing slowdown based on damage + wrap = FALSE + else + RemoveHood() + REMOVE_TRAIT(H, TRAIT_IGNOREDAMAGESLOWDOWN, type) + total_wounds = 0 + slowdown = 0 + if(flagelantes_effect) + QDEL_NULL(flagelantes_effect) + +/obj/item/clothing/suit/hooded/flagelantes_chains/proc/handle_damage(mob/living/carbon/human/H, damage, damagetype, def_zone) + + SIGNAL_HANDLER + + if(suittoggled) //Make sure it only checks when the hood is up + change_slowdown(H, slowdown) //Change speed when damaged + +/obj/item/clothing/suit/hooded/flagelantes_chains/proc/on_heal(mob/living/carbon/human/H, amount, damtype) + + SIGNAL_HANDLER + + if(suittoggled) //Make sure it only checks when the hood is up + change_slowdown(H, slowdown) //Change speed when healed + +/obj/item/clothing/suit/hooded/flagelantes_chains/proc/handle_wound_add(mob/living/carbon/human/H, datum/wound/W, obj/item/bodypart/L) + + SIGNAL_HANDLER + + if(suittoggled) //Make sure it only checks when the hood is up + change_slowdown(H, slowdown) //Change speed when gaining a wound + + +/obj/item/clothing/suit/hooded/flagelantes_chains/proc/handle_wound_remove(mob/living/carbon/human/H, datum/wound/W, obj/item/bodypart/L) + + SIGNAL_HANDLER + + if(suittoggled) //Make sure it only checks when the hood is up + change_slowdown(H, slowdown) //Change speed when losing a wound + +/obj/item/clothing/suit/hooded/flagelantes_chains/proc/change_slowdown(mob/living/carbon/human/H, starting_slowdown) + var/health_percent = H.health / H.maxHealth + var/final_slowdown = 0 + + total_wounds = length(H.all_wounds) //Thanks Molti, Baimo, and Bibby + + if(total_wounds < 0) + total_wounds = 0 + + switch(total_wounds) //Change slowdown based on wounds + if(1) + final_slowdown += -0.1 + if(2) + final_slowdown += -0.2 + if(3 to INFINITY) //Max of three wounds for slowdown calculation + final_slowdown += -0.4 + + switch(health_percent) //Change slowdown based on health + if(0.90 to INFINITY) + final_slowdown += 1 + if(0.80 to 0.89) + final_slowdown += 0.5 + if(0.50 to 0.79) + final_slowdown += 0 + if(0.30 to 0.49) + final_slowdown += -0.2 + if(0.10 to 0.29) + final_slowdown += -0.4 + if(0 to 0.9) + final_slowdown += -0.6 + + slowdown = final_slowdown //set slowdown + + if(slowdown == -1) //Alert the user and those around that they've achieved MAXIMUM OVERDRIVE + if(!speed_message) + to_chat(H, span_notice("You feel yourself grow closer to the divine as your sins seep out of the chains!.")) + H.visible_message(span_warning("[H] starts sweating profusely!")) + speed_message = TRUE + else + speed_message = FALSE + + appearance_change(H, slowdown) //Add particles depending on slowdown + + change_footstep(slowdown) //Change occurance of chain noise + + if(slowdown > starting_slowdown) //Show bubble alert based on starting and new slowdown + H.balloon_alert(H, "You slow down!") + else if(slowdown < starting_slowdown) + H.balloon_alert(H, "You speed up!") + +/obj/item/clothing/suit/hooded/flagelantes_chains/proc/appearance_change(mob/living/carbon/human/H, slowdown) + switch(slowdown) + if(-0.9 to 1) + if(flagelantes_effect) + QDEL_NULL(flagelantes_effect) //Remove particle effect + if(-INFINITY to -1) + if(!flagelantes_effect) + flagelantes_effect = new(H, /particles/droplets) + flagelantes_effect.color = "#a41c1c" + +/obj/item/clothing/suit/hooded/flagelantes_chains/proc/change_footstep(slowdown) //So the chain sounds are not spammed at higher speeds + switch(slowdown) + if(0 to 1) + footstep_max = 2 + if(-0.3 to -0.1) + footstep_max = 3 + if(-0.9 to -0.4) + footstep_max = 4 + if(-INFINITY to -1) + footstep_max = 5 + +/obj/item/clothing/suit/hooded/flagelantes_chains/proc/on_mob_move() + var/mob/living/carbon/human/H = loc + if(!istype(H) || H.wear_suit != src) + return + if(footstep > footstep_max) + playsound(src, 'sound/weapons/chainhit.ogg', 3, 1) + footstep = 0 + else + footstep++ + +/obj/item/clothing/head/hooded/flagelantes_chains_hood + name = "flagellant's hood" + desc = "A hood worn by flagellants to hide their face." + icon = 'icons/obj/clothing/hats/hats.dmi' + mob_overlay_icon = 'icons/mob/clothing/head/head.dmi' + icon_state = "flagelantes_chains_hood" + item_state = "flagelantes_chains_hood" + armor = list(MELEE = -15, BULLET = -15, LASER = -15, ENERGY = -15, BOMB = -15, BIO = -15, RAD = 0, FIRE = 0, ACID = 0) + body_parts_covered = HEAD + flags_inv = HIDEEARS|HIDEEYES|HIDEFACE|HIDEFACIALHAIR|HIDEHAIR|HIDEMASK + resistance_flags = FIRE_PROOF | ACID_PROOF diff --git a/icons/mob/clothing/head/head.dmi b/icons/mob/clothing/head/head.dmi index baeec9187841..34261c5cf8d1 100644 Binary files a/icons/mob/clothing/head/head.dmi and b/icons/mob/clothing/head/head.dmi differ diff --git a/icons/mob/clothing/suit/suit.dmi b/icons/mob/clothing/suit/suit.dmi index ac8c422c19db..8f4c370bae19 100644 Binary files a/icons/mob/clothing/suit/suit.dmi and b/icons/mob/clothing/suit/suit.dmi differ diff --git a/icons/mob/inhands/clothing_lefthand.dmi b/icons/mob/inhands/clothing_lefthand.dmi index 1ebfa63e995f..dc91db1cee3a 100644 Binary files a/icons/mob/inhands/clothing_lefthand.dmi and b/icons/mob/inhands/clothing_lefthand.dmi differ diff --git a/icons/mob/inhands/clothing_righthand.dmi b/icons/mob/inhands/clothing_righthand.dmi index f68dba6e9fb7..907f4139ca43 100644 Binary files a/icons/mob/inhands/clothing_righthand.dmi and b/icons/mob/inhands/clothing_righthand.dmi differ diff --git a/icons/obj/clothing/hats/hats.dmi b/icons/obj/clothing/hats/hats.dmi index 47ce66a37073..8c15a42aef03 100644 Binary files a/icons/obj/clothing/hats/hats.dmi and b/icons/obj/clothing/hats/hats.dmi differ diff --git a/icons/obj/clothing/suits/suits.dmi b/icons/obj/clothing/suits/suits.dmi index 9e3b9be7ff5a..44742549c464 100644 Binary files a/icons/obj/clothing/suits/suits.dmi and b/icons/obj/clothing/suits/suits.dmi differ