mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-29 02:51:41 +00:00
Please refer to #20867 and #20870 for a easier view of the changes. Those two PRs show all meaningful changes (hopefully) and doesn't show the files changed with just 3 lines changed. This PR does three things: It makes all children of /obj/ use the same damage system. Previously to make your new machine/structure be destroyable you needed to give it a var/health, and its own version of many damage related proc such as bullet_act(), take_damage(), attacked_by(), attack_animal(), attack_hulk(), ex_act(), etc... But now, all /obj/ use the same version of those procs at the /obj/ level in code/game/obj_defense.dm. All these obj share the same necessary vars: obj_integrity (health), max_integrity, integrity_failure (optional, below that health level failure happens), and the armor list var which was previously only for items, as well as the resistance_flags bitfield. When you want your new object to be destroyable, you only have to give it a value for those vars and maybe override one proc if you want a special behavior but that's it. This reorganization removes a lot of copypasta (most bullet_act() version for each obj were nearly identical). Two new elements are added to the armor list var: fire and acid armor values. How much damage an obj take depends on the armor value for each damage category. But some objects are INDESTRUCTIBLE and simply never take any damage no matter the type. The armor categories are: -melee(punches, item attacks, xeno/animal/hulk attacks, blob attacks, thrown weapons) -bullet -laser -energy (used by projectiles like ionrifle, taser, and also by EMPs) -bio (unused for this, only here because clothes use them when worn) -rad (same) -bomb (self-explanatory) -fire (for fire damage, not for heat damage though) -acid For machines and structures, when their health reaches zero the object is not just deleted but gets somewhat forcedeconstructed (the proc used is shared with the actual deconstruction system) which can drops things. To not frustrates players most of these objects drop most of the elements necessary to rebuild them (think window dropping shards). Machines drop a machine frame and all components for example (but the frame can then be itself smashed to pieces). For clothes, when they are damaged, they get a "damaged" overlay, which can also be seen when worn, similar to the "bloody" overlay. It refactors acid. See #20537. Some objects are ACID_PROOF and take no damage from acid, while others take varying amounts of damage depending on their acid armor value. Some objects are even UNACIDABLE, no acid effect can even land on them. Acid on objects can be washed off using water. It changes some aspect of damage from fires. All /obj/ can now take fire damage and be flammable, instead of just items. And instead of having just FLAMMABLE objs that become ON_FIRE as soon as some fire touch them (paper), we now have objects that are non flammable but do take damage from fire and become ashes if their health reaches zero (only for items). The damage taken varies depending on the obj's fire armor value and total health. There's also still obj and items that are FIRE_PROOF (although some might still be melted by lava if they're not LAVA_PROOF). When a mob is on fire, its clothes now take fire damage and can turn to ashes. Similarly, when a mob takes melee damages, its clothes gets damaged a bit and can turn to shreds. You can repair clothes with cloth that is produceable by botany's biogenerator. It also does many minor things: Clicking a structure/machine with an item on help intent never results in an attack (so you don't destroy a structure while trying to figure out which tool to use). I moved a lot of objects away from /obj/effect, it should only be used for visual effects, decals and stuff, not for things you can hit and destroy. I tweaked a bit how clothes shredding from bombs work. I made a machine or structure un/anchorable with the wrench, I don't remember which object... Since I changed the meaning of the FIRE_PROOF bitflag to actually mean fire immune, I'm buffing the slime extract that you apply on items to make them fire proof. well now they're really 100% fire proof! animals with environment_smash = 1 no longer one-hit destroy tables and stuff, we give them a decent obj_damage value so they can destroy most obj relatively fast depending on the animal. Probably a million things I forgot. If you want to know how the damage system works all you need is the three obj vars "obj_integrity", "max_integrity", "integrity_failure", as well as the armor list var and the resistance_flags bitfield, and read the file obj_defense.dm
342 lines
11 KiB
Plaintext
342 lines
11 KiB
Plaintext
|
|
|
|
|
|
/obj/structure/statue
|
|
name = "statue"
|
|
desc = "Placeholder. Yell at Firecage if you SOMEHOW see this."
|
|
icon = 'icons/obj/statue.dmi'
|
|
icon_state = ""
|
|
density = 1
|
|
anchored = 0
|
|
obj_integrity = 100
|
|
var/oreAmount = 7
|
|
var/mineralType = "metal"
|
|
|
|
/obj/structure/statue/Destroy()
|
|
density = 0
|
|
return ..()
|
|
|
|
/obj/structure/statue/attackby(obj/item/weapon/W, mob/living/user, params)
|
|
add_fingerprint(user)
|
|
user.changeNext_move(CLICK_CD_MELEE)
|
|
if(istype(W, /obj/item/weapon/wrench))
|
|
if(anchored)
|
|
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
|
|
user.visible_message("[user] is loosening the [name]'s bolts.", \
|
|
"<span class='notice'>You are loosening the [name]'s bolts...</span>")
|
|
if(do_after(user,40/W.toolspeed, target = src))
|
|
if(!src.loc || !anchored)
|
|
return
|
|
user.visible_message("[user] loosened the [name]'s bolts!", \
|
|
"<span class='notice'>You loosen the [name]'s bolts!</span>")
|
|
anchored = 0
|
|
else
|
|
if(!isfloorturf(src.loc))
|
|
user.visible_message("<span class='warning'>A floor must be present to secure the [name]!</span>")
|
|
return
|
|
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
|
|
user.visible_message("[user] is securing the [name]'s bolts...", \
|
|
"<span class='notice'>You are securing the [name]'s bolts...</span>")
|
|
if(do_after(user, 40/W.toolspeed, target = src))
|
|
if(!src.loc || anchored)
|
|
return
|
|
user.visible_message("[user] has secured the [name]'s bolts.", \
|
|
"<span class='notice'>You have secured the [name]'s bolts.</span>")
|
|
anchored = 1
|
|
|
|
else if(istype(W, /obj/item/weapon/gun/energy/plasmacutter))
|
|
playsound(src, 'sound/items/Welder.ogg', 100, 1)
|
|
user.visible_message("[user] is slicing apart the [name]...", \
|
|
"<span class='notice'>You are slicing apart the [name]...</span>")
|
|
if(do_after(user,30, target = src))
|
|
if(!src.loc)
|
|
return
|
|
user.visible_message("[user] slices apart the [name].", \
|
|
"<span class='notice'>You slice apart the [name].</span>")
|
|
deconstruct(FALSE)
|
|
|
|
else if(istype(W, /obj/item/weapon/pickaxe/drill/jackhammer))
|
|
var/obj/item/weapon/pickaxe/drill/jackhammer/D = W
|
|
if(!src.loc)
|
|
return
|
|
user.visible_message("[user] destroys the [name]!", \
|
|
"<span class='notice'>You destroy the [name].</span>")
|
|
D.playDigSound()
|
|
qdel(src)
|
|
|
|
else if(istype(W, /obj/item/weapon/weldingtool) && !anchored)
|
|
playsound(loc, 'sound/items/Welder.ogg', 40, 1)
|
|
user.visible_message("[user] is slicing apart the [name].", \
|
|
"<span class='notice'>You are slicing apart the [name]...</span>")
|
|
if(do_after(user, 40/W.toolspeed, target = src))
|
|
if(!src.loc)
|
|
return
|
|
playsound(loc, 'sound/items/Welder2.ogg', 50, 1)
|
|
user.visible_message("[user] slices apart the [name].", \
|
|
"<span class='notice'>You slice apart the [name]!</span>")
|
|
deconstruct(FALSE)
|
|
else
|
|
return ..()
|
|
|
|
/obj/structure/statue/attack_hand(mob/living/user)
|
|
user.changeNext_move(CLICK_CD_MELEE)
|
|
add_fingerprint(user)
|
|
user.visible_message("[user] rubs some dust off from the [name]'s surface.", \
|
|
"<span class='notice'>You rub some dust off from the [name]'s surface.</span>")
|
|
|
|
/obj/structure/statue/CanAtmosPass()
|
|
return !density
|
|
|
|
/obj/structure/statue/deconstruct(disassembled = TRUE)
|
|
if(!(flags & NODECONSTRUCT))
|
|
if(disassembled)
|
|
if (mineralType == "metal")
|
|
var/ore = /obj/item/stack/sheet/metal
|
|
for(var/i = 1, i <= oreAmount, i++)
|
|
new ore(get_turf(src))
|
|
else
|
|
var/ore = text2path("/obj/item/stack/sheet/mineral/[mineralType]")
|
|
for(var/i = 1, i <= oreAmount, i++)
|
|
new ore(get_turf(src))
|
|
else
|
|
if (mineralType == "metal")
|
|
var/ore = /obj/item/stack/sheet/metal
|
|
for(var/i = 3, i <= oreAmount, i++)
|
|
new ore(get_turf(src))
|
|
else
|
|
var/ore = text2path("/obj/item/stack/sheet/mineral/[mineralType]")
|
|
for(var/i = 3, i <= oreAmount, i++)
|
|
new ore(get_turf(src))
|
|
qdel(src)
|
|
|
|
//////////////////////////////////////STATUES/////////////////////////////////////////////////////////////
|
|
////////////////////////uranium///////////////////////////////////
|
|
|
|
/obj/structure/statue/uranium
|
|
obj_integrity = 300
|
|
luminosity = 2
|
|
mineralType = "uranium"
|
|
var/last_event = 0
|
|
var/active = null
|
|
|
|
/obj/structure/statue/uranium/nuke
|
|
name = "statue of a nuclear fission explosive"
|
|
desc = "This is a grand statue of a Nuclear Explosive. It has a sickening green colour."
|
|
icon_state = "nuke"
|
|
|
|
/obj/structure/statue/uranium/eng
|
|
name = "Statue of an engineer"
|
|
desc = "This statue has a sickening green colour."
|
|
icon_state = "eng"
|
|
|
|
/obj/structure/statue/uranium/attackby(obj/item/weapon/W, mob/user, params)
|
|
radiate()
|
|
return ..()
|
|
|
|
/obj/structure/statue/uranium/Bumped(atom/user)
|
|
radiate()
|
|
..()
|
|
|
|
/obj/structure/statue/uranium/attack_hand(mob/user)
|
|
radiate()
|
|
..()
|
|
|
|
/obj/structure/statue/uranium/attack_paw(mob/user)
|
|
radiate()
|
|
..()
|
|
|
|
/obj/structure/statue/uranium/proc/radiate()
|
|
if(!active)
|
|
if(world.time > last_event+15)
|
|
active = 1
|
|
radiation_pulse(get_turf(src), 3, 3, 12, 0)
|
|
last_event = world.time
|
|
active = null
|
|
return
|
|
return
|
|
|
|
////////////////////////////plasma///////////////////////////////////////////////////////////////////////
|
|
|
|
/obj/structure/statue/plasma
|
|
obj_integrity = 200
|
|
mineralType = "plasma"
|
|
desc = "This statue is suitably made from plasma."
|
|
|
|
/obj/structure/statue/plasma/scientist
|
|
name = "statue of a scientist"
|
|
icon_state = "sci"
|
|
|
|
/obj/structure/statue/plasma/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
|
if(exposed_temperature > 300)
|
|
PlasmaBurn(exposed_temperature)
|
|
|
|
|
|
/obj/structure/statue/plasma/bullet_act(obj/item/projectile/Proj)
|
|
var/burn = FALSE
|
|
if(istype(Proj,/obj/item/projectile/beam))
|
|
PlasmaBurn(2500)
|
|
burn = TRUE
|
|
else if(istype(Proj,/obj/item/projectile/ion))
|
|
PlasmaBurn(500)
|
|
burn = TRUE
|
|
if(burn)
|
|
if(Proj.firer)
|
|
message_admins("Plasma statue ignited by [key_name_admin(Proj.firer)](<A HREF='?_src_=holder;adminmoreinfo=\ref[Proj.firer]'>?</A>) (<A HREF='?_src_=holder;adminplayerobservefollow=\ref[Proj.firer]'>FLW</A>) in ([x],[y],[z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)",0,1)
|
|
log_game("Plasma statue ignited by [key_name(Proj.firer)] in ([x],[y],[z])")
|
|
else
|
|
message_admins("Plasma statue ignited by [Proj]. No known firer.(<A HREF='?_src_=holder;adminmoreinfo=\ref[Proj.firer]'>?</A>) (<A HREF='?_src_=holder;adminplayerobservefollow=\ref[Proj.firer]'>FLW</A>) in ([x],[y],[z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)",0,1)
|
|
log_game("Plasma statue ignited by [Proj] in ([x],[y],[z]). No known firer.")
|
|
..()
|
|
|
|
/obj/structure/statue/plasma/attackby(obj/item/weapon/W, mob/user, params)
|
|
if(W.is_hot() > 300)//If the temperature of the object is over 300, then ignite
|
|
message_admins("Plasma statue ignited by [key_name_admin(user)](<A HREF='?_src_=holder;adminmoreinfo=\ref[user]'>?</A>) (<A HREF='?_src_=holder;adminplayerobservefollow=\ref[user]'>FLW</A>) in ([x],[y],[z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)",0,1)
|
|
log_game("Plasma statue ignited by [key_name(user)] in ([x],[y],[z])")
|
|
ignite(W.is_hot())
|
|
else
|
|
return ..()
|
|
|
|
/obj/structure/statue/plasma/proc/PlasmaBurn()
|
|
atmos_spawn_air("plasma=400;TEMP=1000")
|
|
deconstruct(FALSE)
|
|
|
|
/obj/structure/statue/plasma/proc/ignite(exposed_temperature)
|
|
if(exposed_temperature > 300)
|
|
PlasmaBurn(exposed_temperature)
|
|
|
|
//////////////////////gold///////////////////////////////////////
|
|
|
|
/obj/structure/statue/gold
|
|
obj_integrity = 300
|
|
mineralType = "gold"
|
|
desc = "This is a highly valuable statue made from gold."
|
|
|
|
/obj/structure/statue/gold/hos
|
|
name = "statue of the head of security"
|
|
icon_state = "hos"
|
|
|
|
/obj/structure/statue/gold/hop
|
|
name = "statue of the head of personnel"
|
|
icon_state = "hop"
|
|
|
|
/obj/structure/statue/gold/cmo
|
|
name = "statue of the chief medical officer"
|
|
icon_state = "cmo"
|
|
|
|
/obj/structure/statue/gold/ce
|
|
name = "statue of the chief engineer"
|
|
icon_state = "ce"
|
|
|
|
/obj/structure/statue/gold/rd
|
|
name = "statue of the research director"
|
|
icon_state = "rd"
|
|
|
|
//////////////////////////silver///////////////////////////////////////
|
|
|
|
/obj/structure/statue/silver
|
|
obj_integrity = 300
|
|
mineralType = "silver"
|
|
desc = "This is a valuable statue made from silver."
|
|
|
|
/obj/structure/statue/silver/md
|
|
name = "statue of a medical officer"
|
|
icon_state = "md"
|
|
|
|
/obj/structure/statue/silver/janitor
|
|
name = "statue of a janitor"
|
|
icon_state = "jani"
|
|
|
|
/obj/structure/statue/silver/sec
|
|
name = "statue of a security officer"
|
|
icon_state = "sec"
|
|
|
|
/obj/structure/statue/silver/secborg
|
|
name = "statue of a security cyborg"
|
|
icon_state = "secborg"
|
|
|
|
/obj/structure/statue/silver/medborg
|
|
name = "statue of a medical cyborg"
|
|
icon_state = "medborg"
|
|
|
|
/////////////////////////diamond/////////////////////////////////////////
|
|
|
|
/obj/structure/statue/diamond
|
|
obj_integrity = 1000
|
|
mineralType = "diamond"
|
|
desc = "This is a very expensive diamond statue"
|
|
|
|
/obj/structure/statue/diamond/captain
|
|
name = "statue of THE captain."
|
|
icon_state = "cap"
|
|
|
|
/obj/structure/statue/diamond/ai1
|
|
name = "statue of the AI hologram."
|
|
icon_state = "ai1"
|
|
|
|
/obj/structure/statue/diamond/ai2
|
|
name = "statue of the AI core."
|
|
icon_state = "ai2"
|
|
|
|
////////////////////////bananium///////////////////////////////////////
|
|
|
|
/obj/structure/statue/bananium
|
|
obj_integrity = 300
|
|
mineralType = "bananium"
|
|
desc = "A bananium statue with a small engraving:'HOOOOOOONK'."
|
|
var/spam_flag = 0
|
|
|
|
/obj/structure/statue/bananium/clown
|
|
name = "statue of a clown"
|
|
icon_state = "clown"
|
|
|
|
/obj/structure/statue/bananium/Bumped(atom/user)
|
|
honk()
|
|
..()
|
|
|
|
/obj/structure/statue/bananium/attackby(obj/item/weapon/W, mob/user, params)
|
|
honk()
|
|
return ..()
|
|
|
|
/obj/structure/statue/bananium/attack_hand(mob/user)
|
|
honk()
|
|
..()
|
|
|
|
/obj/structure/statue/bananium/attack_paw(mob/user)
|
|
honk()
|
|
..()
|
|
|
|
/obj/structure/statue/bananium/proc/honk()
|
|
if(!spam_flag)
|
|
spam_flag = 1
|
|
playsound(src.loc, 'sound/items/bikehorn.ogg', 50, 1)
|
|
spawn(20)
|
|
spam_flag = 0
|
|
|
|
/////////////////////sandstone/////////////////////////////////////////
|
|
|
|
/obj/structure/statue/sandstone
|
|
obj_integrity = 50
|
|
mineralType = "sandstone"
|
|
|
|
/obj/structure/statue/sandstone/assistant
|
|
name = "statue of an assistant"
|
|
desc = "A cheap statue of sandstone for a greyshirt."
|
|
icon_state = "assist"
|
|
|
|
|
|
/obj/structure/statue/sandstone/venus //call me when we add marble i guess
|
|
name = "statue of a pure maiden"
|
|
desc = "An ancient marble statue. The subject is depicted with a floor-length braid and is wielding a toolbox. By Jove, it's easily the most gorgeous depiction of a woman you've ever seen. The artist must truly be a master of his craft. Shame about the broken arm, though."
|
|
icon = 'icons/obj/statuelarge.dmi'
|
|
icon_state = "venus"
|
|
|
|
/////////////////////snow/////////////////////////////////////////
|
|
|
|
/obj/structure/statue/snow
|
|
obj_integrity = 50
|
|
mineralType = "snow"
|
|
|
|
/obj/structure/statue/snow/snowman
|
|
name = "snowman"
|
|
desc = "Several lumps of snow put together to form a snowman."
|
|
icon_state = "snowman" |