Skip to content
Closed
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
212 changes: 212 additions & 0 deletions code/game/Rogue Star/magic_damage.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
//RS FILE
#define ED_OVERLAY_LIGHT 1
#define ED_OVERLAY_MEDIUM 2
#define ED_OVERLAY_HEAVY 3
#define ED_OVERLAY_EXTREME 4

/mob/living
var/ether_damage = 0.0

/mob/living/proc/handle_ether_damage()
if(!stat && health - ether_damage <= 0)
death()

/mob/living/carbon/human/handle_ether_damage()
species.handle_ether_damage(src)

/datum/species
var/ether_slow = 1

/datum/species/proc/handle_ether_damage(var/mob/living/carbon/human/H)
if(!H.stat && (H.health + 100) - H.ether_damage <= 0)
H.death()
var/mob/living/simple_mob/hostile/seething/S = new(get_turf(H))
S.visible_message(SPAN_DANGER("\The [S] seems to climb out of \the [H]!!!"))

/mob/living/proc/ether_death()
ether_damage = 0.0
var/mob/living/simple_mob/hostile/seething/S = new(get_turf(src))
S.visible_message(SPAN_DANGER("\The [S] seems to climb out of \the [src]!!!"))

/mob/living/carbon/human/ether_death()
ether_damage = 0.0

/mob/living/proc/getEtherDamage()
return ether_damage

/mob/living/proc/adjustEtherDamage(var/amount = 0.0)
ether_damage += amount

if(ether_damage < 0)
ether_damage = 0
if(amount > 0)
add_modifier(/datum/modifier/ether_damage)

/datum/modifier/ether_damage
name = "Ether Damage"

var/last_dmg = 0.0
var/ticks_since_dmg = 0
var/heal_factor = 0
var/overlay_state
var/obj/screen/fullscreen/ether_damage/our_overlay

/datum/modifier/ether_damage/expire(silent)
. = ..()
clear_overlay()

/datum/modifier/ether_damage/tick()
var/current_dmg = holder.getEtherDamage()
if(current_dmg <= 0)
expire()
return
if(holder.stat == DEAD)
holder.ether_death()
expire()
return
new /obj/particle_emitter/ether_damage/limited(get_turf(holder))
if(current_dmg > last_dmg)
ticks_since_dmg = 0
heal_factor = 0
else
ticks_since_dmg ++
if(ticks_since_dmg >= 10)
heal_factor ++
holder.adjustEtherDamage(-heal_factor)
last_dmg = current_dmg
assess_overlay()

/datum/modifier/ether_damage/proc/assess_overlay()
if(!holder.client)
return
var/which = null
switch(holder.getEtherDamage())
if(10 to 49)
which = ED_OVERLAY_LIGHT
if(50 to 99)
which = ED_OVERLAY_MEDIUM
if(100 to 149)
which = ED_OVERLAY_HEAVY
if(150 to INFINITY)
which = ED_OVERLAY_EXTREME
else
which = null

if(overlay_state == which)
return
overlay_state = which
if(!which)
clear_overlay()
return

if(!our_overlay)
our_overlay = holder.overlay_fullscreen("ether", /obj/screen/fullscreen/ether_damage)

switch(which)
if(ED_OVERLAY_LIGHT)
slowdown = 0
our_overlay.particles.count = 100
our_overlay.particles.spawning = 0.1
if(ED_OVERLAY_MEDIUM)
slowdown = 0.5
our_overlay.particles.count = 100
our_overlay.particles.spawning = 0.25
if(ED_OVERLAY_HEAVY)
slowdown = 1
our_overlay.particles.count = 500
our_overlay.particles.spawning = 1
if(ED_OVERLAY_EXTREME)
slowdown = 1
our_overlay.particles.count = 5000
our_overlay.particles.spawning = 10
our_overlay.icon_state = "[which]"

/datum/modifier/ether_damage/proc/clear_overlay()
holder.clear_fullscreen("ether")
holder.clear_fullscreen("ether_damage")

/obj/particle_emitter/ether_damage
particles = new/particles/ether_damage

/obj/particle_emitter/ether_damage/limited
lifespan = 3

/particles/ether_damage
icon = 'icons/rogue-star/particlesx32.dmi'
icon_state = list("eh1","eh2","eh3","eh4","eh5","eh6","eh7",)
color = "#ae00ff"
width = 1000
height = 1000
count = 10
spawning = 1
bound1 = list(-1000, -1000, -1000)
lifespan = 10
fade = 5
position = generator("box", list(-8,-8,0), list(8,8,0))
gravity = list(0,0.5)
friction = 0.1
velocity = generator("vector",list(-3,0),list(3,0))
spin = generator("num", -10,10)
scale = 0.25
grow = 0.1
gradient = list(0, "#ae00ff", 1, "#520079", 2, "#ff00ff", "loop")

/particles/ether_damage/fullscreen
width = 500
height = 500
spawning = 0.1
position = generator("box", list(-250,-300,0), list(250,-300,0))
gravity = list(0,1)
grow = 0.05
drift = generator("sphere", 0, 2)
lifespan = 50

/particles/ether_damage/fullscreen/medium
count = 100
spawning = 0.25
/particles/ether_damage/fullscreen/heavy
count = 500
spawning = 1
/particles/ether_damage/fullscreen/extreme
count = 5000
spawning = 10

/obj/aoe
name = "ether damage applier"
icon = null
icon_state = null
anchored = TRUE
mouse_opacity = FALSE
plane = PLANE_LIGHTING_ABOVE
particles = new/particles/ether_damage

/obj/aoe/Crossed(O)
if(!isliving(O))
return
var/mob/living/L = O
L.adjustEtherDamage(25)

/obj/particle_emitter/ether_damage/screen
particles = new/particles/ether_damage/fullscreen

/obj/screen/fullscreen/ether_damage
icon = 'icons/rogue-star/full_screen_effects.dmi'
icon_state = null
mouse_opacity = FALSE
layer = 18.4

particles = new/particles/ether_damage/fullscreen

/////
/mob/living/simple_mob/hostile/seething/handle_ether_damage()
health = maxHealth
ether_damage = 0.0

/mob/living/simple_mob/hostile/seething_spawner/handle_ether_damage()
health = maxHealth
ether_damage = 0.0

#undef ED_OVERLAY_LIGHT
#undef ED_OVERLAY_MEDIUM
#undef ED_OVERLAY_HEAVY
#undef ED_OVERLAY_EXTREME
1 change: 1 addition & 0 deletions code/modules/mob/living/bot/bot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
set_stat(CONSCIOUS)
else
health = getMaxHealth() - getFireLoss() - getBruteLoss()
handle_ether_damage() //RS ADD
oxyloss = 0
toxloss = 0
cloneloss = 0
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/living/carbon/human/human_damage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
total_burn += O.burn_dam

health = getMaxHealth() - getOxyLoss() - getToxLoss() - getCloneLoss() - total_burn - total_brute
handle_ether_damage() //RS ADD

//TODO: fix husking
if( ((getMaxHealth() - total_burn) < config.health_threshold_dead * huskmodifier) && stat == DEAD)
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/living/carbon/human/human_movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
. += M.slowdown

var/health_deficiency = (getMaxHealth() - health)
health_deficiency += ether_damage * species.ether_slow //RS ADD
if(istype(src, /mob/living/carbon/human)) //VOREStation Edit Start
var/mob/living/carbon/human/H = src
health_deficiency *= H.species.trauma_mod //Species pain sensitivity does not apply to painkillers, so we apply it before
Expand Down
4 changes: 3 additions & 1 deletion code/modules/mob/living/carbon/human/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1464,7 +1464,7 @@
var/no_damage = 1
var/trauma_val = 0 // Used in calculating softcrit/hardcrit indicators.
if(!(species.flags & NO_PAIN))
trauma_val = max(traumatic_shock,halloss)/species.total_health
trauma_val = max(traumatic_shock,halloss)/species.total_health //RS EDIT
var/limb_trauma_val = trauma_val*0.3
// Collect and apply the images all at once to avoid appearance churn.
var/list/health_images = list()
Expand All @@ -1477,6 +1477,8 @@
if(on_fire)
health_images += image('icons/mob/OnFire.dmi',"[get_fire_icon_state()]")

trauma_val += ether_damage /species.total_health //RS ADD

// Show a general pain/crit indicator if needed.
if(trauma_val)
if(!(species.flags & NO_PAIN))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
human_brute = humanform.getActualBruteLoss()
human_burn = humanform.getActualFireLoss()
health = maxHealth - humanform.getOxyLoss() - humanform.getToxLoss() - humanform.getCloneLoss() - human_brute - human_burn
handle_ether_damage() //RS ADD

//Alive, becoming dead
if((stat < DEAD) && (health <= 0))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
human_brute = humanform.getActualBruteLoss()
human_burn = humanform.getActualFireLoss()
health = maxHealth - humanform.getOxyLoss() - humanform.getToxLoss() - humanform.getCloneLoss() - human_brute - human_burn
handle_ether_damage() //RS ADD

//Alive, becoming dead
if((stat < DEAD) && (health <= 0))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,15 @@
/datum/species/crew_shadekin/get_bodytype()
return SPECIES_SHADEKIN

//RS ADD START
/datum/species/crew_shadekin/handle_ether_damage(var/mob/living/carbon/human/H)
if((H.health + 100) - H.ether_damage <= 0)
H.ISay("*scream")
H.halloss = 999
H.sleeping = 60
H.ether_damage = 0
//RS ADD END

//These species are not really species but are just there for custom species selection

/datum/species/fl_zorren
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
set_stat(CONSCIOUS)
else
health = getMaxHealth() - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss() - getCloneLoss() - halloss
handle_ether_damage() //RS ADD

//This proc is used for mobs which are affected by pressure to calculate the amount of pressure that actually
//affects them once clothing is factored in. ~Errorage
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/silicon/ai/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@
setOxyLoss(0)
else
health = 100 - getFireLoss() - getBruteLoss() // Oxyloss is not part of health as it represents AIs backup power. AI is immune against ToxLoss as it is machine.
handle_ether_damage() //RS ADD

/mob/living/silicon/ai/rejuvenate()
..()
add_ai_verbs(src)

1 change: 1 addition & 0 deletions code/modules/mob/living/silicon/decoy/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
set_stat(CONSCIOUS)
else
health = 100 - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss()
handle_ether_damage() //RS ADD
5 changes: 4 additions & 1 deletion code/modules/mob/living/silicon/pai/life.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/mob/living/silicon/pai/Life()

handle_modifiers() //RS ADD
if(src.cable)
if(get_dist(src, src.cable) > 1)
var/turf/T = get_turf_or_move(src.loc)
Expand All @@ -13,6 +13,8 @@
if (src.stat == DEAD)
return

updatehealth() //RS ADD

if(card.cell != PP_FUNCTIONAL|| card.processor != PP_FUNCTIONAL || card.board != PP_FUNCTIONAL || card.capacitor != PP_FUNCTIONAL)
death()

Expand Down Expand Up @@ -48,3 +50,4 @@
set_stat(CONSCIOUS)
else
health = 100 - getBruteLoss() - getFireLoss()
handle_ether_damage() //RS ADD
1 change: 1 addition & 0 deletions code/modules/mob/living/silicon/robot/drone/drone.dm
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ var/list/mob_hat_cache = list()
set_stat(CONSCIOUS)
return
health = maxHealth - (getBruteLoss() + getFireLoss())
handle_ether_damage() //RS ADD
return

//Easiest to check this here, then check again in the robot proc.
Expand Down
3 changes: 2 additions & 1 deletion code/modules/mob/living/silicon/robot/robot_damage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
set_stat(CONSCIOUS)
return
health = getMaxHealth() - (getBruteLoss() + getFireLoss())
handle_ether_damage() //RS ADD
return

/mob/living/silicon/robot/getBruteLoss()
Expand Down Expand Up @@ -152,4 +153,4 @@

/mob/living/silicon/robot/emp_act(severity)
uneq_all()
..() //Damage is handled at /silicon/ level.
..() //Damage is handled at /silicon/ level.
1 change: 1 addition & 0 deletions code/modules/mob/living/simple_mob/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
//Should we be dead?
/mob/living/simple_mob/updatehealth()
health = getMaxHealth() - getFireLoss() - getBruteLoss() - getToxLoss() - getOxyLoss() - getCloneLoss()
handle_ether_damage() //RS ADD

//Alive, becoming dead
if((stat < DEAD) && (health <= 0))
Expand Down
14 changes: 13 additions & 1 deletion code/modules/paperwork/faxmachine.dm
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
var/list/obj/machinery/photocopier/faxmachine/allfaxes = list()
var/list/admin_departments = list("[using_map.boss_name]", "Virgo-Prime Governmental Authority", "Virgo-Erigonne Job Boards", "Supply")
var/list/admin_departments = list() // RS Edit: Fax machine fix (Lira, March 2026)
var/list/alldepartments = list()
var/global/last_fax_role_request

var/list/adminfaxes = list() //cache for faxes that have been sent to admins

// RS Add: Fax machine fix (Lira, March 2026)
/proc/setup_fax_admin_departments()
if(!using_map)
return

admin_departments = list(
"[using_map.boss_name]",
"Virgo-Prime Governmental Authority",
"Virgo-Erigonne Job Boards",
"Supply"
)

/obj/machinery/photocopier/faxmachine
name = "fax machine"
desc = "Send papers and pictures far away! Or to your co-worker's office a few doors down."
Expand Down
Binary file added icons/rogue-star/full_screen_effects.dmi
Binary file not shown.
Binary file modified icons/rogue-star/particlesx32.dmi
Binary file not shown.
1 change: 1 addition & 0 deletions maps/~map_system/maps_rs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ var/global/list/possible_station_maps = list(
using_map = new DEFAULT_MAP //Something has gone wrong, let's try to make an emergency map object!

if(using_map)
setup_fax_admin_departments() // Fax machine fix (Lira, March 2026)
log_debug("[using_map.name] was created successfully.")
else
error("initialise_map_list() failed to create a map object. No maps will load.")
Expand Down
Loading
Loading