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

Ports Dying Light from PVP CM #568

Merged
merged 1 commit into from
Nov 27, 2024
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
6 changes: 3 additions & 3 deletions code/game/objects/effects/aliens.dm
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@
/// Factor of duration between acid progression
var/acid_delay = 1
/// How much fuel the acid drains from the flare every acid tick
var/flare_damage = 500
var/flare_damage = 600
var/barricade_damage = 40
var/in_weather = FALSE

Expand All @@ -311,15 +311,15 @@
name = "weak acid"
acid_delay = 2.5 //250% delay (40% speed)
barricade_damage = 20
flare_damage = 150
flare_damage = 180
icon_state = "acid_weak"

//Superacid
/obj/effect/xenomorph/acid/strong
name = "strong acid"
acid_delay = 0.4 //40% delay (250% speed)
barricade_damage = 100
flare_damage = 1875
flare_damage = 2250
icon_state = "acid_strong"

/obj/effect/xenomorph/acid/Initialize(mapload, atom/target)
Expand Down
53 changes: 48 additions & 5 deletions code/game/objects/items/devices/flashlight.dm
Original file line number Diff line number Diff line change
Expand Up @@ -304,14 +304,14 @@
desc = "A red USCM issued flare. There are instructions on the side, it reads 'pull cord, make light'."
w_class = SIZE_SMALL
light_power = 2
light_range = 5
light_range = 7
icon_state = "flare"
item_state = "flare"
actions = list() //just pull it manually, neckbeard.
raillight_compatible = 0
can_be_broken = FALSE
var/burnt_out = FALSE
var/fuel = 0
var/fuel = 16 MINUTES
var/fuel_rate = AMOUNT_PER_TIME(1 SECONDS, 1 SECONDS)
var/on_damage = 7
var/ammo_datum = /datum/ammo/flare
Expand All @@ -329,7 +329,6 @@

/obj/item/device/flashlight/flare/Initialize()
. = ..()
fuel = rand(9.5 MINUTES, 10.5 MINUTES)
set_light_color(flame_tint)

/obj/item/device/flashlight/flare/update_icon()
Expand Down Expand Up @@ -364,9 +363,28 @@

/obj/item/device/flashlight/flare/process(delta_time)
fuel -= fuel_rate * delta_time
flare_burn_down()
if(fuel <= 0 || !on)
burn_out()

/obj/item/device/flashlight/flare/proc/flare_burn_down() //Controls the way in which flares slowly die out. Needs to be overriden by children, or they will be forced to use this light behavior.
switch(fuel) //The code belows controls the timing on a flares burn out, and the corresponding reduction in effective range.
if(15.25 MINUTES to 16 MINUTES)
set_light_range(7)
if(14.5 MINUTES to 15.24 MINUTES)
set_light_range(6)
if(6.5 MINUTES to 14.49 MINUTES)
set_light_range(5)
if(5.0 MINUTES to 6.49 MINUTES)
set_light_range(4)
if(3.5 MINUTES to 4.99 MINUTES)
set_light_range(3)
if(2.0 MINUTES to 3.49 MINUTES)
set_light_range(2)
if(0 MINUTES to 1.99 MINUTES)
set_light_range(1)
set_light_power(0.5) // A power of 2 results in no light at all, while .5 results in a small light.

// Causes flares to stop with a rotation offset for visual purposes
/obj/item/device/flashlight/flare/animation_spin(speed = 5, loop_amount = -1, clockwise = TRUE, sections = 3, angular_offset = 0, pixel_fuzz = 0)
pixel_fuzz = 16
Expand Down Expand Up @@ -452,10 +470,14 @@
icon_state = "" //No sprite
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
show_flame = FALSE
light_range = 7

/obj/item/device/flashlight/flare/on/illumination/Initialize()
. = ..()
fuel = rand(4.5 MINUTES, 5.5 MINUTES) // Half the duration of a flare, but justified since it's invincible
fuel = rand(5.0 MINUTES, 6.0 MINUTES) // Approximately half the effective duration of a flare, but justified since it's invincible

/obj/item/device/flashlight/flare/on/illumination/flare_burn_down() // Empty proc to override parent.
return

/obj/item/device/flashlight/flare/on/illumination/update_icon()
return
Expand All @@ -474,12 +496,29 @@
anchored = TRUE//can't be picked up
ammo_datum = /datum/ammo/flare/starshell
show_flame = FALSE
light_range = 6

/obj/item/device/flashlight/flare/on/starshell_ash/Initialize(mapload, ...)
if(mapload)
return INITIALIZE_HINT_QDEL
. = ..()
fuel = rand(30 SECONDS, 60 SECONDS)
fuel = rand(6.0 MINUTES, 6.5 MINUTES)

/obj/item/device/flashlight/flare/on/starshell_ash/flare_burn_down() // Starshell's own burn_down curve, overrides parent flare.
switch(fuel)
if(6.0 MINUTES to 6.5 MINUTES)
set_light_range(6)
if(2.5 MINUTES to 5.99 MINUTES)
set_light_range(5)
if(2.0 MINUTES to 2.49 MINUTES)
set_light_range(4)
if(1.5 MINUTES to 1.99 MINUTES)
set_light_range(3)
if(1.0 MINUTES to 1.49 MINUTES)
set_light_range(2)
if(0 MINUTES to 0.99 MINUTES)
set_light_range(1)
set_light_power(0.5)

/obj/item/device/flashlight/flare/on/illumination/chemical
name = "chemical light"
Expand Down Expand Up @@ -531,6 +570,7 @@
item_state = "cas_flare"
layer = ABOVE_FLY_LAYER
ammo_datum = /datum/ammo/flare/signal
light_range = 5
var/faction = ""
var/datum/cas_signal/signal
var/activate_message = TRUE
Expand All @@ -541,6 +581,9 @@
. = ..()
fuel = rand(160 SECONDS, 200 SECONDS)

/obj/item/device/flashlight/flare/signal/flare_burn_down() // Empty proc to override parent.
return

/obj/item/device/flashlight/flare/signal/attack_self(mob/living/carbon/human/user)
if(!istype(user))
return
Expand Down
8 changes: 4 additions & 4 deletions code/game/objects/items/storage/boxes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -603,12 +603,12 @@

/obj/item/storage/box/m94
name = "\improper M94 marking flare pack"
desc = "A packet of twenty one M94 Marking Flares. Carried by USCM soldiers to light dark areas that cannot be reached with the usual TNR Shoulder Lamp."
desc = "A packet of fourteen M94 Marking Flares. Carried by USCM soldiers to light dark areas that cannot be reached with the usual TNR Shoulder Lamp."
icon_state = "m94"
icon = 'icons/obj/items/storage/packets.dmi'
w_class = SIZE_MEDIUM
storage_slots = 21
max_storage_space = 21
storage_slots = 14
max_storage_space = 14
can_hold = list(/obj/item/device/flashlight/flare,/obj/item/device/flashlight/flare/signal)

/obj/item/storage/box/m94/fill_preset_inventory()
Expand All @@ -624,7 +624,7 @@

/obj/item/storage/box/m94/signal
name = "\improper M89-S signal flare pack"
desc = "A packet of twenty one M89-S Signal Marking Flares."
desc = "A packet of fourteen M89-S Signal Marking Flares."
icon_state = "m89"

/obj/item/storage/box/m94/signal/fill_preset_inventory()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@
icon_state = "secure_crate"

/obj/structure/largecrate/supply/supplies/flares
name = "Flare supply crate (x525)"
name = "Flare supply crate (x320)"
desc = "A supply crate containing two crates of flares."
supplies = list(/obj/item/ammo_box/magazine/misc/flares = 2)

Expand Down
2 changes: 1 addition & 1 deletion code/modules/projectiles/ammo_boxes/misc_boxes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
var/flare_amount = 0
for(var/obj/item/storage/box/m94/flare_box in contents)
flare_amount += length(flare_box.contents)
flare_amount = floor(flare_amount / 20) //10 packs, 20 flares each, maximum total of 10 flares we can throw out
flare_amount = floor(flare_amount / 14) //10 packs, 14 flares each, maximum total of 10 flares we can throw out
return flare_amount

/obj/item/ammo_box/magazine/misc/flares/process_burning(datum/cause_data/flame_cause_data)
Expand Down
5 changes: 4 additions & 1 deletion code/modules/projectiles/guns/flare_gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@
fired_flare.visible_message(SPAN_WARNING("\A [fired_flare] bursts into brilliant light in the sky!"))
fired_flare.invisibility = INVISIBILITY_MAXIMUM
fired_flare.mouse_opacity = FALSE
fired_flare.fuel = 3 MINUTES
fired_flare.light_range = 6
fired_flare.light_power = 3
playsound(user.loc, fire_sound, 50, 1)

var/obj/effect/flare_light/light_effect = new (fired_flare, fired_flare.light_range, fired_flare.light_power, fired_flare.light_color)
Expand All @@ -146,7 +149,7 @@
desc = "You are not supposed to see this. Please report it."
icon_state = "" //No sprite
invisibility = INVISIBILITY_MAXIMUM
light_system = STATIC_LIGHT
light_system = MOVABLE_LIGHT

/obj/effect/flare_light/Initialize(mapload, light_range, light_power, light_color)
. = ..()
Expand Down
Loading