Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BOUNTY] Makes mayhem in a bottle more viable to use in general #3809

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions code/__DEFINES/traits/monkestation/declarations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,7 @@
/// Mob does not homeostasize body temperature
#define TRAIT_COLD_BLOODED "cold_blooded"

/// Mob can't strip other mobs, overrides TRAIT_CAN_STRIP. Importantly, they cannot *open* strip menus, so this is used for mayhem in a bottle.
#define TRAIT_CANT_STRIP "cant_strip"

// END TRAIT DEFINES
1 change: 1 addition & 0 deletions code/_globalvars/traits/_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_CANT_RIDE" = TRAIT_CANT_RIDE,
"TRAIT_CANT_SIGN_SPELLS" = TRAIT_CANT_SIGN_SPELLS,
"TRAIT_CANT_STAMCRIT" = TRAIT_CANT_STAMCRIT,
"TRAIT_CANT_STRIP" = TRAIT_CANT_STRIP,
"TRAIT_CAN_HOLD_ITEMS" = TRAIT_CAN_HOLD_ITEMS,
"TRAIT_CAN_SIGN_ON_COMMS" = TRAIT_CAN_SIGN_ON_COMMS,
"TRAIT_CAN_STRIP" = TRAIT_CAN_STRIP,
Expand Down
5 changes: 4 additions & 1 deletion code/datums/elements/strippable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
if (!(cyborg_user.istate & ISTATE_HARM))
return

if(HAS_TRAIT(user, TRAIT_CANT_STRIP)) // This is a monkestation addition and is used for mayhem in a bottle.
return

if (!isnull(should_strip_proc_path) && !call(source, should_strip_proc_path)(user))
return

Expand Down Expand Up @@ -475,7 +478,7 @@
ui_status_only_living(user, owner),
ui_status_user_has_free_hands(user, owner),
ui_status_user_is_adjacent(user, owner, allow_tk = FALSE),
HAS_TRAIT(user, TRAIT_CAN_STRIP) ? UI_INTERACTIVE : UI_UPDATE,
HAS_TRAIT(user, TRAIT_CAN_STRIP) && !HAS_TRAIT(user, TRAIT_CANT_STRIP) ? UI_INTERACTIVE : UI_UPDATE, // monkestation edit
max(
ui_status_user_is_conscious_and_lying_down(user),
ui_status_user_is_abled(user, owner),
Expand Down
6 changes: 4 additions & 2 deletions code/datums/status_effects/buffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@

/datum/status_effect/mayhem
id = "Mayhem"
duration = 2 MINUTES
duration = 1 MINUTE // monkestation edit
/// The chainsaw spawned by the status effect
var/obj/item/chainsaw/doomslayer/chainsaw

Expand All @@ -387,9 +387,11 @@
if(iscarbon(owner))
chainsaw = new(get_turf(owner))
ADD_TRAIT(chainsaw, TRAIT_NODROP, CHAINSAW_FRENZY_TRAIT)
chainsaw.item_flags |= DROPDEL // monkestation addition
chainsaw.resistance_flags |= INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF // monkestation addition
owner.put_in_hands(chainsaw, forced = TRUE)
chainsaw.attack_self(owner)
owner.reagents.add_reagent(/datum/reagent/medicine/adminordrazine, 25)
//owner.reagents.add_reagent(/datum/reagent/medicine/adminordrazine, 25) MONKESTATION REMOVAL

owner.log_message("entered a blood frenzy", LOG_ATTACK)
to_chat(owner, span_warning("KILL, KILL, KILL! YOU HAVE NO ALLIES ANYMORE, KILL THEM ALL!"))
Expand Down
4 changes: 3 additions & 1 deletion code/game/objects/items/chainsaw.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

/obj/item/chainsaw/attack_self(mob/user)
on = !on
to_chat(user, "As you pull the starting cord dangling from [src], [on ? "it begins to whirr." : "the chain stops moving."]")
to_chat(user, span_notice("As you pull the starting cord dangling from [src], [on ? "it begins to whirr." : "the chain stops moving."]")) // monkestation edit
force = on ? force_on : initial(force)
throwforce = on ? force_on : initial(force)
icon_state = "chainsaw_[on ? "on" : "off"]"
Expand Down Expand Up @@ -99,12 +99,14 @@
armour_penetration = 100
force_on = 30

/* MONKESTATION REMOVAL START
/obj/item/chainsaw/doomslayer/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
if(attack_type == PROJECTILE_ATTACK)
owner.visible_message(span_danger("Ranged attacks just make [owner] angrier!"))
playsound(src, pick('sound/weapons/bulletflyby.ogg', 'sound/weapons/bulletflyby2.ogg', 'sound/weapons/bulletflyby3.ogg'), 75, TRUE)
return TRUE
return FALSE
MONKESTATION REMOVAL END */

/obj/item/chainsaw/mounted_chainsaw
name = "mounted chainsaw"
Expand Down
90 changes: 90 additions & 0 deletions monkestation/code/datums/status_effects/buffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,93 @@
/datum/status_effect/hippocratic_oath/on_remove()
. = ..()
REMOVE_TRAIT(owner, TRAIT_PERFECT_SURGEON, HIPPOCRATIC_OATH_TRAIT)

/datum/movespeed_modifier/mayhem
multiplicative_slowdown = -0.6

/atom/movable/screen/alert/status_effect/mayhem
name = "<span class='cult'>Mayhem</span>"
desc = "<span class='bolddanger'>RIP AND TEAR!!</span>"
icon = 'icons/obj/weapons/chainsaw.dmi'
icon_state = "chainsaw_on"
alerttooltipstyle = "cult"

/datum/status_effect/mayhem
show_duration = TRUE
tick_interval = 0 // Just pass me the SSfastprocess ticks please.

alert_type = /atom/movable/screen/alert/status_effect/mayhem

var/list/traits = list(
TRAIT_NO_SPRINT, // It makes you go really fast already, also makes you focus more on hitting people.
TRAIT_IGNOREDAMAGESLOWDOWN,
TRAIT_NO_PAIN_EFFECTS,
TRAIT_SLEEPIMMUNE,
TRAIT_NOSOFTCRIT,
TRAIT_NOHARDCRIT,
TRAIT_NOCRITOVERLAY,
)

/datum/status_effect/mayhem/on_remove()
. = ..()

owner.remove_movespeed_modifier(/datum/movespeed_modifier/mayhem)
owner.remove_client_colour(/datum/client_colour/mayhem)

owner.remove_traits(traits, CHAINSAW_FRENZY_TRAIT)

/datum/status_effect/mayhem/on_apply()
. = ..()

owner.SetAllImmobility(0)
owner.set_resting(FALSE, silent = TRUE, instant = TRUE)

owner.add_traits(traits, CHAINSAW_FRENZY_TRAIT)

owner.add_movespeed_modifier(/datum/movespeed_modifier/mayhem)

addtimer(CALLBACK(owner, TYPE_PROC_REF(/mob, add_client_colour), /datum/client_colour/mayhem), 2.1 SECONDS) // So that it lines up with the bloodlust colour perfectly.

if(!ishuman(owner))
return

var/mob/living/carbon/human/user = owner

if(user.handcuffed)
shatter(user, ITEM_SLOT_HANDCUFFED)

if(user.legcuffed)
shatter(user, ITEM_SLOT_LEGCUFFED)

if(user.wear_suit?.breakouttime)
shatter(user, ITEM_SLOT_OCLOTHING)

/datum/status_effect/mayhem/proc/shatter(mob/living/carbon/human/user, slot)
var/obj/item/restraints = user.get_item_by_slot(slot)

owner.visible_message(
message = span_warning("[user] shatters [user.p_their()] [restraints.name]!"),
self_message = span_notice("You shatter your [restraints.name]!"),
blind_message = span_hear("You hear something shatter!")
)

qdel(restraints)

/datum/status_effect/mayhem/tick(seconds_per_tick, times_fired) // Replacement for the Adminordazine it used before.
. = ..()

var/healing_amount = 5 * seconds_per_tick

owner.heal_overall_damage(healing_amount, healing_amount, STAMINA_MAX / 10 * seconds_per_tick, updating_health = FALSE)
owner.adjustToxLoss(-healing_amount, updating_health = FALSE)
owner.adjustOxyLoss(-healing_amount, updating_health = FALSE)

owner.blood_volume = min(owner.blood_volume + BLOOD_VOLUME_NORMAL / 10 * seconds_per_tick, BLOOD_VOLUME_NORMAL)

if(iscarbon(owner))
var/mob/living/carbon/user = owner
if(length(user.all_wounds) && SPT_PROB(20, seconds_per_tick))
qdel(pick(user.all_wounds))
to_chat(user, span_green("One of your ailments leaves you.")) // Static message so it gets collapsed in chat.

owner.updatehealth() // Because we healed, what, 5 different damage types on SSfastprocess, this is way more efficient.
38 changes: 38 additions & 0 deletions monkestation/code/game/objects/items/chainsaw.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/obj/item/chainsaw/doomslayer
var/list/nemesis_factions = list(FACTION_MINING, FACTION_BOSS)
var/nemesis_damage_multiplier = 5 // Makes it deal 30 * 5 (150) damage to fauna.

/obj/item/chainsaw/doomslayer/attack_self(mob/user)
if(on && user.has_status_effect(/datum/status_effect/mayhem))
to_chat(user, span_warning("There is no escape. RIP. AND. TEAR."))
return
return ..()

/obj/item/chainsaw/doomslayer/attack(mob/living/target_mob, mob/living/user, params)
if(target_mob == user) // Prevents you from hitting yourself with it. (as well as getting lifesteal from doing so)
return

var/bonus_applied = FALSE
for(var/faction in target_mob.faction)
if(faction in nemesis_factions)
bonus_applied = TRUE
force *= nemesis_damage_multiplier
break

. = ..()

if(bonus_applied)
force /= nemesis_damage_multiplier

var/healing_amount = force / initial(force) * 3 // 3 healing per hit on people and 15 on fauna.
user.heal_overall_damage(healing_amount, healing_amount)

/obj/item/chainsaw/doomslayer/equipped(mob/user, slot, initial)
. = ..()
if(slot != ITEM_SLOT_HANDS)
return
ADD_TRAIT(user, TRAIT_CANT_STRIP, REF(src)) // Pairs well with returning early when you try to attack yourself. LET THE SHUFFLEFEST COMMENCE!!

/obj/item/chainsaw/doomslayer/dropped(mob/user, silent)
. = ..()
REMOVE_TRAIT(user, TRAIT_CANT_STRIP, REF(src))
20 changes: 20 additions & 0 deletions monkestation/code/modules/client/client_colour.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// These defines are unlikely to ever change and making them global would require changing the original file a bunch.
// So while not perfect, simply copying the defines over should work fine here.

#define PRIORITY_ABSOLUTE 1
#define PRIORITY_HIGH 10
#define PRIORITY_NORMAL 100
#define PRIORITY_LOW 1000

/// Mayhem in a bottle also uses the bloodlust client colour, but this is the *persistent* client colour.
/datum/client_colour/mayhem
priority = PRIORITY_HIGH
colour = "#ff9e9e"

fade_in = 0.5 SECONDS
fade_out = 0.5 SECONDS

#undef PRIORITY_ABSOLUTE
#undef PRIORITY_HIGH
#undef PRIORITY_NORMAL
#undef PRIORITY_LOW
4 changes: 4 additions & 0 deletions monkestation/code/modules/mining/lavaland/megafauna_loot.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/obj/item/mayhem/examine(mob/user)
. = ..()
. += span_notice("Also makes you deal a lot of damage to fauna. It'd be best to use it alone for that, though.")
. += span_notice("Additionally, grants lifesteal based on damage dealt.")
13 changes: 13 additions & 0 deletions monkestation/code/modules/mob/living/init_signals.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/mob/living/register_init_signals()
. = ..()

RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_IGNOREDAMAGESLOWDOWN), PROC_REF(on_ignoredamageslowdown_trait_gain))
RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_IGNOREDAMAGESLOWDOWN), PROC_REF(on_ignoredamageslowdown_trait_loss))

/mob/living/proc/on_ignoredamageslowdown_trait_gain(datum/source)
SIGNAL_HANDLER
add_movespeed_mod_immunities(TRAIT_IGNOREDAMAGESLOWDOWN, /datum/movespeed_modifier/damage_slowdown)

/mob/living/proc/on_ignoredamageslowdown_trait_loss(datum/source)
SIGNAL_HANDLER
remove_movespeed_mod_immunities(TRAIT_IGNOREDAMAGESLOWDOWN, /datum/movespeed_modifier/damage_slowdown)
4 changes: 4 additions & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -5917,6 +5917,7 @@
#include "monkestation\code\game\objects\effects\spawners\random\fishing.dm"
#include "monkestation\code\game\objects\items\admin_plushies.dm"
#include "monkestation\code\game\objects\items\caneswords.dm"
#include "monkestation\code\game\objects\items\chainsaw.dm"
#include "monkestation\code\game\objects\items\choice_beacon.dm"
#include "monkestation\code\game\objects\items\cigs_lighters.dm"
#include "monkestation\code\game\objects\items\cirno_plush.dm"
Expand Down Expand Up @@ -6863,6 +6864,7 @@
#include "monkestation\code\modules\cassettes\machines\media\track.dm"
#include "monkestation\code\modules\cassettes\machines\media\subsystem\media_track_manager.dm"
#include "monkestation\code\modules\cassettes\walkman\_walkmen.dm"
#include "monkestation\code\modules\client\client_colour.dm"
#include "monkestation\code\modules\client\preference_savefile.dm"
#include "monkestation\code\modules\client\preferences.dm"
#include "monkestation\code\modules\client\verbs.dm"
Expand Down Expand Up @@ -7297,6 +7299,7 @@
#include "monkestation\code\modules\mining\accelerators\repeater.dm"
#include "monkestation\code\modules\mining\accelerators\shockwave.dm"
#include "monkestation\code\modules\mining\accelerators\shotgun.dm"
#include "monkestation\code\modules\mining\lavaland\megafauna_loot.dm"
#include "monkestation\code\modules\mining\lavaland\tendril_loot.dm"
#include "monkestation\code\modules\mob\login.dm"
#include "monkestation\code\modules\mob\mob.dm"
Expand All @@ -7321,6 +7324,7 @@
#include "monkestation\code\modules\mob\dead\new_player\sprite_accessories\sock_color.dm"
#include "monkestation\code\modules\mob\dead\new_player\sprite_accessories\tails.dm"
#include "monkestation\code\modules\mob\dead\new_player\sprite_accessories\underwear.dm"
#include "monkestation\code\modules\mob\living\init_signals.dm"
#include "monkestation\code\modules\mob\living\living_defines.dm"
#include "monkestation\code\modules\mob\living\living_movement.dm"
#include "monkestation\code\modules\mob\living\status_procs.dm"
Expand Down
Loading