The Mapping Update

Cleans up the map (again)
Makes mining code more better
This commit is contained in:
Letter N
2021-03-12 12:11:35 +08:00
parent cc81a6d65e
commit 935e46b492
149 changed files with 206322 additions and 206270 deletions
@@ -5,7 +5,8 @@
dynamic_lighting = DYNAMIC_LIGHTING_FORCED
requires_power = FALSE
has_gravity = STANDARD_GRAVITY
valid_territory = FALSE
area_flags = BLOBS_ALLOWED | UNIQUE_AREA
flags_1 = CAN_BE_DIRTY_1
//Survival Capsule
/obj/item/survivalcapsule
+107 -40
View File
@@ -16,29 +16,36 @@
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
var/mine_experience = 5 //How much experience do you get for mining this ore?
novariants = TRUE // Ore stacks handle their icon updates themselves to keep the illusion that there's more going
var/list/stack_overlays
var/scan_state = "" //Used by mineral turfs for their scan overlay.
var/spreadChance = 0 //Also used by mineral turfs for spreading veins
/obj/item/stack/ore/update_overlays()
. = ..()
var/difference = min(ORESTACK_OVERLAYS_MAX, amount) - (LAZYLEN(stack_overlays)+1)
if(difference == 0)
if(!difference)
return
else if(difference < 0 && LAZYLEN(stack_overlays)) //amount < stack_overlays, remove excess.
if (LAZYLEN(stack_overlays)-difference <= 0)
if(difference < 0 && LAZYLEN(stack_overlays)) //amount < stack_overlays, remove excess.
if(LAZYLEN(stack_overlays)-difference <= 0)
stack_overlays = null
else
stack_overlays.len += difference
else if(difference > 0) //amount > stack_overlays, add some.
return
stack_overlays.len += difference
else //amount > stack_overlays, add some.
for(var/i in 1 to difference)
var/mutable_appearance/newore = mutable_appearance(icon, icon_state)
newore.pixel_x = rand(-8,8)
newore.pixel_y = rand(-8,8)
LAZYADD(stack_overlays, newore)
if (stack_overlays)
if(stack_overlays)
. += stack_overlays
/obj/item/stack/ore/welder_act(mob/living/user, obj/item/I)
..()
if(!refined_type)
return TRUE
@@ -65,11 +72,16 @@
/obj/item/stack/ore/uranium
name = "uranium ore"
icon_state = "Uranium ore"
item_state = "Uranium ore"
// inhand_icon_state = "Uranium ore"
singular_name = "uranium ore chunk"
points = 30
// material_flags = MATERIAL_NO_EFFECTS
custom_materials = list(/datum/material/uranium=MINERAL_MATERIAL_AMOUNT)
refined_type = /obj/item/stack/sheet/mineral/uranium
mine_experience = 6
scan_state = "rock_Uranium"
spreadChance = 5
// merge_type = /obj/item/stack/ore/uranium
/obj/item/stack/ore/iron
name = "iron ore"
@@ -79,6 +91,10 @@
points = 1
custom_materials = list(/datum/material/iron=MINERAL_MATERIAL_AMOUNT)
refined_type = /obj/item/stack/sheet/metal
mine_experience = 1
scan_state = "rock_Iron"
spreadChance = 20
// merge_type = /obj/item/stack/ore/metal
/obj/item/stack/ore/glass
name = "sand pile"
@@ -89,10 +105,13 @@
custom_materials = list(/datum/material/glass=MINERAL_MATERIAL_AMOUNT)
refined_type = /obj/item/stack/sheet/glass
w_class = WEIGHT_CLASS_TINY
mine_experience = 0 //its sand
// merge_type = /obj/item/stack/ore/glass
GLOBAL_LIST_INIT(sand_recipes, list(\
new/datum/stack_recipe("sandstone", /obj/item/stack/sheet/mineral/sandstone, 1, 1, 50),\
))
new /datum/stack_recipe("sandstone", /obj/item/stack/sheet/mineral/sandstone, 1, 1, 50)
))
/obj/item/stack/ore/glass/get_main_recipes()
. = ..()
@@ -111,7 +130,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
return ..()
var/mob/living/carbon/human/poorsod = M
visible_message("<span class='danger'>[user] throws the sand at [poorsod]'s face!</span>")
if(ishuman(user))
if(ishuman(user) && prob(80))
var/mob/living/carbon/human/sayer = user
sayer.forcesay("POCKET SAAND!!")
eyesand(poorsod)
@@ -133,7 +152,6 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
C.forcesay("*scream")
qdel(src)
/obj/item/stack/ore/glass/ex_act(severity, target)
if (severity == EXPLODE_NONE)
return
@@ -144,15 +162,21 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
icon_state = "volcanic_sand"
icon_state = "volcanic_sand"
singular_name = "volcanic ash pile"
mine_experience = 0
// merge_type = /obj/item/stack/ore/glass/basalt
/obj/item/stack/ore/plasma
name = "plasma ore"
icon_state = "Plasma ore"
item_state = "Plasma ore"
icon_state = "Plasma ore"
singular_name = "plasma ore chunk"
points = 15
custom_materials = list(/datum/material/plasma=MINERAL_MATERIAL_AMOUNT)
refined_type = /obj/item/stack/sheet/mineral/plasma
mine_experience = 5
scan_state = "rock_Plasma"
spreadChance = 8
// merge_type = /obj/item/stack/ore/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>")
@@ -164,8 +188,12 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
item_state = "Silver ore"
singular_name = "silver ore chunk"
points = 16
mine_experience = 3
custom_materials = list(/datum/material/silver=MINERAL_MATERIAL_AMOUNT)
refined_type = /obj/item/stack/sheet/mineral/silver
scan_state = "rock_Silver"
spreadChance = 5
// merge_type = /obj/item/stack/ore/silver
/obj/item/stack/ore/gold
name = "gold ore"
@@ -173,8 +201,12 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
icon_state = "Gold ore"
singular_name = "gold ore chunk"
points = 18
mine_experience = 5
custom_materials = list(/datum/material/gold=MINERAL_MATERIAL_AMOUNT)
refined_type = /obj/item/stack/sheet/mineral/gold
scan_state = "rock_Gold"
spreadChance = 5
// merge_type = /obj/item/stack/ore/gold
/obj/item/stack/ore/diamond
name = "diamond ore"
@@ -184,6 +216,9 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
points = 50
custom_materials = list(/datum/material/diamond=MINERAL_MATERIAL_AMOUNT)
refined_type = /obj/item/stack/sheet/mineral/diamond
mine_experience = 10
scan_state = "rock_Diamond"
// merge_type = /obj/item/stack/ore/diamond
/obj/item/stack/ore/bananium
name = "bananium ore"
@@ -193,6 +228,9 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
points = 60
custom_materials = list(/datum/material/bananium=MINERAL_MATERIAL_AMOUNT)
refined_type = /obj/item/stack/sheet/mineral/bananium
mine_experience = 15
scan_state = "rock_Bananium"
// merge_type = /obj/item/stack/ore/bananium
/obj/item/stack/ore/titanium
name = "titanium ore"
@@ -202,6 +240,10 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
points = 50
custom_materials = list(/datum/material/titanium=MINERAL_MATERIAL_AMOUNT)
refined_type = /obj/item/stack/sheet/mineral/titanium
mine_experience = 3
scan_state = "rock_Titanium"
spreadChance = 5
// merge_type = /obj/item/stack/ore/titanium
/obj/item/stack/ore/slag
name = "slag"
@@ -209,6 +251,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
icon_state = "slag"
item_state = "slag"
singular_name = "slag chunk"
// merge_type = /obj/item/stack/ore/slag
/obj/item/gibtonite
name = "gibtonite ore"
@@ -235,7 +278,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
/obj/item/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>")
user.visible_message("<span class='notice'>[user] attaches [I] to [src].</span>", "<span class='notice'>You attach [I] to [src].</span>")
wires = new /datum/wires/explosive/gibtonite(src)
attacher = key_name(user)
qdel(I)
@@ -255,7 +298,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
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>")
user.visible_message("<span class='notice'>The chain reaction stopped! ...The ore's quality looks diminished.</span>", "<span class='notice'>You stopped the chain reaction. ...The ore's quality looks diminished.</span>")
icon_state = "Gibtonite ore"
quality = GIBTONITE_QUALITY_LOW
return
@@ -269,34 +312,29 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
/obj/item/gibtonite/bullet_act(obj/item/projectile/P)
GibtoniteReaction(P.firer)
return ..()
. = ..()
/obj/item/gibtonite/ex_act()
GibtoniteReaction(null, 1)
/obj/item/gibtonite/proc/GibtoniteReaction(mob/user, triggered_by = 0)
if(!primed)
primed = TRUE
playsound(src,'sound/effects/hit_on_shattered_glass.ogg',50,1)
playsound(src,'sound/effects/hit_on_shattered_glass.ogg',50,TRUE)
icon_state = "Gibtonite active"
var/turf/bombturf = get_turf(src)
var/notify_admins = 0
var/notify_admins = FALSE
if(z != 5)//Only annoy the admins ingame if we're triggered off the mining zlevel
notify_admins = 1
notify_admins = TRUE
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)]")
message_admins("An explosion has triggered a [name] to detonate at [ADMIN_VERBOSEJMP(bombturf)].")
else if(triggered_by == 2)
log_game("A signal has primed a [name] for detonation at [AREACOORD(bombturf)]. Igniter attacher: [key_name(attacher)].")
if(notify_admins)
message_admins("A signal has triggered a [name] to detonate at [ADMIN_VERBOSEJMP(bombturf)]. Igniter attacher: [ADMIN_LOOKUPFLW(attacher)]")
var/bomb_message = "A signal has primed a [name] for detonation at [AREACOORD(bombturf)]. Igniter attacher: [key_name(attacher)]."
log_game(bomb_message)
GLOB.bombers += bomb_message
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)]")
@@ -313,10 +351,10 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
explosion(src,0,1,3,adminlog = notify_admins)
qdel(src)
/obj/item/stack/ore/Initialize()
/obj/item/stack/ore/Initialize(mapload, new_amount, merge = TRUE)
. = ..()
pixel_x = rand(0,16)-8
pixel_y = rand(0,8)-8
pixel_x = initial(pixel_x) + rand(0, 16) - 8
pixel_y = initial(pixel_y) + rand(0, 8) - 8
/obj/item/stack/ore/ex_act(severity, target)
if (!severity || severity >= 2)
@@ -350,8 +388,8 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
. = ..()
coinflip = pick(sideslist)
icon_state = "coin_[coinflip]"
pixel_x = rand(0,16)-8
pixel_y = rand(0,8)-8
pixel_x = initial(pixel_x) + rand(0, 16) - 8
pixel_y = initial(pixel_y) + rand(0, 8) - 8
/obj/item/coin/set_custom_materials(list/materials, multiplier = 1)
. = ..()
@@ -377,6 +415,8 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
user.visible_message("<span class='suicide'>\the [src] lands on [coinflip]! [user] promptly falls over, dead!</span>")
user.adjustOxyLoss(200)
user.death(0)
// user.set_suicide(TRUE)
user.suicide_log()
else
user.visible_message("<span class='suicide'>\the [src] lands on [coinflip]! [user] keeps on living!</span>")
@@ -386,11 +426,12 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
/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 (W.use_tool(src, user, 0, 1, skill_gain_mult = BARE_USE_TOOL_MULT))
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>")
@@ -412,6 +453,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
..()
/obj/item/coin/wirecutter_act(mob/living/user, obj/item/I)
..()
if(!string_attached)
return TRUE
@@ -430,13 +472,13 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
flick("coin_[coinflip]_flip", src)
coinflip = pick(sideslist)
icon_state = "coin_[coinflip]"
playsound(user.loc, 'sound/items/coinflip.ogg', 50, 1)
playsound(user.loc, 'sound/items/coinflip.ogg', 50, TRUE)
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>")
user.visible_message("<span class='notice'>[user] flips [src]. It lands on [coinflip].</span>", \
"<span class='notice'>You flip [src]. It lands on [coinflip].</span>", \
"<span class='hear'>You hear the clattering of loose change.</span>")
return TRUE//did the coin flip? useful for suicide_act
/obj/item/coin/gold
@@ -486,4 +528,29 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
/obj/item/coin/iron
/obj/item/coin/gold/debug
custom_materials = list(/datum/material/gold = 400)
desc = "If you got this somehow, be aware that it will dust you. Almost certainly."
/obj/item/coin/gold/debug/attack_self(mob/user)
if(cooldown < world.time)
if(string_attached) //does the coin have a wire attached
to_chat(user, "<span class='warning'>The coin won't flip very well with something attached!</span>" )
return FALSE//do not flip the coin
cooldown = world.time + 15
flick("coin_[coinflip]_flip", src)
coinflip = pick(sideslist)
icon_state = "coin_[coinflip]"
playsound(user.loc, 'sound/items/coinflip.ogg', 50, TRUE)
var/oldloc = loc
sleep(15)
if(loc == oldloc && user && !user.incapacitated())
user.visible_message("<span class='notice'>[user] flips [src]. It lands on [coinflip].</span>", \
"<span class='notice'>You flip [src]. It lands on [coinflip].</span>", \
"<span class='hear'>You hear the clattering of loose change.</span>")
SSeconomy.fire()
// to_chat(user,"<span class='bounty'>[SSeconomy.inflation_value()] is the inflation value.</span>")
to_chat(user, "<span class='bounty'>Luckily, economical inflation is not yet included. So no, you cannot predict the market with this.</span>")
return TRUE//did the coin flip? useful for suicide_act
#undef ORESTACK_OVERLAYS_MAX