even-still-though-time-itself-be-shattered

This commit is contained in:
Fox McCloud
2019-09-16 01:35:25 -04:00
parent 788f1926fb
commit d015c0c2b2
52 changed files with 369 additions and 298 deletions
+14
View File
@@ -8,6 +8,20 @@
var/health = 15
var/mob/living/carbon/human/master_commander = null
/obj/structure/spider/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
if(damage_type == BURN)//the stickiness of the web mutes all attack sounds except fire damage type
playsound(loc, 'sound/items/welder.ogg', 100, TRUE)
/obj/structure/spider/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir)
if(damage_flag == "melee")
switch(damage_type)
if(BURN)
damage_amount *= 2
if(BRUTE)
damage_amount *= 0.25
. = ..()
/obj/structure/spider/Destroy()
master_commander = null
return ..()
+58 -48
View File
@@ -1,45 +1,52 @@
//the essential proc to call when an obj must receive damage of any kind.
/obj/proc/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir, armour_penetration = 0)
/obj/proc/take_damage(damage_amount, damage_type = BRUTE, damage_flag = "", sound_effect = TRUE, attack_dir, armour_penetration = 0)
if(QDELETED(src))
stack_trace("[src] taking damage after deletion")
return
if(sound_effect)
play_attack_sound(damage_amount, damage_type, damage_flag)
if(!(resistance_flags & INDESTRUCTIBLE) && obj_integrity > 0)
damage_amount = run_obj_armor(damage_amount, damage_type, damage_flag, attack_dir, armour_penetration)
if(damage_amount >= 0.1)
. = damage_amount
var/old_integ = obj_integrity
obj_integrity = max(old_integ - damage_amount, 0)
if(obj_integrity <= 0)
var/int_fail = integrity_failure
if(int_fail && old_integ > int_fail)
obj_break(damage_flag)
obj_destruction(damage_flag)
else if(integrity_failure)
if(obj_integrity <= integrity_failure)
obj_break(damage_flag)
if((resistance_flags & INDESTRUCTIBLE) || obj_integrity <= 0)
return
damage_amount = run_obj_armor(damage_amount, damage_type, damage_flag, attack_dir, armour_penetration)
if(damage_amount < DAMAGE_PRECISION)
return
. = damage_amount
obj_integrity = max(obj_integrity - damage_amount, 0)
//BREAKING FIRST
if(integrity_failure && obj_integrity <= integrity_failure)
obj_break(damage_flag)
//DESTROYING SECOND
if(obj_integrity <= 0)
obj_destruction(damage_flag)
//returns the damage value of the attack after processing the obj's various armor protections
///returns the damage value of the attack after processing the obj's various armor protections
/obj/proc/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir, armour_penetration = 0)
if(!(damage_type in list(BRUTE, BURN)))
if(damage_flag == "melee" && damage_amount < damage_deflection)
return 0
switch(damage_type)
if(BRUTE)
if(BURN)
else
return 0
var/armor_protection = 0
if(damage_flag)
armor_protection = armor[damage_flag]
if(armor_protection) //Only apply weak-against-armor/hollowpoint effects if there actually IS armor.
armor_protection = Clamp(armor_protection - armour_penetration, 0, 100)
return round(damage_amount * (100 - armor_protection) * 0.01, 0.1)
armor_protection = Clamp(armor_protection - armour_penetration, min(armor_protection, 0), 100)
return round(damage_amount * (100 - armor_protection)*0.01, DAMAGE_PRECISION)
//the sound played when the obj is damaged.
///the sound played when the obj is damaged.
/obj/proc/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
switch(damage_type)
if(BRUTE)
if(damage_amount)
playsound(src, 'sound/weapons/smash.ogg', 50, 1)
playsound(src, 'sound/weapons/smash.ogg', 50, TRUE)
else
playsound(src, 'sound/weapons/tap.ogg', 50, 1)
playsound(src, 'sound/weapons/tap.ogg', 50, TRUE)
if(BURN)
playsound(src.loc, 'sound/items/welder.ogg', 100, 1)
playsound(src.loc, 'sound/items/welder.ogg', 100, TRUE)
/obj/hitby(atom/movable/AM)
/obj/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
..()
var/tforce = 0
if(ismob(AM))
@@ -54,8 +61,7 @@
return
switch(severity)
if(1)
obj_integrity = 0
qdel(src)
take_damage(INFINITY, BRUTE, "bomb", 0)
if(2)
take_damage(rand(100, 250), BRUTE, "bomb", 0)
if(3)
@@ -63,11 +69,12 @@
/obj/bullet_act(obj/item/projectile/P)
. = ..()
playsound(src, P.hitsound, 50, 1)
playsound(src, P.hitsound, 50, TRUE)
visible_message("<span class='danger'>[src] is hit by \a [P]!</span>")
if(!QDELETED(src)) //Bullet on_hit effect might have already destroyed this object
take_damage(P.damage, P.damage_type, P.flag, 0, turn(P.dir, 180), P.armour_penetration)
///Called to get the damage that hulks will deal to the obj.
/obj/proc/hulk_damage()
return 150 //the damage hulks do on punches to this object, is affected by melee armor
@@ -84,17 +91,6 @@
return TRUE
return FALSE
/obj/force_pushed(atom/movable/pusher, force = MOVE_FORCE_DEFAULT, direction)
return TRUE
/obj/move_crushed(atom/movable/pusher, force = MOVE_FORCE_DEFAULT, direction)
collision_damage(pusher, force, direction)
return TRUE
/obj/proc/collision_damage(atom/movable/pusher, force = MOVE_FORCE_DEFAULT, direction)
var/amt = max(0, ((force - (move_resist * MOVE_FORCE_CRUSH_RATIO)) / (move_resist * MOVE_FORCE_CRUSH_RATIO)) * 10)
take_damage(amt, BRUTE)
/obj/blob_act(obj/structure/blob/B)
if(isturf(loc))
var/turf/T = loc
@@ -109,7 +105,7 @@
/obj/attack_alien(mob/living/carbon/alien/humanoid/user)
if(attack_generic(user, 60, BRUTE, "melee", 0))
playsound(loc, 'sound/weapons/slash.ogg', 100, 1)
playsound(loc, 'sound/weapons/slash.ogg', 100, TRUE)
/obj/attack_animal(mob/living/simple_animal/M)
if((M.a_intent == INTENT_HELP && M.ckey) || (!M.melee_damage_upper && !M.obj_damage))
@@ -126,6 +122,17 @@
if(. && !play_soundeffect)
playsound(src, 'sound/effects/meteorimpact.ogg', 100, 1)
/obj/force_pushed(atom/movable/pusher, force = MOVE_FORCE_DEFAULT, direction)
return TRUE
/obj/move_crushed(atom/movable/pusher, force = MOVE_FORCE_DEFAULT, direction)
collision_damage(pusher, force, direction)
return TRUE
/obj/proc/collision_damage(atom/movable/pusher, force = MOVE_FORCE_DEFAULT, direction)
var/amt = max(0, ((force - (move_resist * MOVE_FORCE_CRUSH_RATIO)) / (move_resist * MOVE_FORCE_CRUSH_RATIO)) * 10)
take_damage(amt, BRUTE)
/obj/attack_slime(mob/living/carbon/slime/user)
if(!user.is_adult)
return
@@ -141,19 +148,19 @@
else
switch(M.damtype)
if(BRUTE)
playsound(src, 'sound/weapons/punch4.ogg', 50, 1)
playsound(src, 'sound/weapons/punch4.ogg', 50, TRUE)
if(BURN)
playsound(src, 'sound/items/welder.ogg', 50, 1)
playsound(src, 'sound/items/welder.ogg', 50, TRUE)
if(TOX)
playsound(src, 'sound/effects/spray2.ogg', 50, 1)
playsound(src, 'sound/effects/spray2.ogg', 50, TRUE)
return 0
else
return 0
visible_message("<span class='danger'>[M.name] has hit [src].</span>")
M.visible_message("<span class='danger'>[M.name] hits [src]!</span>", "<span class='danger'>You hit [src]!</span>")
return take_damage(M.force*3, mech_damtype, "melee", play_soundeffect, get_dir(src, M)) // multiplied by 3 so we can hit objs hard but not be overpowered against mobs.
/obj/singularity_act()
ex_act(1)
ex_act(EXPLODE_DEVASTATE)
if(src && !QDELETED(src))
qdel(src)
return 2
@@ -210,17 +217,20 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e
add_overlay(fire_overlay, TRUE)
return 1
///called when the obj is destroyed by fire
/obj/proc/burn()
if(resistance_flags & ON_FIRE)
SSfires.processing -= src
deconstruct(FALSE)
///Called when the obj is no longer on fire.
/obj/proc/extinguish()
if(resistance_flags & ON_FIRE)
resistance_flags &= ~ON_FIRE
cut_overlay(fire_overlay, TRUE)
SSfires.processing -= src
///Called when the obj is hit by a tesla bolt.
/obj/proc/tesla_act(power)
being_shocked = TRUE
var/power_bounced = power * 0.5
@@ -232,6 +242,7 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e
//the obj is deconstructed into pieces, whether through careful disassembly or when destroyed.
/obj/proc/deconstruct(disassembled = TRUE)
SEND_SIGNAL(src, COMSIG_OBJ_DECONSTRUCT, disassembled)
qdel(src)
//what happens when the obj's health is below integrity_failure level.
@@ -247,8 +258,7 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e
else
deconstruct(FALSE)
//changes max_integrity while retaining current health percentage
//returns TRUE if the obj broke, FALSE otherwise
///changes max_integrity while retaining current health percentage, returns TRUE if the obj got broken.
/obj/proc/modify_max_integrity(new_max, can_break = TRUE, damage_type = BRUTE, new_failure_integrity = null)
var/current_integrity = obj_integrity
var/current_max = max_integrity
@@ -268,6 +278,6 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e
return TRUE
return FALSE
//returns how much the object blocks an explosion
///returns how much the object blocks an explosion. Used by subtypes.
/obj/proc/GetExplosionBlock()
CRASH("Unimplemented GetExplosionBlock()")
CRASH("Unimplemented GetExplosionBlock()")
+6 -2
View File
@@ -12,11 +12,15 @@
var/force = 0
var/list/armor
var/obj_integrity //defaults to max_integrity
var/max_integrity = INFINITY
var/max_integrity = 500
var/integrity_failure = 0 //0 if we have no special broken behavior
var/acid_level = 0 //how much acid is on that obj
///Damage under this value will be completely ignored
var/damage_deflection = 0
var/resistance_flags = NONE // INDESTRUCTIBLE
var/acid_level = 0 //how much acid is on that obj
var/can_be_hit = TRUE //can this be bludgeoned by items?
var/Mtoollink = 0 // variable to decide if an object should show the multitool menu linking menu, not all objects use it
@@ -8,6 +8,7 @@
locked = 1
broken = 0
armor = list("melee" = 30, "bullet" = 50, "laser" = 50, "energy" = 100, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 80)
damage_deflection = 20
var/large = 1
icon_closed = "secure"
var/icon_locked = "secure1"
@@ -237,6 +237,8 @@
var/sparks = "securecratesparks"
var/emag = "securecrateemag"
armor = list("melee" = 30, "bullet" = 50, "laser" = 50, "energy" = 100, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 80)
damage_deflection = 25
var/tamperproof = 0
broken = 0
locked = 1
health = 1000
@@ -253,6 +255,21 @@
else
overlays += greenlight
/obj/structure/closet/crate/secure/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1)
if(prob(tamperproof) && damage_amount >= DAMAGE_PRECISION)
boom()
else
return ..()
/obj/structure/closet/crate/secure/proc/boom(mob/user)
if(user)
to_chat(user, "<span class='danger'>The crate's anti-tamper system activates!</span>")
investigate_log("[key_name(user)] has detonated a [src]", INVESTIGATE_BOMB)
for(var/atom/movable/AM in src)
qdel(AM)
explosion(get_turf(src), 0, 1, 5, 5)
qdel(src)
/obj/structure/closet/crate/secure/can_open()
return !locked
-12
View File
@@ -41,12 +41,6 @@
take_damage(rand(25, 75))
return
/obj/structure/girder/take_damage(amount)
health -= amount
if(health <= 0)
new /obj/item/stack/sheet/metal(get_turf(src))
qdel(src)
/obj/structure/girder/temperature_expose(datum/gas_mixture/air, exposed_temperature)
..()
var/temp_check = exposed_temperature
@@ -502,12 +496,6 @@
T.ChangeTurf(/turf/simulated/wall/cult)
qdel(src)
/obj/structure/girder/cult/take_damage(amount)
health -= amount
if(health <= 0)
new /obj/item/stack/sheet/runed_metal(get_turf(src))
qdel(src)
/obj/structure/girder/cult/narsie_act()
return
+4
View File
@@ -49,6 +49,10 @@
else
take_damage(rand(5,10), BRUTE, 0)
/obj/structure/grille/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
. = ..()
update_icon()
/obj/structure/grille/blob_act()
if(!broken)
obj_break()
+8 -6
View File
@@ -480,9 +480,10 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f
reinf = TRUE
cancolor = TRUE
heat_resistance = 1600
armor = list("melee" = 90, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 25, "bio" = 100, "rad" = 100, "fire" = 80, "acid" = 100)
armor = list("melee" = 80, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 25, "bio" = 100, "rad" = 100, "fire" = 80, "acid" = 100)
max_integrity = 50
explosion_block = 1
damage_deflection = 11
glass_type = /obj/item/stack/sheet/rglass
/obj/structure/window/reinforced/tinted
@@ -554,7 +555,7 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f
heat_resistance = 32000
max_integrity = 120
explosion_block = 1
armor = list("melee" = 90, "bullet" = 5, "laser" = 0, "energy" = 0, "bomb" = 45, "bio" = 100, "rad" = 100, "fire" = 99, "acid" = 100)
armor = list("melee" = 80, "bullet" = 5, "laser" = 0, "energy" = 0, "bomb" = 45, "bio" = 100, "rad" = 100, "fire" = 99, "acid" = 100)
/obj/structure/window/plasmabasic/BlockSuperconductivity()
return 1
@@ -568,7 +569,8 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f
reinf = TRUE
max_integrity = 160
explosion_block = 2
armor = list("melee" = 90, "bullet" = 20, "laser" = 0, "energy" = 0, "bomb" = 60, "bio" = 100, "rad" = 100, "fire" = 99, "acid" = 100)
armor = list("melee" = 80, "bullet" = 20, "laser" = 0, "energy" = 0, "bomb" = 60, "bio" = 100, "rad" = 100, "fire" = 99, "acid" = 100)
damage_deflection = 21
/obj/structure/window/plasmareinforced/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
return
@@ -604,7 +606,7 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f
smooth = SMOOTH_TRUE
canSmoothWith = list(/obj/structure/window/full/basic, /obj/structure/window/full/reinforced, /obj/structure/window/full/reinforced/tinted, /obj/structure/window/full/plasmabasic, /obj/structure/window/full/plasmareinforced)
explosion_block = 1
armor = list("melee" = 90, "bullet" = 5, "laser" = 0, "energy" = 0, "bomb" = 45, "bio" = 100, "rad" = 100, "fire" = 99, "acid" = 100)
armor = list("melee" = 80, "bullet" = 5, "laser" = 0, "energy" = 0, "bomb" = 45, "bio" = 100, "rad" = 100, "fire" = 99, "acid" = 100)
/obj/structure/window/full/plasmareinforced
name = "reinforced plasma window"
@@ -617,7 +619,7 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f
reinf = TRUE
max_integrity = 320
explosion_block = 2
armor = list("melee" = 90, "bullet" = 20, "laser" = 0, "energy" = 0, "bomb" = 60, "bio" = 100, "rad" = 100, "fire" = 99, "acid" = 100)
armor = list("melee" = 80, "bullet" = 20, "laser" = 0, "energy" = 0, "bomb" = 60, "bio" = 100, "rad" = 100, "fire" = 99, "acid" = 100)
/obj/structure/window/full/plasmareinforced/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
return
@@ -632,7 +634,7 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f
max_integrity = 100
reinf = TRUE
heat_resistance = 1600
armor = list("melee" = 90, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 25, "bio" = 100, "rad" = 100, "fire" = 80, "acid" = 100)
armor = list("melee" = 80, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 25, "bio" = 100, "rad" = 100, "fire" = 80, "acid" = 100)
explosion_block = 1
glass_type = /obj/item/stack/sheet/rglass
cancolor = TRUE