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

Optimizes explosion a bit. #92

Merged
merged 1 commit into from
Aug 21, 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
3 changes: 0 additions & 3 deletions code/game/atoms/_atom.dm
Original file line number Diff line number Diff line change
Expand Up @@ -394,17 +394,14 @@ directive is properly returned.
if(!(flags_atom & PREVENT_CONTENTS_EXPLOSION))
contents_explosion(severity, explosion_direction)


/atom/proc/fire_act()
return


/atom/proc/hitby(atom/movable/AM, speed = 5)
if(density)
AM.stop_throw()
return TRUE


/atom/proc/GenerateTag()
return

Expand Down
3 changes: 0 additions & 3 deletions code/game/objects/effects/countdown.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@
STOP_PROCESSING(SSobj, src)
return ..()

/obj/effect/countdown/ex_act(severity) //immune to explosions
return

/obj/effect/countdown/nuclearbomb
name = "nuclear bomb countdown"
color = "#81FF14"
Expand Down
13 changes: 2 additions & 11 deletions code/game/objects/effects/decals/turfdecals/markings.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,9 @@
icon = 'icons/turf/decals.dmi'
icon_state = "whitedecal"

/* RUTGMC DELETION, TODO: repath it from effects so it can properly be exploded
/obj/effect/turf_decal/tile/ex_act(severity)
switch(severity)
if(EXPLODE_DEVASTATE)
qdel(src)
if(EXPLODE_HEAVY)
if(prob(50))
qdel(src)
if(EXPLODE_LIGHT)
if(prob(25))
qdel(src)
*/
if(prob(severity * 0.3))
qdel(src)

/obj/effect/turf_decal/tile/full
icon_state = "floor_large"
Expand Down
1 change: 0 additions & 1 deletion code/game/objects/effects/effect_system/smoke.dm
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@
animate(src, 7 SECONDS, easing = CIRCULAR_EASING|EASE_IN, alpha = initial(alpha))
addtimer(VARSET_CALLBACK(src, opacity, initial(opacity)), 5 SECONDS)


/obj/effect/particle_effect/smoke/proc/on_cross(datum/source, atom/movable/O, oldloc, oldlocs)
SIGNAL_HANDLER
if(isliving(O))
Expand Down
9 changes: 1 addition & 8 deletions code/game/objects/effects/overlays.dm
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,6 @@
linked_cam = null
return ..()

/obj/effect/overlay/temp/laser_target/ex_act(severity) //immune to explosions
return

/obj/effect/overlay/temp/laser_target/examine(user)
. = ..()
if(ishuman(user))
Expand Down Expand Up @@ -323,10 +320,6 @@
pixel_y = source_mob.pixel_y
icon_state = gib_icon

/obj/effect/overlay/temp/gib_animation/ex_act(severity)
return


/obj/effect/overlay/temp/gib_animation/animal
icon = 'icons/mob/animal.dmi'
effect_duration = 12
Expand Down Expand Up @@ -394,4 +387,4 @@
/// When detected to be unused it gets set to world.time, after a while it gets removed
var/unused = 0
/// Overlays which go unused for 2 minutes get cleaned up
var/cache_expiration = 2 MINUTES
var/cache_expiration = 2 MINUTES
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
deltimer(timerid)
return ..()


/obj/effect/temp_visual/ex_act()
return


/obj/effect/temp_visual/dir_setting
randomdir = FALSE

Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ GLOBAL_DATUM_INIT(welding_sparks_prepdoor, /mutable_appearance, mutable_appearan
if(CHECK_BITFIELD(resistance_flags, INDESTRUCTIBLE))
return

if(!prob(severity / 3))
if(!prob(severity * 0.3))
return

var/msg = pick("is destroyed by the blast!", "is obliterated by the blast!", "shatters as the explosion engulfs it!", "disintegrates in the blast!", "perishes in the blast!", "is mangled into uselessness by the blast!")
Expand Down
7 changes: 0 additions & 7 deletions code/game/objects/items/gift_wrappaper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,6 @@
pixel_x = rand(-10, 10)
pixel_y = rand(-10, 10)


/* RUTGMC DELETION
/obj/item/gift/ex_act()
qdel(src)
*/


/obj/item/gift/attack_self(mob/user)
var/gift_type = pick(gift_types)
var/obj/item/I = new gift_type
Expand Down
5 changes: 0 additions & 5 deletions code/game/objects/items/loot_box.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
///The number of rolls on the table this box has
var/rolls = 1

/* RUTGMC DELETION
/obj/item/loot_box/ex_act()
qdel(src)
*/

/obj/item/loot_box/attack_self(mob/user)
var/obj/loot_pick
while(rolls)
Expand Down
7 changes: 3 additions & 4 deletions code/game/objects/items/portable_vendor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,15 @@
s.start()

/obj/item/portable_vendor/emp_act(severity)
if (broken)
if(broken)
return
if (prob(40*severity))
if(prob(40 * severity))
malfunction()

/obj/item/portable_vendor/ex_act(severity)
if(prob(severity / 4))
if(prob(severity * 0.25))
qdel(src)


/obj/item/portable_vendor/corporate
name = "\improper Nanotrasen Automated Storage Briefcase"
desc = "A suitcase-sized automated storage and retrieval system. Designed to efficiently store and selectively dispense small items. This one has the Nanotrasen logo stamped on its side."
Expand Down
9 changes: 5 additions & 4 deletions code/game/objects/items/power_cells.dm
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,11 @@
update_appearance(UPDATE_ICON)

/obj/item/cell/ex_act(severity)
if(severity >= EXPLODE_WEAK && prob((severity / 2)))
qdel(src)
else if(prob(severity / 2))
corrupt()
if(prob(severity * 0.5))
if(severity >= EXPLODE_WEAK)
qdel(src)
else
corrupt()

/obj/item/cell/suicide_act(mob/user)
user.visible_message(span_danger("[user] is licking the electrodes of the [src.name]! It looks like [user.p_theyre()] trying to commit suicide."))
Expand Down
8 changes: 1 addition & 7 deletions code/game/objects/machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,15 @@
/obj/machinery/proc/on_deconstruction()
return


/obj/machinery/proc/start_processing()
START_PROCESSING(SSmachines, src)


/obj/machinery/proc/stop_processing()
STOP_PROCESSING(SSmachines, src)


/obj/machinery/process() // If you dont use process or power why are you here
return PROCESS_KILL


/obj/machinery/emp_act(severity)
if(CHECK_BITFIELD(resistance_flags, INDESTRUCTIBLE))
return FALSE
Expand All @@ -121,14 +117,12 @@
new /obj/effect/overlay/temp/emp_sparks (loc)
return ..()


/obj/machinery/ex_act(severity)
if(CHECK_BITFIELD(resistance_flags, INDESTRUCTIBLE))
return FALSE
if(prob(severity / 3))
if(prob(severity * 0.3))
deconstruct(FALSE)


/obj/machinery/proc/power_change()
if(!powered(power_channel) && machine_current_charge <= 0)
machine_stat |= NOPOWER
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/machinery/OpTable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
break

/obj/machinery/optable/ex_act(severity)
if(prob(severity / 3))
if(prob(severity * 0.3))
qdel(src)

/obj/machinery/optable/examine(mob/user)
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/machinery/adv_med.dm
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
go_out()

/obj/machinery/bodyscanner/ex_act(severity)
if(!prob(severity / 3))
if(!prob(severity * 0.3))
return

for(var/atom/movable/our_atom as mob|obj in src)
Expand All @@ -186,7 +186,7 @@
set_connected(locate(/obj/machinery/bodyscanner, get_step(src, REVERSE_DIR(dir))))

/obj/machinery/computer/body_scanconsole/ex_act(severity)
if(prob(severity / 3))
if(prob(severity * 0.3))
qdel(src)

/obj/machinery/computer/body_scanconsole/can_interact(mob/user)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/machinery/doors/door.dm
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
/obj/machinery/door/ex_act(severity)
if(CHECK_BITFIELD(resistance_flags, INDESTRUCTIBLE))
return
if(!prob(severity / 4))
if(!prob(severity * 0.25))
var/datum/effect_system/spark_spread/our_sparks = new /datum/effect_system/spark_spread
our_sparks.set_up(2, 1, src)
our_sparks.start()
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/machinery/sleeper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
updateUsrDialog()

/obj/machinery/computer/sleep_console/ex_act(severity)
if(prob(severity / 3))
if(prob(severity * 0.3))
qdel(src)

///Set the connected var
Expand Down Expand Up @@ -302,7 +302,7 @@
/obj/machinery/sleeper/ex_act(severity)
if(filtering)
toggle_filter()
if(prob(severity / 3))
if(prob(severity * 0.3))
qdel(src)

/obj/machinery/sleeper/emp_act(severity)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/machinery/suit_storage_unit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
isUV = 0

/obj/machinery/suit_storage_unit/ex_act(severity)
if(prob(severity / 3))
if(prob(severity * 0.3))
if(prob(50))
dump_everything()
qdel(src)
Expand Down
2 changes: 0 additions & 2 deletions code/game/objects/structures.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@
/obj/structure/proc/handle_barrier_chance(mob/living/M)
return FALSE


/obj/structure/ex_act(severity, direction)
if(CHECK_BITFIELD(resistance_flags, INDESTRUCTIBLE))
return
take_damage(severity, BRUTE, BOMB, attack_dir = direction)


/obj/structure/Initialize(mapload)
. = ..()
if(climbable)
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/structures/bookcase.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
update_icon()

/obj/structure/bookcase/ex_act(severity)
if(prob(severity / 3))
if(prob(severity * 0.3))
for(var/obj/item/book/our_book in contents)
if(prob(severity / 2))
if(prob(severity * 0.5))
qdel(our_book)
else
our_book.forceMove(get_turf(src))
Expand Down
24 changes: 1 addition & 23 deletions code/game/objects/structures/crates_lockers/closets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

/obj/structure/closet/ex_act(severity)
take_damage(severity, BRUTE, BOMB)
if(!locked || prob(severity / 3))
if(!locked || prob(severity * 0.3))
break_open()
contents_explosion(severity)

Expand Down Expand Up @@ -184,28 +184,6 @@
/obj/structure/closet/proc/toggle(mob/living/user)
return opened ? close(user) : open(user)

/obj/structure/closet/ex_act(severity)
var/dmg
switch(severity)
if(EXPLODE_DEVASTATE)
contents_explosion(severity)
dump_contents()
qdel(src)
if(EXPLODE_HEAVY)
dmg = rand()
if(!locked || dmg > 0.1)
contents_explosion(severity)
break_open()
if(dmg > 0.5)
qdel(src)
if(EXPLODE_LIGHT)
dmg = rand()
if(!locked || dmg > 0.5)
contents_explosion(severity)
break_open()
if(dmg > 0.95)
qdel(src)

/obj/structure/closet/attack_animal(mob/living/user)
if(user.wall_smash)
balloon_alert_to_viewers("[user] destroys the [src]")
Expand Down
14 changes: 0 additions & 14 deletions code/game/objects/structures/displaycase.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,6 @@
var/occupied = 1
var/destroyed = 0

/* RUTGMC DELETION
/obj/structure/displaycase/ex_act(severity)
switch(severity)
if(EXPLODE_DEVASTATE)
deconstruct(FALSE)
if(EXPLODE_HEAVY)
take_damage(15, BRUTE, BOMB)
if(EXPLODE_LIGHT)
take_damage(5, BRUTE, BOMB)
if(EXPLODE_WEAK)
take_damage(5, BRUTE, BOMB)
*/


/obj/structure/displaycase/update_icon_state()
. = ..()
if(destroyed)
Expand Down
9 changes: 0 additions & 9 deletions code/game/objects/structures/droppod.dm
Original file line number Diff line number Diff line change
Expand Up @@ -496,15 +496,6 @@ GLOBAL_LIST_INIT(blocked_droppod_tiles, typecacheof(list(/turf/open/space/transi
action.remove_action(occupant)
return ..()

/* RUTGMC DELETION
/obj/structure/droppod/nonmob/mech_pod/ex_act(severity)
switch(severity)
if(EXPLODE_DEVASTATE)
take_damage(100, BRUTE, BOMB, 0)
if(EXPLODE_HEAVY)
take_damage(50, BRUTE, BOMB, 0)
*/

/obj/structure/droppod/nonmob/mech_pod/mech_shift_click(obj/vehicle/sealed/mecha/mecha_clicker, mob/living/user)
if(mecha_clicker == stored_object)
unload_package()
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/fence.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
canSmoothWith = list(SMOOTH_GROUP_FENCE)

/obj/structure/fence/ex_act(severity)
take_damage(severity / 2, BRUTE, BOMB)
take_damage(severity * 0.5, BRUTE, BOMB)

/obj/structure/fence/attackby(obj/item/I, mob/user, params)
. = ..()
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/flora.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
icon_state = "[initial(icon_state)]_[rand(1, icon_variants)]"

/obj/structure/flora/ex_act(severity)
if(prob(severity / 4))
if(prob(severity * 0.25))
qdel(src)

/obj/structure/flora/flamer_fire_act(burnlevel)
Expand Down
Loading
Loading