-
Notifications
You must be signed in to change notification settings - Fork 347
Buffs nightmares to make them playable again #3777
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
Merged
Absolucy
merged 12 commits into
Monkestation:master
from
RikuTheKillerSS13Forks:nightmare_buff
Oct 22, 2024
Merged
Changes from 2 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
dc35ca2
done i think
RikuTheKiller cf65326
finally, done buffing this thing
RikuTheKiller 122d9f7
im about to sacrifice my soul to the byond gods
RikuTheKiller db9dae8
FINALLY
RikuTheKiller dceec37
minor change
RikuTheKiller 83e381b
Merge branch 'master' into nightmare_buff
RikuTheKiller 96636a7
tips tips tips
RikuTheKiller 8b96f07
forgot to remove that
RikuTheKiller 6be4065
change filepath
RikuTheKiller 1326f69
attempt 2
RikuTheKiller b2dda85
finally
RikuTheKiller 528f97f
now it wont conflict
RikuTheKiller File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/datum/action/cooldown/spell/jaunt/shadow_walk | ||
check_flags = AB_CHECK_PHASED | ||
|
||
/datum/action/cooldown/spell/jaunt/shadow_walk/IsAvailable(feedback) | ||
if(!..()) | ||
return FALSE | ||
if(owner.stat >= UNCONSCIOUS) | ||
if(feedback) | ||
owner.balloon_alert(owner, "unconscious!") | ||
return FALSE | ||
return TRUE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/datum/element/light_eater/Attach(datum/target) | ||
. = ..() | ||
RegisterSignal(target, COMSIG_LIGHT_EATER_EAT, PROC_REF(on_eat_signal)) | ||
|
||
/datum/element/light_eater/proc/on_eat_signal(datum/source, food, eater, silent) | ||
SIGNAL_HANDLER | ||
eat_lights(food, eater, silent) |
29 changes: 29 additions & 0 deletions
29
monkestation/code/modules/nightmare/nightmare_equipment.dm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/obj/item/light_eater/attack_atom(atom/attacked_atom, mob/living/user, params) | ||
if(!istype(attacked_atom, /obj/machinery/door/airlock) && !istype(attacked_atom, /obj/machinery/door/window)) | ||
return ..() | ||
|
||
var/obj/machinery/door/opening = attacked_atom | ||
|
||
if(!opening.density) // Don't bother opening that which is already open. | ||
return | ||
|
||
var/has_power = opening.hasPower() | ||
|
||
if((!opening.requiresID() || opening.allowed(user)) && has_power) // Blocks useless messages for doors we can open normally. | ||
return ..() | ||
|
||
if(has_power) | ||
opening.balloon_alert(user, "powered!") | ||
return ..() | ||
|
||
if(opening.locked) | ||
opening.balloon_alert(user, "bolted!") | ||
return ..() | ||
|
||
user.visible_message( | ||
message = span_warning("[user] forces [opening] to open with [user.p_their()] [src]!"), | ||
self_message = span_warning("We force [opening] to open."), | ||
blind_message = span_hear("You hear a metal screeching sound.") | ||
) | ||
|
||
opening.open(BYPASS_DOOR_CHECKS) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#define PASSIVE_SNUFF_LIMIT 0.5 | ||
|
||
/// Handles checking for nearby weak lights to auto-snuff as a nightmare. Start turf arg is optional and can be any atom, it'll just have get_turf called on it. | ||
/proc/check_passive_nightmare_snuff(mob/living/carbon/nightmare, turf/start) | ||
if(!istype(nightmare)) | ||
return | ||
|
||
if(!istype(start)) | ||
start = get_turf(start || nightmare) | ||
|
||
if(!istype(start)) // Really? How did you even... whatever, just ignore it. | ||
return | ||
|
||
var/lumcount = start.get_lumcount() | ||
if(lumcount < SHADOW_SPECIES_LIGHT_THRESHOLD || lumcount > PASSIVE_SNUFF_LIMIT) | ||
return | ||
|
||
var/obj/item/organ/internal/heart/nightmare/heart = nightmare.get_organ_slot(ORGAN_SLOT_HEART) | ||
|
||
if(!istype(heart) || !heart.blade) | ||
return | ||
|
||
var/snuffed_something = FALSE | ||
|
||
for(var/atom/nearby as anything in view(2, start)) | ||
if(!nearby.light) | ||
continue | ||
|
||
if(istype(nearby, /obj/machinery/light)) | ||
var/obj/machinery/light/light_fixture = nearby | ||
if(!light_fixture.low_power_mode) // prevents an issue where nightmares could just turn on a fire alarm to obliterate lights | ||
continue | ||
|
||
var/hsl = rgb2num(nearby.light_color, COLORSPACE_HSL) | ||
if(nearby.light_power * (hsl[3] / 100) > 0.8) // power * lightness is a pretty good measure of "how bright is this thing" | ||
return | ||
|
||
SEND_SIGNAL(heart.blade, COMSIG_LIGHT_EATER_EAT, nearby, heart.blade, TRUE) | ||
snuffed_something = TRUE | ||
|
||
if(!snuffed_something) | ||
RikuTheKiller marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return | ||
|
||
nightmare.visible_message( | ||
message = span_danger("Something dark in [heart.blade] lashes out at nearby lights!"), | ||
self_message = span_notice("Your [heart.blade.name] lashes out at nearby lights!"), | ||
blind_message = span_danger("You feel a gnawing pulse eat at your sight.") | ||
) | ||
|
||
#undef PASSIVE_SNUFF_LIMIT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/obj/item/organ/internal/brain/shadow/nightmare/on_insert(mob/living/carbon/brain_owner) | ||
. = ..() | ||
RegisterSignal(owner, COMSIG_MOVABLE_MOVED, PROC_REF(on_owner_moved)) | ||
|
||
/obj/item/organ/internal/brain/shadow/nightmare/on_life(seconds_per_tick, times_fired) | ||
check_passive_nightmare_snuff(owner) | ||
|
||
if(length(owner.all_wounds) && SPT_PROB(10, seconds_per_tick)) | ||
var/turf/owner_turf = get_turf(owner) | ||
if(owner_turf.get_lumcount() < SHADOW_SPECIES_LIGHT_THRESHOLD) | ||
var/datum/wound/wound = pick(owner.all_wounds) | ||
to_chat(owner, span_green("The darkness soothes the [lowertext(wound.name)] in your [wound.limb.plaintext_zone]!")) | ||
qdel(wound) // Occasionally heal a random wound while in the dark. | ||
|
||
return ..() | ||
|
||
/obj/item/organ/internal/brain/shadow/nightmare/proc/on_owner_moved(datum/source, atom/old_loc, dir, forced, list/old_locs) | ||
SIGNAL_HANDLER | ||
check_passive_nightmare_snuff(owner) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.