mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Fixes gulag stacker not giving points after RPG loot event (#38570)
* Fixes gulag stacker not giving points after RPG loot event * Moves point values to type vars * cleanup
This commit is contained in:
@@ -67,6 +67,7 @@
|
|||||||
attack_verb = list("bluespace polybashed", "bluespace polybattered", "bluespace polybludgeoned", "bluespace polythrashed", "bluespace polysmashed")
|
attack_verb = list("bluespace polybashed", "bluespace polybattered", "bluespace polybludgeoned", "bluespace polythrashed", "bluespace polysmashed")
|
||||||
novariants = TRUE
|
novariants = TRUE
|
||||||
grind_results = list("bluespace" = 20)
|
grind_results = list("bluespace" = 20)
|
||||||
|
point_value = 30
|
||||||
var/crystal_type = /obj/item/stack/ore/bluespace_crystal/refined
|
var/crystal_type = /obj/item/stack/ore/bluespace_crystal/refined
|
||||||
|
|
||||||
/obj/item/stack/sheet/bluespace_crystal/attack_self(mob/user)// to prevent the construction menu from ever happening
|
/obj/item/stack/sheet/bluespace_crystal/attack_self(mob/user)// to prevent the construction menu from ever happening
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ GLOBAL_LIST_INIT(glass_recipes, list ( \
|
|||||||
resistance_flags = ACID_PROOF
|
resistance_flags = ACID_PROOF
|
||||||
merge_type = /obj/item/stack/sheet/glass
|
merge_type = /obj/item/stack/sheet/glass
|
||||||
grind_results = list("silicon" = 20)
|
grind_results = list("silicon" = 20)
|
||||||
|
point_value = 1
|
||||||
|
|
||||||
/obj/item/stack/sheet/glass/suicide_act(mob/living/carbon/user)
|
/obj/item/stack/sheet/glass/suicide_act(mob/living/carbon/user)
|
||||||
user.visible_message("<span class='suicide'>[user] begins to slice [user.p_their()] neck with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
user.visible_message("<span class='suicide'>[user] begins to slice [user.p_their()] neck with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||||
@@ -138,6 +139,7 @@ GLOBAL_LIST_INIT(reinforced_glass_recipes, list ( \
|
|||||||
resistance_flags = ACID_PROOF
|
resistance_flags = ACID_PROOF
|
||||||
merge_type = /obj/item/stack/sheet/rglass
|
merge_type = /obj/item/stack/sheet/rglass
|
||||||
grind_results = list("silicon" = 20, "iron" = 10)
|
grind_results = list("silicon" = 20, "iron" = 10)
|
||||||
|
point_value = 4
|
||||||
|
|
||||||
/obj/item/stack/sheet/rglass/attackby(obj/item/W, mob/user, params)
|
/obj/item/stack/sheet/rglass/attackby(obj/item/W, mob/user, params)
|
||||||
add_fingerprint(user)
|
add_fingerprint(user)
|
||||||
@@ -180,6 +182,7 @@ GLOBAL_LIST_INIT(prglass_recipes, list ( \
|
|||||||
resistance_flags = ACID_PROOF
|
resistance_flags = ACID_PROOF
|
||||||
merge_type = /obj/item/stack/sheet/plasmarglass
|
merge_type = /obj/item/stack/sheet/plasmarglass
|
||||||
grind_results = list("silicon" = 20, "plasma" = 10, "iron" = 10)
|
grind_results = list("silicon" = 20, "plasma" = 10, "iron" = 10)
|
||||||
|
point_value = 23
|
||||||
|
|
||||||
/obj/item/stack/sheet/plasmarglass/Initialize(mapload, new_amount, merge = TRUE)
|
/obj/item/stack/sheet/plasmarglass/Initialize(mapload, new_amount, merge = TRUE)
|
||||||
recipes = GLOB.prglass_recipes
|
recipes = GLOB.prglass_recipes
|
||||||
|
|||||||
@@ -104,6 +104,7 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \
|
|||||||
materials = list(MAT_DIAMOND=MINERAL_MATERIAL_AMOUNT)
|
materials = list(MAT_DIAMOND=MINERAL_MATERIAL_AMOUNT)
|
||||||
novariants = TRUE
|
novariants = TRUE
|
||||||
grind_results = list("carbon" = 20)
|
grind_results = list("carbon" = 20)
|
||||||
|
point_value = 25
|
||||||
|
|
||||||
GLOBAL_LIST_INIT(diamond_recipes, list ( \
|
GLOBAL_LIST_INIT(diamond_recipes, list ( \
|
||||||
new/datum/stack_recipe("diamond door", /obj/structure/mineral_door/transparent/diamond, 10, one_per_turf = 1, on_floor = 1), \
|
new/datum/stack_recipe("diamond door", /obj/structure/mineral_door/transparent/diamond, 10, one_per_turf = 1, on_floor = 1), \
|
||||||
@@ -129,6 +130,7 @@ GLOBAL_LIST_INIT(diamond_recipes, list ( \
|
|||||||
materials = list(MAT_URANIUM=MINERAL_MATERIAL_AMOUNT)
|
materials = list(MAT_URANIUM=MINERAL_MATERIAL_AMOUNT)
|
||||||
novariants = TRUE
|
novariants = TRUE
|
||||||
grind_results = list("uranium" = 20)
|
grind_results = list("uranium" = 20)
|
||||||
|
point_value = 20
|
||||||
|
|
||||||
GLOBAL_LIST_INIT(uranium_recipes, list ( \
|
GLOBAL_LIST_INIT(uranium_recipes, list ( \
|
||||||
new/datum/stack_recipe("uranium door", /obj/structure/mineral_door/uranium, 10, one_per_turf = 1, on_floor = 1), \
|
new/datum/stack_recipe("uranium door", /obj/structure/mineral_door/uranium, 10, one_per_turf = 1, on_floor = 1), \
|
||||||
@@ -154,6 +156,7 @@ GLOBAL_LIST_INIT(uranium_recipes, list ( \
|
|||||||
max_integrity = 100
|
max_integrity = 100
|
||||||
materials = list(MAT_PLASMA=MINERAL_MATERIAL_AMOUNT)
|
materials = list(MAT_PLASMA=MINERAL_MATERIAL_AMOUNT)
|
||||||
grind_results = list("plasma" = 20)
|
grind_results = list("plasma" = 20)
|
||||||
|
point_value = 20
|
||||||
|
|
||||||
/obj/item/stack/sheet/mineral/plasma/suicide_act(mob/living/carbon/user)
|
/obj/item/stack/sheet/mineral/plasma/suicide_act(mob/living/carbon/user)
|
||||||
user.visible_message("<span class='suicide'>[user] begins licking \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
user.visible_message("<span class='suicide'>[user] begins licking \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||||
@@ -193,6 +196,7 @@ GLOBAL_LIST_INIT(plasma_recipes, list ( \
|
|||||||
sheettype = "gold"
|
sheettype = "gold"
|
||||||
materials = list(MAT_GOLD=MINERAL_MATERIAL_AMOUNT)
|
materials = list(MAT_GOLD=MINERAL_MATERIAL_AMOUNT)
|
||||||
grind_results = list("gold" = 20)
|
grind_results = list("gold" = 20)
|
||||||
|
point_value = 20
|
||||||
|
|
||||||
GLOBAL_LIST_INIT(gold_recipes, list ( \
|
GLOBAL_LIST_INIT(gold_recipes, list ( \
|
||||||
new/datum/stack_recipe("golden door", /obj/structure/mineral_door/gold, 10, one_per_turf = 1, on_floor = 1), \
|
new/datum/stack_recipe("golden door", /obj/structure/mineral_door/gold, 10, one_per_turf = 1, on_floor = 1), \
|
||||||
@@ -220,6 +224,7 @@ GLOBAL_LIST_INIT(gold_recipes, list ( \
|
|||||||
sheettype = "silver"
|
sheettype = "silver"
|
||||||
materials = list(MAT_SILVER=MINERAL_MATERIAL_AMOUNT)
|
materials = list(MAT_SILVER=MINERAL_MATERIAL_AMOUNT)
|
||||||
grind_results = list("silver" = 20)
|
grind_results = list("silver" = 20)
|
||||||
|
point_value = 20
|
||||||
|
|
||||||
GLOBAL_LIST_INIT(silver_recipes, list ( \
|
GLOBAL_LIST_INIT(silver_recipes, list ( \
|
||||||
new/datum/stack_recipe("silver door", /obj/structure/mineral_door/silver, 10, one_per_turf = 1, on_floor = 1), \
|
new/datum/stack_recipe("silver door", /obj/structure/mineral_door/silver, 10, one_per_turf = 1, on_floor = 1), \
|
||||||
@@ -247,6 +252,7 @@ GLOBAL_LIST_INIT(silver_recipes, list ( \
|
|||||||
materials = list(MAT_BANANIUM=MINERAL_MATERIAL_AMOUNT)
|
materials = list(MAT_BANANIUM=MINERAL_MATERIAL_AMOUNT)
|
||||||
novariants = TRUE
|
novariants = TRUE
|
||||||
grind_results = list("banana" = 20)
|
grind_results = list("banana" = 20)
|
||||||
|
point_value = 50
|
||||||
|
|
||||||
GLOBAL_LIST_INIT(bananium_recipes, list ( \
|
GLOBAL_LIST_INIT(bananium_recipes, list ( \
|
||||||
new/datum/stack_recipe("bananium tile", /obj/item/stack/tile/mineral/bananium, 1, 4, 20), \
|
new/datum/stack_recipe("bananium tile", /obj/item/stack/tile/mineral/bananium, 1, 4, 20), \
|
||||||
@@ -272,6 +278,7 @@ GLOBAL_LIST_INIT(bananium_recipes, list ( \
|
|||||||
throw_range = 3
|
throw_range = 3
|
||||||
sheettype = "titanium"
|
sheettype = "titanium"
|
||||||
materials = list(MAT_TITANIUM=MINERAL_MATERIAL_AMOUNT)
|
materials = list(MAT_TITANIUM=MINERAL_MATERIAL_AMOUNT)
|
||||||
|
point_value = 20
|
||||||
|
|
||||||
GLOBAL_LIST_INIT(titanium_recipes, list ( \
|
GLOBAL_LIST_INIT(titanium_recipes, list ( \
|
||||||
new/datum/stack_recipe("titanium tile", /obj/item/stack/tile/mineral/titanium, 1, 4, 20), \
|
new/datum/stack_recipe("titanium tile", /obj/item/stack/tile/mineral/titanium, 1, 4, 20), \
|
||||||
@@ -300,6 +307,7 @@ GLOBAL_LIST_INIT(titanium_recipes, list ( \
|
|||||||
throw_range = 3
|
throw_range = 3
|
||||||
sheettype = "plastitanium"
|
sheettype = "plastitanium"
|
||||||
materials = list(MAT_TITANIUM=MINERAL_MATERIAL_AMOUNT, MAT_PLASMA=MINERAL_MATERIAL_AMOUNT)
|
materials = list(MAT_TITANIUM=MINERAL_MATERIAL_AMOUNT, MAT_PLASMA=MINERAL_MATERIAL_AMOUNT)
|
||||||
|
point_value = 45
|
||||||
|
|
||||||
GLOBAL_LIST_INIT(plastitanium_recipes, list ( \
|
GLOBAL_LIST_INIT(plastitanium_recipes, list ( \
|
||||||
new/datum/stack_recipe("plas-titanium tile", /obj/item/stack/tile/mineral/plastitanium, 1, 4, 20), \
|
new/datum/stack_recipe("plas-titanium tile", /obj/item/stack/tile/mineral/plastitanium, 1, 4, 20), \
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \
|
|||||||
resistance_flags = FIRE_PROOF
|
resistance_flags = FIRE_PROOF
|
||||||
merge_type = /obj/item/stack/sheet/metal
|
merge_type = /obj/item/stack/sheet/metal
|
||||||
grind_results = list("iron" = 20)
|
grind_results = list("iron" = 20)
|
||||||
|
point_value = 2
|
||||||
|
|
||||||
/obj/item/stack/sheet/metal/ratvar_act()
|
/obj/item/stack/sheet/metal/ratvar_act()
|
||||||
new /obj/item/stack/tile/brass(loc, amount)
|
new /obj/item/stack/tile/brass(loc, amount)
|
||||||
@@ -158,6 +159,7 @@ GLOBAL_LIST_INIT(plasteel_recipes, list ( \
|
|||||||
resistance_flags = FIRE_PROOF
|
resistance_flags = FIRE_PROOF
|
||||||
merge_type = /obj/item/stack/sheet/plasteel
|
merge_type = /obj/item/stack/sheet/plasteel
|
||||||
grind_results = list("iron" = 20, "plasma" = 20)
|
grind_results = list("iron" = 20, "plasma" = 20)
|
||||||
|
point_value = 23
|
||||||
|
|
||||||
/obj/item/stack/sheet/plasteel/Initialize(mapload, new_amount, merge = TRUE)
|
/obj/item/stack/sheet/plasteel/Initialize(mapload, new_amount, merge = TRUE)
|
||||||
recipes = GLOB.plasteel_recipes
|
recipes = GLOB.plasteel_recipes
|
||||||
|
|||||||
@@ -11,4 +11,5 @@
|
|||||||
attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "smashed")
|
attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "smashed")
|
||||||
novariants = FALSE
|
novariants = FALSE
|
||||||
var/perunit = MINERAL_MATERIAL_AMOUNT
|
var/perunit = MINERAL_MATERIAL_AMOUNT
|
||||||
var/sheettype = null //this is used for girders in the creation of walls/false walls
|
var/sheettype = null //this is used for girders in the creation of walls/false walls
|
||||||
|
var/point_value = 0 //turn-in value for the gulag stacker - loosely relative to its rarity.
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
GLOBAL_LIST(labor_sheet_values)
|
||||||
|
|
||||||
/**********************Prisoners' Console**************************/
|
/**********************Prisoners' Console**************************/
|
||||||
|
|
||||||
/obj/machinery/mineral/labor_claim_console
|
/obj/machinery/mineral/labor_claim_console
|
||||||
@@ -20,6 +22,18 @@
|
|||||||
Radio.listening = FALSE
|
Radio.listening = FALSE
|
||||||
locate_stacking_machine()
|
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/attackby(obj/item/I, mob/user, params)
|
/obj/machinery/mineral/labor_claim_console/attackby(obj/item/I, mob/user, params)
|
||||||
if(istype(I, /obj/item/card/id/prisoner))
|
if(istype(I, /obj/item/card/id/prisoner))
|
||||||
if(!inserted_id)
|
if(!inserted_id)
|
||||||
@@ -52,16 +66,10 @@
|
|||||||
if(check_auth())
|
if(check_auth())
|
||||||
can_go_home = TRUE
|
can_go_home = TRUE
|
||||||
|
|
||||||
var/list/ores = list()
|
|
||||||
if(stacking_machine)
|
if(stacking_machine)
|
||||||
data["unclaimed_points"] = stacking_machine.points
|
data["unclaimed_points"] = stacking_machine.points
|
||||||
for(var/ore in stacking_machine.ore_values)
|
|
||||||
var/list/O = list()
|
|
||||||
O["ore"] = ore
|
|
||||||
O["value"] = stacking_machine.ore_values[ore]
|
|
||||||
ores += list(O)
|
|
||||||
|
|
||||||
data["ores"] = ores
|
data["ores"] = GLOB.labor_sheet_values
|
||||||
data["can_go_home"] = can_go_home
|
data["can_go_home"] = can_go_home
|
||||||
|
|
||||||
return data
|
return data
|
||||||
@@ -127,15 +135,10 @@
|
|||||||
|
|
||||||
|
|
||||||
/obj/machinery/mineral/stacking_machine/laborstacker
|
/obj/machinery/mineral/stacking_machine/laborstacker
|
||||||
var/points = 0 //The unclaimed value of ore stacked. Value for each ore loosely relative to its rarity.
|
var/points = 0 //The unclaimed value of ore stacked.
|
||||||
var/list/ore_values = list("glass" = 1, "metal" = 2, "reinforced glass" = 4, "gold" = 20, "silver" = 20, "uranium" = 20, "titanium" = 20, "solid plasma" = 20, "plasteel" = 23, "plasma glass" = 23, "diamond" = 25, "bluespace polycrystal" = 30, "plastitanium" = 45, "bananium" = 50)
|
|
||||||
|
|
||||||
/obj/machinery/mineral/stacking_machine/laborstacker/process_sheet(obj/item/stack/sheet/inp)
|
/obj/machinery/mineral/stacking_machine/laborstacker/process_sheet(obj/item/stack/sheet/inp)
|
||||||
if(istype(inp))
|
points += inp.point_value * inp.amount
|
||||||
var/n = inp.name
|
|
||||||
var/a = inp.amount
|
|
||||||
if(n in ore_values)
|
|
||||||
points += ore_values[n] * a
|
|
||||||
..()
|
..()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -105,8 +105,8 @@
|
|||||||
stack_list[inp.type] = s
|
stack_list[inp.type] = s
|
||||||
var/obj/item/stack/sheet/storage = stack_list[inp.type]
|
var/obj/item/stack/sheet/storage = stack_list[inp.type]
|
||||||
storage.amount += inp.amount //Stack the sheets
|
storage.amount += inp.amount //Stack the sheets
|
||||||
qdel(inp) //Let the old sheet garbage collect
|
|
||||||
while(storage.amount > stack_amt) //Get rid of excessive stackage
|
while(storage.amount > stack_amt) //Get rid of excessive stackage
|
||||||
var/obj/item/stack/sheet/out = new inp.type(null, stack_amt)
|
var/obj/item/stack/sheet/out = new inp.type(null, stack_amt)
|
||||||
unload_mineral(out)
|
unload_mineral(out)
|
||||||
storage.amount -= stack_amt
|
storage.amount -= stack_amt
|
||||||
|
qdel(inp) //Let the old sheet garbage collect
|
||||||
|
|||||||
Reference in New Issue
Block a user