mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-10 09:54:52 +00:00
458 lines
15 KiB
Plaintext
458 lines
15 KiB
Plaintext
|
|
#define GIBTONITE_QUALITY_HIGH 3
|
|
#define GIBTONITE_QUALITY_MEDIUM 2
|
|
#define GIBTONITE_QUALITY_LOW 1
|
|
|
|
#define ORESTACK_OVERLAYS_MAX 10
|
|
|
|
/**********************Mineral ores**************************/
|
|
|
|
/obj/item/stack/ore
|
|
name = "rock"
|
|
icon = 'icons/obj/mining.dmi'
|
|
icon_state = "ore"
|
|
item_state = "ore"
|
|
full_w_class = WEIGHT_CLASS_BULKY
|
|
singular_name = "ore chunk"
|
|
var/points = 0 //How many points this ore gets you from the ore redemption machine
|
|
var/refined_type = null //What this ore defaults to being refined into
|
|
novariants = TRUE // Ore stacks handle their icon updates themselves to keep the illusion that there's more going
|
|
mats_per_stack = MINERAL_MATERIAL_AMOUNT
|
|
var/list/stack_overlays
|
|
|
|
/obj/item/stack/ore/update_overlays()
|
|
. = ..()
|
|
var/difference = min(ORESTACK_OVERLAYS_MAX, amount) - (LAZYLEN(stack_overlays)+1)
|
|
if(difference == 0)
|
|
return
|
|
else if(difference < 0 && LAZYLEN(stack_overlays)) //amount < stack_overlays, remove excess.
|
|
if (LAZYLEN(stack_overlays)-difference <= 0)
|
|
stack_overlays = null
|
|
else
|
|
stack_overlays.len += difference
|
|
else if(difference > 0) //amount > stack_overlays, add some.
|
|
for(var/i in 1 to difference)
|
|
var/mutable_appearance/newore = mutable_appearance(icon, icon_state)
|
|
newore.pixel_x = rand(-8,8)
|
|
newore.pixel_y = rand(-8,8)
|
|
LAZYADD(stack_overlays, newore)
|
|
if (stack_overlays)
|
|
. += stack_overlays
|
|
|
|
/obj/item/stack/ore/welder_act(mob/living/user, obj/item/I)
|
|
if(!refined_type)
|
|
return TRUE
|
|
|
|
if(I.use_tool(src, user, 0, volume=50, amount=15))
|
|
new refined_type(drop_location())
|
|
use(1)
|
|
|
|
return TRUE
|
|
|
|
/obj/item/stack/ore/fire_act(exposed_temperature, exposed_volume)
|
|
. = ..()
|
|
if(isnull(refined_type))
|
|
return
|
|
else
|
|
var/probability = (rand(0,100))/100
|
|
var/burn_value = probability*amount
|
|
var/amountrefined = round(burn_value, 1)
|
|
if(amountrefined < 1)
|
|
qdel(src)
|
|
else
|
|
new refined_type(drop_location(),amountrefined)
|
|
qdel(src)
|
|
|
|
/obj/item/stack/ore/uranium
|
|
name = "uranium ore"
|
|
icon_state = "Uranium ore"
|
|
item_state = "Uranium ore"
|
|
singular_name = "uranium ore chunk"
|
|
points = 30
|
|
custom_materials = list(/datum/material/uranium=MINERAL_MATERIAL_AMOUNT)
|
|
material_flags = MATERIAL_NO_EFFECTS
|
|
refined_type = /obj/item/stack/sheet/mineral/uranium
|
|
|
|
/obj/item/stack/ore/iron
|
|
name = "iron ore"
|
|
icon_state = "Iron ore"
|
|
item_state = "Iron ore"
|
|
singular_name = "iron ore chunk"
|
|
points = 1
|
|
custom_materials = list(/datum/material/iron=MINERAL_MATERIAL_AMOUNT)
|
|
refined_type = /obj/item/stack/sheet/metal
|
|
|
|
/obj/item/stack/ore/glass
|
|
name = "sand pile"
|
|
icon_state = "Glass ore"
|
|
item_state = "Glass ore"
|
|
singular_name = "sand pile"
|
|
points = 1
|
|
custom_materials = list(/datum/material/glass=MINERAL_MATERIAL_AMOUNT)
|
|
refined_type = /obj/item/stack/sheet/glass
|
|
w_class = WEIGHT_CLASS_TINY
|
|
|
|
GLOBAL_LIST_INIT(sand_recipes, list(\
|
|
new/datum/stack_recipe("sandstone", /obj/item/stack/sheet/mineral/sandstone, 1, 1, 50),\
|
|
))
|
|
|
|
/obj/item/stack/ore/glass/get_main_recipes()
|
|
. = ..()
|
|
. += GLOB.sand_recipes
|
|
|
|
/obj/item/stack/ore/glass/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
|
|
if(..() || !ishuman(hit_atom))
|
|
return
|
|
var/mob/living/carbon/human/C = hit_atom
|
|
if(C.head && C.head.flags_cover & HEADCOVERSEYES)
|
|
visible_message("<span class='danger'>[C]'s headgear blocks the sand!</span>")
|
|
return
|
|
if(C.wear_mask && C.wear_mask.flags_cover & MASKCOVERSEYES)
|
|
visible_message("<span class='danger'>[C]'s mask blocks the sand!</span>")
|
|
return
|
|
if(C.glasses && C.glasses.flags_cover & GLASSESCOVERSEYES)
|
|
visible_message("<span class='danger'>[C]'s glasses block the sand!</span>")
|
|
return
|
|
C.adjust_blurriness(6)
|
|
C.adjustStaminaLoss(15)//the pain from your eyes burning does stamina damage
|
|
C.confused += 5
|
|
to_chat(C, "<span class='userdanger'>\The [src] gets into your eyes! The pain, it burns!</span>")
|
|
qdel(src)
|
|
|
|
/obj/item/stack/ore/glass/ex_act(severity, target)
|
|
if (severity == EXPLODE_NONE)
|
|
return
|
|
qdel(src)
|
|
|
|
/obj/item/stack/ore/glass/basalt
|
|
name = "volcanic ash"
|
|
icon_state = "volcanic_sand"
|
|
icon_state = "volcanic_sand"
|
|
singular_name = "volcanic ash pile"
|
|
|
|
/obj/item/stack/ore/plasma
|
|
name = "plasma ore"
|
|
icon_state = "Plasma ore"
|
|
item_state = "Plasma ore"
|
|
singular_name = "plasma ore chunk"
|
|
points = 15
|
|
custom_materials = list(/datum/material/plasma=MINERAL_MATERIAL_AMOUNT)
|
|
refined_type = /obj/item/stack/sheet/mineral/plasma
|
|
|
|
/obj/item/stack/ore/plasma/welder_act(mob/living/user, obj/item/I)
|
|
to_chat(user, "<span class='warning'>You can't hit a high enough temperature to smelt [src] properly!</span>")
|
|
return TRUE
|
|
|
|
/obj/item/stack/ore/silver
|
|
name = "silver ore"
|
|
icon_state = "Silver ore"
|
|
item_state = "Silver ore"
|
|
singular_name = "silver ore chunk"
|
|
points = 16
|
|
custom_materials = list(/datum/material/silver=MINERAL_MATERIAL_AMOUNT)
|
|
refined_type = /obj/item/stack/sheet/mineral/silver
|
|
|
|
/obj/item/stack/ore/gold
|
|
name = "gold ore"
|
|
icon_state = "Gold ore"
|
|
icon_state = "Gold ore"
|
|
singular_name = "gold ore chunk"
|
|
points = 18
|
|
custom_materials = list(/datum/material/gold=MINERAL_MATERIAL_AMOUNT)
|
|
refined_type = /obj/item/stack/sheet/mineral/gold
|
|
|
|
/obj/item/stack/ore/diamond
|
|
name = "diamond ore"
|
|
icon_state = "Diamond ore"
|
|
item_state = "Diamond ore"
|
|
singular_name = "diamond ore chunk"
|
|
points = 50
|
|
custom_materials = list(/datum/material/diamond=MINERAL_MATERIAL_AMOUNT)
|
|
refined_type = /obj/item/stack/sheet/mineral/diamond
|
|
|
|
/obj/item/stack/ore/bananium
|
|
name = "bananium ore"
|
|
icon_state = "Bananium ore"
|
|
item_state = "Bananium ore"
|
|
singular_name = "bananium ore chunk"
|
|
points = 60
|
|
custom_materials = list(/datum/material/bananium=MINERAL_MATERIAL_AMOUNT)
|
|
refined_type = /obj/item/stack/sheet/mineral/bananium
|
|
|
|
/obj/item/stack/ore/titanium
|
|
name = "titanium ore"
|
|
icon_state = "Titanium ore"
|
|
item_state = "Titanium ore"
|
|
singular_name = "titanium ore chunk"
|
|
points = 50
|
|
custom_materials = list(/datum/material/titanium=MINERAL_MATERIAL_AMOUNT)
|
|
refined_type = /obj/item/stack/sheet/mineral/titanium
|
|
|
|
/obj/item/stack/ore/slag
|
|
name = "slag"
|
|
desc = "Completely useless."
|
|
icon_state = "slag"
|
|
item_state = "slag"
|
|
singular_name = "slag chunk"
|
|
|
|
/obj/item/twohanded/required/gibtonite
|
|
name = "gibtonite ore"
|
|
desc = "Extremely explosive if struck with mining equipment, Gibtonite is often used by miners to speed up their work by using it as a mining charge. This material is illegal to possess by unauthorized personnel under space law."
|
|
icon = 'icons/obj/mining.dmi'
|
|
icon_state = "Gibtonite ore"
|
|
item_state = "Gibtonite ore"
|
|
w_class = WEIGHT_CLASS_BULKY
|
|
throw_range = 0
|
|
var/primed = FALSE
|
|
var/det_time = 100
|
|
var/quality = GIBTONITE_QUALITY_LOW //How pure this gibtonite is, determines the explosion produced by it and is derived from the det_time of the rock wall it was taken from, higher value = better
|
|
var/attacher = "UNKNOWN"
|
|
var/det_timer
|
|
|
|
/obj/item/twohanded/required/gibtonite/Destroy()
|
|
qdel(wires)
|
|
wires = null
|
|
return ..()
|
|
|
|
/obj/item/twohanded/required/gibtonite/attackby(obj/item/I, mob/user, params)
|
|
if(!wires && istype(I, /obj/item/assembly/igniter))
|
|
user.visible_message("[user] attaches [I] to [src].", "<span class='notice'>You attach [I] to [src].</span>")
|
|
wires = new /datum/wires/explosive/gibtonite(src)
|
|
attacher = key_name(user)
|
|
qdel(I)
|
|
add_overlay("Gibtonite_igniter")
|
|
return
|
|
|
|
if(wires && !primed)
|
|
if(is_wire_tool(I))
|
|
wires.interact(user)
|
|
return
|
|
|
|
if(I.tool_behaviour == TOOL_MINING || istype(I, /obj/item/resonator) || I.force >= 10)
|
|
GibtoniteReaction(user)
|
|
return
|
|
if(primed)
|
|
if(istype(I, /obj/item/mining_scanner) || istype(I, /obj/item/t_scanner/adv_mining_scanner) || istype(I, /obj/item/multitool))
|
|
primed = FALSE
|
|
if(det_timer)
|
|
deltimer(det_timer)
|
|
user.visible_message("The chain reaction was stopped! ...The ore's quality looks diminished.", "<span class='notice'>You stopped the chain reaction. ...The ore's quality looks diminished.</span>")
|
|
icon_state = "Gibtonite ore"
|
|
quality = GIBTONITE_QUALITY_LOW
|
|
return
|
|
..()
|
|
|
|
/obj/item/twohanded/required/gibtonite/attack_self(user)
|
|
if(wires)
|
|
wires.interact(user)
|
|
else
|
|
..()
|
|
|
|
/obj/item/twohanded/required/gibtonite/bullet_act(obj/item/projectile/P)
|
|
GibtoniteReaction(P.firer)
|
|
return ..()
|
|
|
|
/obj/item/twohanded/required/gibtonite/ex_act()
|
|
GibtoniteReaction(null, 1)
|
|
|
|
|
|
|
|
/obj/item/twohanded/required/gibtonite/proc/GibtoniteReaction(mob/user, triggered_by = 0)
|
|
if(!primed)
|
|
primed = TRUE
|
|
playsound(src,'sound/effects/hit_on_shattered_glass.ogg',50,1)
|
|
icon_state = "Gibtonite active"
|
|
var/turf/bombturf = get_turf(src)
|
|
var/notify_admins = 0
|
|
if(z != 5)//Only annoy the admins ingame if we're triggered off the mining zlevel
|
|
notify_admins = 1
|
|
|
|
if(notify_admins)
|
|
if(triggered_by == 1)
|
|
message_admins("An explosion has triggered a [name] to detonate at [ADMIN_VERBOSEJMP(bombturf)].")
|
|
else if(triggered_by == 2)
|
|
message_admins("A signal has triggered a [name] to detonate at [ADMIN_VERBOSEJMP(bombturf)]. Igniter attacher: [ADMIN_LOOKUPFLW(attacher)]")
|
|
else
|
|
message_admins("[ADMIN_LOOKUPFLW(attacher)] has triggered a [name] to detonate at [ADMIN_VERBOSEJMP(bombturf)].")
|
|
if(triggered_by == 1)
|
|
log_game("An explosion has primed a [name] for detonation at [AREACOORD(bombturf)]")
|
|
else if(triggered_by == 2)
|
|
log_game("A signal has primed a [name] for detonation at [AREACOORD(bombturf)]. Igniter attacher: [key_name(attacher)].")
|
|
else
|
|
user.visible_message("<span class='warning'>[user] strikes \the [src], causing a chain reaction!</span>", "<span class='danger'>You strike \the [src], causing a chain reaction.</span>")
|
|
log_game("[key_name(user)] has primed a [name] for detonation at [AREACOORD(bombturf)]")
|
|
det_timer = addtimer(CALLBACK(src, .proc/detonate, notify_admins), det_time, TIMER_STOPPABLE)
|
|
|
|
/obj/item/twohanded/required/gibtonite/proc/detonate(notify_admins)
|
|
if(primed)
|
|
switch(quality)
|
|
if(GIBTONITE_QUALITY_HIGH)
|
|
explosion(src,2,4,9,adminlog = notify_admins)
|
|
if(GIBTONITE_QUALITY_MEDIUM)
|
|
explosion(src,1,2,5,adminlog = notify_admins)
|
|
if(GIBTONITE_QUALITY_LOW)
|
|
explosion(src,0,1,3,adminlog = notify_admins)
|
|
qdel(src)
|
|
|
|
/obj/item/stack/ore/Initialize()
|
|
. = ..()
|
|
pixel_x = rand(0,16)-8
|
|
pixel_y = rand(0,8)-8
|
|
|
|
/obj/item/stack/ore/ex_act(severity, target)
|
|
if (!severity || severity >= 2)
|
|
return
|
|
qdel(src)
|
|
|
|
|
|
/*****************************Coin********************************/
|
|
|
|
// The coin's value is a value of it's materials.
|
|
// Yes, the gold standard makes a come-back!
|
|
// This is the only way to make coins that are possible to produce on station actually worth anything.
|
|
/obj/item/coin
|
|
icon = 'icons/obj/economy.dmi'
|
|
name = "coin"
|
|
icon_state = "coin"
|
|
flags_1 = CONDUCT_1
|
|
force = 1
|
|
throwforce = 2
|
|
w_class = WEIGHT_CLASS_TINY
|
|
custom_materials = list(/datum/material/iron = 400)
|
|
material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR | MATERIAL_AFFECT_STATISTICS
|
|
var/string_attached
|
|
var/list/sideslist = list("heads","tails")
|
|
var/cooldown = 0
|
|
var/value
|
|
var/coinflip
|
|
item_flags = NO_MAT_REDEMPTION //You know, it's kind of a problem that money is worth more extrinsicly than intrinsically in this universe.
|
|
|
|
/obj/item/coin/Initialize()
|
|
. = ..()
|
|
coinflip = pick(sideslist)
|
|
icon_state = "coin_[coinflip]"
|
|
pixel_x = rand(0,16)-8
|
|
pixel_y = rand(0,8)-8
|
|
|
|
/obj/item/coin/set_custom_materials(list/materials, multiplier = 1)
|
|
. = ..()
|
|
value = 0
|
|
for(var/i in custom_materials)
|
|
var/datum/material/M = i
|
|
value += M.value_per_unit * custom_materials[M]
|
|
|
|
/obj/item/coin/suicide_act(mob/living/user)
|
|
user.visible_message("<span class='suicide'>[user] contemplates suicide with \the [src]!</span>")
|
|
if (!attack_self(user))
|
|
user.visible_message("<span class='suicide'>[user] couldn't flip \the [src]!</span>")
|
|
return SHAME
|
|
addtimer(CALLBACK(src, .proc/manual_suicide, user), 10)//10 = time takes for flip animation
|
|
return MANUAL_SUICIDE
|
|
|
|
/obj/item/coin/proc/manual_suicide(mob/living/user)
|
|
var/index = sideslist.Find(coinflip)
|
|
if (index==2)//tails
|
|
user.visible_message("<span class='suicide'>\the [src] lands on [coinflip]! [user] promptly falls over, dead!</span>")
|
|
user.adjustOxyLoss(200)
|
|
user.death(0)
|
|
else
|
|
user.visible_message("<span class='suicide'>\the [src] lands on [coinflip]! [user] keeps on living!</span>")
|
|
|
|
/obj/item/coin/examine(mob/user)
|
|
. = ..()
|
|
. += "<span class='info'>It's worth [value] credit\s.</span>"
|
|
|
|
/obj/item/coin/attackby(obj/item/W, mob/user, params)
|
|
if(istype(W, /obj/item/stack/cable_coil))
|
|
var/obj/item/stack/cable_coil/CC = W
|
|
if(string_attached)
|
|
to_chat(user, "<span class='warning'>There already is a string attached to this coin!</span>")
|
|
return
|
|
|
|
if (CC.use(1))
|
|
add_overlay("coin_string_overlay")
|
|
string_attached = 1
|
|
to_chat(user, "<span class='notice'>You attach a string to the coin.</span>")
|
|
else
|
|
to_chat(user, "<span class='warning'>You need one length of cable to attach a string to the coin!</span>")
|
|
return
|
|
else
|
|
..()
|
|
|
|
/obj/item/coin/wirecutter_act(mob/living/user, obj/item/I)
|
|
if(!string_attached)
|
|
return TRUE
|
|
|
|
new /obj/item/stack/cable_coil(drop_location(), 1)
|
|
overlays = list()
|
|
string_attached = null
|
|
to_chat(user, "<span class='notice'>You detach the string from the coin.</span>")
|
|
return TRUE
|
|
|
|
/obj/item/coin/attack_self(mob/user)
|
|
if(cooldown < world.time)
|
|
if(string_attached) //does the coin have a wire attached
|
|
to_chat(user, "<span class='warning'>The coin won't flip very well with something attached!</span>" )
|
|
return FALSE//do not flip the coin
|
|
cooldown = world.time + 15
|
|
flick("coin_[coinflip]_flip", src)
|
|
coinflip = pick(sideslist)
|
|
icon_state = "coin_[coinflip]"
|
|
playsound(user.loc, 'sound/items/coinflip.ogg', 50, 1)
|
|
var/oldloc = loc
|
|
sleep(15)
|
|
if(loc == oldloc && user && !user.incapacitated())
|
|
user.visible_message("[user] has flipped [src]. It lands on [coinflip].", \
|
|
"<span class='notice'>You flip [src]. It lands on [coinflip].</span>", \
|
|
"<span class='italics'>You hear the clattering of loose change.</span>")
|
|
return TRUE//did the coin flip? useful for suicide_act
|
|
|
|
/obj/item/coin/gold
|
|
custom_materials = list(/datum/material/gold = 400)
|
|
|
|
/obj/item/coin/silver
|
|
custom_materials = list(/datum/material/silver = 400)
|
|
|
|
/obj/item/coin/diamond
|
|
custom_materials = list(/datum/material/diamond = 400)
|
|
|
|
/obj/item/coin/plasma
|
|
custom_materials = list(/datum/material/plasma = 400)
|
|
|
|
/obj/item/coin/uranium
|
|
custom_materials = list(/datum/material/uranium = 400)
|
|
|
|
/obj/item/coin/titanium
|
|
custom_materials = list(/datum/material/titanium = 400)
|
|
|
|
/obj/item/coin/bananium
|
|
custom_materials = list(/datum/material/bananium = 400)
|
|
|
|
/obj/item/coin/adamantine
|
|
custom_materials = list(/datum/material/adamantine = 400)
|
|
|
|
/obj/item/coin/mythril
|
|
custom_materials = list(/datum/material/mythril = 400)
|
|
|
|
/obj/item/coin/plastic
|
|
custom_materials = list(/datum/material/plastic = 400)
|
|
|
|
/obj/item/coin/runite
|
|
custom_materials = list(/datum/material/runite = 400)
|
|
|
|
/obj/item/coin/twoheaded
|
|
desc = "Hey, this coin's the same on both sides!"
|
|
sideslist = list("heads")
|
|
|
|
/obj/item/coin/antagtoken
|
|
name = "antag token"
|
|
desc = "A novelty coin that helps the heart know what hard evidence cannot prove."
|
|
icon_state = "coin_valid"
|
|
custom_materials = list(/datum/material/plastic = 400)
|
|
sideslist = list("valid", "salad")
|
|
material_flags = NONE
|
|
|
|
/obj/item/coin/iron
|
|
|
|
#undef ORESTACK_OVERLAYS_MAX
|