mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-21 21:10:30 +01:00
387cee9243
Extends and reworks how various extended information text (desc_info, desc_build, desc_upgrades) are handled to make object interactions and mechanics A.) much more clearly documented in-game and B.) much easier to support from the back-end. Almost certainly a candidate for test merge. Assembly/Disassembly instructions are noticeably sporadic, largely due to our current lack of a unified framework. That's a future thing I'd like to attack so that it can be handled programmatically, but for now I only targeted the biggest culprits as I came across them. --------- Signed-off-by: Batrachophreno <Batrochophreno@gmail.com>
49 lines
1.3 KiB
Plaintext
49 lines
1.3 KiB
Plaintext
/obj/item/am_containment
|
|
name = "antimatter containment jar"
|
|
desc = "Holds antimatter. Warranty void if exposed to matter."
|
|
icon = 'icons/obj/machinery/antimatter.dmi'
|
|
icon_state = "jar"
|
|
force = 18
|
|
throwforce = 10
|
|
throw_speed = 1
|
|
throw_range = 2
|
|
|
|
var/fuel = 1000
|
|
var/stability = 100 //TODO: add all the stability things to this so its not very safe if you keep hitting in on things
|
|
var/exploded = FALSE
|
|
|
|
/obj/item/am_containment/antagonist_hints(mob/user, distance, is_adjacent)
|
|
. += ..()
|
|
. += "Antimatter is extremely volatile, and containment jars are not particularly strong. Weak explosions will reduce the container's integrity, and larger ones will cause it to explode immediately."
|
|
/obj/item/am_containment/proc/boom()
|
|
var/percent = 0
|
|
if(fuel)
|
|
percent = (fuel / initial(fuel)) * 100
|
|
if(!exploded && percent >= 10)
|
|
explosion(get_turf(src), 1, 2, 3, 5)//Should likely be larger but this works fine for now I guess
|
|
exploded = TRUE
|
|
if(src)
|
|
qdel(src)
|
|
|
|
/obj/item/am_containment/ex_act(severity)
|
|
switch(severity)
|
|
if(1.0)
|
|
boom()
|
|
if(2.0)
|
|
if(prob((fuel / 10) - stability))
|
|
boom()
|
|
stability -= 40
|
|
if(3.0)
|
|
stability -= 20
|
|
check_stability()
|
|
|
|
/obj/item/am_containment/proc/check_stability()
|
|
if(stability <= 0)
|
|
boom()
|
|
|
|
/obj/item/am_containment/proc/usefuel(var/wanted)
|
|
if(fuel < wanted)
|
|
wanted = fuel
|
|
fuel -= wanted
|
|
return wanted
|