Merge pull request #5978 from Zuhayr/journalism

Mining changes and basic character backgrounds.
This commit is contained in:
Chinsky
2014-08-14 10:54:49 +04:00
14 changed files with 604 additions and 484 deletions
+53
View File
@@ -77,6 +77,12 @@ datum/preferences
var/language = "None" //Secondary language
var/list/gear //Custom/fluff item loadout.
//Some faction information.
var/home_system = "Unset" //System of birth.
var/citizenship = "None" //Current home system.
var/faction = "None" //Antag faction/general associated faction.
var/religion = "None" //Religious association.
//Mob preview
var/icon/preview_icon = null
var/icon/preview_icon_front = null
@@ -406,7 +412,14 @@ datum/preferences
dat += "<br><b>Body Color</b><br>"
dat += "<a href='?_src_=prefs;preference=skin;task=input'>Change Color</a> <font face='fixedsys' size='3' color='#[num2hex(r_skin, 2)][num2hex(g_skin, 2)][num2hex(b_skin, 2)]'><table style='display:inline;' bgcolor='#[num2hex(r_skin, 2)][num2hex(g_skin, 2)][num2hex(b_skin)]'><tr><td>__</td></tr></table></font>"
dat += "<br><br><b>Background Information</b><br>"
dat += "<b>Home system</b>: <a href='byond://?src=\ref[user];preference=home_system;task=input'>[home_system]</a><br/>"
dat += "<b>Citizenship</b>: <a href='byond://?src=\ref[user];preference=citizenship;task=input'>[citizenship]</a><br/>"
dat += "<b>Faction</b>: <a href='byond://?src=\ref[user];preference=faction;task=input'>[faction]</a><br/>"
dat += "<b>Religion</b>: <a href='byond://?src=\ref[user];preference=religion;task=input'>[religion]</a><br/>"
dat += "<br><br>"
if(jobban_isbanned(user, "Syndicate"))
dat += "<b>You are banned from antagonist roles.</b>"
src.be_special = 0
@@ -1343,6 +1356,46 @@ datum/preferences
return
spawnpoint = choice
if("home_system")
var/choice = input(user, "Please choose a home system.") as null|anything in home_system_choices + list("Unset","Other")
if(!choice)
return
if(choice == "Other")
var/raw_choice = input(user, "Please enter a home system.") as text|null
if(raw_choice)
home_system = sanitize(copytext(raw_choice,1,MAX_MESSAGE_LEN))
return
home_system = choice
if("citizenship")
var/choice = input(user, "Please choose your current citizenship.") as null|anything in citizenship_choices + list("None","Other")
if(!choice)
return
if(choice == "Other")
var/raw_choice = input(user, "Please enter your current citizenship.", "Character Preference") as text|null
if(raw_choice)
citizenship = sanitize(copytext(raw_choice,1,MAX_MESSAGE_LEN))
return
citizenship = choice
if("faction")
var/choice = input(user, "Please choose a faction to work for.") as null|anything in faction_choices + list("None","Other")
if(!choice)
return
if(choice == "Other")
var/raw_choice = input(user, "Please enter a faction.") as text|null
if(raw_choice)
faction = sanitize(copytext(raw_choice,1,MAX_MESSAGE_LEN))
return
faction = choice
if("religion")
var/choice = input(user, "Please choose a religion.") as null|anything in religion_choices + list("None","Other")
if(!choice)
return
if(choice == "Other")
var/raw_choice = input(user, "Please enter a religon.") as text|null
if(raw_choice)
religion = sanitize(copytext(raw_choice,1,MAX_MESSAGE_LEN))
return
religion = choice
else
switch(href_list["preference"])
if("gender")
@@ -0,0 +1,53 @@
var/global/list/seen_citizenships = list()
var/global/list/seen_systems = list()
var/global/list/seen_factions = list()
var/global/list/seen_religions = list()
//Commenting this out for now until I work the lists it into the event generator/journalist/chaplain.
/proc/UpdateFactionList(mob/living/carbon/human/M)
/*if(M && M.client && M.client.prefs)
seen_citizenships |= M.client.prefs.citizenship
seen_systems |= M.client.prefs.home_system
seen_factions |= M.client.prefs.faction
seen_religions |= M.client.prefs.religion*/
return
var/global/list/citizenship_choices = list(
"Earth",
"Mars",
"Moghes",
"Ahdomai",
"Qerrbalak"
)
var/global/list/home_system_choices = list(
"Sol",
"Nyx",
"Tau Ceti",
"Epsilon Ursae Majoris",
"S'randarr"
)
var/global/list/faction_choices = list(
"Sol Central",
"Vey Med",
"Einstein Engines",
"Free Trade Union",
"NanoTrasen",
"Ward-Takahashi GMB",
"Gilthari Exports",
"Grayson Manufactories Ltd.",
"Aether Atmospherics",
"Zeng-Hu Pharmaceuticals",
"Hesphaistos Industries"
)
var/global/list/religion_choices = list(
"Unitarianism",
"Hinduism",
"Buddhist",
"Islamic",
"Christian",
"Agnostic",
"Deist"
)
@@ -166,6 +166,10 @@
S["skill_specialization"] >> skill_specialization
S["organ_data"] >> organ_data
S["gear"] >> gear
S["home_system"] >> home_system
S["citizenship"] >> citizenship
S["faction"] >> faction
S["religion"] >> religion
S["nanotrasen_relation"] >> nanotrasen_relation
//S["skin_style"] >> skin_style
@@ -225,6 +229,11 @@
if(!gear) src.gear = list()
//if(!skin_style) skin_style = "Default"
if(!home_system) home_system = "Unset"
if(!citizenship) citizenship = "None"
if(!faction) faction = "None"
if(!religion) religion = "None"
return 1
/datum/preferences/proc/save_character()
@@ -297,6 +306,10 @@
S["skill_specialization"] << skill_specialization
S["organ_data"] << organ_data
S["gear"] << gear
S["home_system"] << home_system
S["citizenship"] << citizenship
S["faction"] << faction
S["religion"] << religion
S["nanotrasen_relation"] << nanotrasen_relation
//S["skin_style"] << skin_style
@@ -163,7 +163,6 @@ Deep minerals:
target_turf = locate(tx+j, ty+i, asteroid_z)
if(target_turf && target_turf.has_resources)
target_turf.resources = list()
target_turf.resources["silicates"] = rand(3,5)
target_turf.resources["carbonaceous rock"] = rand(3,5)
+67
View File
@@ -181,3 +181,70 @@
icon_opened = "miningcaropen"
icon_closed = "miningcar"
// Flags.
/obj/item/stack/flag
name = "flags"
desc = "Some colourful flags."
singular_name = "flag"
amount = 10
max_amount = 10
icon = 'icons/obj/mining.dmi'
var/upright = 0
var/base_state
/obj/item/stack/flag/New()
..()
base_state = icon_state
/obj/item/stack/flag/red
name = "red flags"
singular_name = "red flag"
icon_state = "redflag"
/obj/item/stack/flag/yellow
name = "yellow flags"
singular_name = "yellow flag"
icon_state = "yellowflag"
/obj/item/stack/flag/green
name = "green flags"
singular_name = "green flag"
icon_state = "greenflag"
/obj/item/stack/flag/attackby(obj/item/W as obj, mob/user as mob)
if(upright && istype(W,src.type))
src.attack_hand(user)
else
..()
/obj/item/stack/flag/attack_hand(user as mob)
if(upright)
upright = 0
icon_state = base_state
anchored = 0
src.visible_message("<b>[user]</b> knocks down [src].")
else
..()
/obj/item/stack/flag/attack_self(mob/user as mob)
var/obj/item/stack/flag/F = locate() in get_turf(src)
var/turf/T = get_turf(src)
if(!T || !istype(T,/turf/simulated/floor/plating/airless/asteroid))
user << "The flag won't stand up in this terrain."
return
if(F && F.upright)
user << "There is already a flag here."
return
var/obj/item/stack/flag/newflag = new src.type(T)
newflag.amount = 1
newflag.upright = 1
anchored = 1
newflag.name = newflag.singular_name
newflag.icon_state = "[newflag.base_state]_open"
newflag.visible_message("<b>[user]</b> plants [newflag] firmly in the ground.")
src.use(1)
+317 -393
View File
@@ -26,353 +26,333 @@
has_resources = 1
New()
. = ..()
/turf/simulated/mineral/New()
MineralSpread()
. = ..()
spawn(1)
var/turf/T
if((istype(get_step(src, NORTH), /turf/simulated/floor)) || (istype(get_step(src, NORTH), /turf/space)) || (istype(get_step(src, NORTH), /turf/simulated/shuttle/floor)))
T = get_step(src, NORTH)
if (T)
T.overlays += image('icons/turf/walls.dmi', "rock_side_s", layer=2)
if((istype(get_step(src, SOUTH), /turf/simulated/floor)) || (istype(get_step(src, SOUTH), /turf/space)) || (istype(get_step(src, SOUTH), /turf/simulated/shuttle/floor)))
T = get_step(src, SOUTH)
if (T)
T.overlays += image('icons/turf/walls.dmi', "rock_side_n", layer=2)
if((istype(get_step(src, EAST), /turf/simulated/floor)) || (istype(get_step(src, EAST), /turf/space)) || (istype(get_step(src, EAST), /turf/simulated/shuttle/floor)))
T = get_step(src, EAST)
if (T)
T.overlays += image('icons/turf/walls.dmi', "rock_side_w", layer=2)
if((istype(get_step(src, WEST), /turf/simulated/floor)) || (istype(get_step(src, WEST), /turf/space)) || (istype(get_step(src, WEST), /turf/simulated/shuttle/floor)))
T = get_step(src, WEST)
if (T)
T.overlays += image('icons/turf/walls.dmi', "rock_side_e", layer=2)
MineralSpread()
spawn(2)
var/list/step_overlays = list("s" = NORTH, "n" = SOUTH, "w" = EAST, "e" = WEST)
for(var/direction in step_overlays)
var/turf/turf_to_check = get_step(src,step_overlays[direction])
ex_act(severity)
switch(severity)
if(2.0)
if (prob(70))
mined_ore = 1 //some of the stuff gets blown up
GetDrilled()
if(1.0)
mined_ore = 2 //some of the stuff gets blown up
if(istype(turf_to_check,/turf/simulated/floor/plating/airless/asteroid))
var/turf/simulated/floor/plating/airless/asteroid/T = turf_to_check
T.updateMineralOverlays()
else if(istype(turf_to_check,/turf/space) || istype(turf_to_check,/turf/simulated/floor))
turf_to_check.overlays += image('icons/turf/walls.dmi', "rock_side_[direction]")
/turf/simulated/mineral/ex_act(severity)
switch(severity)
if(2.0)
if (prob(70))
mined_ore = 1 //some of the stuff gets blown up
GetDrilled()
if(1.0)
mined_ore = 2 //some of the stuff gets blown up
GetDrilled()
/turf/simulated/mineral/Bumped(AM)
. = ..()
if(istype(AM,/mob/living/carbon/human))
var/mob/living/carbon/human/H = AM
if((istype(H.l_hand,/obj/item/weapon/pickaxe)) && (!H.hand))
attackby(H.l_hand,H)
else if((istype(H.r_hand,/obj/item/weapon/pickaxe)) && H.hand)
attackby(H.r_hand,H)
else if(istype(AM,/mob/living/silicon/robot))
var/mob/living/silicon/robot/R = AM
if(istype(R.module_active,/obj/item/weapon/pickaxe))
attackby(R.module_active,R)
else if(istype(AM,/obj/mecha))
var/obj/mecha/M = AM
if(istype(M.selected,/obj/item/mecha_parts/mecha_equipment/tool/drill))
M.selected.action(src)
/turf/simulated/mineral/proc/MineralSpread()
if(mineral && mineral.spread)
for(var/trydir in cardinal)
if(prob(mineral.spread_chance))
var/turf/simulated/mineral/random/target_turf = get_step(src, trydir)
if(istype(target_turf) && !target_turf.mineral)
target_turf.mineral = mineral
target_turf.UpdateMineral()
target_turf.MineralSpread()
Bumped(AM)
. = ..()
if(istype(AM,/mob/living/carbon/human))
var/mob/living/carbon/human/H = AM
if((istype(H.l_hand,/obj/item/weapon/pickaxe)) && (!H.hand))
attackby(H.l_hand,H)
else if((istype(H.r_hand,/obj/item/weapon/pickaxe)) && H.hand)
attackby(H.r_hand,H)
/turf/simulated/mineral/proc/UpdateMineral()
if(!mineral)
name = "\improper Rock"
icon_state = "rock"
return
name = "\improper [mineral.display_name] deposit"
overlays.Cut()
overlays += "rock_[mineral.name]"
else if(istype(AM,/mob/living/silicon/robot))
var/mob/living/silicon/robot/R = AM
if(istype(R.module_active,/obj/item/weapon/pickaxe))
attackby(R.module_active,R)
//Not even going to touch this pile of spaghetti
/turf/simulated/mineral/attackby(obj/item/weapon/W as obj, mob/user as mob)
else if(istype(AM,/obj/mecha))
var/obj/mecha/M = AM
if(istype(M.selected,/obj/item/mecha_parts/mecha_equipment/tool/drill))
M.selected.action(src)
if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
usr << "\red You don't have the dexterity to do this!"
return
if (istype(W, /obj/item/device/core_sampler))
geologic_data.UpdateNearbyArtifactInfo(src)
var/obj/item/device/core_sampler/C = W
C.sample_item(src, user)
return
proc/MineralSpread()
if(mineral && mineral.spread)
for(var/trydir in cardinal)
if(prob(mineral.spread_chance))
var/turf/simulated/mineral/random/target_turf = get_step(src, trydir)
if(istype(target_turf) && !target_turf.mineral)
target_turf.mineral = mineral
target_turf.UpdateMineral()
target_turf.MineralSpread()
if (istype(W, /obj/item/device/depth_scanner))
var/obj/item/device/depth_scanner/C = W
C.scan_atom(user, src)
return
if (istype(W, /obj/item/device/measuring_tape))
var/obj/item/device/measuring_tape/P = W
user.visible_message("\blue[user] extends [P] towards [src].","\blue You extend [P] towards [src].")
if(do_after(user,25))
user << "\blue \icon[P] [src] has been excavated to a depth of [2*excavation_level]cm."
return
proc/UpdateMineral()
if(!mineral)
name = "\improper Rock"
icon_state = "rock"
return
name = "\improper [mineral.display_name] deposit"
overlays.Cut()
overlays += "rock_[mineral.name]"
//Not even going to touch this pile of spaghetti
attackby(obj/item/weapon/W as obj, mob/user as mob)
if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
usr << "\red You don't have the dexterity to do this!"
if (istype(W, /obj/item/weapon/pickaxe))
var/turf/T = user.loc
if (!( istype(T, /turf) ))
return
if (istype(W, /obj/item/device/core_sampler))
geologic_data.UpdateNearbyArtifactInfo(src)
var/obj/item/device/core_sampler/C = W
C.sample_item(src, user)
var/obj/item/weapon/pickaxe/P = W
if(last_act + P.digspeed > world.time)//prevents message spam
return
last_act = world.time
if (istype(W, /obj/item/device/depth_scanner))
var/obj/item/device/depth_scanner/C = W
C.scan_atom(user, src)
return
playsound(user, P.drill_sound, 20, 1)
if (istype(W, /obj/item/device/measuring_tape))
var/obj/item/device/measuring_tape/P = W
user.visible_message("\blue[user] extends [P] towards [src].","\blue You extend [P] towards [src].")
if(do_after(user,25))
user << "\blue \icon[P] [src] has been excavated to a depth of [2*excavation_level]cm."
return
//handle any archaeological finds we might uncover
var/fail_message
if(finds && finds.len)
var/datum/find/F = finds[1]
if(excavation_level + P.excavation_amount > F.excavation_required)
//Chance to destroy / extract any finds here
fail_message = ". <b>[pick("There is a crunching noise","[W] collides with some different rock","Part of the rock face crumbles away","Something breaks under [W]")]</b>"
if (istype(W, /obj/item/weapon/pickaxe))
var/turf/T = user.loc
if (!( istype(T, /turf) ))
return
user << "\red You start [P.drill_verb][fail_message ? fail_message : ""]."
var/obj/item/weapon/pickaxe/P = W
if(last_act + P.digspeed > world.time)//prevents message spam
return
last_act = world.time
if(fail_message && prob(90))
if(prob(25))
excavate_find(5, finds[1])
else if(prob(50))
finds.Remove(finds[1])
if(prob(50))
artifact_debris()
playsound(user, P.drill_sound, 20, 1)
if(do_after(user,P.digspeed))
user << "\blue You finish [P.drill_verb] the rock."
//handle any archaeological finds we might uncover
var/fail_message
if(finds && finds.len)
var/datum/find/F = finds[1]
if(excavation_level + P.excavation_amount > F.excavation_required)
//Chance to destroy / extract any finds here
fail_message = ", <b>[pick("there is a crunching noise","[W] collides with some different rock","part of the rock face crumbles away","something breaks under [W]")]</b>"
user << "\red You start [P.drill_verb][fail_message ? fail_message : ""]."
if(fail_message && prob(90))
if(prob(25))
excavate_find(5, finds[1])
else if(prob(50))
finds.Remove(finds[1])
if(prob(50))
artifact_debris()
if(do_after(user,P.digspeed))
user << "\blue You finish [P.drill_verb] the rock."
if(finds && finds.len)
var/datum/find/F = finds[1]
if(round(excavation_level + P.excavation_amount) == F.excavation_required)
//Chance to extract any items here perfectly, otherwise just pull them out along with the rock surrounding them
if(excavation_level + P.excavation_amount > F.excavation_required)
//if you can get slightly over, perfect extraction
excavate_find(100, F)
else
excavate_find(80, F)
else if(excavation_level + P.excavation_amount > F.excavation_required - F.clearance_range)
//just pull the surrounding rock out
excavate_find(0, F)
if( excavation_level + P.excavation_amount >= 100 )
//if players have been excavating this turf, leave some rocky debris behind
var/obj/structure/boulder/B
if(artifact_find)
if( excavation_level > 0 || prob(15) )
//boulder with an artifact inside
B = new(src)
if(artifact_find)
B.artifact_find = artifact_find
else
artifact_debris(1)
else if(prob(15))
//empty boulder
B = new(src)
if(B)
GetDrilled(0)
if(round(excavation_level + P.excavation_amount) == F.excavation_required)
//Chance to extract any items here perfectly, otherwise just pull them out along with the rock surrounding them
if(excavation_level + P.excavation_amount > F.excavation_required)
//if you can get slightly over, perfect extraction
excavate_find(100, F)
else
GetDrilled(1)
return
excavate_find(80, F)
excavation_level += P.excavation_amount
else if(excavation_level + P.excavation_amount > F.excavation_required - F.clearance_range)
//just pull the surrounding rock out
excavate_find(0, F)
//archaeo overlays
if(!archaeo_overlay && finds && finds.len)
var/datum/find/F = finds[1]
if(F.excavation_required <= excavation_level + F.view_range)
archaeo_overlay = "overlay_archaeo[rand(1,3)]"
overlays += archaeo_overlay
if( excavation_level + P.excavation_amount >= 100 )
//if players have been excavating this turf, leave some rocky debris behind
var/obj/structure/boulder/B
if(artifact_find)
if( excavation_level > 0 || prob(15) )
//boulder with an artifact inside
B = new(src)
if(artifact_find)
B.artifact_find = artifact_find
else
artifact_debris(1)
else if(prob(15))
//empty boulder
B = new(src)
//there's got to be a better way to do this
var/update_excav_overlay = 0
if(excavation_level >= 75)
if(excavation_level - P.excavation_amount < 75)
update_excav_overlay = 1
else if(excavation_level >= 50)
if(excavation_level - P.excavation_amount < 50)
update_excav_overlay = 1
else if(excavation_level >= 25)
if(excavation_level - P.excavation_amount < 25)
update_excav_overlay = 1
//update overlays displaying excavation level
if( !(excav_overlay && excavation_level > 0) || update_excav_overlay )
var/excav_quadrant = round(excavation_level / 25) + 1
excav_overlay = "overlay_excv[excav_quadrant]_[rand(1,3)]"
overlays += excav_overlay
/* Nope.
//extract pesky minerals while we're excavating
while(excavation_minerals.len && excavation_level > excavation_minerals[excavation_minerals.len])
DropMineral()
pop(excavation_minerals)
mineralAmt-- */
//drop some rocks
next_rock += P.excavation_amount * 10
while(next_rock > 100)
next_rock -= 100
var/obj/item/weapon/ore/O = new(src)
geologic_data.UpdateNearbyArtifactInfo(src)
O.geologic_data = geologic_data
else
return attack_hand(user)
proc/DropMineral()
if(!mineral)
return
var/obj/item/weapon/ore/O = new mineral.ore (src)
if(istype(O))
geologic_data.UpdateNearbyArtifactInfo(src)
O.geologic_data = geologic_data
return O
proc/GetDrilled(var/artifact_fail = 0)
//var/destroyed = 0 //used for breaking strange rocks
if (mineral && mineral.result_amount)
//if the turf has already been excavated, some of it's ore has been removed
for (var/i = 1 to mineral.result_amount - mined_ore)
DropMineral()
//destroyed artifacts have weird, unpleasant effects
//make sure to destroy them before changing the turf though
if(artifact_find && artifact_fail)
var/pain = 0
if(prob(50))
pain = 1
for(var/mob/living/M in range(src, 200))
M << "<font color='red'><b>[pick("A high pitched [pick("keening","wailing","whistle")]","A rumbling noise like [pick("thunder","heavy machinery")]")] somehow penetrates your mind before fading away!</b></font>"
if(pain)
flick("pain",M.pain)
if(prob(50))
M.adjustBruteLoss(5)
if(B)
GetDrilled(0)
else
flick("flash",M.flash)
if(prob(50))
M.Stun(5)
M.apply_effect(25, IRRADIATE)
GetDrilled(1)
return
var/turf/simulated/floor/plating/airless/asteroid/N = ChangeTurf(/turf/simulated/floor/plating/airless/asteroid)
N.fullUpdateMineralOverlays()
excavation_level += P.excavation_amount
if(rand(1,500) == 1)
visible_message("<span class='notice'>An old dusty crate was buried within!</span>")
new /obj/structure/closet/crate/secure/loot(src)
//archaeo overlays
if(!archaeo_overlay && finds && finds.len)
var/datum/find/F = finds[1]
if(F.excavation_required <= excavation_level + F.view_range)
archaeo_overlay = "overlay_archaeo[rand(1,3)]"
overlays += archaeo_overlay
//there's got to be a better way to do this
var/update_excav_overlay = 0
if(excavation_level >= 75)
if(excavation_level - P.excavation_amount < 75)
update_excav_overlay = 1
else if(excavation_level >= 50)
if(excavation_level - P.excavation_amount < 50)
update_excav_overlay = 1
else if(excavation_level >= 25)
if(excavation_level - P.excavation_amount < 25)
update_excav_overlay = 1
//update overlays displaying excavation level
if( !(excav_overlay && excavation_level > 0) || update_excav_overlay )
var/excav_quadrant = round(excavation_level / 25) + 1
excav_overlay = "overlay_excv[excav_quadrant]_[rand(1,3)]"
overlays += excav_overlay
//drop some rocks
next_rock += P.excavation_amount * 10
while(next_rock > 100)
next_rock -= 100
var/obj/item/weapon/ore/O = new(src)
geologic_data.UpdateNearbyArtifactInfo(src)
O.geologic_data = geologic_data
else
return attack_hand(user)
/turf/simulated/mineral/proc/DropMineral()
if(!mineral)
return
var/obj/item/weapon/ore/O = new mineral.ore (src)
if(istype(O))
geologic_data.UpdateNearbyArtifactInfo(src)
O.geologic_data = geologic_data
return O
/turf/simulated/mineral/proc/GetDrilled(var/artifact_fail = 0)
//var/destroyed = 0 //used for breaking strange rocks
if (mineral && mineral.result_amount)
//if the turf has already been excavated, some of it's ore has been removed
for (var/i = 1 to mineral.result_amount - mined_ore)
DropMineral()
//destroyed artifacts have weird, unpleasant effects
//make sure to destroy them before changing the turf though
if(artifact_find && artifact_fail)
var/pain = 0
if(prob(50))
pain = 1
for(var/mob/living/M in range(src, 200))
M << "<font color='red'><b>[pick("A high pitched [pick("keening","wailing","whistle")]","A rumbling noise like [pick("thunder","heavy machinery")]")] somehow penetrates your mind before fading away!</b></font>"
if(pain)
flick("pain",M.pain)
if(prob(50))
M.adjustBruteLoss(5)
else
flick("flash",M.flash)
if(prob(50))
M.Stun(5)
M.apply_effect(25, IRRADIATE)
var/turf/simulated/floor/plating/airless/asteroid/N = ChangeTurf(/turf/simulated/floor/plating/airless/asteroid)
for(var/i=0;i<rand(5);i++) N.overlay_detail = "asteroid[rand(0,9)]" //Add some rubble, you did just clear out a big chunk of rock.
N.updateMineralOverlays(1)
if(rand(1,500) == 1)
visible_message("<span class='notice'>An old dusty crate was buried within!</span>")
new /obj/structure/closet/crate/secure/loot(src)
proc/excavate_find(var/prob_clean = 0, var/datum/find/F)
//with skill and luck, players can cleanly extract finds
//otherwise, they come out inside a chunk of rock
var/obj/item/weapon/X
if(prob_clean)
X = new /obj/item/weapon/archaeological_find(src, new_item_type = F.find_type)
else
X = new /obj/item/weapon/ore/strangerock(src, inside_item_type = F.find_type)
geologic_data.UpdateNearbyArtifactInfo(src)
X:geologic_data = geologic_data
/turf/simulated/mineral/proc/excavate_find(var/prob_clean = 0, var/datum/find/F)
//with skill and luck, players can cleanly extract finds
//otherwise, they come out inside a chunk of rock
var/obj/item/weapon/X
if(prob_clean)
X = new /obj/item/weapon/archaeological_find(src, new_item_type = F.find_type)
else
X = new /obj/item/weapon/ore/strangerock(src, inside_item_type = F.find_type)
geologic_data.UpdateNearbyArtifactInfo(src)
X:geologic_data = geologic_data
//some find types delete the /obj/item/weapon/archaeological_find and replace it with something else, this handles when that happens
//yuck
var/display_name = "something"
if(!X)
X = last_find
if(X)
display_name = X.name
//some find types delete the /obj/item/weapon/archaeological_find and replace it with something else, this handles when that happens
//yuck
var/display_name = "something"
if(!X)
X = last_find
if(X)
display_name = X.name
//many finds are ancient and thus very delicate - luckily there is a specialised energy suspension field which protects them when they're being extracted
if(prob(F.prob_delicate))
var/obj/effect/suspension_field/S = locate() in src
if(!S || S.field_type != get_responsive_reagent(F.find_type))
if(X)
visible_message("\red<b>[pick("[display_name] crumbles away into dust","[display_name] breaks apart")].</b>")
del(X)
//many finds are ancient and thus very delicate - luckily there is a specialised energy suspension field which protects them when they're being extracted
if(prob(F.prob_delicate))
var/obj/effect/suspension_field/S = locate() in src
if(!S || S.field_type != get_responsive_reagent(F.find_type))
if(X)
visible_message("\red<b>[pick("[display_name] crumbles away into dust","[display_name] breaks apart")].</b>")
del(X)
finds.Remove(F)
finds.Remove(F)
proc/artifact_debris(var/severity = 0)
//cael's patented random limited drop componentized loot system!
//sky's patented not-fucking-retarded overhaul!
/turf/simulated/mineral/proc/artifact_debris(var/severity = 0)
//cael's patented random limited drop componentized loot system!
//sky's patented not-fucking-retarded overhaul!
//Give a random amount of loot from 1 to 3 or 5, varying on severity.
for(var/j in 1 to rand(1, 3 + max(min(severity, 1), 0) * 2))
switch(rand(1,7))
if(1)
var/obj/item/stack/rods/R = new(src)
R.amount = rand(5,25)
//Give a random amount of loot from 1 to 3 or 5, varying on severity.
for(var/j in 1 to rand(1, 3 + max(min(severity, 1), 0) * 2))
switch(rand(1,7))
if(1)
var/obj/item/stack/rods/R = new(src)
R.amount = rand(5,25)
if(2)
var/obj/item/stack/tile/R = new(src)
R.amount = rand(1,5)
if(2)
var/obj/item/stack/tile/R = new(src)
R.amount = rand(1,5)
if(3)
var/obj/item/stack/sheet/metal/R = new(src)
R.amount = rand(5,25)
if(3)
var/obj/item/stack/sheet/metal/R = new(src)
R.amount = rand(5,25)
if(4)
var/obj/item/stack/sheet/plasteel/R = new(src)
R.amount = rand(5,25)
if(4)
var/obj/item/stack/sheet/plasteel/R = new(src)
R.amount = rand(5,25)
if(5)
var/quantity = rand(1,3)
for(var/i=0, i<quantity, i++)
new /obj/item/weapon/shard(src)
if(5)
var/quantity = rand(1,3)
for(var/i=0, i<quantity, i++)
new /obj/item/weapon/shard(src)
if(6)
var/quantity = rand(1,3)
for(var/i=0, i<quantity, i++)
new /obj/item/weapon/shard/phoron(src)
if(7)
var/obj/item/stack/sheet/mineral/uranium/R = new(src)
R.amount = rand(5,25)
if(6)
var/quantity = rand(1,3)
for(var/i=0, i<quantity, i++)
new /obj/item/weapon/shard/phoron(src)
if(7)
var/obj/item/stack/sheet/mineral/uranium/R = new(src)
R.amount = rand(5,25)
/turf/simulated/mineral/random
name = "Mineral deposit"
var/mineralSpawnChanceList = list("Uranium" = 5, "Platinum" = 5, "Iron" = 35, "Coal" = 35, "Diamond" = 1, "Gold" = 5, "Silver" = 5, "Phoron" = 10)
var/mineralChance = 10 //means 10% chance of this plot changing to a mineral deposit
New()
if (prob(mineralChance) && !mineral)
var/mineral_name = pickweight(mineralSpawnChanceList) //temp mineral name
/turf/simulated/mineral/random/New()
if (prob(mineralChance) && !mineral)
var/mineral_name = pickweight(mineralSpawnChanceList) //temp mineral name
if(!name_to_mineral)
SetupMinerals()
if(!name_to_mineral)
SetupMinerals()
if (mineral_name && mineral_name in name_to_mineral)
mineral = name_to_mineral[mineral_name]
UpdateMineral()
. = ..()
if (mineral_name && mineral_name in name_to_mineral)
mineral = name_to_mineral[mineral_name]
UpdateMineral()
. = ..()
/turf/simulated/mineral/random/high_chance
mineralChance = 25
@@ -395,16 +375,11 @@
has_resources = 1
/turf/simulated/floor/plating/airless/asteroid/New()
var/proper_name = name
..()
name = proper_name
//if (prob(50))
// seedName = pick(list("1","2","3","4"))
// seedAmt = rand(1,4)
. = ..()
if(prob(20))
overlay_detail = "asteroid[rand(0,9)]"
spawn(2)
updateMineralOverlays()
/turf/simulated/floor/plating/airless/asteroid/ex_act(severity)
switch(severity)
@@ -422,58 +397,37 @@
if(!W || !user)
return 0
if ((istype(W, /obj/item/weapon/shovel)))
var/turf/T = user.loc
if (!( istype(T, /turf) ))
return
var/list/usable_tools = list(
/obj/item/weapon/shovel,
/obj/item/weapon/pickaxe/diamonddrill,
/obj/item/weapon/pickaxe/drill,
/obj/item/weapon/pickaxe/borgdrill
)
var/valid_tool
for(var/valid_type in usable_tools)
if(istype(W,valid_type))
valid_tool = 1
break
if(valid_tool)
if (dug)
user << "\red This area has already been dug"
return
user << "\red You start digging."
playsound(loc, 'sound/effects/rustle1.ogg', 50, 1) //russle sounds sounded better
sleep(40)
if ((user.loc == T && user.get_active_hand() == W))
user << "\blue You dug a hole."
gets_dug()
if ((istype(W,/obj/item/weapon/pickaxe/drill)))
var/turf/T = user.loc
if (!( istype(T, /turf) ))
return
if (dug)
user << "\red This area has already been dug"
if (!(istype(T)))
return
user << "\red You start digging."
playsound(loc, 'sound/effects/rustle1.ogg', 50, 1) //russle sounds sounded better
playsound(user.loc, 'sound/effects/rustle1.ogg', 50, 1)
sleep(30)
if ((user.loc == T && user.get_active_hand() == W))
user << "\blue You dug a hole."
gets_dug()
if(!do_after(user,40)) return
if ((istype(W,/obj/item/weapon/pickaxe/diamonddrill)) || (istype(W,/obj/item/weapon/pickaxe/borgdrill)))
var/turf/T = user.loc
if (!( istype(T, /turf) ))
return
user << "\blue You dug a hole."
gets_dug()
if (dug)
user << "\red This area has already been dug"
return
user << "\red You start digging."
playsound(loc, 'sound/effects/rustle1.ogg', 50, 1) //russle sounds sounded better
sleep(0)
if ((user.loc == T && user.get_active_hand() == W))
user << "\blue You dug a hole."
gets_dug()
if(istype(W,/obj/item/weapon/storage/bag/ore))
else if(istype(W,/obj/item/weapon/storage/bag/ore))
var/obj/item/weapon/storage/bag/ore/S = W
if(S.collection_mode)
for(var/obj/item/weapon/ore/O in contents)
@@ -491,71 +445,41 @@
return
/turf/simulated/floor/plating/airless/asteroid/proc/gets_dug()
if(dug)
return
new/obj/item/weapon/ore/glass(src)
new/obj/item/weapon/ore/glass(src)
new/obj/item/weapon/ore/glass(src)
new/obj/item/weapon/ore/glass(src)
new/obj/item/weapon/ore/glass(src)
for(var/i=0;i<(rand(3)+2);i++)
new/obj/item/weapon/ore/glass(src)
dug = 1
icon_plating = "asteroid_dug"
icon_state = "asteroid_dug"
return
/turf/simulated/floor/plating/airless/asteroid/proc/updateMineralOverlays()
/turf/simulated/floor/plating/airless/asteroid/proc/updateMineralOverlays(var/update_neighbors)
overlays.Cut()
spawn(2)
overlays.Cut()
var/list/step_overlays = list("n" = NORTH, "s" = SOUTH, "e" = EAST, "w" = WEST)
for(var/direction in step_overlays)
if(istype(get_step(src, NORTH), /turf/space))
overlays += image('icons/turf/floors.dmi', "asteroid_edge_north")
if(istype(get_step(src, SOUTH), /turf/space))
overlays += image('icons/turf/floors.dmi', "asteroid_edge_south")
if(istype(get_step(src, EAST), /turf/space))
overlays += image('icons/turf/floors.dmi', "asteroid_edge_east")
if(istype(get_step(src, WEST), /turf/space))
overlays += image('icons/turf/floors.dmi', "asteroid_edge_west")
if(istype(get_step(src, step_overlays[direction]), /turf/space))
overlays += image('icons/turf/floors.dmi', "asteroid_edge_[direction]")
if(overlay_detail) overlays += overlay_detail
if(istype(get_step(src, step_overlays[direction]), /turf/simulated/mineral))
overlays += image('icons/turf/walls.dmi', "rock_side_[direction]")
if(istype(get_step(src, NORTH), /turf/simulated/mineral))
overlays += image('icons/turf/walls.dmi', "rock_side_n")
if(istype(get_step(src, SOUTH), /turf/simulated/mineral))
overlays += image('icons/turf/walls.dmi', "rock_side_s", layer=6)
if(istype(get_step(src, EAST), /turf/simulated/mineral))
overlays += image('icons/turf/walls.dmi', "rock_side_e", layer=6)
if(istype(get_step(src, WEST), /turf/simulated/mineral))
overlays += image('icons/turf/walls.dmi', "rock_side_w", layer=6)
/turf/simulated/floor/plating/airless/asteroid/proc/fullUpdateMineralOverlays()
var/turf/simulated/floor/plating/airless/asteroid/A
if(istype(get_step(src, WEST), /turf/simulated/floor/plating/airless/asteroid))
A = get_step(src, WEST)
A.updateMineralOverlays()
if(istype(get_step(src, EAST), /turf/simulated/floor/plating/airless/asteroid))
A = get_step(src, EAST)
A.updateMineralOverlays()
if(istype(get_step(src, NORTH), /turf/simulated/floor/plating/airless/asteroid))
A = get_step(src, NORTH)
A.updateMineralOverlays()
if(istype(get_step(src, NORTHWEST), /turf/simulated/floor/plating/airless/asteroid))
A = get_step(src, NORTHWEST)
A.updateMineralOverlays()
if(istype(get_step(src, NORTHEAST), /turf/simulated/floor/plating/airless/asteroid))
A = get_step(src, NORTHEAST)
A.updateMineralOverlays()
if(istype(get_step(src, SOUTHWEST), /turf/simulated/floor/plating/airless/asteroid))
A = get_step(src, SOUTHWEST)
A.updateMineralOverlays()
if(istype(get_step(src, SOUTHEAST), /turf/simulated/floor/plating/airless/asteroid))
A = get_step(src, SOUTHEAST)
A.updateMineralOverlays()
if(istype(get_step(src, SOUTH), /turf/simulated/floor/plating/airless/asteroid))
A = get_step(src, SOUTH)
A.updateMineralOverlays()
updateMineralOverlays()
if(overlay_detail) overlays += overlay_detail
if(update_neighbors)
var/list/all_step_directions = list(NORTH,NORTHEAST,EAST,SOUTHEAST,SOUTH,SOUTHWEST,WEST,NORTHWEST)
for(var/direction in all_step_directions)
var/turf/simulated/floor/plating/airless/asteroid/A
if(istype(get_step(src, direction), /turf/simulated/floor/plating/airless/asteroid))
A = get_step(src, direction)
A.updateMineralOverlays()
/turf/simulated/floor/plating/airless/asteroid/Entered(atom/movable/M as mob|obj)
..()
@@ -301,6 +301,7 @@
var/mob/living/carbon/human/character = create_character() //creates the human and transfers vars and mind
job_master.EquipRank(character, rank, 1) //equips the human
UpdateFactionList(character)
EquipCustomItems(character)
//Find our spawning point.
@@ -330,6 +331,9 @@
if(character.mind.assigned_role != "Cyborg")
data_core.manifest_inject(character)
ticker.minds += character.mind//Cyborgs and AIs handle this in the transform proc. //TODO!!!!! ~Carn
//Grab some data from the character prefs for use in random news procs.
AnnounceArrival(character, rank, join_message)
else