diff --git a/code/__DEFINES/actionspeed_modification.dm b/code/__DEFINES/actionspeed_modification.dm index c3d288e907f..1753105f127 100644 --- a/code/__DEFINES/actionspeed_modification.dm +++ b/code/__DEFINES/actionspeed_modification.dm @@ -1,3 +1,5 @@ //ids #define ACTIONSPEED_ID_SANITY "sanity_component" #define ACTIONSPEED_ID_STIMULANTS "stimulant_withdrawal" + +#define ACTIONSPEED_ID_MIDAS_BLIGHT "midas_blight_debuff" diff --git a/code/__DEFINES/movespeed_modification.dm b/code/__DEFINES/movespeed_modification.dm index c4300d96606..23c600aae70 100644 --- a/code/__DEFINES/movespeed_modification.dm +++ b/code/__DEFINES/movespeed_modification.dm @@ -11,3 +11,5 @@ #define MOVESPEED_ID_MOB_GRAB_STATE "mob_grab_state" #define MOVESPEED_ID_MOB_WALK_RUN "mob_walk_run" + +#define MOVESPEED_ID_MIDAS_BLIGHT "midas_blight_debuff" diff --git a/code/datums/status_effects/debuffs/debuffs.dm b/code/datums/status_effects/debuffs/debuffs.dm index b2f3e5be918..bb63b177bb5 100644 --- a/code/datums/status_effects/debuffs/debuffs.dm +++ b/code/datums/status_effects/debuffs/debuffs.dm @@ -967,5 +967,71 @@ /datum/movespeed_modifier/careful_driving multiplicative_slowdown = 3 +/datum/status_effect/midas_blight + id = "midas_blight" + alert_type = /atom/movable/screen/alert/status_effect/midas_blight + status_type = STATUS_EFFECT_REPLACE + tick_interval = 0.2 SECONDS + remove_on_fullheal = TRUE + + /// The visual overlay state, helps tell both you and enemies how much gold is in your system + var/midas_state = "midas_1" + /// How fast the gold in a person's system scales. + var/goldscale = 30 // x2.8 - Gives ~ 15u for 1 second + +/datum/status_effect/midas_blight/on_creation(mob/living/new_owner, duration = 1) + // Duration is already input in SECONDS + src.duration = duration + RegisterSignal(new_owner, COMSIG_ATOM_UPDATE_OVERLAYS, PROC_REF(on_update_overlays)) + return ..() + +/atom/movable/screen/alert/status_effect/midas_blight + name = "Midas Blight" + desc = "Your blood is being turned to gold, slowing your movements!" + icon_state = "midas_blight" + +/datum/status_effect/midas_blight/tick(seconds_between_ticks) + var/mob/living/carbon/human/victim = owner + // We're transmuting blood, time to lose some. + if(victim.blood_volume > BLOOD_VOLUME_SURVIVE + 50 && !HAS_TRAIT(victim, TRAIT_NOBLOOD)) + victim.blood_volume -= 5 * seconds_between_ticks + // This has been hell to try and balance so that you'll actually get anything out of it + victim.reagents.add_reagent(/datum/reagent/gold/cursed, amount = seconds_between_ticks * goldscale, no_react = TRUE) + var/current_gold_amount = victim.reagents.get_reagent_amount(/datum/reagent/gold, include_subtypes = TRUE) + switch(current_gold_amount) + if(-INFINITY to 50) + victim.add_movespeed_modifier(/datum/movespeed_modifier/status_effect/midas_blight/soft, update = TRUE) + victim.add_actionspeed_modifier(/datum/actionspeed_modifier/status_effect/midas_blight/soft, update = TRUE) + midas_state = "midas_1" + if(50 to 100) + victim.add_movespeed_modifier(/datum/movespeed_modifier/status_effect/midas_blight/medium, update = TRUE) + victim.add_actionspeed_modifier(/datum/actionspeed_modifier/status_effect/midas_blight/medium, update = TRUE) + midas_state = "midas_2" + if(100 to 200) + victim.add_movespeed_modifier(/datum/movespeed_modifier/status_effect/midas_blight/hard, update = TRUE) + victim.add_actionspeed_modifier(/datum/actionspeed_modifier/status_effect/midas_blight/hard, update = TRUE) + midas_state = "midas_3" + if(200 to INFINITY) + victim.add_movespeed_modifier(/datum/movespeed_modifier/status_effect/midas_blight/gold, update = TRUE) + victim.add_actionspeed_modifier(/datum/actionspeed_modifier/status_effect/midas_blight/gold, update = TRUE) + midas_state = "midas_4" + victim.update_icon() + if(victim.stat == DEAD) + qdel(src) // Dead people stop being turned to gold. Don't want people sitting on dead bodies. + +/datum/status_effect/midas_blight/proc/on_update_overlays(atom/parent_atom, list/overlays) + SIGNAL_HANDLER + + if(midas_state) + var/mutable_appearance/midas_overlay = mutable_appearance('icons/mob/effects/debuff_overlays.dmi', midas_state) + midas_overlay.blend_mode = BLEND_MULTIPLY + overlays += midas_overlay + +/datum/status_effect/midas_blight/on_remove() + owner.remove_movespeed_modifier(MOVESPEED_ID_MIDAS_BLIGHT, update = TRUE) + owner.remove_actionspeed_modifier(ACTIONSPEED_ID_MIDAS_BLIGHT, update = TRUE) + UnregisterSignal(owner, COMSIG_ATOM_UPDATE_OVERLAYS) + owner.update_icon() + #undef HEALING_SLEEP_DEFAULT #undef HEALING_SLEEP_ORGAN_MULTIPLIER diff --git a/code/game/objects/structures/petrified_statue.dm b/code/game/objects/structures/petrified_statue.dm index 78bd478d523..54896c2e414 100644 --- a/code/game/objects/structures/petrified_statue.dm +++ b/code/game/objects/structures/petrified_statue.dm @@ -94,7 +94,7 @@ /mob/proc/petrify(statue_timer) -/mob/living/carbon/human/petrify(statue_timer, save_brain) +/mob/living/carbon/human/petrify(statue_timer, save_brain, colorlist) if(!isturf(loc)) return FALSE var/obj/structure/statue/petrified/S = new(loc, src, statue_timer, save_brain) @@ -102,6 +102,8 @@ ADD_TRAIT(src, TRAIT_NOBLOOD, MAGIC_TRAIT) S.copy_overlays(src) var/newcolor = list(rgb(77,77,77), rgb(150,150,150), rgb(28,28,28), rgb(0,0,0)) + if(colorlist) + newcolor = colorlist S.add_atom_colour(newcolor, FIXED_COLOUR_PRIORITY) return TRUE diff --git a/code/modules/actionspeed/modifiers/status_effects.dm b/code/modules/actionspeed/modifiers/status_effects.dm index fa080edb8d0..ec7b0dba22e 100644 --- a/code/modules/actionspeed/modifiers/status_effects.dm +++ b/code/modules/actionspeed/modifiers/status_effects.dm @@ -12,3 +12,19 @@ /datum/actionspeed_modifier/status_effect/hazard_area multiplicative_slowdown = 4 + +/// Get slower the more gold is in your system. +/datum/actionspeed_modifier/status_effect/midas_blight + id = ACTIONSPEED_ID_MIDAS_BLIGHT + +/datum/actionspeed_modifier/status_effect/midas_blight/soft + multiplicative_slowdown = 0.25 + +/datum/actionspeed_modifier/status_effect/midas_blight/medium + multiplicative_slowdown = 0.75 + +/datum/actionspeed_modifier/status_effect/midas_blight/hard + multiplicative_slowdown = 1.5 + +/datum/actionspeed_modifier/status_effect/midas_blight/gold + multiplicative_slowdown = 2 diff --git a/code/modules/antagonists/pirate/pirate_outfits.dm b/code/modules/antagonists/pirate/pirate_outfits.dm index d2f648bb1fd..4c73cac107f 100644 --- a/code/modules/antagonists/pirate/pirate_outfits.dm +++ b/code/modules/antagonists/pirate/pirate_outfits.dm @@ -36,6 +36,12 @@ id_trim = /datum/id_trim/pirate/captain head = /obj/item/clothing/head/costume/pirate/armored +/datum/outfit/pirate/captain/skeleton + name = "Space Pirate Captain (Skeleton)" + + belt = /obj/item/gun/magic/midas_hand + l_pocket = /obj/item/coin/gold/doubloon + /datum/outfit/pirate/space name = "Space Pirate (EVA)" diff --git a/code/modules/antagonists/pirate/pirate_roles.dm b/code/modules/antagonists/pirate/pirate_roles.dm index 68683333c49..64baa724db1 100644 --- a/code/modules/antagonists/pirate/pirate_roles.dm +++ b/code/modules/antagonists/pirate/pirate_roles.dm @@ -61,7 +61,7 @@ /obj/effect/mob_spawn/ghost_role/human/pirate/skeleton/captain rank = "Captain" - outfit = /datum/outfit/pirate/captain + outfit = /datum/outfit/pirate/captain/skeleton /obj/effect/mob_spawn/ghost_role/human/pirate/skeleton/gunner rank = "Gunner" diff --git a/code/modules/movespeed/modifiers/status_effects.dm b/code/modules/movespeed/modifiers/status_effects.dm index e8aad88c50d..65245880ef4 100644 --- a/code/modules/movespeed/modifiers/status_effects.dm +++ b/code/modules/movespeed/modifiers/status_effects.dm @@ -37,3 +37,19 @@ /datum/movespeed_modifier/status_effect/tired_post_charge multiplicative_slowdown = 3 + +/// Get slower the more gold is in your system. +/datum/movespeed_modifier/status_effect/midas_blight + id = MOVESPEED_ID_MIDAS_BLIGHT + +/datum/movespeed_modifier/status_effect/midas_blight/soft + multiplicative_slowdown = 0.25 + +/datum/movespeed_modifier/status_effect/midas_blight/medium + multiplicative_slowdown = 0.75 + +/datum/movespeed_modifier/status_effect/midas_blight/hard + multiplicative_slowdown = 1.5 + +/datum/movespeed_modifier/status_effect/midas_blight/gold + multiplicative_slowdown = 2 diff --git a/code/modules/projectiles/guns/special/hand_of_midas.dm b/code/modules/projectiles/guns/special/hand_of_midas.dm new file mode 100644 index 00000000000..9907352e3f5 --- /dev/null +++ b/code/modules/projectiles/guns/special/hand_of_midas.dm @@ -0,0 +1,138 @@ +// Hand of Midas + +/obj/item/gun/magic/midas_hand + name = "The Hand of Midas" + desc = "An ancient Egyptian matchlock pistol imbued with the powers of the Greek King Midas. Don't question the cultural or religious implications of this." + ammo_type = /obj/item/ammo_casing/magic/midas_round + icon_state = "midas_hand" + inhand_icon_state = "gun" + worn_icon_state = "gun" + lefthand_file = 'icons/mob/inhands/weapons/guns_lefthand.dmi' + righthand_file = 'icons/mob/inhands/weapons/guns_righthand.dmi' + fire_sound = 'sound/weapons/gun/rifle/shot.ogg' + pinless = TRUE + max_charges = 1 + can_charge = FALSE + item_flags = NEEDS_PERMIT + w_class = WEIGHT_CLASS_BULKY // Should fit on a belt. + force = 3 + trigger_guard = TRIGGER_GUARD_NORMAL + antimagic_flags = NONE + can_hold_up = FALSE + + /// The length of the Midas Blight debuff, dependant on the amount of gold reagent we've sucked up. + var/gold_timer = 3 SECONDS + /// The range that we can suck gold out of people's bodies + var/gold_suck_range = 2 + +/obj/item/gun/magic/midas_hand/examine(mob/user) + . = ..() + var/gold_time_converted = gold_time_convert() + . += span_notice("Your next shot will inflict [gold_time_converted] second[gold_time_converted == 1 ? "" : "s"] of Midas Blight.") + . += span_notice("Right-Click on enemies to drain gold from their bloodstreams to reload [src].") + . += span_notice("[src] can be reloaded using gold coins in a pinch.") + +/obj/item/gun/magic/midas_hand/shoot_with_empty_chamber(mob/living/user) + . = ..() + balloon_alert(user, "not enough gold") + +// Siphon gold from a victim, recharging our gun & removing their Midas Blight debuff in the process. +/obj/item/gun/magic/midas_hand/afterattack_secondary(mob/living/victim, mob/living/user, proximity_flag, click_parameters) + if(!isliving(victim) || !IN_GIVEN_RANGE(user, victim, gold_suck_range)) + return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN + if(victim == user) + balloon_alert(user, "can't siphon from self") + return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN + if(!victim.reagents) + return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN + if(!victim.reagents.has_reagent(/datum/reagent/gold, check_subtypes = TRUE)) + balloon_alert(user, "no gold in bloodstream") + return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN + var/gold_beam = user.Beam(victim, icon_state="drain_gold") + if(!do_after(user = user, delay = 1 SECONDS, target = victim, timed_action_flags = (IGNORE_USER_LOC_CHANGE | IGNORE_TARGET_LOC_CHANGE), extra_checks = CALLBACK(src, PROC_REF(check_gold_range), user, victim))) + qdel(gold_beam) + balloon_alert(user, "link broken") + return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN + handle_gold_charges(user, victim.reagents.get_reagent_amount(/datum/reagent/gold, include_subtypes = TRUE)) + victim.reagents.remove_all_type(/datum/reagent/gold, victim.reagents.get_reagent_amount(/datum/reagent/gold, include_subtypes = TRUE)) + victim.remove_status_effect(/datum/status_effect/midas_blight) + qdel(gold_beam) + return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN + +// If we botch a shot, we have to start over again by inserting gold coins into the gun. Can only be done if it has no charges or gold. +/obj/item/gun/magic/midas_hand/attackby(obj/item/I, mob/living/user, params) + . = ..() + if(charges || gold_timer) + balloon_alert(user, "already loaded") + return + if(istype(I, /obj/item/coin/gold)) + handle_gold_charges(user, 1.5 SECONDS) + qdel(I) + +/// Handles recharging & inserting gold amount +/obj/item/gun/magic/midas_hand/proc/handle_gold_charges(user, gold_amount) + gold_timer += gold_amount + var/gold_time_converted = gold_time_convert() + balloon_alert(user, "[gold_time_converted] second[gold_time_converted == 1 ? "" : "s"]") + if(!charges) + instant_recharge() + +/// Converts our gold_timer to time in seconds, for various ballons/examines +/obj/item/gun/magic/midas_hand/proc/gold_time_convert() + return min(30 SECONDS, round(gold_timer, 0.2)) / 10 + +/// Checks our range to the person we're sucking gold out of. Double the initial range, so you need to get in close to start. +/obj/item/gun/magic/midas_hand/proc/check_gold_range(mob/living/user, mob/living/victim) + return IN_GIVEN_RANGE(user, victim, gold_suck_range*2) + +/obj/item/ammo_casing/magic/midas_round + projectile_type = /obj/projectile/magic/midas_round + + +/obj/projectile/magic/midas_round + name = "gold pellet" + desc = "A typical flintlock ball, save for the fact it's made of cursed Egyptian gold." + damage_type = BRUTE + damage = 10 + stamina = 20 + armour_penetration = 50 + hitsound = 'sound/effects/coin2.ogg' + icon_state = "pellet" + color = "#FFD700" + /// The gold charge in this pellet + var/gold_charge = 0 + + +/obj/projectile/magic/midas_round/fire(setAngle) + /// Transfer the gold energy to our bullet + var/obj/item/gun/magic/midas_hand/my_gun = fired_from + gold_charge = my_gun.gold_timer + my_gun.gold_timer = 0 + ..() + +// Gives human targets Midas Blight. +/obj/projectile/magic/midas_round/on_hit(atom/target) + . = ..() + if(ishuman(target)) + var/mob/living/carbon/human/my_guy = target + if(isskeleton(my_guy)) // No cheap farming + return + my_guy.apply_status_effect(/datum/status_effect/midas_blight, min(30 SECONDS, round(gold_charge, 0.2))) // 100u gives 10 seconds + return + +/obj/item/gun/magic/midas_hand/suicide_act(mob/living/user) + if(!ishuman(user)) + return + + var/mob/living/carbon/human/victim = user + victim.visible_message(span_suicide("[victim] holds the barrel of [src] to [victim.p_their()] head, lighting the fuse. It looks like [user.p_theyre()] trying to commit suicide!")) + if(!do_after(victim, 1.5 SECONDS)) + return + playsound(src, 'sound/weapons/gun/rifle/shot.ogg', 75, TRUE) + to_chat(victim, span_danger("You don't even have the time to register the gunshot by the time your body has completely converted into a golden statue.")) + var/newcolors = list(rgb(206, 164, 50), rgb(146, 146, 139), rgb(28,28,28), rgb(0,0,0)) + victim.petrify(statue_timer = INFINITY, save_brain = FALSE, colorlist = newcolors) + playsound(victim, 'sound/effects/coin2.ogg', 75, TRUE) + charges = 0 + gold_timer = 0 + return OXYLOSS diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index 1f3a305cb47..3a699da266d 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -3035,3 +3035,8 @@ . = UPDATE_MOB_HEALTH if(SPT_PROB(10, seconds_per_tick)) affected_mob.emote(pick("twitch","choke","shiver","gag")) + +// The same as gold just with a slower metabolism rate, to make using the Hand of Midas easier. +/datum/reagent/gold/cursed + name = "Cursed Gold" + metabolization_rate = 0.2 * REAGENTS_METABOLISM diff --git a/icons/effects/beam.dmi b/icons/effects/beam.dmi index ae695c3227f..12e3ce9f7d5 100644 Binary files a/icons/effects/beam.dmi and b/icons/effects/beam.dmi differ diff --git a/icons/hud/screen_alert.dmi b/icons/hud/screen_alert.dmi index 1edd4d29cb5..0fa8ec21850 100644 Binary files a/icons/hud/screen_alert.dmi and b/icons/hud/screen_alert.dmi differ diff --git a/icons/mob/effects/debuff_overlays.dmi b/icons/mob/effects/debuff_overlays.dmi new file mode 100644 index 00000000000..383ce22aabe Binary files /dev/null and b/icons/mob/effects/debuff_overlays.dmi differ diff --git a/icons/obj/weapons/guns/magic.dmi b/icons/obj/weapons/guns/magic.dmi index fe3eb6ae895..7cab0cdfc25 100644 Binary files a/icons/obj/weapons/guns/magic.dmi and b/icons/obj/weapons/guns/magic.dmi differ diff --git a/tgstation.dme b/tgstation.dme index e6f65e3dd38..b215241ebb7 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -5070,6 +5070,7 @@ #include "code\modules\projectiles\guns\special\blastcannon.dm" #include "code\modules\projectiles\guns\special\chem_gun.dm" #include "code\modules\projectiles\guns\special\grenade_launcher.dm" +#include "code\modules\projectiles\guns\special\hand_of_midas.dm" #include "code\modules\projectiles\guns\special\meat_hook.dm" #include "code\modules\projectiles\guns\special\medbeam.dm" #include "code\modules\projectiles\guns\special\syringe_gun.dm"