This commit is contained in:
Seris02
2020-01-13 12:53:52 +08:00
1027 changed files with 196105 additions and 197892 deletions
@@ -29,6 +29,7 @@
resistance_flags = FIRE_PROOF
/obj/item/clothing/suit/hooded/explorer/standard
hoodtype = /obj/item/clothing/head/hooded/explorer/standard
/obj/item/clothing/head/hooded/explorer/standard
+154 -154
View File
@@ -1,154 +1,154 @@
/*****************Pickaxes & Drills & Shovels****************/
/obj/item/pickaxe
name = "pickaxe"
icon = 'icons/obj/mining.dmi'
icon_state = "pickaxe"
flags_1 = CONDUCT_1
slot_flags = ITEM_SLOT_BELT | ITEM_SLOT_BACK
force = 15
throwforce = 10
item_state = "pickaxe"
lefthand_file = 'icons/mob/inhands/equipment/mining_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/mining_righthand.dmi'
w_class = WEIGHT_CLASS_BULKY
materials = list(MAT_METAL=2000) //one sheet, but where can you make them?
tool_behaviour = TOOL_MINING
toolspeed = 1
usesound = list('sound/effects/picaxe1.ogg', 'sound/effects/picaxe2.ogg', 'sound/effects/picaxe3.ogg')
attack_verb = list("hit", "pierced", "sliced", "attacked")
var/digrange = 1
/obj/item/pickaxe/attack_self(mob/user)
if(initial(digrange) > 0)
if(digrange == 0)
digrange = initial(digrange)
toolspeed = initial(toolspeed)
to_chat(user, "<span class='notice'>You increase the tools dig range, decreasing its mining speed.</span>")
else
digrange = 0
toolspeed = toolspeed/2
to_chat(user, "<span class='notice'>You decrease the tools dig range, increasing its mining speed.</span>")
else
to_chat(user, "<span class='notice'>Tool does not have a configureable dig range.</span>")
/obj/item/pickaxe/suicide_act(mob/living/user)
user.visible_message("<span class='suicide'>[user] begins digging into [user.p_their()] chest! It looks like [user.p_theyre()] trying to commit suicide!</span>")
if(use_tool(user, user, 30, volume=50))
return BRUTELOSS
user.visible_message("<span class='suicide'>[user] couldn't do it!</span>")
return SHAME
/obj/item/pickaxe/mini
name = "compact pickaxe"
desc = "A smaller, compact version of the standard pickaxe."
icon_state = "minipick"
force = 10
throwforce = 7
slot_flags = ITEM_SLOT_BELT
w_class = WEIGHT_CLASS_SMALL
materials = list(MAT_METAL=1000)
/obj/item/pickaxe/silver
name = "silver-plated pickaxe"
icon_state = "spickaxe"
item_state = "spickaxe"
toolspeed = 0.5 //mines faster than a normal pickaxe, bought from mining vendor
desc = "A silver-plated pickaxe that mines slightly faster than standard-issue."
force = 17
materials = list(MAT_SILVER=4000)
/obj/item/pickaxe/diamond
name = "diamond-tipped pickaxe"
icon_state = "dpickaxe"
item_state = "dpickaxe"
toolspeed = 0.3
desc = "A pickaxe with a diamond pick head. Extremely robust at cracking rock walls and digging up dirt."
force = 19
materials = list(MAT_DIAMOND=4000)
/obj/item/pickaxe/drill
name = "mining drill"
icon_state = "handdrill"
item_state = "jackhammer"
slot_flags = ITEM_SLOT_BELT
toolspeed = 0.6 //available from roundstart, faster than a pickaxe.
usesound = 'sound/weapons/drill.ogg'
hitsound = 'sound/weapons/drill.ogg'
desc = "An electric mining drill for the especially scrawny."
/obj/item/pickaxe/drill/cyborg
name = "cyborg mining drill"
desc = "An integrated electric mining drill."
flags_1 = NONE
toolspeed = 0.5
/obj/item/pickaxe/drill/cyborg/Initialize()
. = ..()
ADD_TRAIT(src, TRAIT_NODROP, CYBORG_ITEM_TRAIT)
/obj/item/pickaxe/drill/diamonddrill
name = "diamond-tipped mining drill"
icon_state = "diamonddrill"
toolspeed = 0.4
desc = "Yours is the drill that will pierce the heavens!"
/obj/item/pickaxe/drill/cyborg/diamond //This is the BORG version!
name = "diamond-tipped cyborg mining drill" //To inherit the NODROP_1 flag, and easier to change borg specific drill mechanics.
icon_state = "diamonddrill"
toolspeed = 0.4
digrange = 2
/obj/item/pickaxe/drill/jackhammer
name = "sonic jackhammer"
icon_state = "jackhammer"
item_state = "jackhammer"
w_class = WEIGHT_CLASS_HUGE
toolspeed = 0.2 //the epitome of powertools. extremely fast mining, laughs at puny walls
usesound = 'sound/weapons/sonic_jackhammer.ogg'
hitsound = 'sound/weapons/sonic_jackhammer.ogg'
desc = "Cracks rocks with sonic blasts, and doubles as a demolition power tool for smashing walls."
digrange = 2
/obj/item/shovel
name = "shovel"
desc = "A large tool for digging and moving dirt."
icon = 'icons/obj/mining.dmi'
icon_state = "shovel"
lefthand_file = 'icons/mob/inhands/equipment/mining_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/mining_righthand.dmi'
flags_1 = CONDUCT_1
slot_flags = ITEM_SLOT_BELT
force = 8
tool_behaviour = TOOL_SHOVEL
toolspeed = 0.1 //Can only dig ash and thats about it, out classed by the picks and drills no more!
usesound = 'sound/effects/shovel_dig.ogg'
throwforce = 4
item_state = "shovel"
w_class = WEIGHT_CLASS_NORMAL
materials = list(MAT_METAL=350)
attack_verb = list("bashed", "bludgeoned", "thrashed", "whacked")
sharpness = IS_SHARP
/obj/item/shovel/Initialize()
. = ..()
AddComponent(/datum/component/butchering, 150, 40) //it's sharp, so it works, but barely.
/obj/item/shovel/suicide_act(mob/living/user)
user.visible_message("<span class='suicide'>[user] begins digging their own grave! It looks like [user.p_theyre()] trying to commit suicide!</span>")
if(use_tool(user, user, 30, volume=50))
return BRUTELOSS
user.visible_message("<span class='suicide'>[user] couldn't do it!</span>")
return SHAME
/obj/item/shovel/spade
name = "spade"
desc = "A small tool for digging and moving dirt."
icon_state = "spade"
item_state = "spade"
lefthand_file = 'icons/mob/inhands/equipment/hydroponics_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/hydroponics_righthand.dmi'
toolspeed = 0.5
force = 5
throwforce = 7
materials = list(MAT_METAL=50)
w_class = WEIGHT_CLASS_SMALL
/*****************Pickaxes & Drills & Shovels****************/
/obj/item/pickaxe
name = "pickaxe"
icon = 'icons/obj/mining.dmi'
icon_state = "pickaxe"
flags_1 = CONDUCT_1
slot_flags = ITEM_SLOT_BELT | ITEM_SLOT_BACK
force = 15
throwforce = 10
item_state = "pickaxe"
lefthand_file = 'icons/mob/inhands/equipment/mining_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/mining_righthand.dmi'
w_class = WEIGHT_CLASS_BULKY
materials = list(MAT_METAL=2000) //one sheet, but where can you make them?
tool_behaviour = TOOL_MINING
toolspeed = 1
usesound = list('sound/effects/picaxe1.ogg', 'sound/effects/picaxe2.ogg', 'sound/effects/picaxe3.ogg')
attack_verb = list("hit", "pierced", "sliced", "attacked")
var/digrange = 1
/obj/item/pickaxe/attack_self(mob/user)
if(initial(digrange) > 0)
if(digrange == 0)
digrange = initial(digrange)
toolspeed = initial(toolspeed)
to_chat(user, "<span class='notice'>You increase the tools dig range, decreasing its mining speed.</span>")
else
digrange = 0
toolspeed = toolspeed/2
to_chat(user, "<span class='notice'>You decrease the tools dig range, increasing its mining speed.</span>")
else
to_chat(user, "<span class='notice'>Tool does not have a configureable dig range.</span>")
/obj/item/pickaxe/suicide_act(mob/living/user)
user.visible_message("<span class='suicide'>[user] begins digging into [user.p_their()] chest! It looks like [user.p_theyre()] trying to commit suicide!</span>")
if(use_tool(user, user, 30, volume=50))
return BRUTELOSS
user.visible_message("<span class='suicide'>[user] couldn't do it!</span>")
return SHAME
/obj/item/pickaxe/mini
name = "compact pickaxe"
desc = "A smaller, compact version of the standard pickaxe."
icon_state = "minipick"
force = 10
throwforce = 7
slot_flags = ITEM_SLOT_BELT
w_class = WEIGHT_CLASS_SMALL
materials = list(MAT_METAL=1000)
/obj/item/pickaxe/silver
name = "silver-plated pickaxe"
icon_state = "spickaxe"
item_state = "spickaxe"
toolspeed = 0.5 //mines faster than a normal pickaxe, bought from mining vendor
desc = "A silver-plated pickaxe that mines slightly faster than standard-issue."
force = 17
materials = list(MAT_SILVER=4000)
/obj/item/pickaxe/diamond
name = "diamond-tipped pickaxe"
icon_state = "dpickaxe"
item_state = "dpickaxe"
toolspeed = 0.3
desc = "A pickaxe with a diamond pick head. Extremely robust at cracking rock walls and digging up dirt."
force = 19
materials = list(MAT_DIAMOND=4000)
/obj/item/pickaxe/drill
name = "mining drill"
icon_state = "handdrill"
item_state = "jackhammer"
slot_flags = ITEM_SLOT_BELT
toolspeed = 0.6 //available from roundstart, faster than a pickaxe.
usesound = 'sound/weapons/drill.ogg'
hitsound = 'sound/weapons/drill.ogg'
desc = "An electric mining drill for the especially scrawny."
/obj/item/pickaxe/drill/cyborg
name = "cyborg mining drill"
desc = "An integrated electric mining drill."
flags_1 = NONE
toolspeed = 0.5
/obj/item/pickaxe/drill/cyborg/Initialize()
. = ..()
ADD_TRAIT(src, TRAIT_NODROP, CYBORG_ITEM_TRAIT)
/obj/item/pickaxe/drill/diamonddrill
name = "diamond-tipped mining drill"
icon_state = "diamonddrill"
toolspeed = 0.4
desc = "Yours is the drill that will pierce the heavens!"
/obj/item/pickaxe/drill/cyborg/diamond //This is the BORG version!
name = "diamond-tipped cyborg mining drill" //To inherit the NODROP_1 flag, and easier to change borg specific drill mechanics.
icon_state = "diamonddrill"
toolspeed = 0.4
digrange = 2
/obj/item/pickaxe/drill/jackhammer
name = "sonic jackhammer"
icon_state = "jackhammer"
item_state = "jackhammer"
w_class = WEIGHT_CLASS_HUGE
toolspeed = 0.2 //the epitome of powertools. extremely fast mining, laughs at puny walls
usesound = 'sound/weapons/sonic_jackhammer.ogg'
hitsound = 'sound/weapons/sonic_jackhammer.ogg'
desc = "Cracks rocks with sonic blasts, and doubles as a demolition power tool for smashing walls."
digrange = 2
/obj/item/shovel
name = "shovel"
desc = "A large tool for digging and moving dirt."
icon = 'icons/obj/mining.dmi'
icon_state = "shovel"
lefthand_file = 'icons/mob/inhands/equipment/mining_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/mining_righthand.dmi'
flags_1 = CONDUCT_1
slot_flags = ITEM_SLOT_BELT
force = 8
tool_behaviour = TOOL_SHOVEL
toolspeed = 0.1 //Can only dig ash and thats about it, out classed by the picks and drills no more!
usesound = 'sound/effects/shovel_dig.ogg'
throwforce = 4
item_state = "shovel"
w_class = WEIGHT_CLASS_NORMAL
materials = list(MAT_METAL=350)
attack_verb = list("bashed", "bludgeoned", "thrashed", "whacked")
sharpness = IS_SHARP
/obj/item/shovel/Initialize()
. = ..()
AddComponent(/datum/component/butchering, 150, 40) //it's sharp, so it works, but barely.
/obj/item/shovel/suicide_act(mob/living/user)
user.visible_message("<span class='suicide'>[user] begins digging their own grave! It looks like [user.p_theyre()] trying to commit suicide!</span>")
if(use_tool(user, user, 30, volume=50))
return BRUTELOSS
user.visible_message("<span class='suicide'>[user] couldn't do it!</span>")
return SHAME
/obj/item/shovel/spade
name = "spade"
desc = "A small tool for digging and moving dirt."
icon_state = "spade"
item_state = "spade"
lefthand_file = 'icons/mob/inhands/equipment/hydroponics_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/hydroponics_righthand.dmi'
toolspeed = 0.5
force = 5
throwforce = 7
materials = list(MAT_METAL=50)
w_class = WEIGHT_CLASS_SMALL
+147 -147
View File
@@ -1,147 +1,147 @@
/*********************Hivelord stabilizer****************/
/obj/item/hivelordstabilizer
name = "stabilizing serum"
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle19"
desc = "Inject certain types of monster organs with this stabilizer to preserve their healing powers indefinitely."
w_class = WEIGHT_CLASS_TINY
/obj/item/hivelordstabilizer/afterattack(obj/item/organ/M, mob/user)
. = ..()
var/obj/item/organ/regenerative_core/C = M
if(!istype(C, /obj/item/organ/regenerative_core))
to_chat(user, "<span class='warning'>The stabilizer only works on certain types of monster organs, generally regenerative in nature.</span>")
return ..()
C.preserved()
to_chat(user, "<span class='notice'>You inject the [M] with the stabilizer. It will no longer go inert.</span>")
qdel(src)
/************************Hivelord core*******************/
/obj/item/organ/regenerative_core
name = "regenerative core"
desc = "All that remains of a hivelord. It can be used to heal completely, but it will rapidly decay into uselessness."
icon_state = "roro core 2"
item_flags = NOBLUDGEON
slot = "hivecore"
force = 0
actions_types = list(/datum/action/item_action/organ_action/use)
var/inert = 0
var/preserved = 0
/obj/item/organ/regenerative_core/Initialize()
. = ..()
addtimer(CALLBACK(src, .proc/inert_check), 2400)
/obj/item/organ/regenerative_core/proc/inert_check()
if(!preserved)
go_inert()
/obj/item/organ/regenerative_core/proc/preserved(implanted = 0)
inert = FALSE
preserved = TRUE
update_icon()
desc = "All that remains of a hivelord. It is preserved, allowing you to use it to heal completely without danger of decay."
if(implanted)
SSblackbox.record_feedback("nested tally", "hivelord_core", 1, list("[type]", "implanted"))
else
SSblackbox.record_feedback("nested tally", "hivelord_core", 1, list("[type]", "stabilizer"))
/obj/item/organ/regenerative_core/proc/go_inert()
inert = TRUE
name = "decayed regenerative core"
desc = "All that remains of a hivelord. It has decayed, and is completely useless."
SSblackbox.record_feedback("nested tally", "hivelord_core", 1, list("[type]", "inert"))
update_icon()
/obj/item/organ/regenerative_core/ui_action_click()
if(inert)
to_chat(owner, "<span class='notice'>[src] breaks down as it tries to activate.</span>")
else
owner.revive(full_heal = 1)
owner.log_message("[owner] used an implanted [src] to heal themselves! Keep fighting, it's just a flesh wound!", LOG_ATTACK, color="green") //Logging for implanted legion core use
qdel(src)
/obj/item/organ/regenerative_core/on_life()
..()
if(owner.health < owner.crit_threshold)
ui_action_click()
/obj/item/organ/regenerative_core/afterattack(atom/target, mob/user, proximity_flag)
. = ..()
if(proximity_flag && ishuman(target))
var/mob/living/carbon/human/H = target
if(inert)
to_chat(user, "<span class='notice'>[src] has decayed and can no longer be used to heal.</span>")
return
if(isvamp(user))
to_chat(user, "<span class='notice'>[src] breaks down as it fails to heal your unholy self</span>")
return
else
if(H.stat == DEAD)
to_chat(user, "<span class='notice'>[src] are useless on the dead.</span>")
return
if(H != user)
H.visible_message("[user] forces [H] to apply [src]... [H.p_they()] quickly regenerate all injuries!")
SSblackbox.record_feedback("nested tally", "hivelord_core", 1, list("[type]", "used", "other"))
else
to_chat(user, "<span class='notice'>You start to smear [src] on yourself. It feels and smells disgusting, but you feel amazingly refreshed in mere moments.</span>")
SSblackbox.record_feedback("nested tally", "hivelord_core", 1, list("[type]", "used", "self"))
H.revive(full_heal = 1)
qdel(src)
user.log_message("[user] used [src] to heal [H]! Wake the fuck up, Samurai!", LOG_ATTACK, color="green") //Logging for 'old' style legion core use, when clicking on a sprite of yourself or another.
/obj/item/organ/regenerative_core/attack_self(mob/user) //Knouli's first hack! Allows for the use of the core in hand rather than needing to click on the target, yourself, to selfheal. Its a rip of the proc just above - but skips on distance check and only uses 'user' rather than 'target'
if(ishuman(user)) //Check if user is human, no need for distance check as it's self heal
var/mob/living/carbon/human/H = user //Set H to user rather than target
if(inert) //Inert cores are useless
to_chat(user, "<span class='notice'>[src] has decayed and can no longer be used to heal.</span>")
return
else //Skip on check if the target to be healed is dead as, if you are dead, you're not going to be able to use it on yourself!
to_chat(user, "<span class='notice'>You start to smear [src] on yourself. It feels and smells disgusting, but you feel amazingly refreshed in mere moments.</span>")
SSblackbox.record_feedback("nested tally", "hivelord_core", 1, list("[type]", "used", "self"))
H.revive(full_heal = 1)
qdel(src)
H.log_message("[H] used [src] to heal themselves! Making use of Knouli's sexy and intelligent use-in-hand proc!", LOG_ATTACK, color="green") //Logging for 'new' style legion core use, when using the core in-hand.
/obj/item/organ/regenerative_core/Insert(mob/living/carbon/M, special = 0, drop_if_replaced = TRUE)
. = ..()
if(!preserved && !inert)
preserved(TRUE)
owner.visible_message("<span class='notice'>[src] stabilizes as it's inserted.</span>")
/obj/item/organ/regenerative_core/Remove(mob/living/carbon/M, special = 0)
if(!inert && !special)
owner.visible_message("<span class='notice'>[src] rapidly decays as it's removed.</span>")
go_inert()
return ..()
/obj/item/organ/regenerative_core/prepare_eat()
return null
/*************************Legion core********************/
/obj/item/organ/regenerative_core/legion
desc = "A strange rock that crackles with power. It can be used to heal completely, but it will rapidly decay into uselessness."
icon_state = "legion_soul"
/obj/item/organ/regenerative_core/legion/Initialize()
. = ..()
update_icon()
/obj/item/organ/regenerative_core/update_icon()
icon_state = inert ? "legion_soul_inert" : "legion_soul"
cut_overlays()
if(!inert && !preserved)
add_overlay("legion_soul_crackle")
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
/obj/item/organ/regenerative_core/legion/go_inert()
..()
desc = "[src] has become inert. It has decayed, and is completely useless."
/obj/item/organ/regenerative_core/legion/preserved(implanted = 0)
..()
desc = "[src] has been stabilized. It is preserved, allowing you to use it to heal completely without danger of decay."
/*********************Hivelord stabilizer****************/
/obj/item/hivelordstabilizer
name = "stabilizing serum"
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle19"
desc = "Inject certain types of monster organs with this stabilizer to preserve their healing powers indefinitely."
w_class = WEIGHT_CLASS_TINY
/obj/item/hivelordstabilizer/afterattack(obj/item/organ/M, mob/user)
. = ..()
var/obj/item/organ/regenerative_core/C = M
if(!istype(C, /obj/item/organ/regenerative_core))
to_chat(user, "<span class='warning'>The stabilizer only works on certain types of monster organs, generally regenerative in nature.</span>")
return ..()
C.preserved()
to_chat(user, "<span class='notice'>You inject the [M] with the stabilizer. It will no longer go inert.</span>")
qdel(src)
/************************Hivelord core*******************/
/obj/item/organ/regenerative_core
name = "regenerative core"
desc = "All that remains of a hivelord. It can be used to heal completely, but it will rapidly decay into uselessness."
icon_state = "roro core 2"
item_flags = NOBLUDGEON
slot = "hivecore"
force = 0
actions_types = list(/datum/action/item_action/organ_action/use)
var/inert = 0
var/preserved = 0
/obj/item/organ/regenerative_core/Initialize()
. = ..()
addtimer(CALLBACK(src, .proc/inert_check), 2400)
/obj/item/organ/regenerative_core/proc/inert_check()
if(!preserved)
go_inert()
/obj/item/organ/regenerative_core/proc/preserved(implanted = 0)
inert = FALSE
preserved = TRUE
update_icon()
desc = "All that remains of a hivelord. It is preserved, allowing you to use it to heal completely without danger of decay."
if(implanted)
SSblackbox.record_feedback("nested tally", "hivelord_core", 1, list("[type]", "implanted"))
else
SSblackbox.record_feedback("nested tally", "hivelord_core", 1, list("[type]", "stabilizer"))
/obj/item/organ/regenerative_core/proc/go_inert()
inert = TRUE
name = "decayed regenerative core"
desc = "All that remains of a hivelord. It has decayed, and is completely useless."
SSblackbox.record_feedback("nested tally", "hivelord_core", 1, list("[type]", "inert"))
update_icon()
/obj/item/organ/regenerative_core/ui_action_click()
if(inert)
to_chat(owner, "<span class='notice'>[src] breaks down as it tries to activate.</span>")
else
owner.revive(full_heal = 1)
owner.log_message("[owner] used an implanted [src] to heal themselves! Keep fighting, it's just a flesh wound!", LOG_ATTACK, color="green") //Logging for implanted legion core use
qdel(src)
/obj/item/organ/regenerative_core/on_life()
..()
if(owner.health < owner.crit_threshold)
ui_action_click()
/obj/item/organ/regenerative_core/afterattack(atom/target, mob/user, proximity_flag)
. = ..()
if(proximity_flag && ishuman(target))
var/mob/living/carbon/human/H = target
if(inert)
to_chat(user, "<span class='notice'>[src] has decayed and can no longer be used to heal.</span>")
return
if(isvamp(user))
to_chat(user, "<span class='notice'>[src] breaks down as it fails to heal your unholy self</span>")
return
else
if(H.stat == DEAD)
to_chat(user, "<span class='notice'>[src] are useless on the dead.</span>")
return
if(H != user)
H.visible_message("[user] forces [H] to apply [src]... [H.p_they()] quickly regenerate all injuries!")
SSblackbox.record_feedback("nested tally", "hivelord_core", 1, list("[type]", "used", "other"))
else
to_chat(user, "<span class='notice'>You start to smear [src] on yourself. It feels and smells disgusting, but you feel amazingly refreshed in mere moments.</span>")
SSblackbox.record_feedback("nested tally", "hivelord_core", 1, list("[type]", "used", "self"))
H.revive(full_heal = 1)
qdel(src)
user.log_message("[user] used [src] to heal [H]! Wake the fuck up, Samurai!", LOG_ATTACK, color="green") //Logging for 'old' style legion core use, when clicking on a sprite of yourself or another.
/obj/item/organ/regenerative_core/attack_self(mob/user) //Knouli's first hack! Allows for the use of the core in hand rather than needing to click on the target, yourself, to selfheal. Its a rip of the proc just above - but skips on distance check and only uses 'user' rather than 'target'
if(ishuman(user)) //Check if user is human, no need for distance check as it's self heal
var/mob/living/carbon/human/H = user //Set H to user rather than target
if(inert) //Inert cores are useless
to_chat(user, "<span class='notice'>[src] has decayed and can no longer be used to heal.</span>")
return
else //Skip on check if the target to be healed is dead as, if you are dead, you're not going to be able to use it on yourself!
to_chat(user, "<span class='notice'>You start to smear [src] on yourself. It feels and smells disgusting, but you feel amazingly refreshed in mere moments.</span>")
SSblackbox.record_feedback("nested tally", "hivelord_core", 1, list("[type]", "used", "self"))
H.revive(full_heal = 1)
qdel(src)
H.log_message("[H] used [src] to heal themselves! Making use of Knouli's sexy and intelligent use-in-hand proc!", LOG_ATTACK, color="green") //Logging for 'new' style legion core use, when using the core in-hand.
/obj/item/organ/regenerative_core/Insert(mob/living/carbon/M, special = 0, drop_if_replaced = TRUE)
. = ..()
if(!preserved && !inert)
preserved(TRUE)
owner.visible_message("<span class='notice'>[src] stabilizes as it's inserted.</span>")
/obj/item/organ/regenerative_core/Remove(mob/living/carbon/M, special = 0)
if(!inert && !special)
owner.visible_message("<span class='notice'>[src] rapidly decays as it's removed.</span>")
go_inert()
return ..()
/obj/item/organ/regenerative_core/prepare_eat()
return null
/*************************Legion core********************/
/obj/item/organ/regenerative_core/legion
desc = "A strange rock that crackles with power. It can be used to heal completely, but it will rapidly decay into uselessness."
icon_state = "legion_soul"
/obj/item/organ/regenerative_core/legion/Initialize()
. = ..()
update_icon()
/obj/item/organ/regenerative_core/update_icon()
icon_state = inert ? "legion_soul_inert" : "legion_soul"
cut_overlays()
if(!inert && !preserved)
add_overlay("legion_soul_crackle")
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
/obj/item/organ/regenerative_core/legion/go_inert()
..()
desc = "[src] has become inert. It has decayed, and is completely useless."
/obj/item/organ/regenerative_core/legion/preserved(implanted = 0)
..()
desc = "[src] has been stabilized. It is preserved, allowing you to use it to heal completely without danger of decay."
+26 -26
View File
@@ -1,27 +1,27 @@
/obj/machinery/computer/shuttle/labor
name = "labor shuttle console"
desc = "Used to call and send the labor camp shuttle."
circuit = /obj/item/circuitboard/computer/labor_shuttle
shuttleId = "laborcamp"
possible_destinations = "laborcamp_home;laborcamp_away"
req_access = list(ACCESS_BRIG)
/obj/machinery/computer/shuttle/labor/one_way
name = "prisoner shuttle console"
desc = "A one-way shuttle console, used to summon the shuttle to the labor camp."
possible_destinations = "laborcamp_away"
circuit = /obj/item/circuitboard/computer/labor_shuttle/one_way
req_access = list( )
/obj/machinery/computer/shuttle/labor/one_way/Topic(href, href_list)
if(href_list["move"])
var/obj/docking_port/mobile/M = SSshuttle.getShuttle("laborcamp")
if(!M)
to_chat(usr, "<span class='warning'>Cannot locate shuttle!</span>")
return 0
var/obj/docking_port/stationary/S = M.get_docked()
if(S && S.name == "laborcamp_away")
to_chat(usr, "<span class='warning'>Shuttle is already at the outpost!</span>")
return 0
/obj/machinery/computer/shuttle/labor
name = "labor shuttle console"
desc = "Used to call and send the labor camp shuttle."
circuit = /obj/item/circuitboard/computer/labor_shuttle
shuttleId = "laborcamp"
possible_destinations = "laborcamp_home;laborcamp_away"
req_access = list(ACCESS_BRIG)
/obj/machinery/computer/shuttle/labor/one_way
name = "prisoner shuttle console"
desc = "A one-way shuttle console, used to summon the shuttle to the labor camp."
possible_destinations = "laborcamp_away"
circuit = /obj/item/circuitboard/computer/labor_shuttle/one_way
req_access = list( )
/obj/machinery/computer/shuttle/labor/one_way/Topic(href, href_list)
if(href_list["move"])
var/obj/docking_port/mobile/M = SSshuttle.getShuttle("laborcamp")
if(!M)
to_chat(usr, "<span class='warning'>Cannot locate shuttle!</span>")
return 0
var/obj/docking_port/stationary/S = M.get_docked()
if(S && S.name == "laborcamp_away")
to_chat(usr, "<span class='warning'>Shuttle is already at the outpost!</span>")
return 0
..()
+157 -157
View File
@@ -1,157 +1,157 @@
GLOBAL_LIST(labor_sheet_values)
/**********************Prisoners' Console**************************/
/obj/machinery/mineral/labor_claim_console
name = "point claim console"
desc = "A stacking console with an electromagnetic writer, used to track ore mined by prisoners."
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "console"
density = FALSE
var/obj/machinery/mineral/stacking_machine/laborstacker/stacking_machine = null
var/machinedir = SOUTH
var/obj/machinery/door/airlock/release_door
var/door_tag = "prisonshuttle"
var/obj/item/radio/Radio //needed to send messages to sec radio
/obj/machinery/mineral/labor_claim_console/Initialize()
. = ..()
Radio = new/obj/item/radio(src)
Radio.listening = FALSE
locate_stacking_machine()
if(!GLOB.labor_sheet_values)
var/sheet_list = list()
for(var/sheet_type in subtypesof(/obj/item/stack/sheet))
var/obj/item/stack/sheet/sheet = sheet_type
if(!initial(sheet.point_value) || (initial(sheet.merge_type) && initial(sheet.merge_type) != sheet_type)) //ignore no-value sheets and x/fifty subtypes
continue
sheet_list += list(list("ore" = initial(sheet.name), "value" = initial(sheet.point_value)))
GLOB.labor_sheet_values = sortList(sheet_list, /proc/cmp_sheet_list)
/proc/cmp_sheet_list(list/a, list/b)
return a["value"] - b["value"]
/obj/machinery/mineral/labor_claim_console/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "labor_claim_console", name, 450, 475, master_ui, state)
ui.open()
/obj/machinery/mineral/labor_claim_console/ui_data(mob/user)
var/list/data = list()
var/can_go_home = FALSE
data["emagged"] = (obj_flags & EMAGGED) ? 1 : 0
if(obj_flags & EMAGGED)
can_go_home = TRUE
data["status_info"] = "No Prisoner ID detected."
var/obj/item/card/id/I = user.get_idcard(TRUE)
if(istype(I, /obj/item/card/id/prisoner))
var/obj/item/card/id/prisoner/P = I
data["id_points"] = P.points
if(P.points >= P.goal)
can_go_home = TRUE
data["status_info"] = "Goal met!"
else
data["status_info"] = "You are [(P.goal - P.points)] points away."
if(stacking_machine)
data["unclaimed_points"] = stacking_machine.points
data["ores"] = GLOB.labor_sheet_values
data["can_go_home"] = can_go_home
return data
/obj/machinery/mineral/labor_claim_console/ui_act(action, params)
if(..())
return
switch(action)
if("claim_points")
var/mob/M = usr
var/obj/item/card/id/I = M.get_idcard(TRUE)
if(istype(I, /obj/item/card/id/prisoner))
var/obj/item/card/id/prisoner/P = I
P.points += stacking_machine.points
stacking_machine.points = 0
to_chat(usr, "<span class='notice'>Points transferred.</span>")
else
to_chat(usr, "<span class='notice'>No valid id for point transfer detected.</span>")
if("move_shuttle")
if(!alone_in_area(get_area(src), usr))
to_chat(usr, "<span class='warning'>Prisoners are only allowed to be released while alone.</span>")
else
switch(SSshuttle.moveShuttle("laborcamp", "laborcamp_home", TRUE))
if(1)
to_chat(usr, "<span class='notice'>Shuttle not found.</span>")
if(2)
to_chat(usr, "<span class='notice'>Shuttle already at station.</span>")
if(3)
to_chat(usr, "<span class='notice'>No permission to dock could be granted.</span>")
else
if(!(obj_flags & EMAGGED))
Radio.set_frequency(FREQ_SECURITY)
Radio.talk_into(src, "A prisoner has returned to the station. Minerals and Prisoner ID card ready for retrieval.", FREQ_SECURITY)
to_chat(usr, "<span class='notice'>Shuttle received message and will be sent shortly.</span>")
/obj/machinery/mineral/labor_claim_console/proc/locate_stacking_machine()
stacking_machine = locate(/obj/machinery/mineral/stacking_machine, get_step(src, machinedir))
if(stacking_machine)
stacking_machine.CONSOLE = src
else
qdel(src)
/obj/machinery/mineral/labor_claim_console/emag_act(mob/user)
. = ..()
if(obj_flags & EMAGGED)
return
obj_flags |= EMAGGED
to_chat(user, "<span class='warning'>PZZTTPFFFT</span>")
return TRUE
/**********************Prisoner Collection Unit**************************/
/obj/machinery/mineral/stacking_machine/laborstacker
force_connect = TRUE
var/points = 0 //The unclaimed value of ore stacked.
/obj/machinery/mineral/stacking_machine/laborstacker/process_sheet(obj/item/stack/sheet/inp)
points += inp.point_value * inp.amount
..()
/obj/machinery/mineral/stacking_machine/laborstacker/attackby(obj/item/I, mob/living/user)
if(istype(I, /obj/item/stack/sheet) && user.canUnEquip(I))
var/obj/item/stack/sheet/inp = I
points += inp.point_value * inp.amount
return ..()
/**********************Point Lookup Console**************************/
/obj/machinery/mineral/labor_points_checker
name = "points checking console"
desc = "A console used by prisoners to check the progress on their quotas. Simply swipe a prisoner ID."
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "console"
density = FALSE
/obj/machinery/mineral/labor_points_checker/attack_hand(mob/user)
. = ..()
if(.)
return
user.examinate(src)
/obj/machinery/mineral/labor_points_checker/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/card/id))
if(istype(I, /obj/item/card/id/prisoner))
var/obj/item/card/id/prisoner/prisoner_id = I
to_chat(user, "<span class='notice'><B>ID: [prisoner_id.registered_name]</B></span>")
to_chat(user, "<span class='notice'>Points Collected:[prisoner_id.points]</span>")
to_chat(user, "<span class='notice'>Point Quota: [prisoner_id.goal]</span>")
to_chat(user, "<span class='notice'>Collect points by bringing smelted minerals to the Labor Shuttle stacking machine. Reach your quota to earn your release.</span>")
else
to_chat(user, "<span class='warning'>Error: Invalid ID</span>")
else
return ..()
GLOBAL_LIST(labor_sheet_values)
/**********************Prisoners' Console**************************/
/obj/machinery/mineral/labor_claim_console
name = "point claim console"
desc = "A stacking console with an electromagnetic writer, used to track ore mined by prisoners."
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "console"
density = FALSE
var/obj/machinery/mineral/stacking_machine/laborstacker/stacking_machine = null
var/machinedir = SOUTH
var/obj/machinery/door/airlock/release_door
var/door_tag = "prisonshuttle"
var/obj/item/radio/Radio //needed to send messages to sec radio
/obj/machinery/mineral/labor_claim_console/Initialize()
. = ..()
Radio = new/obj/item/radio(src)
Radio.listening = FALSE
locate_stacking_machine()
if(!GLOB.labor_sheet_values)
var/sheet_list = list()
for(var/sheet_type in subtypesof(/obj/item/stack/sheet))
var/obj/item/stack/sheet/sheet = sheet_type
if(!initial(sheet.point_value) || (initial(sheet.merge_type) && initial(sheet.merge_type) != sheet_type)) //ignore no-value sheets and x/fifty subtypes
continue
sheet_list += list(list("ore" = initial(sheet.name), "value" = initial(sheet.point_value)))
GLOB.labor_sheet_values = sortList(sheet_list, /proc/cmp_sheet_list)
/proc/cmp_sheet_list(list/a, list/b)
return a["value"] - b["value"]
/obj/machinery/mineral/labor_claim_console/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "labor_claim_console", name, 450, 475, master_ui, state)
ui.open()
/obj/machinery/mineral/labor_claim_console/ui_data(mob/user)
var/list/data = list()
var/can_go_home = FALSE
data["emagged"] = (obj_flags & EMAGGED) ? 1 : 0
if(obj_flags & EMAGGED)
can_go_home = TRUE
data["status_info"] = "No Prisoner ID detected."
var/obj/item/card/id/I = user.get_idcard(TRUE)
if(istype(I, /obj/item/card/id/prisoner))
var/obj/item/card/id/prisoner/P = I
data["id_points"] = P.points
if(P.points >= P.goal)
can_go_home = TRUE
data["status_info"] = "Goal met!"
else
data["status_info"] = "You are [(P.goal - P.points)] points away."
if(stacking_machine)
data["unclaimed_points"] = stacking_machine.points
data["ores"] = GLOB.labor_sheet_values
data["can_go_home"] = can_go_home
return data
/obj/machinery/mineral/labor_claim_console/ui_act(action, params)
if(..())
return
switch(action)
if("claim_points")
var/mob/M = usr
var/obj/item/card/id/I = M.get_idcard(TRUE)
if(istype(I, /obj/item/card/id/prisoner))
var/obj/item/card/id/prisoner/P = I
P.points += stacking_machine.points
stacking_machine.points = 0
to_chat(usr, "<span class='notice'>Points transferred.</span>")
else
to_chat(usr, "<span class='notice'>No valid id for point transfer detected.</span>")
if("move_shuttle")
if(!alone_in_area(get_area(src), usr))
to_chat(usr, "<span class='warning'>Prisoners are only allowed to be released while alone.</span>")
else
switch(SSshuttle.moveShuttle("laborcamp", "laborcamp_home", TRUE))
if(1)
to_chat(usr, "<span class='notice'>Shuttle not found.</span>")
if(2)
to_chat(usr, "<span class='notice'>Shuttle already at station.</span>")
if(3)
to_chat(usr, "<span class='notice'>No permission to dock could be granted.</span>")
else
if(!(obj_flags & EMAGGED))
Radio.set_frequency(FREQ_SECURITY)
Radio.talk_into(src, "A prisoner has returned to the station. Minerals and Prisoner ID card ready for retrieval.", FREQ_SECURITY)
to_chat(usr, "<span class='notice'>Shuttle received message and will be sent shortly.</span>")
/obj/machinery/mineral/labor_claim_console/proc/locate_stacking_machine()
stacking_machine = locate(/obj/machinery/mineral/stacking_machine, get_step(src, machinedir))
if(stacking_machine)
stacking_machine.CONSOLE = src
else
qdel(src)
/obj/machinery/mineral/labor_claim_console/emag_act(mob/user)
. = ..()
if(obj_flags & EMAGGED)
return
obj_flags |= EMAGGED
to_chat(user, "<span class='warning'>PZZTTPFFFT</span>")
return TRUE
/**********************Prisoner Collection Unit**************************/
/obj/machinery/mineral/stacking_machine/laborstacker
force_connect = TRUE
var/points = 0 //The unclaimed value of ore stacked.
/obj/machinery/mineral/stacking_machine/laborstacker/process_sheet(obj/item/stack/sheet/inp)
points += inp.point_value * inp.amount
..()
/obj/machinery/mineral/stacking_machine/laborstacker/attackby(obj/item/I, mob/living/user)
if(istype(I, /obj/item/stack/sheet) && user.canUnEquip(I))
var/obj/item/stack/sheet/inp = I
points += inp.point_value * inp.amount
return ..()
/**********************Point Lookup Console**************************/
/obj/machinery/mineral/labor_points_checker
name = "points checking console"
desc = "A console used by prisoners to check the progress on their quotas. Simply swipe a prisoner ID."
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "console"
density = FALSE
/obj/machinery/mineral/labor_points_checker/attack_hand(mob/user)
. = ..()
if(.)
return
user.examinate(src)
/obj/machinery/mineral/labor_points_checker/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/card/id))
if(istype(I, /obj/item/card/id/prisoner))
var/obj/item/card/id/prisoner/prisoner_id = I
to_chat(user, "<span class='notice'><B>ID: [prisoner_id.registered_name]</B></span>")
to_chat(user, "<span class='notice'>Points Collected:[prisoner_id.points]</span>")
to_chat(user, "<span class='notice'>Point Quota: [prisoner_id.goal]</span>")
to_chat(user, "<span class='notice'>Collect points by bringing smelted minerals to the Labor Shuttle stacking machine. Reach your quota to earn your release.</span>")
else
to_chat(user, "<span class='warning'>Error: Invalid ID</span>")
else
return ..()
+211 -211
View File
@@ -1,211 +1,211 @@
#define SMELT_AMOUNT 10
/**********************Mineral processing unit console**************************/
/obj/machinery/mineral
var/input_dir = NORTH
var/output_dir = SOUTH
/obj/machinery/mineral/proc/unload_mineral(atom/movable/S)
S.forceMove(drop_location())
var/turf/T = get_step(src,output_dir)
if(T)
S.forceMove(T)
/obj/machinery/mineral/processing_unit_console
name = "production machine console"
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "console"
density = TRUE
var/obj/machinery/mineral/processing_unit/machine = null
var/machinedir = EAST
speed_process = TRUE
/obj/machinery/mineral/processing_unit_console/Initialize()
. = ..()
machine = locate(/obj/machinery/mineral/processing_unit, get_step(src, machinedir))
if (machine)
machine.CONSOLE = src
else
return INITIALIZE_HINT_QDEL
/obj/machinery/mineral/processing_unit_console/ui_interact(mob/user)
. = ..()
if(!machine)
return
var/dat = machine.get_machine_data()
var/datum/browser/popup = new(user, "processing", "Smelting Console", 300, 500)
popup.set_content(dat)
popup.open()
/obj/machinery/mineral/processing_unit_console/Topic(href, href_list)
if(..())
return
usr.set_machine(src)
add_fingerprint(usr)
if(href_list["material"])
machine.selected_material = href_list["material"]
machine.selected_alloy = null
if(href_list["alloy"])
machine.selected_material = null
machine.selected_alloy = href_list["alloy"]
if(href_list["set_on"])
machine.on = (href_list["set_on"] == "on")
updateUsrDialog()
return
/obj/machinery/mineral/processing_unit_console/Destroy()
machine = null
return ..()
/**********************Mineral processing unit**************************/
/obj/machinery/mineral/processing_unit
name = "furnace"
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "furnace"
density = TRUE
var/obj/machinery/mineral/CONSOLE = null
var/on = FALSE
var/selected_material = MAT_METAL
var/selected_alloy = null
var/datum/techweb/stored_research
/obj/machinery/mineral/processing_unit/Initialize()
. = ..()
proximity_monitor = new(src, 1)
AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_GLASS, MAT_SILVER, MAT_GOLD, MAT_DIAMOND, MAT_PLASMA, MAT_URANIUM, MAT_BANANIUM, MAT_TITANIUM, MAT_BLUESPACE), INFINITY, TRUE, /obj/item/stack)
stored_research = new /datum/techweb/specialized/autounlocking/smelter
/obj/machinery/mineral/processing_unit/Destroy()
CONSOLE = null
QDEL_NULL(stored_research)
return ..()
/obj/machinery/mineral/processing_unit/HasProximity(atom/movable/AM)
if(istype(AM, /obj/item/stack/ore) && AM.loc == get_step(src, input_dir))
process_ore(AM)
/obj/machinery/mineral/processing_unit/proc/process_ore(obj/item/stack/ore/O)
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
var/material_amount = materials.get_item_material_amount(O)
if(!materials.has_space(material_amount))
unload_mineral(O)
else
materials.insert_item(O)
qdel(O)
if(CONSOLE)
CONSOLE.updateUsrDialog()
/obj/machinery/mineral/processing_unit/proc/get_machine_data()
var/dat = "<b>Smelter control console</b><br><br>"
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
for(var/mat_id in materials.materials)
var/datum/material/M = materials.materials[mat_id]
dat += "<span class=\"res_name\">[M.name]: </span>[M.amount] cm&sup3;"
if (selected_material == mat_id)
dat += " <i>Smelting</i>"
else
dat += " <A href='?src=[REF(CONSOLE)];material=[mat_id]'><b>Not Smelting</b></A> "
dat += "<br>"
dat += "<br><br>"
dat += "<b>Smelt Alloys</b><br>"
for(var/v in stored_research.researched_designs)
var/datum/design/D = SSresearch.techweb_design_by_id(v)
dat += "<span class=\"res_name\">[D.name] "
if (selected_alloy == D.id)
dat += " <i>Smelting</i>"
else
dat += " <A href='?src=[REF(CONSOLE)];alloy=[D.id]'><b>Not Smelting</b></A> "
dat += "<br>"
dat += "<br><br>"
//On or off
dat += "Machine is currently "
if (on)
dat += "<A href='?src=[REF(CONSOLE)];set_on=off'>On</A> "
else
dat += "<A href='?src=[REF(CONSOLE)];set_on=on'>Off</A> "
return dat
/obj/machinery/mineral/processing_unit/process()
if (on)
if(selected_material)
smelt_ore()
else if(selected_alloy)
smelt_alloy()
if(CONSOLE)
CONSOLE.updateUsrDialog()
/obj/machinery/mineral/processing_unit/proc/smelt_ore()
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
var/datum/material/mat = materials.materials[selected_material]
if(mat)
var/sheets_to_remove = (mat.amount >= (MINERAL_MATERIAL_AMOUNT * SMELT_AMOUNT) ) ? SMELT_AMOUNT : round(mat.amount / MINERAL_MATERIAL_AMOUNT)
if(!sheets_to_remove)
on = FALSE
else
var/out = get_step(src, output_dir)
materials.retrieve_sheets(sheets_to_remove, selected_material, out)
/obj/machinery/mineral/processing_unit/proc/smelt_alloy()
var/datum/design/alloy = stored_research.isDesignResearchedID(selected_alloy) //check if it's a valid design
if(!alloy)
on = FALSE
return
var/amount = can_smelt(alloy)
if(!amount)
on = FALSE
return
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
materials.use_amount(alloy.materials, amount)
generate_mineral(alloy.build_path)
/obj/machinery/mineral/processing_unit/proc/can_smelt(datum/design/D)
if(D.make_reagents.len)
return FALSE
var/build_amount = SMELT_AMOUNT
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
for(var/mat_id in D.materials)
var/M = D.materials[mat_id]
var/datum/material/smelter_mat = materials.materials[mat_id]
if(!M || !smelter_mat)
return FALSE
build_amount = min(build_amount, round(smelter_mat.amount / M))
return build_amount
/obj/machinery/mineral/processing_unit/proc/generate_mineral(P)
var/O = new P(src)
unload_mineral(O)
/obj/machinery/mineral/processing_unit/on_deconstruction()
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
materials.retrieve_all()
..()
#undef SMELT_AMOUNT
#define SMELT_AMOUNT 10
/**********************Mineral processing unit console**************************/
/obj/machinery/mineral
var/input_dir = NORTH
var/output_dir = SOUTH
/obj/machinery/mineral/proc/unload_mineral(atom/movable/S)
S.forceMove(drop_location())
var/turf/T = get_step(src,output_dir)
if(T)
S.forceMove(T)
/obj/machinery/mineral/processing_unit_console
name = "production machine console"
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "console"
density = TRUE
var/obj/machinery/mineral/processing_unit/machine = null
var/machinedir = EAST
speed_process = TRUE
/obj/machinery/mineral/processing_unit_console/Initialize()
. = ..()
machine = locate(/obj/machinery/mineral/processing_unit, get_step(src, machinedir))
if (machine)
machine.CONSOLE = src
else
return INITIALIZE_HINT_QDEL
/obj/machinery/mineral/processing_unit_console/ui_interact(mob/user)
. = ..()
if(!machine)
return
var/dat = machine.get_machine_data()
var/datum/browser/popup = new(user, "processing", "Smelting Console", 300, 500)
popup.set_content(dat)
popup.open()
/obj/machinery/mineral/processing_unit_console/Topic(href, href_list)
if(..())
return
usr.set_machine(src)
add_fingerprint(usr)
if(href_list["material"])
machine.selected_material = href_list["material"]
machine.selected_alloy = null
if(href_list["alloy"])
machine.selected_material = null
machine.selected_alloy = href_list["alloy"]
if(href_list["set_on"])
machine.on = (href_list["set_on"] == "on")
updateUsrDialog()
return
/obj/machinery/mineral/processing_unit_console/Destroy()
machine = null
return ..()
/**********************Mineral processing unit**************************/
/obj/machinery/mineral/processing_unit
name = "furnace"
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "furnace"
density = TRUE
var/obj/machinery/mineral/CONSOLE = null
var/on = FALSE
var/selected_material = MAT_METAL
var/selected_alloy = null
var/datum/techweb/stored_research
/obj/machinery/mineral/processing_unit/Initialize()
. = ..()
proximity_monitor = new(src, 1)
AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_GLASS, MAT_SILVER, MAT_GOLD, MAT_DIAMOND, MAT_PLASMA, MAT_URANIUM, MAT_BANANIUM, MAT_TITANIUM, MAT_BLUESPACE), INFINITY, TRUE, /obj/item/stack)
stored_research = new /datum/techweb/specialized/autounlocking/smelter
/obj/machinery/mineral/processing_unit/Destroy()
CONSOLE = null
QDEL_NULL(stored_research)
return ..()
/obj/machinery/mineral/processing_unit/HasProximity(atom/movable/AM)
if(istype(AM, /obj/item/stack/ore) && AM.loc == get_step(src, input_dir))
process_ore(AM)
/obj/machinery/mineral/processing_unit/proc/process_ore(obj/item/stack/ore/O)
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
var/material_amount = materials.get_item_material_amount(O)
if(!materials.has_space(material_amount))
unload_mineral(O)
else
materials.insert_item(O)
qdel(O)
if(CONSOLE)
CONSOLE.updateUsrDialog()
/obj/machinery/mineral/processing_unit/proc/get_machine_data()
var/dat = "<b>Smelter control console</b><br><br>"
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
for(var/mat_id in materials.materials)
var/datum/material/M = materials.materials[mat_id]
dat += "<span class=\"res_name\">[M.name]: </span>[M.amount] cm&sup3;"
if (selected_material == mat_id)
dat += " <i>Smelting</i>"
else
dat += " <A href='?src=[REF(CONSOLE)];material=[mat_id]'><b>Not Smelting</b></A> "
dat += "<br>"
dat += "<br><br>"
dat += "<b>Smelt Alloys</b><br>"
for(var/v in stored_research.researched_designs)
var/datum/design/D = SSresearch.techweb_design_by_id(v)
dat += "<span class=\"res_name\">[D.name] "
if (selected_alloy == D.id)
dat += " <i>Smelting</i>"
else
dat += " <A href='?src=[REF(CONSOLE)];alloy=[D.id]'><b>Not Smelting</b></A> "
dat += "<br>"
dat += "<br><br>"
//On or off
dat += "Machine is currently "
if (on)
dat += "<A href='?src=[REF(CONSOLE)];set_on=off'>On</A> "
else
dat += "<A href='?src=[REF(CONSOLE)];set_on=on'>Off</A> "
return dat
/obj/machinery/mineral/processing_unit/process()
if (on)
if(selected_material)
smelt_ore()
else if(selected_alloy)
smelt_alloy()
if(CONSOLE)
CONSOLE.updateUsrDialog()
/obj/machinery/mineral/processing_unit/proc/smelt_ore()
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
var/datum/material/mat = materials.materials[selected_material]
if(mat)
var/sheets_to_remove = (mat.amount >= (MINERAL_MATERIAL_AMOUNT * SMELT_AMOUNT) ) ? SMELT_AMOUNT : round(mat.amount / MINERAL_MATERIAL_AMOUNT)
if(!sheets_to_remove)
on = FALSE
else
var/out = get_step(src, output_dir)
materials.retrieve_sheets(sheets_to_remove, selected_material, out)
/obj/machinery/mineral/processing_unit/proc/smelt_alloy()
var/datum/design/alloy = stored_research.isDesignResearchedID(selected_alloy) //check if it's a valid design
if(!alloy)
on = FALSE
return
var/amount = can_smelt(alloy)
if(!amount)
on = FALSE
return
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
materials.use_amount(alloy.materials, amount)
generate_mineral(alloy.build_path)
/obj/machinery/mineral/processing_unit/proc/can_smelt(datum/design/D)
if(D.make_reagents.len)
return FALSE
var/build_amount = SMELT_AMOUNT
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
for(var/mat_id in D.materials)
var/M = D.materials[mat_id]
var/datum/material/smelter_mat = materials.materials[mat_id]
if(!M || !smelter_mat)
return FALSE
build_amount = min(build_amount, round(smelter_mat.amount / M))
return build_amount
/obj/machinery/mineral/processing_unit/proc/generate_mineral(P)
var/O = new P(src)
unload_mineral(O)
/obj/machinery/mineral/processing_unit/on_deconstruction()
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
materials.retrieve_all()
..()
#undef SMELT_AMOUNT
+121 -121
View File
@@ -1,121 +1,121 @@
/**********************Mineral stacking unit console**************************/
/obj/machinery/mineral/stacking_unit_console
name = "stacking machine console"
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "console"
desc = "Controls a stacking machine... in theory."
density = FALSE
circuit = /obj/item/circuitboard/machine/stacking_unit_console
var/obj/machinery/mineral/stacking_machine/machine
var/machinedir = SOUTHEAST
/obj/machinery/mineral/stacking_unit_console/Initialize()
. = ..()
machine = locate(/obj/machinery/mineral/stacking_machine, get_step(src, machinedir))
if (machine)
machine.CONSOLE = src
/obj/machinery/mineral/stacking_unit_console/ui_interact(mob/user)
. = ..()
if(!machine)
to_chat(user, "<span class='notice'>[src] is not linked to a machine!</span>")
return
var/obj/item/stack/sheet/s
var/dat
dat += text("<b>Stacking unit console</b><br><br>")
for(var/O in machine.stack_list)
s = machine.stack_list[O]
if(s.amount > 0)
dat += text("[capitalize(s.name)]: [s.amount] <A href='?src=[REF(src)];release=[s.type]'>Release</A><br>")
dat += text("<br>Stacking: [machine.stack_amt]<br><br>")
user << browse(dat, "window=console_stacking_machine")
/obj/machinery/mineral/stacking_unit_console/multitool_act(mob/living/user, obj/item/I)
if(istype(I, /obj/item/multitool))
var/obj/item/multitool/M = I
M.buffer = src
to_chat(user, "<span class='notice'>You store linkage information in [I]'s buffer.</span>")
return TRUE
/obj/machinery/mineral/stacking_unit_console/Topic(href, href_list)
if(..())
return
usr.set_machine(src)
src.add_fingerprint(usr)
if(href_list["release"])
if(!(text2path(href_list["release"]) in machine.stack_list))
return //someone tried to spawn materials by spoofing hrefs
var/obj/item/stack/sheet/inp = machine.stack_list[text2path(href_list["release"])]
var/obj/item/stack/sheet/out = new inp.type(null, inp.amount)
inp.amount = 0
machine.unload_mineral(out)
src.updateUsrDialog()
return
/**********************Mineral stacking unit**************************/
/obj/machinery/mineral/stacking_machine
name = "stacking machine"
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "stacker"
desc = "A machine that automatically stacks acquired materials. Controlled by a nearby console."
density = TRUE
circuit = /obj/item/circuitboard/machine/stacking_machine
input_dir = EAST
output_dir = WEST
var/obj/machinery/mineral/stacking_unit_console/CONSOLE
var/stk_types = list()
var/stk_amt = list()
var/stack_list[0] //Key: Type. Value: Instance of type.
var/stack_amt = 50 //amount to stack before releassing
var/datum/component/remote_materials/materials
var/force_connect = FALSE
/obj/machinery/mineral/stacking_machine/Initialize(mapload)
. = ..()
proximity_monitor = new(src, 1)
materials = AddComponent(/datum/component/remote_materials, "stacking", mapload, FALSE, mapload && force_connect)
/obj/machinery/mineral/stacking_machine/HasProximity(atom/movable/AM)
if(istype(AM, /obj/item/stack/sheet) && AM.loc == get_step(src, input_dir))
process_sheet(AM)
/obj/machinery/mineral/stacking_machine/multitool_act(mob/living/user, obj/item/multitool/M)
if(istype(M))
if(istype(M.buffer, /obj/machinery/mineral/stacking_unit_console))
CONSOLE = M.buffer
CONSOLE.machine = src
to_chat(user, "<span class='notice'>You link [src] to the console in [M]'s buffer.</span>")
return TRUE
/obj/machinery/mineral/stacking_machine/proc/process_sheet(obj/item/stack/sheet/inp)
var/key = inp.merge_type
var/obj/item/stack/sheet/storage = stack_list[key]
if(!storage) //It's the first of this sheet added
stack_list[key] = storage = new inp.type(src, 0)
storage.amount += inp.amount //Stack the sheets
qdel(inp)
if(materials.silo && !materials.on_hold()) //Dump the sheets to the silo
var/matlist = storage.materials & materials.mat_container.materials
if (length(matlist))
var/inserted = materials.mat_container.insert_stack(storage)
materials.silo_log(src, "collected", inserted, "sheets", matlist)
if (QDELETED(storage))
stack_list -= key
return
while(storage.amount >= stack_amt) //Get rid of excessive stackage
var/obj/item/stack/sheet/out = new inp.type(null, stack_amt)
unload_mineral(out)
storage.amount -= stack_amt
/**********************Mineral stacking unit console**************************/
/obj/machinery/mineral/stacking_unit_console
name = "stacking machine console"
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "console"
desc = "Controls a stacking machine... in theory."
density = FALSE
circuit = /obj/item/circuitboard/machine/stacking_unit_console
var/obj/machinery/mineral/stacking_machine/machine
var/machinedir = SOUTHEAST
/obj/machinery/mineral/stacking_unit_console/Initialize()
. = ..()
machine = locate(/obj/machinery/mineral/stacking_machine, get_step(src, machinedir))
if (machine)
machine.CONSOLE = src
/obj/machinery/mineral/stacking_unit_console/ui_interact(mob/user)
. = ..()
if(!machine)
to_chat(user, "<span class='notice'>[src] is not linked to a machine!</span>")
return
var/obj/item/stack/sheet/s
var/dat
dat += text("<b>Stacking unit console</b><br><br>")
for(var/O in machine.stack_list)
s = machine.stack_list[O]
if(s.amount > 0)
dat += text("[capitalize(s.name)]: [s.amount] <A href='?src=[REF(src)];release=[s.type]'>Release</A><br>")
dat += text("<br>Stacking: [machine.stack_amt]<br><br>")
user << browse(dat, "window=console_stacking_machine")
/obj/machinery/mineral/stacking_unit_console/multitool_act(mob/living/user, obj/item/I)
if(istype(I, /obj/item/multitool))
var/obj/item/multitool/M = I
M.buffer = src
to_chat(user, "<span class='notice'>You store linkage information in [I]'s buffer.</span>")
return TRUE
/obj/machinery/mineral/stacking_unit_console/Topic(href, href_list)
if(..())
return
usr.set_machine(src)
src.add_fingerprint(usr)
if(href_list["release"])
if(!(text2path(href_list["release"]) in machine.stack_list))
return //someone tried to spawn materials by spoofing hrefs
var/obj/item/stack/sheet/inp = machine.stack_list[text2path(href_list["release"])]
var/obj/item/stack/sheet/out = new inp.type(null, inp.amount)
inp.amount = 0
machine.unload_mineral(out)
src.updateUsrDialog()
return
/**********************Mineral stacking unit**************************/
/obj/machinery/mineral/stacking_machine
name = "stacking machine"
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "stacker"
desc = "A machine that automatically stacks acquired materials. Controlled by a nearby console."
density = TRUE
circuit = /obj/item/circuitboard/machine/stacking_machine
input_dir = EAST
output_dir = WEST
var/obj/machinery/mineral/stacking_unit_console/CONSOLE
var/stk_types = list()
var/stk_amt = list()
var/stack_list[0] //Key: Type. Value: Instance of type.
var/stack_amt = 50 //amount to stack before releassing
var/datum/component/remote_materials/materials
var/force_connect = FALSE
/obj/machinery/mineral/stacking_machine/Initialize(mapload)
. = ..()
proximity_monitor = new(src, 1)
materials = AddComponent(/datum/component/remote_materials, "stacking", mapload, FALSE, mapload && force_connect)
/obj/machinery/mineral/stacking_machine/HasProximity(atom/movable/AM)
if(istype(AM, /obj/item/stack/sheet) && AM.loc == get_step(src, input_dir))
process_sheet(AM)
/obj/machinery/mineral/stacking_machine/multitool_act(mob/living/user, obj/item/multitool/M)
if(istype(M))
if(istype(M.buffer, /obj/machinery/mineral/stacking_unit_console))
CONSOLE = M.buffer
CONSOLE.machine = src
to_chat(user, "<span class='notice'>You link [src] to the console in [M]'s buffer.</span>")
return TRUE
/obj/machinery/mineral/stacking_machine/proc/process_sheet(obj/item/stack/sheet/inp)
var/key = inp.merge_type
var/obj/item/stack/sheet/storage = stack_list[key]
if(!storage) //It's the first of this sheet added
stack_list[key] = storage = new inp.type(src, 0)
storage.amount += inp.amount //Stack the sheets
qdel(inp)
if(materials.silo && !materials.on_hold()) //Dump the sheets to the silo
var/matlist = storage.materials & materials.mat_container.materials
if (length(matlist))
var/inserted = materials.mat_container.insert_stack(storage)
materials.silo_log(src, "collected", inserted, "sheets", matlist)
if (QDELETED(storage))
stack_list -= key
return
while(storage.amount >= stack_amt) //Get rid of excessive stackage
var/obj/item/stack/sheet/out = new inp.type(null, stack_amt)
unload_mineral(out)
storage.amount -= stack_amt
+30 -30
View File
@@ -1,31 +1,31 @@
/**********************Unloading unit**************************/
/obj/machinery/mineral/unloading_machine
name = "unloading machine"
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "unloader"
density = TRUE
input_dir = WEST
output_dir = EAST
speed_process = TRUE
/obj/machinery/mineral/unloading_machine/process()
var/turf/T = get_step(src,input_dir)
if(T)
var/limit
for(var/obj/structure/ore_box/B in T)
for (var/obj/item/stack/ore/O in B)
B.contents -= O
unload_mineral(O)
limit++
if (limit>=10)
return
CHECK_TICK
CHECK_TICK
for(var/obj/item/I in T)
unload_mineral(I)
limit++
if (limit>=10)
return
/**********************Unloading unit**************************/
/obj/machinery/mineral/unloading_machine
name = "unloading machine"
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "unloader"
density = TRUE
input_dir = WEST
output_dir = EAST
speed_process = TRUE
/obj/machinery/mineral/unloading_machine/process()
var/turf/T = get_step(src,input_dir)
if(T)
var/limit
for(var/obj/structure/ore_box/B in T)
for (var/obj/item/stack/ore/O in B)
B.contents -= O
unload_mineral(O)
limit++
if (limit>=10)
return
CHECK_TICK
CHECK_TICK
for(var/obj/item/I in T)
unload_mineral(I)
limit++
if (limit>=10)
return
CHECK_TICK
+1 -1
View File
@@ -302,7 +302,7 @@
/obj/item/storage/backpack/duffelbag/mining_cloned
name = "mining replacement kit"
desc = "A large bag that has advance tools and a spare jumpsuit, boots, and gloves for a newly cloned miner to get back in the field. Even as a new Id!"
desc = "A large bag that has advance tools and a spare jumpsuit, boots, and gloves for a newly cloned miner to get back in the field. Even has a new ID!"
/obj/item/storage/backpack/duffelbag/mining_cloned/PopulateContents()
new /obj/item/pickaxe/mini(src)
+105 -105
View File
@@ -1,105 +1,105 @@
/**********************Mint**************************/
/obj/machinery/mineral/mint
name = "coin press"
icon = 'icons/obj/economy.dmi'
icon_state = "coinpress0"
density = TRUE
var/newCoins = 0 //how many coins the machine made in it's last load
var/processing = FALSE
var/chosen = MAT_METAL //which material will be used to make coins
var/coinsToProduce = 10
speed_process = TRUE
/obj/machinery/mineral/mint/Initialize()
. = ..()
AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_PLASMA, MAT_SILVER, MAT_GOLD, MAT_URANIUM, MAT_DIAMOND, MAT_BANANIUM), MINERAL_MATERIAL_AMOUNT * 50, FALSE, /obj/item/stack)
/obj/machinery/mineral/mint/process()
var/turf/T = get_step(src, input_dir)
if(!T)
return
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
for(var/obj/item/stack/sheet/O in T)
materials.insert_stack(O, O.amount)
/obj/machinery/mineral/mint/attack_hand(mob/user)
. = ..()
if(.)
return
var/dat = "<b>Coin Press</b><br>"
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
for(var/mat_id in materials.materials)
var/datum/material/M = materials.materials[mat_id]
if(!M.amount && chosen != mat_id)
continue
dat += "<br><b>[M.name] amount:</b> [M.amount] cm<sup>3</sup> "
if (chosen == mat_id)
dat += "<b>Chosen</b>"
else
dat += "<A href='?src=[REF(src)];choose=[mat_id]'>Choose</A>"
var/datum/material/M = materials.materials[chosen]
dat += "<br><br>Will produce [coinsToProduce] [lowertext(M.name)] coins if enough materials are available.<br>"
dat += "<A href='?src=[REF(src)];chooseAmt=-10'>-10</A> "
dat += "<A href='?src=[REF(src)];chooseAmt=-5'>-5</A> "
dat += "<A href='?src=[REF(src)];chooseAmt=-1'>-1</A> "
dat += "<A href='?src=[REF(src)];chooseAmt=1'>+1</A> "
dat += "<A href='?src=[REF(src)];chooseAmt=5'>+5</A> "
dat += "<A href='?src=[REF(src)];chooseAmt=10'>+10</A> "
dat += "<br><br>In total this machine produced <font color='green'><b>[newCoins]</b></font> coins."
dat += "<br><A href='?src=[REF(src)];makeCoins=[1]'>Make coins</A>"
user << browse(dat, "window=mint")
/obj/machinery/mineral/mint/Topic(href, href_list)
if(..())
return
usr.set_machine(src)
src.add_fingerprint(usr)
if(processing==1)
to_chat(usr, "<span class='notice'>The machine is processing.</span>")
return
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
if(href_list["choose"])
if(materials.materials[href_list["choose"]])
chosen = href_list["choose"]
if(href_list["chooseAmt"])
coinsToProduce = CLAMP(coinsToProduce + text2num(href_list["chooseAmt"]), 0, 1000)
if(href_list["makeCoins"])
var/temp_coins = coinsToProduce
processing = TRUE
icon_state = "coinpress1"
var/coin_mat = MINERAL_MATERIAL_AMOUNT * 0.2
var/datum/material/M = materials.materials[chosen]
if(!M || !M.coin_type)
updateUsrDialog()
return
while(coinsToProduce > 0 && materials.use_amount_type(coin_mat, chosen))
create_coins(M.coin_type)
coinsToProduce--
newCoins++
src.updateUsrDialog()
sleep(5)
icon_state = "coinpress0"
processing = FALSE
coinsToProduce = temp_coins
src.updateUsrDialog()
return
/obj/machinery/mineral/mint/proc/create_coins(P)
var/turf/T = get_step(src,output_dir)
if(T)
var/obj/item/O = new P(src)
var/obj/item/storage/bag/money/M = locate(/obj/item/storage/bag/money, T)
if(!M)
M = new /obj/item/storage/bag/money(src)
unload_mineral(M)
O.forceMove(M)
/**********************Mint**************************/
/obj/machinery/mineral/mint
name = "coin press"
icon = 'icons/obj/economy.dmi'
icon_state = "coinpress0"
density = TRUE
var/newCoins = 0 //how many coins the machine made in it's last load
var/processing = FALSE
var/chosen = MAT_METAL //which material will be used to make coins
var/coinsToProduce = 10
speed_process = TRUE
/obj/machinery/mineral/mint/Initialize()
. = ..()
AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_PLASMA, MAT_SILVER, MAT_GOLD, MAT_URANIUM, MAT_DIAMOND, MAT_BANANIUM), MINERAL_MATERIAL_AMOUNT * 50, FALSE, /obj/item/stack)
/obj/machinery/mineral/mint/process()
var/turf/T = get_step(src, input_dir)
if(!T)
return
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
for(var/obj/item/stack/sheet/O in T)
materials.insert_stack(O, O.amount)
/obj/machinery/mineral/mint/attack_hand(mob/user)
. = ..()
if(.)
return
var/dat = "<b>Coin Press</b><br>"
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
for(var/mat_id in materials.materials)
var/datum/material/M = materials.materials[mat_id]
if(!M.amount && chosen != mat_id)
continue
dat += "<br><b>[M.name] amount:</b> [M.amount] cm<sup>3</sup> "
if (chosen == mat_id)
dat += "<b>Chosen</b>"
else
dat += "<A href='?src=[REF(src)];choose=[mat_id]'>Choose</A>"
var/datum/material/M = materials.materials[chosen]
dat += "<br><br>Will produce [coinsToProduce] [lowertext(M.name)] coins if enough materials are available.<br>"
dat += "<A href='?src=[REF(src)];chooseAmt=-10'>-10</A> "
dat += "<A href='?src=[REF(src)];chooseAmt=-5'>-5</A> "
dat += "<A href='?src=[REF(src)];chooseAmt=-1'>-1</A> "
dat += "<A href='?src=[REF(src)];chooseAmt=1'>+1</A> "
dat += "<A href='?src=[REF(src)];chooseAmt=5'>+5</A> "
dat += "<A href='?src=[REF(src)];chooseAmt=10'>+10</A> "
dat += "<br><br>In total this machine produced <font color='green'><b>[newCoins]</b></font> coins."
dat += "<br><A href='?src=[REF(src)];makeCoins=[1]'>Make coins</A>"
user << browse(dat, "window=mint")
/obj/machinery/mineral/mint/Topic(href, href_list)
if(..())
return
usr.set_machine(src)
src.add_fingerprint(usr)
if(processing==1)
to_chat(usr, "<span class='notice'>The machine is processing.</span>")
return
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
if(href_list["choose"])
if(materials.materials[href_list["choose"]])
chosen = href_list["choose"]
if(href_list["chooseAmt"])
coinsToProduce = CLAMP(coinsToProduce + text2num(href_list["chooseAmt"]), 0, 1000)
if(href_list["makeCoins"])
var/temp_coins = coinsToProduce
processing = TRUE
icon_state = "coinpress1"
var/coin_mat = MINERAL_MATERIAL_AMOUNT * 0.2
var/datum/material/M = materials.materials[chosen]
if(!M || !M.coin_type)
updateUsrDialog()
return
while(coinsToProduce > 0 && materials.use_amount_type(coin_mat, chosen))
create_coins(M.coin_type)
coinsToProduce--
newCoins++
src.updateUsrDialog()
sleep(5)
icon_state = "coinpress0"
processing = FALSE
coinsToProduce = temp_coins
src.updateUsrDialog()
return
/obj/machinery/mineral/mint/proc/create_coins(P)
var/turf/T = get_step(src,output_dir)
if(T)
var/obj/item/O = new P(src)
var/obj/item/storage/bag/money/M = locate(/obj/item/storage/bag/money, T)
if(!M)
M = new /obj/item/storage/bag/money(src)
unload_mineral(M)
O.forceMove(M)
+487 -487
View File
@@ -1,487 +1,487 @@
#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
var/list/stack_overlays
/obj/item/stack/ore/update_icon()
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.
cut_overlays()
if (LAZYLEN(stack_overlays)-difference <= 0)
stack_overlays = null;
else
stack_overlays.len += difference
else if(difference > 0) //amount > stack_overlays, add some.
cut_overlays()
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)
add_overlay(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
materials = list(MAT_URANIUM=MINERAL_MATERIAL_AMOUNT)
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
materials = list(MAT_METAL=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
materials = list(MAT_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/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.sand_recipes
. = ..()
/obj/item/stack/ore/glass/throw_impact(atom/hit_atom)
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
materials = list(MAT_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
materials = list(MAT_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
materials = list(MAT_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
materials = list(MAT_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
materials = list(MAT_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
materials = list(MAT_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)
..()
/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__heads"
flags_1 = CONDUCT_1
force = 1
throwforce = 2
w_class = WEIGHT_CLASS_TINY
var/string_attached
var/list/sideslist = list("heads","tails")
var/cmineral = null
var/cooldown = 0
var/value = 1
var/coinflip
/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/Initialize()
. = ..()
pixel_x = rand(0,16)-8
pixel_y = rand(0,8)-8
/obj/item/coin/examine(mob/user)
. = ..()
if(value)
. += "<span class='info'>It's worth [value] credit\s.</span>"
/obj/item/coin/gold
name = "gold coin"
cmineral = "gold"
icon_state = "coin_gold_heads"
value = 50
materials = list(MAT_GOLD = MINERAL_MATERIAL_AMOUNT*0.2)
grind_results = list(/datum/reagent/gold = 4)
/obj/item/coin/silver
name = "silver coin"
cmineral = "silver"
icon_state = "coin_silver_heads"
value = 20
materials = list(MAT_SILVER = MINERAL_MATERIAL_AMOUNT*0.2)
grind_results = list(/datum/reagent/silver = 4)
/obj/item/coin/diamond
name = "diamond coin"
cmineral = "diamond"
icon_state = "coin_diamond_heads"
value = 500
materials = list(MAT_DIAMOND = MINERAL_MATERIAL_AMOUNT*0.2)
grind_results = list(/datum/reagent/carbon = 4)
/obj/item/coin/iron
name = "iron coin"
cmineral = "iron"
icon_state = "coin_iron_heads"
value = 1
materials = list(MAT_METAL = MINERAL_MATERIAL_AMOUNT*0.2)
grind_results = list(/datum/reagent/iron = 4)
/obj/item/coin/plasma
name = "plasma coin"
cmineral = "plasma"
icon_state = "coin_plasma_heads"
value = 100
materials = list(MAT_PLASMA = MINERAL_MATERIAL_AMOUNT*0.2)
grind_results = list(/datum/reagent/toxin/plasma = 4)
/obj/item/coin/uranium
name = "uranium coin"
cmineral = "uranium"
icon_state = "coin_uranium_heads"
value = 80
materials = list(MAT_URANIUM = MINERAL_MATERIAL_AMOUNT*0.2)
grind_results = list(/datum/reagent/uranium = 4)
/obj/item/coin/bananium
name = "bananium coin"
cmineral = "bananium"
icon_state = "coin_bananium_heads"
value = 1000 //makes the clown cry
materials = list(MAT_BANANIUM = MINERAL_MATERIAL_AMOUNT*0.2)
grind_results = list(/datum/reagent/consumable/banana = 4)
/obj/item/coin/adamantine
name = "adamantine coin"
cmineral = "adamantine"
icon_state = "coin_adamantine_heads"
value = 1500
/obj/item/coin/mythril
name = "mythril coin"
cmineral = "mythril"
icon_state = "coin_mythril_heads"
value = 3000
/obj/item/coin/twoheaded
cmineral = "iron"
icon_state = "coin_iron_heads"
desc = "Hey, this coin's the same on both sides!"
sideslist = list("heads")
materials = list(MAT_METAL = MINERAL_MATERIAL_AMOUNT*0.2)
value = 1
grind_results = list(/datum/reagent/iron = 4)
/obj/item/coin/antagtoken
name = "antag token"
icon_state = "coin_valid_valid"
cmineral = "valid"
desc = "A novelty coin that helps the heart know what hard evidence cannot prove."
sideslist = list("valid", "salad")
value = 0
grind_results = list(/datum/reagent/consumable/sodiumchloride = 4)
/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
coinflip = pick(sideslist)
cooldown = world.time + 15
flick("coin_[cmineral]_flip", src)
icon_state = "coin_[cmineral]_[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
#undef ORESTACK_OVERLAYS_MAX
#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
var/list/stack_overlays
/obj/item/stack/ore/update_icon()
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.
cut_overlays()
if (LAZYLEN(stack_overlays)-difference <= 0)
stack_overlays = null;
else
stack_overlays.len += difference
else if(difference > 0) //amount > stack_overlays, add some.
cut_overlays()
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)
add_overlay(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
materials = list(MAT_URANIUM=MINERAL_MATERIAL_AMOUNT)
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
materials = list(MAT_METAL=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
materials = list(MAT_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/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.sand_recipes
. = ..()
/obj/item/stack/ore/glass/throw_impact(atom/hit_atom)
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
materials = list(MAT_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
materials = list(MAT_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
materials = list(MAT_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
materials = list(MAT_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
materials = list(MAT_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
materials = list(MAT_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)
..()
/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__heads"
flags_1 = CONDUCT_1
force = 1
throwforce = 2
w_class = WEIGHT_CLASS_TINY
var/string_attached
var/list/sideslist = list("heads","tails")
var/cmineral = null
var/cooldown = 0
var/value = 1
var/coinflip
/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/Initialize()
. = ..()
pixel_x = rand(0,16)-8
pixel_y = rand(0,8)-8
/obj/item/coin/examine(mob/user)
. = ..()
if(value)
. += "<span class='info'>It's worth [value] credit\s.</span>"
/obj/item/coin/gold
name = "gold coin"
cmineral = "gold"
icon_state = "coin_gold_heads"
value = 50
materials = list(MAT_GOLD = MINERAL_MATERIAL_AMOUNT*0.2)
grind_results = list(/datum/reagent/gold = 4)
/obj/item/coin/silver
name = "silver coin"
cmineral = "silver"
icon_state = "coin_silver_heads"
value = 20
materials = list(MAT_SILVER = MINERAL_MATERIAL_AMOUNT*0.2)
grind_results = list(/datum/reagent/silver = 4)
/obj/item/coin/diamond
name = "diamond coin"
cmineral = "diamond"
icon_state = "coin_diamond_heads"
value = 500
materials = list(MAT_DIAMOND = MINERAL_MATERIAL_AMOUNT*0.2)
grind_results = list(/datum/reagent/carbon = 4)
/obj/item/coin/iron
name = "iron coin"
cmineral = "iron"
icon_state = "coin_iron_heads"
value = 1
materials = list(MAT_METAL = MINERAL_MATERIAL_AMOUNT*0.2)
grind_results = list(/datum/reagent/iron = 4)
/obj/item/coin/plasma
name = "plasma coin"
cmineral = "plasma"
icon_state = "coin_plasma_heads"
value = 100
materials = list(MAT_PLASMA = MINERAL_MATERIAL_AMOUNT*0.2)
grind_results = list(/datum/reagent/toxin/plasma = 4)
/obj/item/coin/uranium
name = "uranium coin"
cmineral = "uranium"
icon_state = "coin_uranium_heads"
value = 80
materials = list(MAT_URANIUM = MINERAL_MATERIAL_AMOUNT*0.2)
grind_results = list(/datum/reagent/uranium = 4)
/obj/item/coin/bananium
name = "bananium coin"
cmineral = "bananium"
icon_state = "coin_bananium_heads"
value = 1000 //makes the clown cry
materials = list(MAT_BANANIUM = MINERAL_MATERIAL_AMOUNT*0.2)
grind_results = list(/datum/reagent/consumable/banana = 4)
/obj/item/coin/adamantine
name = "adamantine coin"
cmineral = "adamantine"
icon_state = "coin_adamantine_heads"
value = 1500
/obj/item/coin/mythril
name = "mythril coin"
cmineral = "mythril"
icon_state = "coin_mythril_heads"
value = 3000
/obj/item/coin/twoheaded
cmineral = "iron"
icon_state = "coin_iron_heads"
desc = "Hey, this coin's the same on both sides!"
sideslist = list("heads")
materials = list(MAT_METAL = MINERAL_MATERIAL_AMOUNT*0.2)
value = 1
grind_results = list(/datum/reagent/iron = 4)
/obj/item/coin/antagtoken
name = "antag token"
icon_state = "coin_valid_valid"
cmineral = "valid"
desc = "A novelty coin that helps the heart know what hard evidence cannot prove."
sideslist = list("valid", "salad")
value = 0
grind_results = list(/datum/reagent/consumable/sodiumchloride = 4)
/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
coinflip = pick(sideslist)
cooldown = world.time + 15
flick("coin_[cmineral]_flip", src)
icon_state = "coin_[cmineral]_[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
#undef ORESTACK_OVERLAYS_MAX
+89 -89
View File
@@ -1,89 +1,89 @@
/**********************Ore box**************************/
/obj/structure/ore_box
icon = 'icons/obj/mining.dmi'
icon_state = "orebox"
name = "ore box"
desc = "A heavy wooden box, which can be filled with a lot of ores."
density = TRUE
pressure_resistance = 5*ONE_ATMOSPHERE
/obj/structure/ore_box/attackby(obj/item/W, mob/user, params)
if (istype(W, /obj/item/stack/ore))
user.transferItemToLoc(W, src)
else if(SEND_SIGNAL(W, COMSIG_CONTAINS_STORAGE))
SEND_SIGNAL(W, COMSIG_TRY_STORAGE_TAKE_TYPE, /obj/item/stack/ore, src)
to_chat(user, "<span class='notice'>You empty the ore in [W] into \the [src].</span>")
else
return ..()
/obj/structure/ore_box/crowbar_act(mob/living/user, obj/item/I)
if(I.use_tool(src, user, 50, volume=50))
user.visible_message("[user] pries \the [src] apart.",
"<span class='notice'>You pry apart \the [src].</span>",
"<span class='italics'>You hear splitting wood.</span>")
deconstruct(TRUE, user)
return TRUE
/obj/structure/ore_box/examine(mob/living/user)
if(Adjacent(user) && istype(user))
show_contents(user)
return ..()
/obj/structure/ore_box/attack_hand(mob/user)
. = ..()
if(.)
return
if(Adjacent(user))
show_contents(user)
/obj/structure/ore_box/attack_robot(mob/user)
if(Adjacent(user))
show_contents(user)
/obj/structure/ore_box/proc/show_contents(mob/user)
var/dat = text("<b>The contents of the ore box reveal...</b><br>")
var/list/assembled = list()
for(var/obj/item/stack/ore/O in src)
assembled[O.type] += O.amount
for(var/type in assembled)
var/obj/item/stack/ore/O = type
dat += "[initial(O.name)] - [assembled[type]]<br>"
dat += text("<br><br><A href='?src=[REF(src)];removeall=1'>Empty box</A>")
user << browse(dat, "window=orebox")
/obj/structure/ore_box/proc/dump_box_contents()
var/drop = drop_location()
for(var/obj/item/stack/ore/O in src)
if(QDELETED(O))
continue
if(QDELETED(src))
break
O.forceMove(drop)
if(TICK_CHECK)
stoplag()
drop = drop_location()
/obj/structure/ore_box/Topic(href, href_list)
if(..())
return
if(!Adjacent(usr))
return
usr.set_machine(src)
add_fingerprint(usr)
if(href_list["removeall"])
dump_box_contents()
to_chat(usr, "<span class='notice'>You open the release hatch on the box..</span>")
updateUsrDialog()
/obj/structure/ore_box/deconstruct(disassembled = TRUE, mob/user)
var/obj/item/stack/sheet/mineral/wood/WD = new (loc, 4)
if(user)
WD.add_fingerprint(user)
dump_box_contents()
qdel(src)
/obj/structure/ore_box/onTransitZ()
return
/**********************Ore box**************************/
/obj/structure/ore_box
icon = 'icons/obj/mining.dmi'
icon_state = "orebox"
name = "ore box"
desc = "A heavy wooden box, which can be filled with a lot of ores."
density = TRUE
pressure_resistance = 5*ONE_ATMOSPHERE
/obj/structure/ore_box/attackby(obj/item/W, mob/user, params)
if (istype(W, /obj/item/stack/ore))
user.transferItemToLoc(W, src)
else if(SEND_SIGNAL(W, COMSIG_CONTAINS_STORAGE))
SEND_SIGNAL(W, COMSIG_TRY_STORAGE_TAKE_TYPE, /obj/item/stack/ore, src)
to_chat(user, "<span class='notice'>You empty the ore in [W] into \the [src].</span>")
else
return ..()
/obj/structure/ore_box/crowbar_act(mob/living/user, obj/item/I)
if(I.use_tool(src, user, 50, volume=50))
user.visible_message("[user] pries \the [src] apart.",
"<span class='notice'>You pry apart \the [src].</span>",
"<span class='italics'>You hear splitting wood.</span>")
deconstruct(TRUE, user)
return TRUE
/obj/structure/ore_box/examine(mob/living/user)
if(Adjacent(user) && istype(user))
show_contents(user)
return ..()
/obj/structure/ore_box/attack_hand(mob/user)
. = ..()
if(.)
return
if(Adjacent(user))
show_contents(user)
/obj/structure/ore_box/attack_robot(mob/user)
if(Adjacent(user))
show_contents(user)
/obj/structure/ore_box/proc/show_contents(mob/user)
var/dat = text("<b>The contents of the ore box reveal...</b><br>")
var/list/assembled = list()
for(var/obj/item/stack/ore/O in src)
assembled[O.type] += O.amount
for(var/type in assembled)
var/obj/item/stack/ore/O = type
dat += "[initial(O.name)] - [assembled[type]]<br>"
dat += text("<br><br><A href='?src=[REF(src)];removeall=1'>Empty box</A>")
user << browse(dat, "window=orebox")
/obj/structure/ore_box/proc/dump_box_contents()
var/drop = drop_location()
for(var/obj/item/stack/ore/O in src)
if(QDELETED(O))
continue
if(QDELETED(src))
break
O.forceMove(drop)
if(TICK_CHECK)
stoplag()
drop = drop_location()
/obj/structure/ore_box/Topic(href, href_list)
if(..())
return
if(!Adjacent(usr))
return
usr.set_machine(src)
add_fingerprint(usr)
if(href_list["removeall"])
dump_box_contents()
to_chat(usr, "<span class='notice'>You open the release hatch on the box..</span>")
updateUsrDialog()
/obj/structure/ore_box/deconstruct(disassembled = TRUE, mob/user)
var/obj/item/stack/sheet/mineral/wood/WD = new (loc, 4)
if(user)
WD.add_fingerprint(user)
dump_box_contents()
qdel(src)
/obj/structure/ore_box/onTransitZ()
return