mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-28 19:11:22 +00:00
@@ -4,6 +4,7 @@ var/global/datum/money_account/station_account
|
||||
var/global/list/datum/money_account/department_accounts = list()
|
||||
var/global/next_account_number = 0
|
||||
var/global/obj/machinery/account_database/centcomm_account_db
|
||||
var/global/datum/money_account/vendor_account
|
||||
|
||||
/proc/create_station_account()
|
||||
if(!station_account)
|
||||
@@ -99,6 +100,9 @@ var/global/obj/machinery/account_database/centcomm_account_db
|
||||
if(department_accounts.len == 0)
|
||||
for(var/department in station_departments)
|
||||
create_department_account(department)
|
||||
if(!vendor_account)
|
||||
create_department_account("Vendor")
|
||||
vendor_account = department_accounts["Vendor"]
|
||||
|
||||
if(!current_date_string)
|
||||
current_date_string = "[num2text(rand(1,31))] [pick("January","February","March","April","May","June","July","August","September","October","November","December")], 2557"
|
||||
|
||||
@@ -199,11 +199,11 @@
|
||||
T.time = worldtime2text()
|
||||
linked_account.transaction_log.Add(T)
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>You don't have that much money!<span>"
|
||||
usr << "\icon[src]<span class='warning'>You don't have that much money!</span>"
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>Unable to access account. Check security settings and try again.</span>"
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>EFTPOS is not connected to an account.<span>"
|
||||
usr << "\icon[src]<span class='warning'>EFTPOS is not connected to an account.</span>"
|
||||
else
|
||||
..()
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@ max volume of plasma storeable by the field = the total volume of a number of ti
|
||||
active_power_usage = 500 //multiplied by field strength
|
||||
var/cached_power_avail = 0
|
||||
directwired = 1
|
||||
anchored = 0
|
||||
|
||||
var/state = 0
|
||||
var/locked = 1
|
||||
|
||||
@@ -3,17 +3,19 @@
|
||||
name = "Fuel Injector"
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "injector0"
|
||||
|
||||
density = 1
|
||||
var/state = 2
|
||||
anchored = 0
|
||||
var/state = 0
|
||||
var/locked = 0
|
||||
req_access = list(access_engine)
|
||||
|
||||
var/obj/item/weapon/fuel_assembly/cur_assembly
|
||||
var/fuel_usage = 0.0001 //percentage of available fuel to use per cycle
|
||||
var/id_tag = "One"
|
||||
var/injecting = 0
|
||||
var/trying_to_swap_fuel = 0
|
||||
//
|
||||
req_access = list(access_engine)
|
||||
//
|
||||
|
||||
use_power = 1
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 500
|
||||
|
||||
@@ -1,55 +1,55 @@
|
||||
|
||||
//---------- actual energy field
|
||||
|
||||
/obj/effect/energy_field
|
||||
name = "energy field"
|
||||
desc = "Impenetrable field of energy, capable of blocking anything as long as it's active."
|
||||
icon = 'shielding.dmi'
|
||||
icon_state = "shieldsparkles"
|
||||
anchored = 1
|
||||
layer = 2.1
|
||||
density = 0
|
||||
invisibility = 101
|
||||
var/strength = 0
|
||||
|
||||
/obj/effect/energy_field/ex_act(var/severity)
|
||||
Stress(0.5 + severity)
|
||||
|
||||
/obj/effect/energy_field/bullet_act(var/obj/item/projectile/Proj)
|
||||
Stress(Proj.damage / 10)
|
||||
|
||||
/obj/effect/energy_field/meteorhit(obj/effect/meteor/M as obj)
|
||||
if(M)
|
||||
walk(M,0)
|
||||
Stress(2)
|
||||
|
||||
/obj/effect/energy_field/proc/Stress(var/severity)
|
||||
strength -= severity
|
||||
|
||||
//if we take too much damage, drop out - the generator will bring us back up if we have enough power
|
||||
if(strength < 1)
|
||||
invisibility = 101
|
||||
density = 0
|
||||
else if(strength >= 1)
|
||||
invisibility = 0
|
||||
density = 1
|
||||
|
||||
/obj/effect/energy_field/proc/Strengthen(var/severity)
|
||||
strength += severity
|
||||
|
||||
//if we take too much damage, drop out - the generator will bring us back up if we have enough power
|
||||
if(strength >= 1)
|
||||
invisibility = 0
|
||||
density = 1
|
||||
else if(strength < 1)
|
||||
invisibility = 101
|
||||
density = 0
|
||||
|
||||
/obj/effect/energy_field/CanPass(atom/movable/mover, turf/target, height=1.5, air_group = 0)
|
||||
//Purpose: Determines if the object (or airflow) can pass this atom.
|
||||
//Called by: Movement, airflow.
|
||||
//Inputs: The moving atom (optional), target turf, "height" and air group
|
||||
//Outputs: Boolean if can pass.
|
||||
|
||||
//return (!density || !height || air_group)
|
||||
return !density
|
||||
|
||||
//---------- actual energy field
|
||||
|
||||
/obj/effect/energy_field
|
||||
name = "energy field"
|
||||
desc = "Impenetrable field of energy, capable of blocking anything as long as it's active."
|
||||
icon = 'shielding.dmi'
|
||||
icon_state = "shieldsparkles"
|
||||
anchored = 1
|
||||
layer = 4.1 //just above mobs
|
||||
density = 0
|
||||
invisibility = 101
|
||||
var/strength = 0
|
||||
|
||||
/obj/effect/energy_field/ex_act(var/severity)
|
||||
Stress(0.5 + severity)
|
||||
|
||||
/obj/effect/energy_field/bullet_act(var/obj/item/projectile/Proj)
|
||||
Stress(Proj.damage / 10)
|
||||
|
||||
/obj/effect/energy_field/meteorhit(obj/effect/meteor/M as obj)
|
||||
if(M)
|
||||
walk(M,0)
|
||||
Stress(2)
|
||||
|
||||
/obj/effect/energy_field/proc/Stress(var/severity)
|
||||
strength -= severity
|
||||
|
||||
//if we take too much damage, drop out - the generator will bring us back up if we have enough power
|
||||
if(strength < 1)
|
||||
invisibility = 101
|
||||
density = 0
|
||||
else if(strength >= 1)
|
||||
invisibility = 0
|
||||
density = 1
|
||||
|
||||
/obj/effect/energy_field/proc/Strengthen(var/severity)
|
||||
strength += severity
|
||||
|
||||
//if we take too much damage, drop out - the generator will bring us back up if we have enough power
|
||||
if(strength >= 1)
|
||||
invisibility = 0
|
||||
density = 1
|
||||
else if(strength < 1)
|
||||
invisibility = 101
|
||||
density = 0
|
||||
|
||||
/obj/effect/energy_field/CanPass(atom/movable/mover, turf/target, height=1.5, air_group = 0)
|
||||
//Purpose: Determines if the object (or airflow) can pass this atom.
|
||||
//Called by: Movement, airflow.
|
||||
//Inputs: The moving atom (optional), target turf, "height" and air group
|
||||
//Outputs: Boolean if can pass.
|
||||
|
||||
//return (!density || !height || air_group)
|
||||
return !density
|
||||
|
||||
@@ -1,300 +1,318 @@
|
||||
/obj/hud/proc/amorph_hud(var/ui_style='screen1_old.dmi')
|
||||
|
||||
src.adding = list( )
|
||||
src.other = list( )
|
||||
src.intents = list( )
|
||||
src.mon_blo = list( )
|
||||
src.m_ints = list( )
|
||||
src.mov_int = list( )
|
||||
src.vimpaired = list( )
|
||||
src.darkMask = list( )
|
||||
src.intent_small_hud_objects = list( )
|
||||
|
||||
src.g_dither = new /obj/screen( src )
|
||||
src.g_dither.screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
src.g_dither.name = "Mask"
|
||||
src.g_dither.icon = ui_style
|
||||
src.g_dither.icon_state = "dither12g"
|
||||
src.g_dither.layer = 18
|
||||
src.g_dither.mouse_opacity = 0
|
||||
|
||||
src.alien_view = new /obj/screen(src)
|
||||
src.alien_view.screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
src.alien_view.name = "Alien"
|
||||
src.alien_view.icon = ui_style
|
||||
src.alien_view.icon_state = "alien"
|
||||
src.alien_view.layer = 18
|
||||
src.alien_view.mouse_opacity = 0
|
||||
|
||||
src.blurry = new /obj/screen( src )
|
||||
src.blurry.screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
src.blurry.name = "Blurry"
|
||||
src.blurry.icon = ui_style
|
||||
src.blurry.icon_state = "blurry"
|
||||
src.blurry.layer = 17
|
||||
src.blurry.mouse_opacity = 0
|
||||
|
||||
src.druggy = new /obj/screen( src )
|
||||
src.druggy.screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
src.druggy.name = "Druggy"
|
||||
src.druggy.icon = ui_style
|
||||
src.druggy.icon_state = "druggy"
|
||||
src.druggy.layer = 17
|
||||
src.druggy.mouse_opacity = 0
|
||||
|
||||
var/obj/screen/using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "act_intent"
|
||||
using.dir = SOUTHWEST
|
||||
using.icon = ui_style
|
||||
using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
|
||||
using.screen_loc = ui_acti
|
||||
using.layer = 20
|
||||
src.adding += using
|
||||
action_intent = using
|
||||
|
||||
//intent small hud objects
|
||||
var/icon/ico
|
||||
|
||||
ico = new(ui_style, "black")
|
||||
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
|
||||
ico.DrawBox(rgb(255,255,255,1),1,ico.Height()/2,ico.Width()/2,ico.Height())
|
||||
using = new /obj/screen( src )
|
||||
using.name = "help"
|
||||
using.icon = ico
|
||||
using.screen_loc = ui_acti
|
||||
using.layer = 21
|
||||
src.adding += using
|
||||
help_intent = using
|
||||
|
||||
ico = new(ui_style, "black")
|
||||
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
|
||||
ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,ico.Height()/2,ico.Width(),ico.Height())
|
||||
using = new /obj/screen( src )
|
||||
using.name = "disarm"
|
||||
using.icon = ico
|
||||
using.screen_loc = ui_acti
|
||||
using.layer = 21
|
||||
src.adding += using
|
||||
disarm_intent = using
|
||||
|
||||
ico = new(ui_style, "black")
|
||||
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
|
||||
ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,1,ico.Width(),ico.Height()/2)
|
||||
using = new /obj/screen( src )
|
||||
using.name = "grab"
|
||||
using.icon = ico
|
||||
using.screen_loc = ui_acti
|
||||
using.layer = 21
|
||||
src.adding += using
|
||||
grab_intent = using
|
||||
|
||||
ico = new(ui_style, "black")
|
||||
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
|
||||
ico.DrawBox(rgb(255,255,255,1),1,1,ico.Width()/2,ico.Height()/2)
|
||||
using = new /obj/screen( src )
|
||||
using.name = "harm"
|
||||
using.icon = ico
|
||||
using.screen_loc = ui_acti
|
||||
using.layer = 21
|
||||
src.adding += using
|
||||
hurt_intent = using
|
||||
|
||||
//end intent small hud objects
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "mov_intent"
|
||||
using.dir = SOUTHWEST
|
||||
using.icon = ui_style
|
||||
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
|
||||
using.screen_loc = ui_movi
|
||||
using.layer = 20
|
||||
src.adding += using
|
||||
move_intent = using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "drop"
|
||||
using.icon = ui_style
|
||||
using.icon_state = "act_drop"
|
||||
using.screen_loc = ui_dropbutton
|
||||
using.layer = 19
|
||||
src.adding += using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "r_hand"
|
||||
using.dir = WEST
|
||||
using.icon = ui_style
|
||||
using.icon_state = "hand_inactive"
|
||||
if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use
|
||||
using.icon_state = "hand_active"
|
||||
using.screen_loc = ui_rhand
|
||||
using.layer = 19
|
||||
src.r_hand_hud_object = using
|
||||
src.adding += using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "l_hand"
|
||||
using.dir = EAST
|
||||
using.icon = ui_style
|
||||
using.icon_state = "hand_inactive"
|
||||
if(mymob && mymob.hand) //This being 1 means the left hand is in use
|
||||
using.icon_state = "hand_active"
|
||||
using.screen_loc = ui_lhand
|
||||
using.layer = 19
|
||||
src.l_hand_hud_object = using
|
||||
src.adding += using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "hand"
|
||||
using.dir = SOUTH
|
||||
using.icon = ui_style
|
||||
using.icon_state = "hand1"
|
||||
using.screen_loc = ui_swaphand1
|
||||
using.layer = 19
|
||||
src.adding += using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "hand"
|
||||
using.dir = SOUTH
|
||||
using.icon = ui_style
|
||||
using.icon_state = "hand2"
|
||||
using.screen_loc = ui_swaphand2
|
||||
using.layer = 19
|
||||
src.adding += using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "mask"
|
||||
using.dir = NORTH
|
||||
using.icon = ui_style
|
||||
using.icon_state = "equip"
|
||||
using.screen_loc = ui_monkey_mask
|
||||
using.layer = 19
|
||||
src.adding += using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "back"
|
||||
using.dir = NORTHEAST
|
||||
using.icon = ui_style
|
||||
using.icon_state = "equip"
|
||||
using.screen_loc = ui_back
|
||||
using.layer = 19
|
||||
src.adding += using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = null
|
||||
using.icon = ui_style
|
||||
using.icon_state = "dither50"
|
||||
using.screen_loc = "1,1 to 5,15"
|
||||
using.layer = 17
|
||||
using.mouse_opacity = 0
|
||||
src.vimpaired += using
|
||||
using = new /obj/screen( src )
|
||||
using.name = null
|
||||
using.icon = ui_style
|
||||
using.icon_state = "dither50"
|
||||
using.screen_loc = "5,1 to 10,5"
|
||||
using.layer = 17
|
||||
using.mouse_opacity = 0
|
||||
src.vimpaired += using
|
||||
using = new /obj/screen( src )
|
||||
using.name = null
|
||||
using.icon = ui_style
|
||||
using.icon_state = "dither50"
|
||||
using.screen_loc = "6,11 to 10,15"
|
||||
using.layer = 17
|
||||
using.mouse_opacity = 0
|
||||
src.vimpaired += using
|
||||
using = new /obj/screen( src )
|
||||
using.name = null
|
||||
using.icon = ui_style
|
||||
using.icon_state = "dither50"
|
||||
using.screen_loc = "11,1 to 15,15"
|
||||
using.layer = 17
|
||||
using.mouse_opacity = 0
|
||||
src.vimpaired += using
|
||||
|
||||
mymob.throw_icon = new /obj/screen(null)
|
||||
mymob.throw_icon.icon = ui_style
|
||||
mymob.throw_icon.icon_state = "act_throw_off"
|
||||
mymob.throw_icon.name = "throw"
|
||||
mymob.throw_icon.screen_loc = ui_throw
|
||||
|
||||
mymob.oxygen = new /obj/screen( null )
|
||||
mymob.oxygen.icon = ui_style
|
||||
mymob.oxygen.icon_state = "oxy0"
|
||||
mymob.oxygen.name = "oxygen"
|
||||
mymob.oxygen.screen_loc = ui_oxygen
|
||||
|
||||
mymob.pressure = new /obj/screen( null )
|
||||
mymob.pressure.icon = ui_style
|
||||
mymob.pressure.icon_state = "pressure0"
|
||||
mymob.pressure.name = "pressure"
|
||||
mymob.pressure.screen_loc = ui_pressure
|
||||
|
||||
mymob.toxin = new /obj/screen( null )
|
||||
mymob.toxin.icon = ui_style
|
||||
mymob.toxin.icon_state = "tox0"
|
||||
mymob.toxin.name = "toxin"
|
||||
mymob.toxin.screen_loc = ui_toxin
|
||||
|
||||
mymob.internals = new /obj/screen( null )
|
||||
mymob.internals.icon = ui_style
|
||||
mymob.internals.icon_state = "internal0"
|
||||
mymob.internals.name = "internal"
|
||||
mymob.internals.screen_loc = ui_internal
|
||||
|
||||
mymob.fire = new /obj/screen( null )
|
||||
mymob.fire.icon = ui_style
|
||||
mymob.fire.icon_state = "fire0"
|
||||
mymob.fire.name = "fire"
|
||||
mymob.fire.screen_loc = ui_fire
|
||||
|
||||
mymob.bodytemp = new /obj/screen( null )
|
||||
mymob.bodytemp.icon = ui_style
|
||||
mymob.bodytemp.icon_state = "temp1"
|
||||
mymob.bodytemp.name = "body temperature"
|
||||
mymob.bodytemp.screen_loc = ui_temp
|
||||
|
||||
mymob.healths = new /obj/screen( null )
|
||||
mymob.healths.icon = ui_style
|
||||
mymob.healths.icon_state = "health0"
|
||||
mymob.healths.name = "health"
|
||||
mymob.healths.screen_loc = ui_health
|
||||
|
||||
mymob.pullin = new /obj/screen( null )
|
||||
mymob.pullin.icon = ui_style
|
||||
mymob.pullin.icon_state = "pull0"
|
||||
mymob.pullin.name = "pull"
|
||||
mymob.pullin.screen_loc = ui_pull
|
||||
|
||||
mymob.blind = new /obj/screen( null )
|
||||
mymob.blind.icon = ui_style
|
||||
mymob.blind.icon_state = "blackanimate"
|
||||
mymob.blind.name = " "
|
||||
mymob.blind.screen_loc = "1,1 to 15,15"
|
||||
mymob.blind.layer = 0
|
||||
mymob.blind.mouse_opacity = 0
|
||||
|
||||
mymob.flash = new /obj/screen( null )
|
||||
mymob.flash.icon = ui_style
|
||||
mymob.flash.icon_state = "blank"
|
||||
mymob.flash.name = "flash"
|
||||
mymob.flash.screen_loc = "1,1 to 15,15"
|
||||
mymob.flash.layer = 17
|
||||
|
||||
mymob.zone_sel = new /obj/screen/zone_sel( null )
|
||||
mymob.zone_sel.overlays = null
|
||||
mymob.zone_sel.overlays += image("icon" = 'zone_sel.dmi', "icon_state" = text("[]", mymob.zone_sel.selecting))
|
||||
|
||||
mymob.gun_setting_icon = new /obj/screen/gun/mode(null)
|
||||
|
||||
mymob.client.screen = null
|
||||
|
||||
//, mymob.i_select, mymob.m_select
|
||||
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.pressure, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.healths, mymob.pullin, mymob.blind, mymob.flash, mymob.gun_setting_icon) //, mymob.hands, mymob.rest, mymob.sleep, mymob.mach, mymob.hands, )
|
||||
mymob.client.screen += src.adding + src.other
|
||||
|
||||
//if(istype(mymob,/mob/living/carbon/monkey)) mymob.client.screen += src.mon_blo
|
||||
|
||||
return
|
||||
/obj/hud/proc/amorph_hud(var/ui_style='screen1_old.dmi')
|
||||
|
||||
src.adding = list( )
|
||||
src.other = list( )
|
||||
src.intents = list( )
|
||||
src.mon_blo = list( )
|
||||
src.m_ints = list( )
|
||||
src.mov_int = list( )
|
||||
src.vimpaired = list( )
|
||||
src.darkMask = list( )
|
||||
src.intent_small_hud_objects = list( )
|
||||
|
||||
src.g_dither = new /obj/screen( src )
|
||||
src.g_dither.screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
src.g_dither.name = "Mask"
|
||||
src.g_dither.icon = ui_style
|
||||
src.g_dither.icon_state = "dither12g"
|
||||
src.g_dither.layer = 18
|
||||
src.g_dither.mouse_opacity = 0
|
||||
|
||||
src.alien_view = new /obj/screen(src)
|
||||
src.alien_view.screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
src.alien_view.name = "Alien"
|
||||
src.alien_view.icon = ui_style
|
||||
src.alien_view.icon_state = "alien"
|
||||
src.alien_view.layer = 18
|
||||
src.alien_view.mouse_opacity = 0
|
||||
|
||||
src.blurry = new /obj/screen( src )
|
||||
src.blurry.screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
src.blurry.name = "Blurry"
|
||||
src.blurry.icon = ui_style
|
||||
src.blurry.icon_state = "blurry"
|
||||
src.blurry.layer = 17
|
||||
src.blurry.mouse_opacity = 0
|
||||
|
||||
src.druggy = new /obj/screen( src )
|
||||
src.druggy.screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
src.druggy.name = "Druggy"
|
||||
src.druggy.icon = ui_style
|
||||
src.druggy.icon_state = "druggy"
|
||||
src.druggy.layer = 17
|
||||
src.druggy.mouse_opacity = 0
|
||||
|
||||
var/obj/screen/using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "act_intent"
|
||||
using.dir = SOUTHWEST
|
||||
using.icon = ui_style
|
||||
using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
|
||||
using.screen_loc = ui_acti
|
||||
using.layer = 20
|
||||
src.adding += using
|
||||
action_intent = using
|
||||
|
||||
//intent small hud objects
|
||||
var/icon/ico
|
||||
|
||||
ico = new(ui_style, "black")
|
||||
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
|
||||
ico.DrawBox(rgb(255,255,255,1),1,ico.Height()/2,ico.Width()/2,ico.Height())
|
||||
using = new /obj/screen( src )
|
||||
using.name = "help"
|
||||
using.icon = ico
|
||||
using.screen_loc = ui_acti
|
||||
using.layer = 21
|
||||
src.adding += using
|
||||
help_intent = using
|
||||
|
||||
ico = new(ui_style, "black")
|
||||
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
|
||||
ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,ico.Height()/2,ico.Width(),ico.Height())
|
||||
using = new /obj/screen( src )
|
||||
using.name = "disarm"
|
||||
using.icon = ico
|
||||
using.screen_loc = ui_acti
|
||||
using.layer = 21
|
||||
src.adding += using
|
||||
disarm_intent = using
|
||||
|
||||
ico = new(ui_style, "black")
|
||||
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
|
||||
ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,1,ico.Width(),ico.Height()/2)
|
||||
using = new /obj/screen( src )
|
||||
using.name = "grab"
|
||||
using.icon = ico
|
||||
using.screen_loc = ui_acti
|
||||
using.layer = 21
|
||||
src.adding += using
|
||||
grab_intent = using
|
||||
|
||||
ico = new(ui_style, "black")
|
||||
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
|
||||
ico.DrawBox(rgb(255,255,255,1),1,1,ico.Width()/2,ico.Height()/2)
|
||||
using = new /obj/screen( src )
|
||||
using.name = "harm"
|
||||
using.icon = ico
|
||||
using.screen_loc = ui_acti
|
||||
using.layer = 21
|
||||
src.adding += using
|
||||
hurt_intent = using
|
||||
|
||||
//end intent small hud objects
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "mov_intent"
|
||||
using.dir = SOUTHWEST
|
||||
using.icon = ui_style
|
||||
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
|
||||
using.screen_loc = ui_movi
|
||||
using.layer = 20
|
||||
src.adding += using
|
||||
move_intent = using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "drop"
|
||||
using.icon = ui_style
|
||||
using.icon_state = "act_drop"
|
||||
using.screen_loc = ui_dropbutton
|
||||
using.layer = 19
|
||||
src.adding += using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "r_hand"
|
||||
using.dir = WEST
|
||||
using.icon = ui_style
|
||||
using.icon_state = "hand_inactive"
|
||||
if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use
|
||||
using.icon_state = "hand_active"
|
||||
using.screen_loc = ui_rhand
|
||||
using.layer = 19
|
||||
src.r_hand_hud_object = using
|
||||
src.adding += using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "l_hand"
|
||||
using.dir = EAST
|
||||
using.icon = ui_style
|
||||
using.icon_state = "hand_inactive"
|
||||
if(mymob && mymob.hand) //This being 1 means the left hand is in use
|
||||
using.icon_state = "hand_active"
|
||||
using.screen_loc = ui_lhand
|
||||
using.layer = 19
|
||||
src.l_hand_hud_object = using
|
||||
src.adding += using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "hand"
|
||||
using.dir = SOUTH
|
||||
using.icon = ui_style
|
||||
using.icon_state = "hand1"
|
||||
using.screen_loc = ui_swaphand1
|
||||
using.layer = 19
|
||||
src.adding += using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "hand"
|
||||
using.dir = SOUTH
|
||||
using.icon = ui_style
|
||||
using.icon_state = "hand2"
|
||||
using.screen_loc = ui_swaphand2
|
||||
using.layer = 19
|
||||
src.adding += using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "mask"
|
||||
using.dir = NORTH
|
||||
using.icon = ui_style
|
||||
using.icon_state = "equip"
|
||||
using.screen_loc = ui_monkey_mask
|
||||
using.layer = 19
|
||||
src.adding += using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = "back"
|
||||
using.dir = NORTHEAST
|
||||
using.icon = ui_style
|
||||
using.icon_state = "equip"
|
||||
using.screen_loc = ui_back
|
||||
using.layer = 19
|
||||
src.adding += using
|
||||
|
||||
using = new /obj/screen( src )
|
||||
using.name = null
|
||||
using.icon = ui_style
|
||||
using.icon_state = "dither50"
|
||||
using.screen_loc = "1,1 to 5,15"
|
||||
using.layer = 17
|
||||
using.mouse_opacity = 0
|
||||
src.vimpaired += using
|
||||
using = new /obj/screen( src )
|
||||
using.name = null
|
||||
using.icon = ui_style
|
||||
using.icon_state = "dither50"
|
||||
using.screen_loc = "5,1 to 10,5"
|
||||
using.layer = 17
|
||||
using.mouse_opacity = 0
|
||||
src.vimpaired += using
|
||||
using = new /obj/screen( src )
|
||||
using.name = null
|
||||
using.icon = ui_style
|
||||
using.icon_state = "dither50"
|
||||
using.screen_loc = "6,11 to 10,15"
|
||||
using.layer = 17
|
||||
using.mouse_opacity = 0
|
||||
src.vimpaired += using
|
||||
using = new /obj/screen( src )
|
||||
using.name = null
|
||||
using.icon = ui_style
|
||||
using.icon_state = "dither50"
|
||||
using.screen_loc = "11,1 to 15,15"
|
||||
using.layer = 17
|
||||
using.mouse_opacity = 0
|
||||
src.vimpaired += using
|
||||
|
||||
mymob.throw_icon = new /obj/screen(null)
|
||||
mymob.throw_icon.icon = ui_style
|
||||
mymob.throw_icon.icon_state = "act_throw_off"
|
||||
mymob.throw_icon.name = "throw"
|
||||
mymob.throw_icon.screen_loc = ui_throw
|
||||
|
||||
mymob.oxygen = new /obj/screen( null )
|
||||
mymob.oxygen.icon = ui_style
|
||||
mymob.oxygen.icon_state = "oxy0"
|
||||
mymob.oxygen.name = "oxygen"
|
||||
mymob.oxygen.screen_loc = ui_oxygen
|
||||
|
||||
mymob.pressure = new /obj/screen( null )
|
||||
mymob.pressure.icon = ui_style
|
||||
mymob.pressure.icon_state = "pressure0"
|
||||
mymob.pressure.name = "pressure"
|
||||
mymob.pressure.screen_loc = ui_pressure
|
||||
|
||||
mymob.toxin = new /obj/screen( null )
|
||||
mymob.toxin.icon = ui_style
|
||||
mymob.toxin.icon_state = "tox0"
|
||||
mymob.toxin.name = "toxin"
|
||||
mymob.toxin.screen_loc = ui_toxin
|
||||
|
||||
mymob.internals = new /obj/screen( null )
|
||||
mymob.internals.icon = ui_style
|
||||
mymob.internals.icon_state = "internal0"
|
||||
mymob.internals.name = "internal"
|
||||
mymob.internals.screen_loc = ui_internal
|
||||
|
||||
mymob.fire = new /obj/screen( null )
|
||||
mymob.fire.icon = ui_style
|
||||
mymob.fire.icon_state = "fire0"
|
||||
mymob.fire.name = "fire"
|
||||
mymob.fire.screen_loc = ui_fire
|
||||
|
||||
mymob.bodytemp = new /obj/screen( null )
|
||||
mymob.bodytemp.icon = ui_style
|
||||
mymob.bodytemp.icon_state = "temp1"
|
||||
mymob.bodytemp.name = "body temperature"
|
||||
mymob.bodytemp.screen_loc = ui_temp
|
||||
|
||||
mymob.healths = new /obj/screen( null )
|
||||
mymob.healths.icon = ui_style
|
||||
mymob.healths.icon_state = "health0"
|
||||
mymob.healths.name = "health"
|
||||
mymob.healths.screen_loc = ui_health
|
||||
|
||||
mymob.pullin = new /obj/screen( null )
|
||||
mymob.pullin.icon = ui_style
|
||||
mymob.pullin.icon_state = "pull0"
|
||||
mymob.pullin.name = "pull"
|
||||
mymob.pullin.screen_loc = ui_pull
|
||||
|
||||
mymob.blind = new /obj/screen( null )
|
||||
mymob.blind.icon = ui_style
|
||||
mymob.blind.icon_state = "blackanimate"
|
||||
mymob.blind.name = " "
|
||||
mymob.blind.screen_loc = "1,1 to 15,15"
|
||||
mymob.blind.layer = 0
|
||||
mymob.blind.mouse_opacity = 0
|
||||
|
||||
mymob.flash = new /obj/screen( null )
|
||||
mymob.flash.icon = ui_style
|
||||
mymob.flash.icon_state = "blank"
|
||||
mymob.flash.name = "flash"
|
||||
mymob.flash.screen_loc = "1,1 to 15,15"
|
||||
mymob.flash.layer = 17
|
||||
|
||||
mymob.zone_sel = new /obj/screen/zone_sel( null )
|
||||
mymob.zone_sel.overlays = null
|
||||
mymob.zone_sel.overlays += image("icon" = 'zone_sel.dmi', "icon_state" = text("[]", mymob.zone_sel.selecting))
|
||||
|
||||
//Handle the gun settings buttons
|
||||
mymob.gun_setting_icon = new /obj/screen/gun/mode(null)
|
||||
if (mymob.client)
|
||||
if (mymob.client.gun_mode) // If in aim mode, correct the sprite
|
||||
mymob.gun_setting_icon.dir = 2
|
||||
for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons
|
||||
if (G.target)
|
||||
mymob.item_use_icon = new /obj/screen/gun/item(null)
|
||||
if (mymob.client.target_can_click)
|
||||
mymob.item_use_icon.dir = 1
|
||||
src.adding += mymob.item_use_icon
|
||||
mymob.gun_move_icon = new /obj/screen/gun/move(null)
|
||||
if (mymob.client.target_can_move)
|
||||
mymob.gun_move_icon.dir = 1
|
||||
mymob.gun_run_icon = new /obj/screen/gun/run(null)
|
||||
if (mymob.client.target_can_run)
|
||||
mymob.gun_run_icon.dir = 1
|
||||
src.adding += mymob.gun_run_icon
|
||||
src.adding += mymob.gun_move_icon
|
||||
|
||||
mymob.client.screen = null
|
||||
|
||||
//, mymob.i_select, mymob.m_select
|
||||
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.pressure, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.healths, mymob.pullin, mymob.blind, mymob.flash, mymob.gun_setting_icon) //, mymob.hands, mymob.rest, mymob.sleep, mymob.mach, mymob.hands, )
|
||||
mymob.client.screen += src.adding + src.other
|
||||
|
||||
//if(istype(mymob,/mob/living/carbon/monkey)) mymob.client.screen += src.mon_blo
|
||||
|
||||
return
|
||||
|
||||
@@ -259,7 +259,7 @@ mob/living/parasite/meme/verb/Paralyze()
|
||||
set desc = "Prevents your host from using emote for a while."
|
||||
|
||||
if(!src.host) return
|
||||
if(!host.emote_allowed)
|
||||
if(!host.use_me)
|
||||
usr << "\red Your host already can't use body language.."
|
||||
return
|
||||
if(!use_points(250)) return
|
||||
@@ -271,11 +271,11 @@ mob/living/parasite/meme/verb/Paralyze()
|
||||
host << "\red Your body feels numb.. You lose your ability to use body language."
|
||||
usr << "\red Your host can't use body language anymore."
|
||||
|
||||
host.emote_allowed = 0
|
||||
host.use_me = 0
|
||||
|
||||
sleep(1200)
|
||||
|
||||
host.emote_allowed = 1
|
||||
host.use_me = 1
|
||||
host << "\red Your body has feeling again.."
|
||||
usr << "\red [host] can use body language again."
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 12 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.5 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 7.0 KiB |
@@ -1,405 +0,0 @@
|
||||
|
||||
// Basic transit tubes. Straight pieces, curved sections,
|
||||
// and basic splits/joins (no routing logic).
|
||||
// Mappers: you can use "Generate Instances from Icon-states"
|
||||
// to get the different pieces.
|
||||
/obj/structure/transit_tube
|
||||
icon = 'transit_tube.dmi'
|
||||
icon_state = "E-W"
|
||||
density = 1
|
||||
layer = 3.1
|
||||
anchored = 1.0
|
||||
var/list/tube_dirs = null
|
||||
var/exit_delay = 2
|
||||
var/enter_delay = 1
|
||||
|
||||
|
||||
// A place where tube pods stop, and people can get in or out.
|
||||
// Mappers: use "Generate Instances from Directions" for this
|
||||
// one.
|
||||
/obj/structure/transit_tube/station
|
||||
icon = 'transit_tube_station.dmi'
|
||||
icon_state = "closed"
|
||||
exit_delay = 2
|
||||
enter_delay = 3
|
||||
var/pod_moving = 0
|
||||
var/automatic_launch_time = 100
|
||||
|
||||
var/const/OPEN_DURATION = 6
|
||||
var/const/CLOSE_DURATION = 6
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube_pod
|
||||
icon = 'transit_tube_pod.dmi'
|
||||
icon_state = "pod"
|
||||
animate_movement = FORWARD_STEPS
|
||||
var/moving = 0
|
||||
var/datum/gas_mixture/air_contents
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube/station/New(loc)
|
||||
..(loc)
|
||||
|
||||
spawn(automatic_launch_time)
|
||||
launch_pod()
|
||||
|
||||
|
||||
/obj/structure/transit_tube/station/Bumped(mob/AM as mob|obj)
|
||||
if(!pod_moving && icon_state == "open" && istype(AM, /mob))
|
||||
for(var/obj/structure/transit_tube_pod/pod in loc)
|
||||
if(!pod.moving && pod.dir in directions())
|
||||
AM.loc = pod
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube/station/attack_hand(mob/user as mob)
|
||||
if(!pod_moving)
|
||||
for(var/obj/structure/transit_tube_pod/pod in loc)
|
||||
if(!pod.moving && pod.dir in directions())
|
||||
if(icon_state == "closed")
|
||||
open_animation()
|
||||
|
||||
else if(icon_state == "open")
|
||||
close_animation()
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube/station/proc/open_animation()
|
||||
if(icon_state == "closed")
|
||||
icon_state = "opening"
|
||||
spawn(OPEN_DURATION)
|
||||
if(icon_state == "opening")
|
||||
icon_state = "open"
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube/station/proc/close_animation()
|
||||
if(icon_state == "open")
|
||||
icon_state = "closing"
|
||||
spawn(CLOSE_DURATION)
|
||||
if(icon_state == "closing")
|
||||
icon_state = "closed"
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube/station/proc/launch_pod()
|
||||
for(var/obj/structure/transit_tube_pod/pod in loc)
|
||||
if(!pod.moving && pod.dir in directions())
|
||||
spawn(5)
|
||||
pod_moving = 1
|
||||
close_animation()
|
||||
sleep(CLOSE_DURATION + 2)
|
||||
if(icon_state == "closed" && pod)
|
||||
pod.follow_tube()
|
||||
|
||||
pod_moving = 0
|
||||
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube/proc/should_stop_pod(pod, from_dir)
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube/station/should_stop_pod(pod, from_dir)
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube/proc/pod_stopped(pod, from_dir)
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube/station/pod_stopped(obj/structure/transit_tube_pod/pod, from_dir)
|
||||
pod_moving = 1
|
||||
spawn(5)
|
||||
open_animation()
|
||||
sleep(OPEN_DURATION + 2)
|
||||
pod_moving = 0
|
||||
pod.mix_air()
|
||||
|
||||
if(automatic_launch_time)
|
||||
var/const/wait_step = 5
|
||||
var/i = 0
|
||||
while(i < automatic_launch_time)
|
||||
sleep(wait_step)
|
||||
i += wait_step
|
||||
|
||||
if(pod_moving || icon_state != "open")
|
||||
return
|
||||
|
||||
launch_pod()
|
||||
|
||||
|
||||
|
||||
// Returns a /list of directions this tube section can
|
||||
// connect to.
|
||||
/obj/structure/transit_tube/proc/directions()
|
||||
return tube_dirs
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube/proc/has_entrance(from_dir)
|
||||
from_dir = turn(from_dir, 180)
|
||||
|
||||
for(var/direction in directions())
|
||||
if(direction == from_dir)
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube/proc/has_exit(in_dir)
|
||||
for(var/direction in directions())
|
||||
if(direction == in_dir)
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
// Searches for an exit direction within 45 degrees of the
|
||||
// specified dir. Returns that direction, or 0 if none match.
|
||||
/obj/structure/transit_tube/proc/get_exit(in_dir)
|
||||
var/near_dir = 0
|
||||
var/in_dir_cw = turn(in_dir, -45)
|
||||
var/in_dir_ccw = turn(in_dir, 45)
|
||||
|
||||
for(var/direction in directions())
|
||||
if(direction == in_dir)
|
||||
return direction
|
||||
|
||||
else if(direction == in_dir_cw)
|
||||
near_dir = direction
|
||||
|
||||
else if(direction == in_dir_ccw)
|
||||
near_dir = direction
|
||||
|
||||
return near_dir
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube/proc/exit_delay(pod, to_dir)
|
||||
return exit_delay
|
||||
|
||||
/obj/structure/transit_tube/proc/enter_delay(pod, to_dir)
|
||||
return enter_delay
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube_pod/proc/follow_tube()
|
||||
if(moving)
|
||||
return
|
||||
|
||||
moving = 1
|
||||
|
||||
spawn()
|
||||
var/obj/structure/transit_tube/current_tube = null
|
||||
var/next_dir
|
||||
var/next_loc
|
||||
|
||||
for(var/obj/structure/transit_tube/tube in loc)
|
||||
if(tube.has_exit(dir))
|
||||
current_tube = tube
|
||||
break
|
||||
|
||||
while(current_tube)
|
||||
next_dir = current_tube.get_exit(dir)
|
||||
|
||||
if(!next_dir)
|
||||
break
|
||||
|
||||
sleep(current_tube.exit_delay(src, dir))
|
||||
next_loc = get_step(loc, next_dir)
|
||||
|
||||
current_tube = null
|
||||
for(var/obj/structure/transit_tube/tube in next_loc)
|
||||
if(tube.has_entrance(next_dir))
|
||||
current_tube = tube
|
||||
break
|
||||
|
||||
if(current_tube == null)
|
||||
dir = next_dir
|
||||
step(src, dir)
|
||||
break
|
||||
|
||||
sleep(current_tube.enter_delay(src, next_dir))
|
||||
dir = next_dir
|
||||
loc = next_loc
|
||||
|
||||
if(current_tube && current_tube.should_stop_pod(src, next_dir))
|
||||
current_tube.pod_stopped(src, dir)
|
||||
break
|
||||
|
||||
moving = 0
|
||||
|
||||
|
||||
|
||||
// HUGE HACK: Because the pod isn't a mecha, travelling through tubes over space
|
||||
// won't protect people from space.
|
||||
// This avoids editing an additional file, so that adding
|
||||
// tubes to a SS13 codebase is a simple as dropping this code file and the
|
||||
// required icon files somewhere where BYOND can find them.
|
||||
/mob/living/carbon/human/handle_environment(datum/gas_mixture/environment)
|
||||
if(!istype(loc, /obj/structure/transit_tube_pod))
|
||||
return ..(environment)
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube_pod/return_air()
|
||||
var/datum/gas_mixture/GM = new()
|
||||
GM.oxygen = MOLES_O2STANDARD * 2
|
||||
GM.nitrogen = MOLES_N2STANDARD
|
||||
GM.temperature = T20C
|
||||
return GM
|
||||
|
||||
// For now, copying what I found in an unused FEA file (and almost identical in a
|
||||
// used ZAS file). Means that assume_air and remove_air don't actually alter the
|
||||
// air contents.
|
||||
/obj/structure/transit_tube_pod/assume_air(datum/gas_mixture/giver)
|
||||
return 0
|
||||
|
||||
/obj/structure/transit_tube_pod/remove_air(amount)
|
||||
var/oxygen = MOLES_O2STANDARD
|
||||
var/carbon_dioxide = 0
|
||||
var/nitrogen = MOLES_N2STANDARD
|
||||
var/toxins = 0
|
||||
|
||||
var/datum/gas_mixture/GM = new()
|
||||
|
||||
var/sum = oxygen + carbon_dioxide + nitrogen + toxins
|
||||
if(sum>0)
|
||||
GM.oxygen = (oxygen/sum)*amount
|
||||
GM.carbon_dioxide = (carbon_dioxide/sum)*amount
|
||||
GM.nitrogen = (nitrogen/sum)*amount
|
||||
GM.toxins = (toxins/sum)*amount
|
||||
|
||||
GM.temperature = T20C
|
||||
GM.update_values() //Needed in ZAS to prevent suffocation. Not present in FEA. Comment/uncomment as nessecary.
|
||||
|
||||
return GM
|
||||
|
||||
|
||||
|
||||
// Called when a pod arrives at, and before a pod departs from a station,
|
||||
// giving it a chance to mix its internal air supply with the turf it is
|
||||
// currently on.
|
||||
/obj/structure/transit_tube_pod/proc/mix_air()
|
||||
//Needs to be implemented at some point
|
||||
|
||||
|
||||
|
||||
// When the player moves, check if the pos is currently stopped at a station.
|
||||
// if it is, check the direction. If the direction matches the direction of
|
||||
// the station, try to exit. If the direction matches one of the station's
|
||||
// tube directions, launch the pod in that direction.
|
||||
/obj/structure/transit_tube_pod/relaymove(mob/mob, direction)
|
||||
if(!moving && istype(mob, /mob) && mob.client)
|
||||
for(var/obj/structure/transit_tube/station/station in loc)
|
||||
if(!station.pod_moving && (dir in station.directions()))
|
||||
if(direction == station.dir)
|
||||
if(station.icon_state == "open")
|
||||
mob.loc = loc
|
||||
mob.client.Move(get_step(loc, direction), direction)
|
||||
|
||||
else
|
||||
station.open_animation()
|
||||
|
||||
else if(direction in station.directions())
|
||||
dir = direction
|
||||
station.launch_pod()
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube/New(loc)
|
||||
..(loc)
|
||||
|
||||
if(tube_dirs == null)
|
||||
init_dirs()
|
||||
|
||||
|
||||
|
||||
// Parse the icon_state into a list of directions.
|
||||
// This means that mappers can use Dream Maker's built in
|
||||
// "Generate Instances from Icon-states" option to get all
|
||||
// variations. Additionally, as a separate proc, sub-types
|
||||
// can handle it more intelligently.
|
||||
/obj/structure/transit_tube/proc/init_dirs()
|
||||
tube_dirs = parse_dirs(icon_state)
|
||||
|
||||
if(copytext(icon_state, 1, 3) == "D-")
|
||||
density = 0
|
||||
|
||||
|
||||
|
||||
// Tube station directions are simply 90 to either side of
|
||||
// the exit.
|
||||
/obj/structure/transit_tube/station/init_dirs()
|
||||
tube_dirs = list(turn(dir, 90), turn(dir, -90))
|
||||
|
||||
|
||||
|
||||
// Uses a list() to cache return values. Since they should
|
||||
// never be edited directly, all tubes with a certain
|
||||
// icon_state can just reference the same list. In theory,
|
||||
// reduces memory usage, and improves CPU cache usage.
|
||||
// In reality, I don't know if that is quite how BYOND works,
|
||||
// but it is probably safer to assume the existence of, and
|
||||
// rely on, a sufficiently smart compiler/optimizer.
|
||||
/obj/structure/transit_tube/proc/parse_dirs(text)
|
||||
var/global/list/direction_table = list()
|
||||
|
||||
if(text in direction_table)
|
||||
return direction_table[text]
|
||||
|
||||
var/list/split_text = stringsplit(text, "-")
|
||||
|
||||
// If the first token is D, the icon_state represents
|
||||
// a purely decorative tube, and doesn't actually
|
||||
// connect to anything.
|
||||
if(split_text[1] == "D")
|
||||
direction_table[text] = list()
|
||||
return null
|
||||
|
||||
var/list/directions = list()
|
||||
|
||||
for(var/text_part in split_text)
|
||||
var/direction = text2dir_extended(text_part)
|
||||
|
||||
if(direction > 0)
|
||||
directions += direction
|
||||
|
||||
direction_table[text] = directions
|
||||
return directions
|
||||
|
||||
|
||||
|
||||
// A copy of text2dir, extended to accept one and two letter
|
||||
// directions, and to clearly return 0 otherwise.
|
||||
/obj/structure/transit_tube/proc/text2dir_extended(direction)
|
||||
switch(uppertext(direction))
|
||||
if("NORTH", "N")
|
||||
return 1
|
||||
if("SOUTH", "S")
|
||||
return 2
|
||||
if("EAST", "E")
|
||||
return 4
|
||||
if("WEST", "W")
|
||||
return 8
|
||||
if("NORTHEAST", "NE")
|
||||
return 5
|
||||
if("NORTHWEST", "NW")
|
||||
return 9
|
||||
if("SOUTHEAST", "SE")
|
||||
return 6
|
||||
if("SOUTHWEST", "SW")
|
||||
return 10
|
||||
else
|
||||
return 0
|
||||
@@ -146,11 +146,12 @@ proc/listclearnulls(list/list)
|
||||
* Sorting
|
||||
*/
|
||||
|
||||
//Reverses the order of items in the list (Turning a stack into a queue)
|
||||
/proc/reverselist(var/list/input)
|
||||
var/list/output = new/list()
|
||||
for(var/A in input)
|
||||
output += A
|
||||
//Reverses the order of items in the list
|
||||
/proc/reverselist(list/L)
|
||||
var/list/output = list()
|
||||
if(L)
|
||||
for(var/i = L.len; i >= 1; i--)
|
||||
output += L[i]
|
||||
return output
|
||||
|
||||
//Randomize: Return the list in a random order
|
||||
@@ -320,4 +321,28 @@ proc/listclearnulls(list/list)
|
||||
for(var/T in L)
|
||||
if(istype(T, type))
|
||||
i++
|
||||
return i
|
||||
return i
|
||||
|
||||
//Don't use this on lists larger than half a dozen or so
|
||||
/proc/insertion_sort_numeric_list_ascending(var/list/L)
|
||||
//world.log << "ascending len input: [L.len]"
|
||||
var/list/out = list(pop(L))
|
||||
for(var/entry in L)
|
||||
if(isnum(entry))
|
||||
var/success = 0
|
||||
for(var/i=1, i<=out.len, i++)
|
||||
if(entry <= out[i])
|
||||
success = 1
|
||||
out.Insert(i, entry)
|
||||
break
|
||||
if(!success)
|
||||
out.Add(entry)
|
||||
|
||||
//world.log << " output: [out.len]"
|
||||
return out
|
||||
|
||||
/proc/insertion_sort_numeric_list_descending(var/list/L)
|
||||
//world.log << "descending len input: [L.len]"
|
||||
var/list/out = insertion_sort_numeric_list_ascending(L)
|
||||
//world.log << " output: [out.len]"
|
||||
return reverselist(out)
|
||||
|
||||
@@ -130,9 +130,10 @@ datum/shuttle_controller
|
||||
|
||||
start_location.move_contents_to(end_location, null, NORTH)
|
||||
|
||||
for(var/obj/machinery/door/D in world)
|
||||
for(var/obj/machinery/door/unpowered/D in world)
|
||||
if( get_area(D) == end_location )
|
||||
spawn(0)
|
||||
D.locked = 0
|
||||
D.open()
|
||||
|
||||
for(var/mob/M in end_location)
|
||||
@@ -291,9 +292,10 @@ datum/shuttle_controller
|
||||
// Just before it leaves, close the damn doors!
|
||||
if(timeleft == 2 || timeleft == 1)
|
||||
var/area/start_location = locate(/area/shuttle/escape/station)
|
||||
for(var/obj/machinery/door/D in start_location)
|
||||
for(var/obj/machinery/door/unpowered/shuttle/D in start_location)
|
||||
spawn(0)
|
||||
D.close()
|
||||
D.locked = 1
|
||||
|
||||
if(timeleft>0)
|
||||
return 0
|
||||
|
||||
@@ -75,6 +75,24 @@ datum/controller/vote
|
||||
choices[master_mode] += non_voters
|
||||
if(choices[master_mode] >= greatest_votes)
|
||||
greatest_votes = choices[master_mode]
|
||||
else if(mode == "crew_transfer")
|
||||
var/factor = 0.5
|
||||
switch(world.time / (10 * 60)) // minutes
|
||||
if(0 to 60)
|
||||
factor = 0.5
|
||||
if(61 to 120)
|
||||
factor = 0.8
|
||||
if(121 to 240)
|
||||
factor = 1
|
||||
if(241 to 300)
|
||||
factor = 1.2
|
||||
else
|
||||
factor = 1.4
|
||||
choices["Initiate Crew Transfer"] = round(choices["Initiate Crew Transfer"] * factor)
|
||||
world << "<font color='purple'>Crew Transfer Factor: [factor]</font>"
|
||||
greatest_votes = max(choices["Initiate Crew Transfer"], choices["Continue The Round"])
|
||||
|
||||
|
||||
//get all options with that many votes and return them in a list
|
||||
. = list()
|
||||
if(greatest_votes)
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
/datum/organ
|
||||
var/name = "organ"
|
||||
var/mob/living/carbon/human/owner = null
|
||||
var/list/datum/autopsy_data/autopsy_data = list()
|
||||
|
||||
var/list/trace_chemicals = list() // traces of chemicals in the organ,
|
||||
// links chemical IDs to number of ticks for which they'll stay in the blood
|
||||
|
||||
|
||||
///datum/organ/proc/process()
|
||||
// return 0
|
||||
|
||||
///datum/organ/proc/receive_chem(chemical as obj)
|
||||
// return 0
|
||||
|
||||
proc/process()
|
||||
return 0
|
||||
|
||||
proc/receive_chem(chemical as obj)
|
||||
return 0
|
||||
@@ -227,6 +227,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
containertype = /obj/structure/largecrate/lisa
|
||||
containername = "Corgi Crate"
|
||||
group = "Hydroponics"
|
||||
|
||||
/datum/supply_packs/hydroponics // -- Skie
|
||||
name = "Hydroponics Supply Crate"
|
||||
contains = list(/obj/item/weapon/reagent_containers/spray/plantbgone,
|
||||
@@ -343,7 +344,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
|
||||
/datum/supply_packs/virus
|
||||
name = "Virus crate"
|
||||
contains = list(/obj/item/weapon/reagent_containers/glass/bottle/flu_virion,
|
||||
/* contains = list(/obj/item/weapon/reagent_containers/glass/bottle/flu_virion,
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/cold,
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/epiglottis_virion,
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/liver_enhance_virion,
|
||||
@@ -354,7 +355,11 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/hullucigen_virion,
|
||||
/obj/item/weapon/storage/box/syringes,
|
||||
/obj/item/weapon/storage/box/beakers,
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/mutagen)
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/mutagen)*/
|
||||
contains = list(/obj/item/weapon/virusdish/random,
|
||||
/obj/item/weapon/virusdish/random,
|
||||
/obj/item/weapon/virusdish/random,
|
||||
/obj/item/weapon/virusdish/random)
|
||||
cost = 25
|
||||
containertype = "/obj/structure/closet/crate/secure"
|
||||
containername = "Virus crate"
|
||||
@@ -931,3 +936,18 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
containername = "Atmospheric circulator crate"
|
||||
group = "Engineering"
|
||||
access = access_engine
|
||||
|
||||
/datum/supply_packs/bee_keeper
|
||||
name = "Beekeeping Crate"
|
||||
contains = list(/obj/item/beezeez,
|
||||
/obj/item/beezeez,
|
||||
/obj/item/weapon/bee_net,
|
||||
/obj/item/apiary,
|
||||
/obj/item/queen_bee,
|
||||
/obj/item/queen_bee,
|
||||
/obj/item/queen_bee)
|
||||
cost = 20
|
||||
containertype = /obj/structure/closet/crate/hydroponics
|
||||
containername = "Beekeeping crate"
|
||||
access = access_hydroponics
|
||||
group = "Hydroponics"
|
||||
|
||||
@@ -550,6 +550,8 @@ its easier to just keep the beam vertical.
|
||||
|
||||
/atom/Click(location,control,params)
|
||||
//world << "atom.Click() on [src] by [usr] : src.type is [src.type]"
|
||||
if(!istype(src,/obj/item/weapon/gun))
|
||||
usr.last_target_click = world.time
|
||||
if(usr.client.buildmode)
|
||||
build_click(usr, usr.client.buildmode, location, control, params, src)
|
||||
return
|
||||
|
||||
@@ -1060,4 +1060,4 @@ message = replacetext(message, "ch", "chi")
|
||||
message = replacetext(message, "than", "sen")
|
||||
message = replacetext(message, ".", "")
|
||||
message = lowertext(message)
|
||||
*/
|
||||
*/
|
||||
|
||||
@@ -336,7 +336,7 @@ datum/objective/silence
|
||||
|
||||
|
||||
datum/objective/escape
|
||||
explanation_text = "Escape on the shuttle or an escape pod alive."
|
||||
explanation_text = "Escape on the shuttle or an escape pod alive and free."
|
||||
|
||||
|
||||
check_completion()
|
||||
@@ -353,6 +353,10 @@ datum/objective/escape
|
||||
return 0
|
||||
|
||||
if(istype(location, /turf/simulated/shuttle/floor4)) // Fails tratiors if they are in the shuttle brig -- Polymorph
|
||||
if(istype(owner.current, /mob/living/carbon))
|
||||
var/mob/living/carbon/C = owner.current
|
||||
if (!C.handcuffed)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
var/area/check_area = location.loc
|
||||
|
||||
@@ -78,6 +78,17 @@
|
||||
rev_mind.special_role = "Head Revolutionary"
|
||||
obj_count++
|
||||
|
||||
// Show each head revolutionary up to 3 candidates
|
||||
var/list/already_considered = list()
|
||||
for(var/i = 0, i < 2, i++)
|
||||
var/mob/rev_mob = rev_mind.current
|
||||
already_considered += rev_mob
|
||||
// Tell them about people they might want to contact.
|
||||
var/mob/living/carbon/human/M = get_nt_opposed()
|
||||
if(M && !(M.mind in head_revolutionaries) && !(M in already_considered))
|
||||
rev_mob << "We have received credible reports that [M.real_name] might be willing to help our cause. If you need assistance, consider contacting them."
|
||||
rev_mob.mind.store_memory("<b>Potential Collaborator</b>: [M.real_name]")
|
||||
|
||||
///////////////////////////////////////////////////
|
||||
//Deals with converting players to the revolution//
|
||||
///////////////////////////////////////////////////
|
||||
|
||||
@@ -45,6 +45,12 @@
|
||||
#define ui_borg_module "13:26,2:7"
|
||||
#define ui_borg_panel "14:28,2:7"
|
||||
|
||||
//Gun buttons
|
||||
#define ui_gun1 "13:26,3:7"
|
||||
#define ui_gun2 "14:28, 4:7"
|
||||
#define ui_gun3 "13:26,4:7"
|
||||
#define ui_gun_select "14:28,3:7"
|
||||
|
||||
//Upper-middle right (damage indicators)
|
||||
#define ui_toxin "14:28,13:27"
|
||||
#define ui_fire "14:28,12:25"
|
||||
|
||||
1
code/game/jobs/departments.dm
Normal file
1
code/game/jobs/departments.dm
Normal file
@@ -0,0 +1 @@
|
||||
var/list/departments = list("Command", "Medical", "Engineering", "Security", "Civilian", "Cargo")
|
||||
@@ -23,7 +23,7 @@
|
||||
var/obj/item/clothing/under/U = new /obj/item/clothing/under/rank/captain(H)
|
||||
U.hastie = new /obj/item/clothing/tie/medal/gold/captain(U)
|
||||
H.equip_to_slot_or_del(U, slot_w_uniform)
|
||||
//H.equip_to_slot_or_del(new /obj/item/device/pda/captain(H), slot_belt)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/pda/captain(H), slot_belt)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/suit/armor/captain(H), slot_wear_suit)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(H), slot_shoes)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/head/caphat(H), slot_head)
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
access = list(access_engine, access_engine_equip, access_tech_storage, access_maint_tunnels,
|
||||
access_teleporter, access_external_airlocks, access_atmospherics, access_emergency_storage, access_eva,
|
||||
access_heads, access_construction, access_sec_doors,
|
||||
access_ce, access_RC_announce, access_keycard_auth, access_tcomsat)
|
||||
access_ce, access_RC_announce, access_keycard_auth, access_tcomsat, access_ai_upload)
|
||||
minimal_access = list(access_engine, access_engine_equip, access_tech_storage, access_maint_tunnels,
|
||||
access_teleporter, access_external_airlocks, access_atmospherics, access_emergency_storage, access_eva,
|
||||
access_heads, access_construction, access_sec_doors,
|
||||
access_ce, access_RC_announce, access_keycard_auth, access_tcomsat)
|
||||
access_ce, access_RC_announce, access_keycard_auth, access_tcomsat, access_ai_upload)
|
||||
minimal_player_age = 7
|
||||
|
||||
|
||||
|
||||
@@ -174,7 +174,7 @@
|
||||
if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_med(H), slot_back)
|
||||
if(4) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/virologist(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/pda/medical(H), slot_belt)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/pda/viro(H), slot_belt)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/mask/surgical(H), slot_wear_mask)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(H), slot_shoes)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/labcoat/virologist(H), slot_wear_suit)
|
||||
@@ -215,4 +215,4 @@
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand)
|
||||
else
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
|
||||
return 1
|
||||
return 1
|
||||
|
||||
@@ -495,5 +495,5 @@ var/global/datum/controller/occupations/job_master
|
||||
level3++
|
||||
else level4++ //not selected
|
||||
|
||||
tmp_str += "HIGH=[level1]|MEDIUM=[level2]|LOW=[level3]|NEVER=[level4]|BANNED=[level5]|-|YOUNG=[level6]|-"
|
||||
tmp_str += "HIGH=[level1]|MEDIUM=[level2]|LOW=[level3]|NEVER=[level4]|BANNED=[level5]|YOUNG=[level6]|-"
|
||||
feedback_add_details("job_preferences",tmp_str)
|
||||
|
||||
@@ -45,12 +45,6 @@ var/const/ASSISTANT =(1<<13)
|
||||
|
||||
|
||||
var/list/assistant_occupations = list(
|
||||
"Assistant",
|
||||
"Atmospheric Technician",
|
||||
"Cargo Technician",
|
||||
"Chaplain",
|
||||
"Lawyer",
|
||||
"Librarian"
|
||||
)
|
||||
|
||||
|
||||
@@ -68,7 +62,6 @@ var/list/engineering_positions = list(
|
||||
"Chief Engineer",
|
||||
"Station Engineer",
|
||||
"Atmospheric Technician",
|
||||
"Roboticist"
|
||||
)
|
||||
|
||||
|
||||
@@ -85,7 +78,7 @@ var/list/science_positions = list(
|
||||
"Research Director",
|
||||
"Scientist",
|
||||
"Geneticist", //Part of both medical and science
|
||||
"Roboticist" //Part of both engineering and science
|
||||
"Roboticist"
|
||||
)
|
||||
|
||||
//BS12 EDIT
|
||||
|
||||
184
code/game/machinery/bees.dm
Normal file
184
code/game/machinery/bees.dm
Normal file
@@ -0,0 +1,184 @@
|
||||
|
||||
/obj/effect/bee
|
||||
name = "bees"
|
||||
icon = 'icons/obj/apiary_bees_etc.dmi'
|
||||
icon_state = "bees1"
|
||||
var/strength = 1
|
||||
var/feral = 0
|
||||
var/mut = 0
|
||||
var/toxic = 0
|
||||
var/turf/target_turf
|
||||
var/mob/target_mob
|
||||
var/obj/machinery/apiary/parent
|
||||
pass_flags = PASSGRILLE|PASSTABLE
|
||||
|
||||
/obj/effect/bee/New(loc, var/obj/machinery/apiary/new_parent)
|
||||
..()
|
||||
processing_objects.Add(src)
|
||||
parent = new_parent
|
||||
|
||||
/obj/effect/bee/Del()
|
||||
processing_objects.Remove(src)
|
||||
if(parent)
|
||||
parent.owned_bee_swarms.Remove(src)
|
||||
..()
|
||||
|
||||
/obj/effect/bee/process()
|
||||
|
||||
//if we're strong enough, sting some people
|
||||
var/overrun = strength - 5 + feral / 2
|
||||
if(prob(max( overrun * 10 + feral * 10, 0)))
|
||||
var/mob/living/carbon/human/M = locate() in src.loc
|
||||
if(M)
|
||||
var/sting_prob = 100
|
||||
var/obj/item/clothing/worn_suit = M.wear_suit
|
||||
var/obj/item/clothing/worn_helmet = M.head
|
||||
if(worn_suit)
|
||||
sting_prob -= worn_suit.armor["bio"]
|
||||
if(worn_helmet)
|
||||
sting_prob -= worn_helmet.armor["bio"]
|
||||
|
||||
if( prob(sting_prob) && (M.stat == CONSCIOUS || (M.stat == UNCONSCIOUS && prob(25))) )
|
||||
M.apply_damage(overrun / 2 + mut / 2, BRUTE)
|
||||
M.apply_damage(overrun / 2 + toxic / 2, TOX)
|
||||
M << "\red You have been stung!"
|
||||
M.flash_pain()
|
||||
|
||||
//if we're chasing someone, get a little bit angry
|
||||
if(target_mob && prob(10))
|
||||
feral++
|
||||
|
||||
//calm down a little bit
|
||||
var/move_prob = 40
|
||||
if(feral > 0)
|
||||
if(prob(feral * 10))
|
||||
feral -= 1
|
||||
else
|
||||
//if feral is less than 0, we're becalmed by smoke or steam
|
||||
if(feral < 0)
|
||||
feral += 1
|
||||
|
||||
if(target_mob)
|
||||
target_mob = null
|
||||
target_turf = null
|
||||
if(strength > 5)
|
||||
//calm down and spread out a little
|
||||
var/obj/effect/bee/B = new(get_turf(pick(orange(src,1))))
|
||||
B.strength = rand(1,5)
|
||||
src.strength -= B.strength
|
||||
if(src.strength <= 5)
|
||||
src.icon_state = "bees[src.strength]"
|
||||
B.icon_state = "bees[B.strength]"
|
||||
if(src.parent)
|
||||
B.parent = src.parent
|
||||
src.parent.owned_bee_swarms.Add(B)
|
||||
|
||||
//make some noise
|
||||
if(prob(0.5))
|
||||
src.visible_message("\blue [pick("Buzzzz.","Hmmmmm.","Bzzz.")]")
|
||||
|
||||
//smoke, water and steam calms us down
|
||||
var/calming = 0
|
||||
var/list/calmers = list(/obj/effect/effect/chem_smoke, /obj/effect/effect/water, /obj/effect/effect/foam, /obj/effect/effect/steam, /obj/effect/mist)
|
||||
|
||||
for(var/this_type in calmers)
|
||||
var/obj/effect/check_effect = locate() in src.loc
|
||||
if(check_effect.type == this_type)
|
||||
calming = 1
|
||||
break
|
||||
|
||||
if(calming)
|
||||
if(feral > 0)
|
||||
src.visible_message("\blue The bees calm down!")
|
||||
feral = -10
|
||||
target_mob = null
|
||||
target_turf = null
|
||||
|
||||
for(var/obj/effect/bee/B in src.loc)
|
||||
if(B == src)
|
||||
continue
|
||||
|
||||
if(feral > 0)
|
||||
src.strength += B.strength
|
||||
del(B)
|
||||
src.icon_state = "bees[src.strength]"
|
||||
if(strength > 5)
|
||||
icon_state = "bees_swarm"
|
||||
else if(prob(10))
|
||||
//make the other swarm of bees stronger, then move away
|
||||
var/total_bees = B.strength + src.strength
|
||||
if(total_bees < 10)
|
||||
B.strength = min(5, total_bees)
|
||||
src.strength = total_bees - B.strength
|
||||
|
||||
B.icon_state = "bees[B.strength]"
|
||||
if(src.strength <= 0)
|
||||
del(src)
|
||||
return
|
||||
src.icon_state = "bees[B.strength]"
|
||||
var/turf/simulated/floor/T = get_turf(get_step(src, pick(1,2,4,8)))
|
||||
density = 1
|
||||
if(T.Enter(src, get_turf(src)))
|
||||
src.loc = T
|
||||
density = 0
|
||||
break
|
||||
|
||||
if(target_mob)
|
||||
if(target_mob in view(src,7))
|
||||
target_turf = get_turf(target_mob)
|
||||
else
|
||||
for(var/mob/living/carbon/M in view(src,7))
|
||||
target_mob = M
|
||||
break
|
||||
|
||||
if(target_turf)
|
||||
var/turf/next_turf = get_step(src.loc, get_dir(src,target_turf))
|
||||
|
||||
//hacky, but w/e
|
||||
var/old_density = -1
|
||||
if(target_mob && get_dist(src, target_mob) <= 1)
|
||||
old_density = target_mob.density
|
||||
target_mob.density = 0
|
||||
density = 1
|
||||
if(next_turf.Enter(src, get_turf(src)))
|
||||
src.loc = next_turf
|
||||
density = 0
|
||||
if(src.loc == target_turf)
|
||||
target_turf = null
|
||||
if(target_mob && old_density != -1)
|
||||
target_mob.density = old_density
|
||||
else
|
||||
//find some flowers, harvest
|
||||
//angry bee swarms don't hang around
|
||||
if(feral > 0)
|
||||
move_prob = 60
|
||||
else if(feral < 0)
|
||||
move_prob = 0
|
||||
else
|
||||
var/obj/machinery/hydroponics/H = locate() in src.loc
|
||||
if(H)
|
||||
if(H.planted && !H.dead && H.myseed)
|
||||
move_prob = 1
|
||||
|
||||
//chance to wander around
|
||||
if(prob(move_prob))
|
||||
var/turf/simulated/floor/T = get_turf(get_step(src, pick(1,2,4,8)))
|
||||
density = 1
|
||||
if(T.Enter(src, get_turf(src)))
|
||||
src.loc = T
|
||||
density = 0
|
||||
|
||||
pixel_x = rand(-12,12)
|
||||
pixel_y = rand(-12,12)
|
||||
|
||||
if(!parent && prob(10))
|
||||
strength -= 1
|
||||
if(strength <= 0)
|
||||
del(src)
|
||||
else if(strength <= 5)
|
||||
icon_state = "bees[strength]"
|
||||
|
||||
//debugging
|
||||
/*icon_state = "[strength]"
|
||||
if(strength > 5)
|
||||
icon_state = "unknown"*/
|
||||
238
code/game/machinery/bees_apiary.dm
Normal file
238
code/game/machinery/bees_apiary.dm
Normal file
@@ -0,0 +1,238 @@
|
||||
//http://www.youtube.com/watch?v=-1GadTfGFvU
|
||||
//i could have done these as just an ordinary plant, but fuck it - there would have been too much snowflake code
|
||||
|
||||
/obj/machinery/apiary
|
||||
name = "apiary tray"
|
||||
icon = 'icons/obj/hydroponics.dmi'
|
||||
icon_state = "hydrotray3"
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/nutrilevel = 0
|
||||
var/yieldmod = 1
|
||||
var/mut = 1
|
||||
var/toxic = 0
|
||||
var/dead = 0
|
||||
var/health = -1
|
||||
var/maxhealth = 100
|
||||
var/lastcycle = 0
|
||||
var/cycledelay = 100
|
||||
var/harvestable_honey = 0
|
||||
var/beezeez = 0
|
||||
var/swarming = 0
|
||||
|
||||
var/bees_in_hive = 0
|
||||
var/list/owned_bee_swarms = list()
|
||||
|
||||
//overwrite this after it's created if the apiary needs a custom machinery sprite
|
||||
/obj/machinery/apiary/New()
|
||||
..()
|
||||
overlays += image('icons/obj/apiary_bees_etc.dmi', icon_state="apiary")
|
||||
|
||||
/obj/machinery/apiary/bullet_act(var/obj/item/projectile/Proj) //Works with the Somatoray to modify plant variables.
|
||||
if(istype(Proj ,/obj/item/projectile/energy/floramut))
|
||||
mut++
|
||||
else if(istype(Proj ,/obj/item/projectile/energy/florayield))
|
||||
if(!yieldmod)
|
||||
yieldmod += 1
|
||||
//world << "Yield increased by 1, from 0, to a total of [myseed.yield]"
|
||||
else if (prob(1/(yieldmod * yieldmod) *100))//This formula gives you diminishing returns based on yield. 100% with 1 yield, decreasing to 25%, 11%, 6, 4, 2...
|
||||
yieldmod += 1
|
||||
//world << "Yield increased by 1, to a total of [myseed.yield]"
|
||||
else
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/machinery/apiary/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(istype(O, /obj/item/queen_bee))
|
||||
if(health > 0)
|
||||
user << "\red There is already a queen in there."
|
||||
else
|
||||
health = 10
|
||||
nutrilevel += 10
|
||||
user.drop_item()
|
||||
del(O)
|
||||
user << "\blue You carefully insert the queen into [src], she gets busy making a hive."
|
||||
bees_in_hive = 0
|
||||
else if(istype(O, /obj/item/beezeez))
|
||||
beezeez += 100
|
||||
nutrilevel += 10
|
||||
user.drop_item()
|
||||
if(health > 0)
|
||||
user << "\blue You insert [O] into [src]. A relaxed humming appears to pick up."
|
||||
else
|
||||
user << "\blue You insert [O] into [src]. Now it just needs some bees."
|
||||
del(O)
|
||||
else if(istype(O, /obj/item/weapon/minihoe))
|
||||
if(health > 0)
|
||||
user << "\red <b>You begin to dislodge the apiary from the tray, the bees don't like that.</b>"
|
||||
angry_swarm(user)
|
||||
else
|
||||
user << "\blue You begin to dislodge the dead apiary from the tray."
|
||||
if(do_after(user, 50))
|
||||
new /obj/machinery/hydroponics(src.loc)
|
||||
new /obj/item/apiary(src.loc)
|
||||
user << "\red You dislodge the apiary from the tray."
|
||||
del(src)
|
||||
else if(istype(O, /obj/item/weapon/bee_net))
|
||||
var/obj/item/weapon/bee_net/N = O
|
||||
if(N.caught_bees > 0)
|
||||
user << "\blue You empty the bees into the apiary."
|
||||
bees_in_hive += N.caught_bees
|
||||
N.caught_bees = 0
|
||||
else
|
||||
user << "\blue There are no more bees in the net."
|
||||
else if(istype(O, /obj/item/weapon/reagent_containers/glass))
|
||||
var/obj/item/weapon/reagent_containers/glass/G = O
|
||||
if(harvestable_honey > 0)
|
||||
if(health > 0)
|
||||
user << "\red You begin to harvest the honey. The bees don't seem to like it."
|
||||
angry_swarm()
|
||||
else
|
||||
user << "\blue You begin to harvest the honey."
|
||||
if(do_after(user,50))
|
||||
G.reagents.add_reagent("honey",harvestable_honey)
|
||||
harvestable_honey = 0
|
||||
user << "\blue You successfully harvest the honey."
|
||||
else
|
||||
user << "\blue There is no honey left to harvest."
|
||||
else
|
||||
angry_swarm()
|
||||
..()
|
||||
|
||||
/obj/machinery/apiary/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(air_group || (height==0)) return 1
|
||||
|
||||
if(istype(mover) && mover.checkpass(PASSTABLE))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/machinery/apiary/process()
|
||||
|
||||
if(swarming > 0)
|
||||
swarming -= 1
|
||||
if(swarming <= 0)
|
||||
for(var/obj/effect/bee/B in src.loc)
|
||||
bees_in_hive += B.strength
|
||||
del(B)
|
||||
else if(bees_in_hive < 10)
|
||||
for(var/obj/effect/bee/B in src.loc)
|
||||
bees_in_hive += B.strength
|
||||
del(B)
|
||||
|
||||
if(world.time > (lastcycle + cycledelay))
|
||||
lastcycle = world.time
|
||||
if(health < 0)
|
||||
return
|
||||
|
||||
//magical bee formula
|
||||
if(beezeez > 0)
|
||||
beezeez -= 1
|
||||
|
||||
nutrilevel += 2
|
||||
health += 1
|
||||
toxic = max(0, toxic - 1)
|
||||
|
||||
//handle nutrients
|
||||
nutrilevel -= bees_in_hive / 10 + owned_bee_swarms.len / 5
|
||||
if(nutrilevel > 0)
|
||||
bees_in_hive += 1 * yieldmod
|
||||
if(health < maxhealth)
|
||||
health++
|
||||
else
|
||||
//nutrilevel is less than 1, so we're effectively subtracting here
|
||||
health += max(nutrilevel - 1, round(-health / 2))
|
||||
bees_in_hive += max(nutrilevel - 1, round(-bees_in_hive / 2))
|
||||
if(owned_bee_swarms.len)
|
||||
var/obj/effect/bee/B = pick(owned_bee_swarms)
|
||||
B.target_turf = get_turf(src)
|
||||
|
||||
//clear out some toxins
|
||||
if(toxic > 0)
|
||||
toxic -= 1
|
||||
health -= 1
|
||||
|
||||
if(health <= 0)
|
||||
return
|
||||
|
||||
//make a bit of honey
|
||||
if(harvestable_honey < 50)
|
||||
harvestable_honey += 0.5
|
||||
|
||||
//make some new bees
|
||||
if(bees_in_hive >= 10 && prob(bees_in_hive * 10))
|
||||
var/obj/effect/bee/B = new(get_turf(src), src)
|
||||
owned_bee_swarms.Add(B)
|
||||
B.mut = mut
|
||||
B.toxic = toxic
|
||||
bees_in_hive -= 1
|
||||
|
||||
//find some plants, harvest
|
||||
for(var/obj/machinery/hydroponics/H in view(7, src))
|
||||
if(H.planted && !H.dead && H.myseed && prob(owned_bee_swarms.len * 10))
|
||||
if(mut < H.mutmod - 1)
|
||||
mut = H.mutmod - 1
|
||||
else if(mut > H.mutmod - 1)
|
||||
H.mutmod = mut
|
||||
|
||||
//flowers give us pollen (nutrients)
|
||||
if(H.myseed.type == /obj/item/seeds/harebell || H.myseed.type == /obj/item/seeds/sunflowerseed)
|
||||
src.nutrilevel++
|
||||
H.nutrilevel++
|
||||
|
||||
//have a few beneficial effects on nearby plants
|
||||
if(prob(10))
|
||||
H.lastcycle -= 5
|
||||
if(prob(10))
|
||||
H.myseed.lifespan = max(initial(H.myseed.lifespan) * 1.5, H.myseed.lifespan + 1)
|
||||
if(prob(10))
|
||||
H.myseed.endurance = max(initial(H.myseed.endurance) * 1.5, H.myseed.endurance + 1)
|
||||
if(H.toxic && prob(10))
|
||||
H.toxic = min(0, H.toxic - 1)
|
||||
toxic++
|
||||
|
||||
/obj/machinery/apiary/proc/die()
|
||||
if(owned_bee_swarms.len)
|
||||
var/obj/effect/bee/B = pick(owned_bee_swarms)
|
||||
B.target_turf = get_turf(src)
|
||||
B.strength -= 1
|
||||
if(B.strength <= 0)
|
||||
del(B)
|
||||
else if(B.strength <= 5)
|
||||
B.icon_state = "bees[B.strength]"
|
||||
bees_in_hive = 0
|
||||
health = 0
|
||||
|
||||
/obj/machinery/apiary/proc/angry_swarm(var/mob/M)
|
||||
for(var/obj/effect/bee/B in owned_bee_swarms)
|
||||
B.feral = 50
|
||||
B.target_mob = M
|
||||
|
||||
swarming = 25
|
||||
|
||||
while(bees_in_hive > 0)
|
||||
var/spawn_strength = bees_in_hive
|
||||
if(bees_in_hive >= 5)
|
||||
spawn_strength = 6
|
||||
|
||||
var/obj/effect/bee/B = new(get_turf(src), src)
|
||||
B.target_mob = M
|
||||
B.strength = spawn_strength
|
||||
B.feral = 5
|
||||
B.mut = mut
|
||||
B.toxic = toxic
|
||||
bees_in_hive -= spawn_strength
|
||||
|
||||
/obj/machinery/apiary/verb/harvest_honeycomb()
|
||||
set src in oview(1)
|
||||
set name = "Harvest honeycomb"
|
||||
set category = "Object"
|
||||
|
||||
while(health > 15)
|
||||
health -= 15
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/honeycomb/H = new(src.loc)
|
||||
if(toxic > 0)
|
||||
H.reagents.add_reagent("toxin", toxic)
|
||||
|
||||
usr << "\blue You harvest the honeycomb from the hive. There is a wild buzzing!"
|
||||
angry_swarm(usr)
|
||||
122
code/game/machinery/bees_items.dm
Normal file
122
code/game/machinery/bees_items.dm
Normal file
@@ -0,0 +1,122 @@
|
||||
|
||||
/obj/item/queen_bee
|
||||
name = "queen bee packet"
|
||||
desc = "Place her into an apiary so she can get busy."
|
||||
icon = 'icons/obj/seeds.dmi'
|
||||
icon_state = "seed-kudzu"
|
||||
w_class = 1
|
||||
|
||||
/obj/item/weapon/bee_net
|
||||
name = "bee net"
|
||||
desc = "For catching rogue bees."
|
||||
icon = 'icons/obj/apiary_bees_etc.dmi'
|
||||
icon_state = "bee_net"
|
||||
item_state = "bedsheet"
|
||||
w_class = 3
|
||||
var/caught_bees = 0
|
||||
|
||||
/obj/item/weapon/bee_net/attack_self(mob/user as mob)
|
||||
var/turf/T = get_step(get_turf(user), user.dir)
|
||||
for(var/obj/effect/bee/B in T)
|
||||
if(B.feral < 0)
|
||||
caught_bees += B.strength
|
||||
del(B)
|
||||
user.visible_message("\blue [user] nets some bees.","\blue You net up some of the becalmed bees.")
|
||||
else
|
||||
user.visible_message("\red [user] swings at some bees, they don't seem to like it.","\red You swing at some bees, they don't seem to like it.")
|
||||
B.feral = 5
|
||||
B.target_mob = user
|
||||
|
||||
/obj/item/weapon/bee_net/verb/empty_bees()
|
||||
set src in usr
|
||||
set name = "Empty bee net"
|
||||
set category = "Object"
|
||||
var/mob/living/carbon/M
|
||||
if(iscarbon(usr))
|
||||
M = usr
|
||||
|
||||
while(caught_bees > 0)
|
||||
//release a few super massive swarms
|
||||
while(caught_bees > 5)
|
||||
var/obj/effect/bee/B = new(src.loc)
|
||||
B.feral = 5
|
||||
B.target_mob = M
|
||||
B.strength = 6
|
||||
B.icon_state = "bees_swarm"
|
||||
caught_bees -= 6
|
||||
|
||||
//what's left over
|
||||
var/obj/effect/bee/B = new(src.loc)
|
||||
B.strength = caught_bees
|
||||
B.icon_state = "bees[B.strength]"
|
||||
B.feral = 5
|
||||
B.target_mob = M
|
||||
|
||||
caught_bees = 0
|
||||
|
||||
/obj/item/apiary
|
||||
name = "moveable apiary"
|
||||
icon = 'icons/obj/apiary_bees_etc.dmi'
|
||||
icon_state = "apiary_item"
|
||||
item_state = "giftbag"
|
||||
w_class = 5
|
||||
|
||||
/obj/item/beezeez
|
||||
name = "bottle of BeezEez"
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle17"
|
||||
flags = FPRINT | TABLEPASS
|
||||
New()
|
||||
src.pixel_x = rand(-5.0, 5)
|
||||
src.pixel_y = rand(-5.0, 5)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/honeycomb
|
||||
name = "honeycomb"
|
||||
icon_state = "honeycomb"
|
||||
desc = "Dripping with sugary sweetness."
|
||||
|
||||
New()
|
||||
..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/honeycomb/New()
|
||||
..()
|
||||
reagents.add_reagent("honey",10)
|
||||
reagents.add_reagent("nutriment", 0.5)
|
||||
reagents.add_reagent("sugar", 2)
|
||||
bitesize = 2
|
||||
|
||||
/datum/reagent/honey
|
||||
name = "Honey"
|
||||
id = "honey"
|
||||
description = "A golden yellow syrup, loaded with sugary sweetness."
|
||||
color = "#FFFF00"
|
||||
|
||||
/obj/item/weapon/book/manual/hydroponics_beekeeping
|
||||
name = "The Ins and Outs of Apiculture - A Precise Art"
|
||||
icon_state ="bookHydroponicsBees"
|
||||
author = "Beekeeper Dave"
|
||||
title = "The Ins and Outs of Apiculture - A Precise Art"
|
||||
dat = {"<html>
|
||||
<head>
|
||||
<style>
|
||||
h1 {font-size: 18px; margin: 15px 0px 5px;}
|
||||
h2 {font-size: 15px; margin: 15px 0px 5px;}
|
||||
li {margin: 2px 0px 2px 15px;}
|
||||
ul {list-style: none; margin: 5px; padding: 0px;}
|
||||
ol {margin: 5px; padding: 0px 15px;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h3>Raising Bees</h3>
|
||||
|
||||
Bees are loving but fickle creatures. Don't mess with their hive and stay away from any clusters of them, and you'll avoid their ire.
|
||||
Sometimes, you'll need to dig around in there for those delicious sweeties though - in that case make sure you wear sealed protection gear
|
||||
and carry an extinguisher or smoker with you - any bees chasing you, once calmed down, can thusly be netted and returned safely to the hive.<br.
|
||||
<br>
|
||||
Beezeez is a cure-all panacea for them, but use it too much and the hive may grow to apocalyptic proportions. Other than that, bees are excellent pets
|
||||
for all the family and are excellent caretakers of one's garden: having a hive or two around will aid in the longevity and growth rate of plants,
|
||||
and aid them in fighting off poisons and disease.
|
||||
|
||||
</body>
|
||||
</html>
|
||||
"}
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
//Potential replacement for genetics revives or something I dunno (?)
|
||||
|
||||
#define CLONE_BIOMASS 150
|
||||
|
||||
/obj/machinery/clonepod
|
||||
anchored = 1
|
||||
name = "cloning pod"
|
||||
@@ -18,6 +20,7 @@
|
||||
var/mess = 0 //Need to clean out it if it's full of exploded clone.
|
||||
var/attempting = 0 //One clone attempt at a time thanks
|
||||
var/eject_wait = 0 //Don't eject them as soon as they are created fuckkk
|
||||
var/biomass = CLONE_BIOMASS
|
||||
|
||||
//The return of data disks?? Just for transferring between genetics machine/cloning machine.
|
||||
//TO-DO: Make the genetics machine accept them.
|
||||
@@ -133,7 +136,7 @@
|
||||
return 0
|
||||
|
||||
|
||||
src.heal_level = rand(60,100) //Randomizes what health the clone is when ejected
|
||||
src.heal_level = rand(10,40) //Randomizes what health the clone is when ejected
|
||||
src.attempting = 1 //One at a time!!
|
||||
src.locked = 1
|
||||
|
||||
@@ -150,8 +153,8 @@
|
||||
|
||||
src.icon_state = "pod_1"
|
||||
//Get the clone body ready
|
||||
H.adjustCloneLoss(src.heal_level + 100) //new damage var so you can't eject a clone early then stab them to abuse the current damage system --NeoFite
|
||||
H.adjustBrainLoss(heal_level)
|
||||
H.adjustCloneLoss(150) //new damage var so you can't eject a clone early then stab them to abuse the current damage system --NeoFite
|
||||
H.adjustBrainLoss(src.heal_level + 50 + rand(10, 30)) // The rand(10, 30) will come out as extra brain damage
|
||||
H.Paralyse(4)
|
||||
|
||||
//Here let's calculate their health so the pod doesn't immediately eject them!!!
|
||||
@@ -271,6 +274,12 @@
|
||||
src.locked = 0
|
||||
src.go_out()
|
||||
return
|
||||
else if (istype(W, /obj/item/weapon/reagent_containers/food/snacks/meat))
|
||||
user << "\blue \The [src] processes \the [W]."
|
||||
biomass += 50
|
||||
user.drop_item()
|
||||
del(W)
|
||||
return
|
||||
else
|
||||
..()
|
||||
|
||||
@@ -328,6 +337,9 @@
|
||||
domutcheck(src.occupant) //Waiting until they're out before possible monkeyizing.
|
||||
src.occupant.add_side_effect("Bad Stomach") // Give them an extra side-effect for free.
|
||||
src.occupant = null
|
||||
|
||||
src.biomass -= CLONE_BIOMASS
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/clonepod/proc/malfunction()
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
laws.add_inherent_law(M.newFreeFormLaw)
|
||||
usr << "Added a freeform law."
|
||||
|
||||
if(istype(P, /obj/item/device/mmi) || istype(P, /obj/item/device/posibrain))
|
||||
if(istype(P, /obj/item/device/mmi) || istype(P, /obj/item/device/mmi/posibrain))
|
||||
if(!P:brainmob)
|
||||
user << "\red Sticking an empty [P] into the frame would sort of defeat the purpose."
|
||||
return
|
||||
|
||||
@@ -194,6 +194,10 @@
|
||||
name = "Circuit board (Mining Shuttle)"
|
||||
build_path = "/obj/machinery/computer/mining_shuttle"
|
||||
origin_tech = "programming=2"
|
||||
/obj/item/weapon/circuitboard/research_shuttle
|
||||
name = "Circuit board (Research Shuttle)"
|
||||
build_path = "/obj/machinery/computer/research_shuttle"
|
||||
origin_tech = "programming=2"
|
||||
/obj/item/weapon/circuitboard/HolodeckControl // Not going to let people get this, but it's just here for future
|
||||
name = "Circuit board (Holodeck Control)"
|
||||
build_path = "/obj/machinery/computer/HolodeckControl"
|
||||
|
||||
@@ -202,6 +202,9 @@
|
||||
|
||||
dat += "Lock status: <a href='byond://?src=\ref[src];lock=1'>[src.scanner.locked ? "Locked" : "Unlocked"]</a><br>"
|
||||
|
||||
if (!isnull(src.pod1))
|
||||
dat += "Biomass: <i>[src.pod1.biomass]</i><br>"
|
||||
|
||||
// Database
|
||||
dat += "<h4>Database Functions</h4>"
|
||||
dat += "<a href='byond://?src=\ref[src];menu=2'>View Records</a><br>"
|
||||
@@ -243,8 +246,12 @@
|
||||
dat += "<br>" //Keeping a line empty for appearances I guess.
|
||||
|
||||
dat += {"<b>UI:</b> [src.active_record.fields["UI"]]<br>
|
||||
<b>SE:</b> [src.active_record.fields["SE"]]<br><br>
|
||||
<a href='byond://?src=\ref[src];clone=\ref[src.active_record]'>Clone</a><br>"}
|
||||
<b>SE:</b> [src.active_record.fields["SE"]]<br><br>"}
|
||||
|
||||
if(pod1 && pod1.biomass >= CLONE_BIOMASS)
|
||||
dat += {"<a href='byond://?src=\ref[src];clone=\ref[src.active_record]'>Clone</a><br>"}
|
||||
else
|
||||
dat += {"<b>Unsufficient biomass</b><br>"}
|
||||
|
||||
if(4)
|
||||
if (!src.active_record)
|
||||
@@ -378,6 +385,8 @@
|
||||
temp = "Error: No Clonepod detected."
|
||||
else if(pod1.occupant)
|
||||
temp = "Error: Clonepod is currently occupied."
|
||||
else if(pod1.biomass < CLONE_BIOMASS)
|
||||
temp = "Error: Not enough biomass."
|
||||
else if(pod1.mess)
|
||||
temp = "Error: Clonepod malfunction."
|
||||
else if(!config.revival_cloning)
|
||||
@@ -389,6 +398,7 @@
|
||||
del(C)
|
||||
menu = 1
|
||||
else
|
||||
|
||||
var/mob/selected = find_dead_player("[C.fields["ckey"]]")
|
||||
selected << 'chime.ogg' //probably not the best sound but I think it's reasonable
|
||||
var/answer = alert(selected,"Do you want to return to life?","Cloning","Yes","No")
|
||||
|
||||
@@ -122,15 +122,6 @@
|
||||
if(emergency_shuttle.online)
|
||||
post_status("shuttle")
|
||||
src.state = STATE_DEFAULT
|
||||
if("crewtransfer")
|
||||
src.state= STATE_DEFAULT
|
||||
if(src.authenticated)
|
||||
src.state = STATE_CREWTRANSFER
|
||||
if("crewtransfer2")
|
||||
if(src.authenticated)
|
||||
init_shift_change(usr) //key difference here
|
||||
if(emergency_shuttle.online)
|
||||
post_status("shuttle")
|
||||
if("cancelshuttle")
|
||||
src.state = STATE_DEFAULT
|
||||
if(src.authenticated)
|
||||
@@ -323,7 +314,6 @@
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=cancelshuttle'>Cancel Shuttle Call</A> \]"
|
||||
else
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=callshuttle'>Call Emergency Shuttle</A> \]"
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=crewtransfer'>Initiate Crew Transfer</A> \]"
|
||||
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=status'>Set Status Display</A> \]"
|
||||
else
|
||||
@@ -331,8 +321,6 @@
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=messagelist'>Message List</A> \]"
|
||||
if(STATE_CALLSHUTTLE)
|
||||
dat += "Are you sure you want to call the shuttle? \[ <A HREF='?src=\ref[src];operation=callshuttle2'>OK</A> | <A HREF='?src=\ref[src];operation=main'>Cancel</A> \]"
|
||||
if(STATE_CREWTRANSFER) // this is the shiftchage screen.
|
||||
dat += "Are you sure you want to initiate a crew transfer? This will call the shuttle. \[ <a HREF='?src=\ref[src];operation=crewtransfer2'>OK</a> | <A HREF='?src=\ref[src];operation=main'>Cancel</A> \]"
|
||||
if(STATE_CANCELSHUTTLE)
|
||||
dat += "Are you sure you want to cancel the shuttle? \[ <A HREF='?src=\ref[src];operation=cancelshuttle2'>OK</A> | <A HREF='?src=\ref[src];operation=main'>Cancel</A> \]"
|
||||
if(STATE_MESSAGELIST)
|
||||
|
||||
@@ -847,6 +847,8 @@ About the new airlock wires panel:
|
||||
if(src.shock(user, 100))
|
||||
return
|
||||
|
||||
// No. -- cib
|
||||
/**
|
||||
if(ishuman(user) && prob(40) && src.density)
|
||||
var/mob/living/carbon/human/H = user
|
||||
if(H.getBrainLoss() >= 60)
|
||||
@@ -861,6 +863,7 @@ About the new airlock wires panel:
|
||||
else
|
||||
visible_message("\red [user] headbutts the airlock. Good thing they're wearing a helmet.")
|
||||
return
|
||||
**/
|
||||
|
||||
if(src.p_open)
|
||||
user.set_machine(src)
|
||||
|
||||
@@ -6,66 +6,58 @@
|
||||
icon_state = "flood00"
|
||||
density = 1
|
||||
var/on = 0
|
||||
var/obj/item/weapon/cell/cell = null
|
||||
var/use = 1
|
||||
var/obj/item/weapon/cell/high/cell = null
|
||||
var/use = 5
|
||||
var/unlocked = 0
|
||||
var/open = 0
|
||||
var/brightness_on = 999 //can't remember what the maxed out value is
|
||||
|
||||
/obj/machinery/floodlight/New()
|
||||
src.cell = new(src)
|
||||
..()
|
||||
|
||||
/obj/machinery/floodlight/proc/updateicon()
|
||||
icon_state = "flood[open ? "o" : ""][open && cell ? "b" : ""]0[on]"
|
||||
|
||||
/obj/machinery/floodlight/process()
|
||||
if (!on)
|
||||
if (luminosity)
|
||||
if(on)
|
||||
cell.charge -= use
|
||||
if(cell.charge <= 0)
|
||||
on = 0
|
||||
updateicon()
|
||||
//sd_SetLuminosity(0)
|
||||
return
|
||||
|
||||
if(!luminosity && cell && cell.charge > 0)
|
||||
//sd_SetLuminosity(10)
|
||||
updateicon()
|
||||
|
||||
if(!cell && luminosity)
|
||||
on = 0
|
||||
updateicon()
|
||||
//sd_SetLuminosity(0)
|
||||
return
|
||||
|
||||
cell.charge -= use
|
||||
|
||||
if(cell.charge <= 0 && luminosity)
|
||||
on = 0
|
||||
updateicon()
|
||||
//sd_SetLuminosity(0)
|
||||
return
|
||||
SetLuminosity(0)
|
||||
src.visible_message("<span class='warning'>[src] shuts down due to lack of power!</span>")
|
||||
return
|
||||
|
||||
/obj/machinery/floodlight/attack_hand(mob/user as mob)
|
||||
if(open && cell)
|
||||
cell.loc = usr
|
||||
cell.layer = 20
|
||||
if (user.hand )
|
||||
user.l_hand = cell
|
||||
if(ishuman(user))
|
||||
if(!user.get_active_hand())
|
||||
user.put_in_hands(cell)
|
||||
cell.loc = user.loc
|
||||
else
|
||||
user.r_hand = cell
|
||||
cell.loc = loc
|
||||
|
||||
cell.add_fingerprint(user)
|
||||
updateicon()
|
||||
cell.updateicon()
|
||||
|
||||
src.cell = null
|
||||
user << "You remove the power cell"
|
||||
updateicon()
|
||||
return
|
||||
|
||||
if(on)
|
||||
on = 0
|
||||
user << "You turn off the light"
|
||||
user << "\blue You turn off the light"
|
||||
SetLuminosity(0)
|
||||
else
|
||||
if(!cell)
|
||||
return
|
||||
if(cell.charge <= 0)
|
||||
return
|
||||
on = 1
|
||||
user << "You turn on the light"
|
||||
user << "\blue You turn on the light"
|
||||
SetLuminosity(brightness_on)
|
||||
|
||||
updateicon()
|
||||
|
||||
@@ -101,10 +93,3 @@
|
||||
cell = W
|
||||
user << "You insert the power cell."
|
||||
updateicon()
|
||||
|
||||
/obj/machinery/floodlight/New()
|
||||
src.cell = new/obj/item/weapon/cell(src)
|
||||
cell.maxcharge = 1000
|
||||
cell.charge = 1000
|
||||
..()
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#define SPEED_MULTIPLIER 0.5
|
||||
#define HYDRO_SPEED_MULTIPLIER 0.25
|
||||
|
||||
/obj/machinery/hydroponics
|
||||
name = "hydroponics tray"
|
||||
@@ -38,6 +38,14 @@
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/machinery/hydroponics/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(air_group || (height==0)) return 1
|
||||
|
||||
if(istype(mover) && mover.checkpass(PASSTABLE))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
obj/machinery/hydroponics/process()
|
||||
|
||||
if(myseed && (myseed.loc != src))
|
||||
@@ -47,42 +55,42 @@ obj/machinery/hydroponics/process()
|
||||
lastcycle = world.time
|
||||
if(planted && !dead)
|
||||
// Advance age
|
||||
age += 1 * SPEED_MULTIPLIER
|
||||
age += 1 * HYDRO_SPEED_MULTIPLIER
|
||||
|
||||
//Nutrients//////////////////////////////////////////////////////////////
|
||||
// Nutrients deplete slowly
|
||||
if(nutrilevel > 0)
|
||||
if(prob(50))
|
||||
nutrilevel -= 1 * SPEED_MULTIPLIER
|
||||
nutrilevel -= 1 * HYDRO_SPEED_MULTIPLIER
|
||||
|
||||
// Lack of nutrients hurts non-weeds
|
||||
if(nutrilevel <= 0 && myseed.plant_type != 1)
|
||||
health -= rand(1,3) * SPEED_MULTIPLIER
|
||||
health -= rand(1,3) * HYDRO_SPEED_MULTIPLIER
|
||||
|
||||
//Water//////////////////////////////////////////////////////////////////
|
||||
// Drink random amount of water
|
||||
waterlevel = max(waterlevel - rand(1,6) * SPEED_MULTIPLIER, 0)
|
||||
waterlevel = max(waterlevel - rand(1,6) * HYDRO_SPEED_MULTIPLIER, 0)
|
||||
|
||||
// If the plant is dry, it loses health pretty fast, unless mushroom
|
||||
if(waterlevel <= 10 && myseed.plant_type != 2)
|
||||
health -= rand(0,1) * SPEED_MULTIPLIER
|
||||
health -= rand(0,1) * HYDRO_SPEED_MULTIPLIER
|
||||
if(waterlevel <= 0)
|
||||
health -= rand(0,2) * SPEED_MULTIPLIER
|
||||
health -= rand(0,2) * HYDRO_SPEED_MULTIPLIER
|
||||
|
||||
// Sufficient water level and nutrient level = plant healthy
|
||||
else if(waterlevel > 10 && nutrilevel > 0)
|
||||
health += rand(1,2) * SPEED_MULTIPLIER
|
||||
health += rand(1,2) * HYDRO_SPEED_MULTIPLIER
|
||||
if(prob(5)) //5 percent chance the weed population will increase
|
||||
weedlevel += 1 * SPEED_MULTIPLIER
|
||||
weedlevel += 1 * HYDRO_SPEED_MULTIPLIER
|
||||
//Toxins/////////////////////////////////////////////////////////////////
|
||||
|
||||
// Too much toxins cause harm, but when the plant drinks the contaiminated water, the toxins disappear slowly
|
||||
if(toxic >= 40 && toxic < 80)
|
||||
health -= 1 * SPEED_MULTIPLIER
|
||||
toxic -= rand(1,10) * SPEED_MULTIPLIER
|
||||
health -= 1 * HYDRO_SPEED_MULTIPLIER
|
||||
toxic -= rand(1,10) * HYDRO_SPEED_MULTIPLIER
|
||||
else if(toxic >= 80) // I don't think it ever gets here tbh unless above is commented out
|
||||
health -= 3 * SPEED_MULTIPLIER
|
||||
toxic -= rand(1,10) * SPEED_MULTIPLIER
|
||||
health -= 3 * HYDRO_SPEED_MULTIPLIER
|
||||
toxic -= rand(1,10) * HYDRO_SPEED_MULTIPLIER
|
||||
else if(toxic < 0) // Make sure it won't go overoboard
|
||||
toxic = 0
|
||||
|
||||
@@ -93,11 +101,11 @@ obj/machinery/hydroponics/process()
|
||||
pestlevel = 10
|
||||
|
||||
else if(pestlevel >= 5)
|
||||
health -= 1 * SPEED_MULTIPLIER
|
||||
health -= 1 * HYDRO_SPEED_MULTIPLIER
|
||||
|
||||
// If it's a weed, it doesn't stunt the growth
|
||||
if(weedlevel >= 5 && myseed.plant_type != 1 )
|
||||
health -= 1 * SPEED_MULTIPLIER
|
||||
health -= 1 * HYDRO_SPEED_MULTIPLIER
|
||||
|
||||
|
||||
//Health & Age///////////////////////////////////////////////////////////
|
||||
@@ -109,12 +117,12 @@ obj/machinery/hydroponics/process()
|
||||
else if(health <= 0)
|
||||
dead = 1
|
||||
harvest = 0
|
||||
weedlevel += 1 * SPEED_MULTIPLIER // Weeds flourish
|
||||
weedlevel += 1 * HYDRO_SPEED_MULTIPLIER // Weeds flourish
|
||||
pestlevel = 0 // Pests die
|
||||
|
||||
// If the plant is too old, lose health fast
|
||||
if(age > myseed.lifespan)
|
||||
health -= rand(1,5) * SPEED_MULTIPLIER
|
||||
health -= rand(1,5) * HYDRO_SPEED_MULTIPLIER
|
||||
|
||||
// Harvest code
|
||||
if(age > myseed.production && (age - lastproduce) > myseed.production && (!harvest && !dead))
|
||||
@@ -131,10 +139,10 @@ obj/machinery/hydroponics/process()
|
||||
else
|
||||
lastproduce = age
|
||||
if(prob(5)) // On each tick, there's a 5 percent chance the pest population will increase
|
||||
pestlevel += 1 * SPEED_MULTIPLIER
|
||||
pestlevel += 1 * HYDRO_SPEED_MULTIPLIER
|
||||
else
|
||||
if(waterlevel > 10 && nutrilevel > 0 && prob(10)) // If there's no plant, the percentage chance is 10%
|
||||
weedlevel += 1 * SPEED_MULTIPLIER
|
||||
weedlevel += 1 * HYDRO_SPEED_MULTIPLIER
|
||||
if(weedlevel > 10)
|
||||
weedlevel = 10
|
||||
|
||||
@@ -761,6 +769,17 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(istype(src, /obj/machinery/hydroponics/soil))
|
||||
user << "You clear up the [src]!"
|
||||
del(src)
|
||||
else if(istype(O, /obj/item/apiary))
|
||||
if(planted)
|
||||
user << "\red The hydroponics tray is already occupied!"
|
||||
else
|
||||
user.drop_item()
|
||||
del(O)
|
||||
|
||||
var/obj/machinery/apiary/A = new(src.loc)
|
||||
A.icon = src.icon
|
||||
A.icon_state = src.icon_state
|
||||
del(src)
|
||||
return
|
||||
|
||||
|
||||
@@ -1042,4 +1061,4 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
SetLuminosity(0)
|
||||
return
|
||||
|
||||
#undef SPEED_MULTIPLIER
|
||||
#undef HYDRO_SPEED_MULTIPLIER
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
if(istype(src.beaker, /obj/item/weapon/reagent_containers/blood))
|
||||
// speed up transfer on blood packs
|
||||
transfer_amount = 4
|
||||
src.beaker.reagents.trans_to(src.attached, transfer_amount)
|
||||
attached.inject_blood(beaker,transfer_amount)
|
||||
update_icon()
|
||||
|
||||
// Take blood
|
||||
@@ -99,52 +99,23 @@
|
||||
var/mob/living/carbon/human/T = attached
|
||||
|
||||
if(!istype(T)) return
|
||||
var/datum/reagent/B
|
||||
for(var/datum/reagent/blood/Blood in beaker.reagents.reagent_list)
|
||||
if(Blood.data && Blood.data["blood_type"]==T.dna.b_type)
|
||||
B = Blood
|
||||
break
|
||||
if(!B) B = new /datum/reagent/blood
|
||||
if(!T.dna)
|
||||
return
|
||||
if(NOCLONE in T.mutations)
|
||||
return
|
||||
|
||||
// If the human is losing too much blood, beep.
|
||||
if(T.vessel.get_reagent_amount("blood") < BLOOD_VOLUME_SAFE) if(prob(5))
|
||||
visible_message("\The [src] beeps loudly.")
|
||||
if(T.vessel.get_reagent_amount("blood") < amount)
|
||||
return
|
||||
B.holder = beaker
|
||||
B.volume += amount
|
||||
//set reagent data
|
||||
B.data["donor"] = T
|
||||
|
||||
if(T.virus2)
|
||||
B.data["virus2"] = T.virus2.getcopy()
|
||||
var/datum/reagent/B = T.take_blood(beaker,amount)
|
||||
|
||||
B.data["blood_DNA"] = copytext(T.dna.unique_enzymes,1,0)
|
||||
if(T.resistances && T.resistances.len)
|
||||
if(B.data["resistances"])
|
||||
B.data["resistances"] |= T.resistances.Copy()
|
||||
else
|
||||
B.data["resistances"] = T.resistances.Copy()
|
||||
|
||||
B.data["blood_type"] = copytext(T.dna.b_type,1,0)
|
||||
|
||||
var/list/temp_chem = list()
|
||||
for(var/datum/reagent/R in T.reagents.reagent_list)
|
||||
temp_chem += R.name
|
||||
temp_chem[R.name] = R.volume
|
||||
B.data["trace_chem"] = list2params(temp_chem)
|
||||
B.data["antibodies"] |= T.antibodies
|
||||
|
||||
T.vessel.remove_reagent("blood",amount) // Removes blood if human
|
||||
|
||||
beaker.reagents.reagent_list |= B
|
||||
beaker.reagents.update_total()
|
||||
beaker.on_reagent_change()
|
||||
beaker.reagents.handle_reactions()
|
||||
update_icon()
|
||||
if (B)
|
||||
beaker.reagents.reagent_list |= B
|
||||
beaker.reagents.update_total()
|
||||
beaker.on_reagent_change()
|
||||
beaker.reagents.handle_reactions()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/iv_drip/attack_hand(mob/user as mob)
|
||||
if(src.beaker)
|
||||
|
||||
@@ -85,6 +85,8 @@
|
||||
|
||||
M << "<B>You have joined the ranks of the Syndicate and become a traitor to the station!</B>"
|
||||
|
||||
message_admins("[N]/([N.ckey]) has accepted a traitor objective from a syndicate beacon.")
|
||||
|
||||
var/obj_count = 1
|
||||
for(var/datum/objective/OBJ in M.mind.objectives)
|
||||
M << "<B>Objective #[obj_count]</B>: [OBJ.explanation_text]"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
var/product_name = "generic"
|
||||
var/product_path = null
|
||||
var/amount = 0
|
||||
var/price = 0
|
||||
var/display_color = "blue"
|
||||
|
||||
|
||||
@@ -17,11 +18,13 @@
|
||||
var/active = 1 //No sales pitches if off!
|
||||
var/vend_ready = 1 //Are we ready to vend?? Is it time??
|
||||
var/vend_delay = 10 //How long does it take to vend?
|
||||
var/datum/data/vending_product/currently_vending = null // A /datum/data/vending_product instance of what we're paying for right now.
|
||||
|
||||
// To be filled out at compile time
|
||||
var/list/products = list() // For each, use the following pattern:
|
||||
var/list/contraband = list() // list(/type/path = amount,/type/path2 = amount2)
|
||||
var/list/premium = list() // No specified amount = only one in stock
|
||||
var/list/prices = list() // Prices for each item, list(/type/path = price), items not in the list don't have a price.
|
||||
|
||||
var/product_slogans = "" //String of slogans separated by semicolons, optional
|
||||
var/product_ads = "" //String of small ad messages in the vending screen - random chance
|
||||
@@ -49,6 +52,9 @@
|
||||
var/const/WIRE_SHOCK = 3
|
||||
var/const/WIRE_SHOOTINV = 4
|
||||
|
||||
var/obj/machinery/account_database/linked_db
|
||||
var/datum/money_account/linked_account
|
||||
|
||||
/obj/machinery/vending/New()
|
||||
..()
|
||||
spawn(4)
|
||||
@@ -64,10 +70,20 @@
|
||||
src.build_inventory(contraband, 1)
|
||||
src.build_inventory(premium, 0, 1)
|
||||
power_change()
|
||||
|
||||
reconnect_database()
|
||||
linked_account = vendor_account
|
||||
|
||||
return
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/vending/proc/reconnect_database()
|
||||
for(var/obj/machinery/account_database/DB in world)
|
||||
if(DB.z == src.z)
|
||||
linked_db = DB
|
||||
break
|
||||
|
||||
/obj/machinery/vending/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
@@ -98,6 +114,7 @@
|
||||
/obj/machinery/vending/proc/build_inventory(var/list/productlist,hidden=0,req_coin=0)
|
||||
for(var/typepath in productlist)
|
||||
var/amount = productlist[typepath]
|
||||
var/price = prices[typepath]
|
||||
if(isnull(amount)) amount = 1
|
||||
|
||||
var/atom/temp = new typepath(null)
|
||||
@@ -105,6 +122,7 @@
|
||||
R.product_name = temp.name
|
||||
R.product_path = typepath
|
||||
R.amount = amount
|
||||
R.price = price
|
||||
R.display_color = pick("red","blue","green")
|
||||
|
||||
if(hidden)
|
||||
@@ -139,9 +157,69 @@
|
||||
coin = W
|
||||
user << "\blue You insert the [W] into the [src]"
|
||||
return
|
||||
else if(istype(W, /obj/item/weapon/card) && currently_vending)
|
||||
//attempt to connect to a new db, and if that doesn't work then fail
|
||||
if(!linked_db)
|
||||
reconnect_database()
|
||||
if(linked_db)
|
||||
if(linked_account)
|
||||
var/obj/item/weapon/card/I = W
|
||||
scan_card(I)
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>Unable to connect to linked account.</span>"
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>Unable to connect to accounts database.</span>"
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/machinery/vending/proc/scan_card(var/obj/item/weapon/card/I)
|
||||
if(!currently_vending) return
|
||||
if (istype(I, /obj/item/weapon/card/id))
|
||||
var/obj/item/weapon/card/id/C = I
|
||||
visible_message("<span class='info'>[usr] swipes a card through [src].</span>")
|
||||
if(linked_account)
|
||||
var/attempt_pin = input("Enter pin code", "Vendor transaction") as num
|
||||
var/datum/money_account/D = linked_db.attempt_account_access(C.associated_account_number, attempt_pin, 2)
|
||||
if(D)
|
||||
var/transaction_amount = currently_vending.price
|
||||
if(transaction_amount <= D.money)
|
||||
|
||||
//transfer the money
|
||||
D.money -= transaction_amount
|
||||
linked_account.money += transaction_amount
|
||||
|
||||
//create entries in the two account transaction logs
|
||||
var/datum/transaction/T = new()
|
||||
T.target_name = "[linked_account.owner_name] (via [src.name])"
|
||||
T.purpose = "Purchase of [currently_vending.product_name]"
|
||||
if(transaction_amount > 0)
|
||||
T.amount = "([transaction_amount])"
|
||||
else
|
||||
T.amount = "[transaction_amount]"
|
||||
T.source_terminal = src.name
|
||||
T.date = current_date_string
|
||||
T.time = worldtime2text()
|
||||
D.transaction_log.Add(T)
|
||||
//
|
||||
T = new()
|
||||
T.target_name = D.owner_name
|
||||
T.purpose = "Purchase of [currently_vending.product_name]"
|
||||
T.amount = "[transaction_amount]"
|
||||
T.source_terminal = src.name
|
||||
T.date = current_date_string
|
||||
T.time = worldtime2text()
|
||||
linked_account.transaction_log.Add(T)
|
||||
|
||||
// Vend the item
|
||||
src.vend(src.currently_vending, usr)
|
||||
currently_vending = null
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>You don't have that much money!</span>"
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>Unable to access account. Check security settings and try again.</span>"
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>EFTPOS is not connected to an account.</span>"
|
||||
|
||||
/obj/machinery/vending/attack_paw(mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
@@ -158,6 +236,15 @@
|
||||
return
|
||||
|
||||
var/vendorname = (src.name) //import the machine's name
|
||||
|
||||
if(src.currently_vending)
|
||||
var/dat = "<TT><center><b>[vendorname]</b></center><hr /><br>" //display the name, and added a horizontal rule
|
||||
dat += "<b>You have selected [currently_vending.product_name].<br>Please swipe your ID to pay for the article.</b><br>"
|
||||
dat += "<a href='byond://?src=\ref[src];cancel_buying=1'>Cancel</a>"
|
||||
user << browse(dat, "window=vending")
|
||||
onclose(user, "")
|
||||
return
|
||||
|
||||
var/dat = "<TT><center><b>[vendorname]</b></center><hr /><br>" //display the name, and added a horizontal rule
|
||||
dat += "<b>Select an item: </b><br><br>" //the rest is just general spacing and bolding
|
||||
|
||||
@@ -178,8 +265,10 @@
|
||||
for (var/datum/data/vending_product/R in display_records)
|
||||
dat += "<FONT color = '[R.display_color]'><B>[R.product_name]</B>:"
|
||||
dat += " <b>[R.amount]</b> </font>"
|
||||
if(R.price)
|
||||
dat += " <b>(Price: [R.price])</b>"
|
||||
if (R.amount > 0)
|
||||
dat += "<a href='byond://?src=\ref[src];vend=\ref[R]'>(Vend)</A>"
|
||||
dat += " <a href='byond://?src=\ref[src];vend=\ref[R]'>(Vend)</A>"
|
||||
else
|
||||
dat += " <font color = 'red'>SOLD OUT</font>"
|
||||
dat += "<br>"
|
||||
@@ -247,48 +336,27 @@
|
||||
|
||||
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))))
|
||||
usr.set_machine(src)
|
||||
if ((href_list["vend"]) && (src.vend_ready))
|
||||
if ((href_list["vend"]) && (src.vend_ready) && (!currently_vending))
|
||||
|
||||
if ((!src.allowed(usr)) && (!src.emagged) && (src.wires & WIRE_SCANID)) //For SECURE VENDING MACHINES YEAH
|
||||
usr << "\red Access denied." //Unless emagged of course
|
||||
flick(src.icon_deny,src)
|
||||
return
|
||||
|
||||
src.vend_ready = 0 //One thing at a time!!
|
||||
|
||||
var/datum/data/vending_product/R = locate(href_list["vend"])
|
||||
if (!R || !istype(R) || !R.product_path || R.amount <= 0)
|
||||
src.vend_ready = 1
|
||||
return
|
||||
|
||||
if (R in coin_records)
|
||||
if(!coin)
|
||||
usr << "\blue You need to insert a coin to get this item."
|
||||
return
|
||||
if(coin.string_attached)
|
||||
if(prob(50))
|
||||
usr << "\blue You successfully pull the coin out before the [src] could swallow it."
|
||||
else
|
||||
usr << "\blue You weren't able to pull the coin out fast enough, the machine ate it, string and all."
|
||||
del(coin)
|
||||
else
|
||||
del(coin)
|
||||
if(R.price == null)
|
||||
src.vend(R, usr)
|
||||
else
|
||||
src.currently_vending = R
|
||||
src.updateUsrDialog()
|
||||
|
||||
R.amount--
|
||||
|
||||
if(((src.last_reply + (src.vend_delay + 200)) <= world.time) && src.vend_reply)
|
||||
spawn(0)
|
||||
src.speak(src.vend_reply)
|
||||
src.last_reply = world.time
|
||||
|
||||
use_power(5)
|
||||
if (src.icon_vend) //Show the vending animation if needed
|
||||
flick(src.icon_vend,src)
|
||||
spawn(src.vend_delay)
|
||||
new R.product_path(get_turf(src))
|
||||
src.vend_ready = 1
|
||||
return
|
||||
return
|
||||
|
||||
else if (href_list["cancel_buying"])
|
||||
src.currently_vending = null
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
@@ -323,6 +391,43 @@
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/vending/proc/vend(datum/data/vending_product/R, mob/user)
|
||||
if ((!src.allowed(user)) && (!src.emagged) && (src.wires & WIRE_SCANID)) //For SECURE VENDING MACHINES YEAH
|
||||
user << "\red Access denied." //Unless emagged of course
|
||||
flick(src.icon_deny,src)
|
||||
return
|
||||
src.vend_ready = 0 //One thing at a time!!
|
||||
|
||||
if (R in coin_records)
|
||||
if(!coin)
|
||||
user << "\blue You need to insert a coin to get this item."
|
||||
return
|
||||
if(coin.string_attached)
|
||||
if(prob(50))
|
||||
user << "\blue You successfully pull the coin out before the [src] could swallow it."
|
||||
else
|
||||
user << "\blue You weren't able to pull the coin out fast enough, the machine ate it, string and all."
|
||||
del(coin)
|
||||
else
|
||||
del(coin)
|
||||
|
||||
R.amount--
|
||||
|
||||
if(((src.last_reply + (src.vend_delay + 200)) <= world.time) && src.vend_reply)
|
||||
spawn(0)
|
||||
src.speak(src.vend_reply)
|
||||
src.last_reply = world.time
|
||||
|
||||
use_power(5)
|
||||
if (src.icon_vend) //Show the vending animation if needed
|
||||
flick(src.icon_vend,src)
|
||||
spawn(src.vend_delay)
|
||||
new R.product_path(get_turf(src))
|
||||
src.vend_ready = 1
|
||||
return
|
||||
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/vending/process()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
@@ -532,6 +637,8 @@
|
||||
vend_delay = 34
|
||||
products = list(/obj/item/weapon/reagent_containers/food/drinks/coffee = 25,/obj/item/weapon/reagent_containers/food/drinks/tea = 25,/obj/item/weapon/reagent_containers/food/drinks/h_chocolate = 25)
|
||||
contraband = list(/obj/item/weapon/reagent_containers/food/drinks/ice = 10)
|
||||
prices = list(/obj/item/weapon/reagent_containers/food/drinks/coffee = 25, /obj/item/weapon/reagent_containers/food/drinks/tea = 25, /obj/item/weapon/reagent_containers/food/drinks/h_chocolate = 25)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -545,6 +652,9 @@
|
||||
/obj/item/weapon/reagent_containers/food/snacks/sosjerky = 6,/obj/item/weapon/reagent_containers/food/snacks/no_raisin = 6,/obj/item/weapon/reagent_containers/food/snacks/spacetwinkie = 6,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cheesiehonkers = 6)
|
||||
contraband = list(/obj/item/weapon/reagent_containers/food/snacks/syndicake = 6)
|
||||
prices = list(/obj/item/weapon/reagent_containers/food/snacks/candy = 20,/obj/item/weapon/reagent_containers/food/drinks/dry_ramen = 30,/obj/item/weapon/reagent_containers/food/snacks/chips =25,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/sosjerky = 30,/obj/item/weapon/reagent_containers/food/snacks/no_raisin = 20,/obj/item/weapon/reagent_containers/food/snacks/spacetwinkie = 30,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cheesiehonkers = 25)
|
||||
|
||||
|
||||
|
||||
@@ -558,6 +668,9 @@
|
||||
/obj/item/weapon/reagent_containers/food/drinks/dr_gibb = 10,/obj/item/weapon/reagent_containers/food/drinks/starkist = 10,
|
||||
/obj/item/weapon/reagent_containers/food/drinks/space_up = 10)
|
||||
contraband = list(/obj/item/weapon/reagent_containers/food/drinks/thirteenloko = 5)
|
||||
prices = list(/obj/item/weapon/reagent_containers/food/drinks/cola = 20,/obj/item/weapon/reagent_containers/food/drinks/space_mountain_wind = 20,
|
||||
/obj/item/weapon/reagent_containers/food/drinks/dr_gibb = 20,/obj/item/weapon/reagent_containers/food/drinks/starkist = 20,
|
||||
/obj/item/weapon/reagent_containers/food/drinks/space_up = 20)
|
||||
|
||||
//This one's from bay12
|
||||
/obj/machinery/vending/cart
|
||||
@@ -581,6 +694,8 @@
|
||||
products = list(/obj/item/weapon/storage/fancy/cigarettes = 10,/obj/item/weapon/storage/box/matches = 10,/obj/item/weapon/lighter/random = 4)
|
||||
contraband = list(/obj/item/weapon/lighter/zippo = 4)
|
||||
premium = list(/obj/item/clothing/mask/cigarette/cigar/havana = 2)
|
||||
prices = list(/obj/item/weapon/storage/fancy/cigarettes = 60,/obj/item/weapon/storage/box/matches = 10,/obj/item/weapon/lighter/random = 60)
|
||||
|
||||
|
||||
/obj/machinery/vending/medical
|
||||
name = "NanoMed Plus"
|
||||
@@ -644,7 +759,7 @@
|
||||
product_ads = "We like plants!;Don't you want some?;The greenest thumbs ever.;We like big plants.;Soft soil..."
|
||||
icon_state = "nutri"
|
||||
icon_deny = "nutri-deny"
|
||||
products = list(/obj/item/nutrient/ez = 35,/obj/item/nutrient/l4z = 25,/obj/item/nutrient/rh = 15,/obj/item/weapon/pestspray = 20,
|
||||
products = list(/obj/item/beezeez = 45,/obj/item/nutrient/ez = 35,/obj/item/nutrient/l4z = 25,/obj/item/nutrient/rh = 15,/obj/item/weapon/pestspray = 20,
|
||||
/obj/item/weapon/reagent_containers/syringe = 5,/obj/item/weapon/storage/bag/plants = 5)
|
||||
contraband = list(/obj/item/weapon/reagent_containers/glass/bottle/ammonia = 10,/obj/item/weapon/reagent_containers/glass/bottle/diethylamine = 5)
|
||||
|
||||
|
||||
@@ -651,7 +651,7 @@
|
||||
/obj/mecha/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
|
||||
|
||||
if(istype(W, /obj/item/device/mmi) || istype(W, /obj/item/device/posibrain))
|
||||
if(istype(W, /obj/item/device/mmi) || istype(W, /obj/item/device/mmi/posibrain))
|
||||
if(mmi_move_inside(W,user))
|
||||
user << "[src]-MMI interface initialized successfuly"
|
||||
else
|
||||
@@ -1136,7 +1136,7 @@
|
||||
src.occupant.client.perspective = MOB_PERSPECTIVE
|
||||
*/
|
||||
src.occupant << browse(null, "window=exosuit")
|
||||
if(istype(mob_container, /obj/item/device/mmi) || istype(mob_container, /obj/item/device/posibrain))
|
||||
if(istype(mob_container, /obj/item/device/mmi) || istype(mob_container, /obj/item/device/mmi/posibrain))
|
||||
var/obj/item/device/mmi/mmi = mob_container
|
||||
if(mmi.brainmob)
|
||||
occupant.loc = mmi
|
||||
|
||||
@@ -20,6 +20,9 @@ proc/empulse(turf/epicenter, heavy_range, light_range, log=0)
|
||||
if(heavy_range > light_range)
|
||||
light_range = heavy_range
|
||||
|
||||
for(var/mob/M in range(heavy_range, epicenter))
|
||||
M << 'sound/effects/EMPulse.ogg'
|
||||
|
||||
for(var/atom/T in range(light_range, epicenter))
|
||||
var/distance = get_dist(epicenter, T)
|
||||
if(distance < 0)
|
||||
|
||||
@@ -48,6 +48,10 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
default_cartridge = /obj/item/weapon/cartridge/medical
|
||||
icon_state = "pda-m"
|
||||
|
||||
/obj/item/device/pda/viro
|
||||
default_cartridge = /obj/item/weapon/cartridge/medical
|
||||
icon_state = "pda-v"
|
||||
|
||||
/obj/item/device/pda/engineering
|
||||
default_cartridge = /obj/item/weapon/cartridge/engineering
|
||||
icon_state = "pda-e"
|
||||
|
||||
@@ -210,10 +210,12 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
|
||||
if (!connection)
|
||||
return
|
||||
|
||||
Broadcast_Message(connection, new /mob/living/silicon/ai(src,null,null,1),
|
||||
var/mob/living/silicon/ai/A = new /mob/living/silicon/ai(src, null, null, 1)
|
||||
Broadcast_Message(connection, A,
|
||||
0, "*garbled automated announcement*", src,
|
||||
message, from, "Automated Announcement", from, "synthesized voice",
|
||||
4, 0, 1)
|
||||
4, 0, list(1), 1459)
|
||||
del(A)
|
||||
return
|
||||
|
||||
/obj/item/device/radio/talk_into(mob/living/M as mob, message, channel)
|
||||
|
||||
@@ -161,7 +161,7 @@
|
||||
else
|
||||
user << "\blue You need to attach a flash to it first!"
|
||||
|
||||
if(istype(W, /obj/item/device/mmi) || istype(W, /obj/item/device/posibrain))
|
||||
if(istype(W, /obj/item/device/mmi) || istype(W, /obj/item/device/mmi/posibrain))
|
||||
var/obj/item/device/mmi/M = W
|
||||
if(check_completion())
|
||||
if(!istype(loc,/turf))
|
||||
|
||||
37
code/game/objects/items/stacks/nanopaste.dm
Normal file
37
code/game/objects/items/stacks/nanopaste.dm
Normal file
@@ -0,0 +1,37 @@
|
||||
/obj/item/stack/nanopaste
|
||||
name = "nanopaste"
|
||||
singular_name = "nanite swarm"
|
||||
desc = "A tube of paste containing swarms of repair nanites. Very effective in repairing robotic machinery."
|
||||
icon = 'icons/obj/nanopaste.dmi'
|
||||
icon_state = "tube"
|
||||
origin_tech = "materials=4;engineering=3"
|
||||
amount = 10
|
||||
|
||||
|
||||
/obj/item/stack/nanopaste/attack(mob/living/M as mob, mob/user as mob)
|
||||
if (!istype(M) || !istype(user))
|
||||
return 0
|
||||
if (istype(M,/mob/living/silicon/robot)) //Repairing cyborgs
|
||||
var/mob/living/silicon/robot/R = M
|
||||
if (R.getBruteLoss() || R.getFireLoss() )
|
||||
R.adjustBruteLoss(-60)
|
||||
R.adjustFireLoss(-60)
|
||||
R.updatehealth()
|
||||
use(1)
|
||||
user.visible_message("<span class='notice'>\The [user] applied some [src] at [R]'s damaged areas.</span>",\
|
||||
"<span class='notice'>You apply some [src] at [R]'s damaged areas.</span>")
|
||||
else
|
||||
user << "<span class='notice'>All [R]'s systems are nominal.</span>"
|
||||
|
||||
if (istype(M,/mob/living/carbon/human)) //Repairing robolimbs
|
||||
var/mob/living/carbon/human/H = M
|
||||
var/datum/organ/external/S = H.get_organ(user.zone_sel.selecting)
|
||||
if (S && (S.status & ORGAN_ROBOT))
|
||||
if(S.get_damage())
|
||||
S.heal_damage(30, 30, robo_repair = 1)
|
||||
H.updatehealth()
|
||||
use(1)
|
||||
user.visible_message("<span class='notice'>\The [user] applies some nanite paste at[user != M ? " \the [M]'s" : " \the"][S.display_name] with \the [src].</span>",\
|
||||
"<span class='notice'>You apply some nanite paste at [user == M ? "your" : "[M]'s"] [S.display_name].</span>")
|
||||
else
|
||||
user << "<span class='notice'>Nothing to fix here.</span>"
|
||||
@@ -287,7 +287,7 @@
|
||||
var/datum/organ/external/affecting = H.get_organ(pick("l_foot", "r_foot"))
|
||||
if(affecting.status & ORGAN_ROBOT)
|
||||
return
|
||||
|
||||
|
||||
H.Weaken(3)
|
||||
if(affecting.take_damage(5, 0))
|
||||
H.UpdateDamageIcon()
|
||||
|
||||
@@ -103,6 +103,7 @@ var/global/list/datum/stack_recipe/wood_recipes = list ( \
|
||||
new/datum/stack_recipe("wooden barricade", /obj/structure/barricade/wooden, 5, time = 50, one_per_turf = 1, on_floor = 1), \
|
||||
new/datum/stack_recipe("wooden door", /obj/structure/mineral_door/wood, 10, time = 20, one_per_turf = 1, on_floor = 1), \
|
||||
new/datum/stack_recipe("coffin", /obj/structure/closet/coffin, 5, time = 15, one_per_turf = 1, on_floor = 1), \
|
||||
new/datum/stack_recipe("apiary", /obj/item/apiary, 10, time = 25, one_per_turf = 0, on_floor = 0), \
|
||||
)
|
||||
|
||||
/obj/item/stack/sheet/wood
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
/*
|
||||
* Spoons
|
||||
*/
|
||||
/obj/item/weapon/kitchen/utensil/spoon
|
||||
/obj/item/weapon/kitchen/utensil/spoon
|
||||
name = "spoon"
|
||||
desc = "SPOON!"
|
||||
icon_state = "spoon"
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
for(var/obj/effect/dummy/chameleon/AD in src)
|
||||
AD.loc = src.loc
|
||||
|
||||
for(var/obj/item/I in src)
|
||||
for(var/obj/I in src)
|
||||
I.loc = src.loc
|
||||
|
||||
for(var/mob/M in src)
|
||||
|
||||
@@ -23,4 +23,5 @@
|
||||
new /obj/item/clothing/head/greenbandana(src)
|
||||
new /obj/item/weapon/minihoe(src)
|
||||
new /obj/item/weapon/hatchet(src)
|
||||
new /obj/item/weapon/bee_net(src)
|
||||
return
|
||||
@@ -169,11 +169,35 @@
|
||||
name = "large crate"
|
||||
desc = "A hefty metal crate with an electronic locking system."
|
||||
icon = 'icons/obj/storage.dmi'
|
||||
icon_state = "largecrate"
|
||||
icon_opened = "largecrateopen"
|
||||
icon_closed = "largecrate"
|
||||
redlight = "largecrater"
|
||||
greenlight = "largecrateg"
|
||||
icon_state = "largemetal"
|
||||
icon_opened = "largemetalopen"
|
||||
icon_closed = "largemetal"
|
||||
redlight = "largemetalr"
|
||||
greenlight = "largemetalg"
|
||||
|
||||
/obj/structure/closet/crate/secure/large/close()
|
||||
//we can hold up to one large item
|
||||
var/found = 0
|
||||
for(var/obj/structure/S in src.loc)
|
||||
if(S == src)
|
||||
continue
|
||||
if(!S.anchored)
|
||||
found = 1
|
||||
S.loc = src
|
||||
break
|
||||
if(!found)
|
||||
for(var/obj/machinery/M in src.loc)
|
||||
if(!M.anchored)
|
||||
M.loc = src
|
||||
break
|
||||
..()
|
||||
|
||||
//fluff variant
|
||||
/obj/structure/closet/crate/secure/large/reinforced
|
||||
desc = "A hefty, reinforced metal crate with an electronic locking system."
|
||||
icon_state = "largermetal"
|
||||
icon_opened = "largermetalopen"
|
||||
icon_closed = "largermetal"
|
||||
|
||||
/obj/structure/closet/crate/secure
|
||||
desc = "A secure crate."
|
||||
@@ -192,10 +216,26 @@
|
||||
name = "large crate"
|
||||
desc = "A hefty metal crate."
|
||||
icon = 'icons/obj/storage.dmi'
|
||||
icon_state = "largecrate"
|
||||
icon_opened = "largecrateopen"
|
||||
icon_closed = "largecrate"
|
||||
density = 1
|
||||
icon_state = "largemetal"
|
||||
icon_opened = "largemetalopen"
|
||||
icon_closed = "largemetal"
|
||||
|
||||
/obj/structure/closet/crate/large/close()
|
||||
//we can hold up to one large item
|
||||
var/found = 0
|
||||
for(var/obj/structure/S in src.loc)
|
||||
if(S == src)
|
||||
continue
|
||||
if(!S.anchored)
|
||||
found = 1
|
||||
S.loc = src
|
||||
break
|
||||
if(!found)
|
||||
for(var/obj/machinery/M in src.loc)
|
||||
if(!M.anchored)
|
||||
M.loc = src
|
||||
break
|
||||
..()
|
||||
|
||||
/obj/structure/closet/crate/hydroponics
|
||||
name = "Hydroponics crate"
|
||||
|
||||
621
code/game/objects/structures/transit_tubes.dm
Normal file
621
code/game/objects/structures/transit_tubes.dm
Normal file
@@ -0,0 +1,621 @@
|
||||
|
||||
// Basic transit tubes. Straight pieces, curved sections,
|
||||
// and basic splits/joins (no routing logic).
|
||||
// Mappers: you can use "Generate Instances from Icon-states"
|
||||
// to get the different pieces.
|
||||
/obj/structure/transit_tube
|
||||
icon = 'icons/obj/pipes/transit_tube.dmi'
|
||||
icon_state = "E-W"
|
||||
density = 1
|
||||
layer = 3.1
|
||||
anchored = 1.0
|
||||
var/list/tube_dirs = null
|
||||
var/exit_delay = 2
|
||||
var/enter_delay = 1
|
||||
|
||||
// alldirs in global.dm is the same list of directions, but since
|
||||
// the specific order matters to get a usable icon_state, it is
|
||||
// copied here so that, in the unlikely case that alldirs is changed,
|
||||
// this continues to work.
|
||||
var/global/list/tube_dir_list = list(NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST)
|
||||
|
||||
|
||||
// A place where tube pods stop, and people can get in or out.
|
||||
// Mappers: use "Generate Instances from Directions" for this
|
||||
// one.
|
||||
/obj/structure/transit_tube/station
|
||||
icon = 'icons/obj/pipes/transit_tube_station.dmi'
|
||||
icon_state = "closed"
|
||||
exit_delay = 2
|
||||
enter_delay = 3
|
||||
var/pod_moving = 0
|
||||
var/automatic_launch_time = 100
|
||||
|
||||
var/const/OPEN_DURATION = 6
|
||||
var/const/CLOSE_DURATION = 6
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube_pod
|
||||
icon = 'icons/obj/pipes/transit_tube_pod.dmi'
|
||||
icon_state = "pod"
|
||||
animate_movement = FORWARD_STEPS
|
||||
anchored = 1.0
|
||||
density = 1
|
||||
var/moving = 0
|
||||
var/datum/gas_mixture/air_contents = new()
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube_pod/Del()
|
||||
for(var/atom/movable/AM in contents)
|
||||
AM.loc = loc
|
||||
|
||||
..()
|
||||
|
||||
|
||||
|
||||
// When destroyed by explosions, properly handle contents.
|
||||
obj/structure/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
for(var/atom/movable/AM in contents)
|
||||
AM.loc = loc
|
||||
AM.ex_act(severity++)
|
||||
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if(prob(50))
|
||||
for(var/atom/movable/AM in contents)
|
||||
AM.loc = loc
|
||||
AM.ex_act(severity++)
|
||||
|
||||
del(src)
|
||||
return
|
||||
if(3.0)
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube_pod/New(loc)
|
||||
..(loc)
|
||||
|
||||
air_contents.oxygen = MOLES_O2STANDARD * 2
|
||||
air_contents.nitrogen = MOLES_N2STANDARD
|
||||
air_contents.temperature = T20C
|
||||
|
||||
// Give auto tubes time to align before trying to start moving
|
||||
spawn(5)
|
||||
follow_tube()
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube/New(loc)
|
||||
..(loc)
|
||||
|
||||
if(tube_dirs == null)
|
||||
init_dirs()
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube/station/New(loc)
|
||||
..(loc)
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube/station/Bumped(mob/AM as mob|obj)
|
||||
if(!pod_moving && icon_state == "open" && istype(AM, /mob))
|
||||
for(var/obj/structure/transit_tube_pod/pod in loc)
|
||||
if(!pod.moving && pod.dir in directions())
|
||||
AM.loc = pod
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube/station/attack_hand(mob/user as mob)
|
||||
if(!pod_moving)
|
||||
for(var/obj/structure/transit_tube_pod/pod in loc)
|
||||
if(!pod.moving && pod.dir in directions())
|
||||
if(icon_state == "closed")
|
||||
open_animation()
|
||||
|
||||
else if(icon_state == "open")
|
||||
close_animation()
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube/station/proc/open_animation()
|
||||
if(icon_state == "closed")
|
||||
icon_state = "opening"
|
||||
spawn(OPEN_DURATION)
|
||||
if(icon_state == "opening")
|
||||
icon_state = "open"
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube/station/proc/close_animation()
|
||||
if(icon_state == "open")
|
||||
icon_state = "closing"
|
||||
spawn(CLOSE_DURATION)
|
||||
if(icon_state == "closing")
|
||||
icon_state = "closed"
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube/station/proc/launch_pod()
|
||||
for(var/obj/structure/transit_tube_pod/pod in loc)
|
||||
if(!pod.moving && pod.dir in directions())
|
||||
spawn(5)
|
||||
pod_moving = 1
|
||||
close_animation()
|
||||
sleep(CLOSE_DURATION + 2)
|
||||
if(icon_state == "closed" && pod)
|
||||
pod.follow_tube()
|
||||
|
||||
pod_moving = 0
|
||||
|
||||
return
|
||||
|
||||
|
||||
|
||||
// Called to check if a pod should stop upon entering this tube.
|
||||
/obj/structure/transit_tube/proc/should_stop_pod(pod, from_dir)
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube/station/should_stop_pod(pod, from_dir)
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
// Called when a pod stops in this tube section.
|
||||
/obj/structure/transit_tube/proc/pod_stopped(pod, from_dir)
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube/station/pod_stopped(obj/structure/transit_tube_pod/pod, from_dir)
|
||||
pod_moving = 1
|
||||
spawn(5)
|
||||
open_animation()
|
||||
sleep(OPEN_DURATION + 2)
|
||||
pod_moving = 0
|
||||
pod.mix_air()
|
||||
|
||||
if(automatic_launch_time)
|
||||
var/const/wait_step = 5
|
||||
var/i = 0
|
||||
while(i < automatic_launch_time)
|
||||
sleep(wait_step)
|
||||
i += wait_step
|
||||
|
||||
if(pod_moving || icon_state != "open")
|
||||
return
|
||||
|
||||
launch_pod()
|
||||
|
||||
|
||||
|
||||
// Returns a /list of directions this tube section can connect to.
|
||||
// Tubes that have some sort of logic or changing direction might
|
||||
// override it with additional logic.
|
||||
/obj/structure/transit_tube/proc/directions()
|
||||
return tube_dirs
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube/proc/has_entrance(from_dir)
|
||||
from_dir = turn(from_dir, 180)
|
||||
|
||||
for(var/direction in directions())
|
||||
if(direction == from_dir)
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube/proc/has_exit(in_dir)
|
||||
for(var/direction in directions())
|
||||
if(direction == in_dir)
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
// Searches for an exit direction within 45 degrees of the
|
||||
// specified dir. Returns that direction, or 0 if none match.
|
||||
/obj/structure/transit_tube/proc/get_exit(in_dir)
|
||||
var/near_dir = 0
|
||||
var/in_dir_cw = turn(in_dir, -45)
|
||||
var/in_dir_ccw = turn(in_dir, 45)
|
||||
|
||||
for(var/direction in directions())
|
||||
if(direction == in_dir)
|
||||
return direction
|
||||
|
||||
else if(direction == in_dir_cw)
|
||||
near_dir = direction
|
||||
|
||||
else if(direction == in_dir_ccw)
|
||||
near_dir = direction
|
||||
|
||||
return near_dir
|
||||
|
||||
|
||||
|
||||
// Return how many BYOND ticks to wait before entering/exiting
|
||||
// the tube section. Default action is to return the value of
|
||||
// a var, which wouldn't need a proc, but it makes it possible
|
||||
// for later tube types to interact in more interesting ways
|
||||
// such as being very fast in one direction, but slow in others
|
||||
/obj/structure/transit_tube/proc/exit_delay(pod, to_dir)
|
||||
return exit_delay
|
||||
|
||||
/obj/structure/transit_tube/proc/enter_delay(pod, to_dir)
|
||||
return enter_delay
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube_pod/proc/follow_tube()
|
||||
if(moving)
|
||||
return
|
||||
|
||||
moving = 1
|
||||
|
||||
spawn()
|
||||
var/obj/structure/transit_tube/current_tube = null
|
||||
var/next_dir
|
||||
var/next_loc
|
||||
var/last_delay = 0
|
||||
var/exit_delay
|
||||
|
||||
for(var/obj/structure/transit_tube/tube in loc)
|
||||
if(tube.has_exit(dir))
|
||||
current_tube = tube
|
||||
break
|
||||
|
||||
while(current_tube)
|
||||
next_dir = current_tube.get_exit(dir)
|
||||
|
||||
if(!next_dir)
|
||||
break
|
||||
|
||||
exit_delay = current_tube.exit_delay(src, dir)
|
||||
last_delay += exit_delay
|
||||
|
||||
sleep(exit_delay)
|
||||
|
||||
next_loc = get_step(loc, next_dir)
|
||||
|
||||
current_tube = null
|
||||
for(var/obj/structure/transit_tube/tube in next_loc)
|
||||
if(tube.has_entrance(next_dir))
|
||||
current_tube = tube
|
||||
break
|
||||
|
||||
if(current_tube == null)
|
||||
dir = next_dir
|
||||
Move(get_step(loc, dir)) // Allow collisions when leaving the tubes.
|
||||
break
|
||||
|
||||
last_delay = current_tube.enter_delay(src, next_dir)
|
||||
sleep(last_delay)
|
||||
dir = next_dir
|
||||
loc = next_loc // When moving from one tube to another, skip collision and such.
|
||||
density = current_tube.density
|
||||
|
||||
if(current_tube && current_tube.should_stop_pod(src, next_dir))
|
||||
current_tube.pod_stopped(src, dir)
|
||||
break
|
||||
|
||||
density = 1
|
||||
|
||||
// If the pod is no longer in a tube, move in a line until stopped or slowed to a halt.
|
||||
// /turf/inertial_drift appears to only work on mobs, and re-implementing some of the
|
||||
// logic allows a gradual slowdown and eventual stop when passing over non-space turfs.
|
||||
if(!current_tube && last_delay <= 10)
|
||||
do
|
||||
sleep(last_delay)
|
||||
|
||||
if(!istype(loc, /turf/space))
|
||||
last_delay++
|
||||
|
||||
if(last_delay > 10)
|
||||
break
|
||||
|
||||
while(isturf(loc) && Move(get_step(loc, dir)))
|
||||
|
||||
moving = 0
|
||||
|
||||
|
||||
// Should I return a copy here? If the caller edits or del()s the returned
|
||||
// datum, there might be problems if I don't...
|
||||
/obj/structure/transit_tube_pod/return_air()
|
||||
var/datum/gas_mixture/GM = new()
|
||||
GM.oxygen = air_contents.oxygen
|
||||
GM.carbon_dioxide = air_contents.carbon_dioxide
|
||||
GM.nitrogen = air_contents.nitrogen
|
||||
GM.toxins = air_contents.toxins
|
||||
GM.temperature = air_contents.temperature
|
||||
return GM
|
||||
|
||||
// For now, copying what I found in an unused FEA file (and almost identical in a
|
||||
// used ZAS file). Means that assume_air and remove_air don't actually alter the
|
||||
// air contents.
|
||||
/obj/structure/transit_tube_pod/assume_air(datum/gas_mixture/giver)
|
||||
return air_contents.merge(giver)
|
||||
|
||||
/obj/structure/transit_tube_pod/remove_air(amount)
|
||||
return air_contents.remove(amount)
|
||||
|
||||
|
||||
|
||||
// Called when a pod arrives at, and before a pod departs from a station,
|
||||
// giving it a chance to mix its internal air supply with the turf it is
|
||||
// currently on.
|
||||
/obj/structure/transit_tube_pod/proc/mix_air()
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
var/env_pressure = environment.return_pressure()
|
||||
var/int_pressure = air_contents.return_pressure()
|
||||
var/total_pressure = env_pressure + int_pressure
|
||||
|
||||
if(total_pressure == 0)
|
||||
return
|
||||
|
||||
// Math here: Completely made up, not based on realistic equasions.
|
||||
// Goal is to balance towards equal pressure, but ensure some gas
|
||||
// transfer in both directions regardless.
|
||||
// Feel free to rip this out and replace it with something better,
|
||||
// I don't really know muhch about how gas transfer rates work in
|
||||
// SS13.
|
||||
var/transfer_in = max(0.1, 0.5 * (env_pressure - int_pressure) / total_pressure)
|
||||
var/transfer_out = max(0.1, 0.3 * (int_pressure - env_pressure) / total_pressure)
|
||||
|
||||
var/datum/gas_mixture/from_env = loc.remove_air(environment.total_moles() * transfer_in)
|
||||
var/datum/gas_mixture/from_int = air_contents.remove(air_contents.total_moles() * transfer_out)
|
||||
|
||||
loc.assume_air(from_int)
|
||||
air_contents.merge(from_env)
|
||||
|
||||
|
||||
|
||||
// When the player moves, check if the pos is currently stopped at a station.
|
||||
// if it is, check the direction. If the direction matches the direction of
|
||||
// the station, try to exit. If the direction matches one of the station's
|
||||
// tube directions, launch the pod in that direction.
|
||||
/obj/structure/transit_tube_pod/relaymove(mob/mob, direction)
|
||||
if(istype(mob, /mob) && mob.client)
|
||||
// If the pod is not in a tube at all, you can get out at any time.
|
||||
if(!(locate(/obj/structure/transit_tube) in loc))
|
||||
mob.loc = loc
|
||||
mob.client.Move(get_step(loc, direction), direction)
|
||||
|
||||
//if(moving && istype(loc, /turf/space))
|
||||
// Todo: If you get out of a moving pod in space, you should move as well.
|
||||
// Same direction as pod? Direcion you moved? Halfway between?
|
||||
|
||||
if(!moving)
|
||||
for(var/obj/structure/transit_tube/station/station in loc)
|
||||
if(dir in station.directions())
|
||||
if(!station.pod_moving)
|
||||
if(direction == station.dir)
|
||||
if(station.icon_state == "open")
|
||||
mob.loc = loc
|
||||
mob.client.Move(get_step(loc, direction), direction)
|
||||
|
||||
else
|
||||
station.open_animation()
|
||||
|
||||
else if(direction in station.directions())
|
||||
dir = direction
|
||||
station.launch_pod()
|
||||
return
|
||||
|
||||
for(var/obj/structure/transit_tube/tube in loc)
|
||||
if(dir in tube.directions())
|
||||
if(tube.has_exit(direction))
|
||||
dir = direction
|
||||
return
|
||||
|
||||
|
||||
|
||||
// Parse the icon_state into a list of directions.
|
||||
// This means that mappers can use Dream Maker's built in
|
||||
// "Generate Instances from Icon-states" option to get all
|
||||
// variations. Additionally, as a separate proc, sub-types
|
||||
// can handle it more intelligently.
|
||||
/obj/structure/transit_tube/proc/init_dirs()
|
||||
if(icon_state == "auto")
|
||||
// Additional delay, for map loading.
|
||||
spawn(1)
|
||||
init_dirs_automatic()
|
||||
|
||||
else
|
||||
tube_dirs = parse_dirs(icon_state)
|
||||
|
||||
if(copytext(icon_state, 1, 3) == "D-" || findtextEx(icon_state, "Pass"))
|
||||
density = 0
|
||||
|
||||
|
||||
|
||||
// Tube station directions are simply 90 to either side of
|
||||
// the exit.
|
||||
/obj/structure/transit_tube/station/init_dirs()
|
||||
tube_dirs = list(turn(dir, 90), turn(dir, -90))
|
||||
|
||||
|
||||
|
||||
// Initialize dirs by searching for tubes that do/might connect
|
||||
// on nearby turfs. Create corner pieces if nessecary.
|
||||
// Pick two directions, preferring tubes that already connect
|
||||
// to loc, or other auto tubes if there aren't enough connections.
|
||||
/obj/structure/transit_tube/proc/init_dirs_automatic()
|
||||
var/list/connected = list()
|
||||
var/list/connected_auto = list()
|
||||
|
||||
for(var/direction in tube_dir_list)
|
||||
var/location = get_step(loc, direction)
|
||||
for(var/obj/structure/transit_tube/tube in location)
|
||||
if(tube.directions() == null && tube.icon_state == "auto")
|
||||
connected_auto += direction
|
||||
break
|
||||
|
||||
else if(turn(direction, 180) in tube.directions())
|
||||
connected += direction
|
||||
break
|
||||
|
||||
connected += connected_auto
|
||||
|
||||
tube_dirs = select_automatic_dirs(connected)
|
||||
|
||||
if(length(tube_dirs) == 2 && tube_dir_list.Find(tube_dirs[1]) > tube_dir_list.Find(tube_dirs[2]))
|
||||
tube_dirs.Swap(1, 2)
|
||||
|
||||
generate_automatic_corners(tube_dirs)
|
||||
select_automatic_icon_state(tube_dirs)
|
||||
|
||||
|
||||
|
||||
// Given a list of directions, look a pair that forms a 180 or
|
||||
// 135 degree angle, and return a list containing the pair.
|
||||
// If none exist, return list(connected[1], turn(connected[1], 180)
|
||||
/obj/structure/transit_tube/proc/select_automatic_dirs(connected)
|
||||
if(length(connected) < 1)
|
||||
return list()
|
||||
|
||||
for(var/i = 1, i <= length(connected), i++)
|
||||
for(var/j = i + 1, j <= length(connected), j++)
|
||||
var/d1 = connected[i]
|
||||
var/d2 = connected[j]
|
||||
|
||||
if(d1 == turn(d2, 135) || d1 == turn(d2, 180) || d1 == turn(d2, 225))
|
||||
return list(d1, d2)
|
||||
|
||||
return list(connected[1], turn(connected[1], 180))
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube/proc/select_automatic_icon_state(directions)
|
||||
if(length(directions) == 2)
|
||||
icon_state = "[dir2text_short(directions[1])]-[dir2text_short(directions[2])]"
|
||||
|
||||
|
||||
|
||||
// Look for diagonal directions, generate the decorative corners in each.
|
||||
/obj/structure/transit_tube/proc/generate_automatic_corners(directions)
|
||||
for(var/direction in directions)
|
||||
if(direction == 5 || direction == 6 || direction == 9 || direction == 10)
|
||||
if(direction & NORTH)
|
||||
create_automatic_decorative_corner(get_step(loc, NORTH), direction ^ 3)
|
||||
|
||||
else
|
||||
create_automatic_decorative_corner(get_step(loc, SOUTH), direction ^ 3)
|
||||
|
||||
if(direction & EAST)
|
||||
create_automatic_decorative_corner(get_step(loc, EAST), direction ^ 12)
|
||||
|
||||
else
|
||||
create_automatic_decorative_corner(get_step(loc, WEST), direction ^ 12)
|
||||
|
||||
|
||||
|
||||
// Generate a corner, if one doesn't exist for the direction on the turf.
|
||||
/obj/structure/transit_tube/proc/create_automatic_decorative_corner(location, direction)
|
||||
var/state = "D-[dir2text_short(direction)]"
|
||||
|
||||
for(var/obj/structure/transit_tube/tube in location)
|
||||
if(tube.icon_state == state)
|
||||
return
|
||||
|
||||
var/obj/structure/transit_tube/tube = new(location)
|
||||
tube.icon_state = state
|
||||
tube.init_dirs()
|
||||
|
||||
|
||||
|
||||
// Uses a list() to cache return values. Since they should
|
||||
// never be edited directly, all tubes with a certain
|
||||
// icon_state can just reference the same list. In theory,
|
||||
// reduces memory usage, and improves CPU cache usage.
|
||||
// In reality, I don't know if that is quite how BYOND works,
|
||||
// but it is probably safer to assume the existence of, and
|
||||
// rely on, a sufficiently smart compiler/optimizer.
|
||||
/obj/structure/transit_tube/proc/parse_dirs(text)
|
||||
var/global/list/direction_table = list()
|
||||
|
||||
if(text in direction_table)
|
||||
return direction_table[text]
|
||||
|
||||
var/list/split_text = stringsplit(text, "-")
|
||||
|
||||
// If the first token is D, the icon_state represents
|
||||
// a purely decorative tube, and doesn't actually
|
||||
// connect to anything.
|
||||
if(split_text[1] == "D")
|
||||
direction_table[text] = list()
|
||||
return null
|
||||
|
||||
var/list/directions = list()
|
||||
|
||||
for(var/text_part in split_text)
|
||||
var/direction = text2dir_extended(text_part)
|
||||
|
||||
if(direction > 0)
|
||||
directions += direction
|
||||
|
||||
direction_table[text] = directions
|
||||
return directions
|
||||
|
||||
|
||||
|
||||
// A copy of text2dir, extended to accept one and two letter
|
||||
// directions, and to clearly return 0 otherwise.
|
||||
/obj/structure/transit_tube/proc/text2dir_extended(direction)
|
||||
switch(uppertext(direction))
|
||||
if("NORTH", "N")
|
||||
return 1
|
||||
if("SOUTH", "S")
|
||||
return 2
|
||||
if("EAST", "E")
|
||||
return 4
|
||||
if("WEST", "W")
|
||||
return 8
|
||||
if("NORTHEAST", "NE")
|
||||
return 5
|
||||
if("NORTHWEST", "NW")
|
||||
return 9
|
||||
if("SOUTHEAST", "SE")
|
||||
return 6
|
||||
if("SOUTHWEST", "SW")
|
||||
return 10
|
||||
else
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
// A copy of dir2text, which returns the short one or two letter
|
||||
// directions used in tube icon states.
|
||||
/obj/structure/transit_tube/proc/dir2text_short(direction)
|
||||
switch(direction)
|
||||
if(1)
|
||||
return "N"
|
||||
if(2)
|
||||
return "S"
|
||||
if(4)
|
||||
return "E"
|
||||
if(8)
|
||||
return "W"
|
||||
if(5)
|
||||
return "NE"
|
||||
if(6)
|
||||
return "SE"
|
||||
if(9)
|
||||
return "NW"
|
||||
if(10)
|
||||
return "SW"
|
||||
else
|
||||
return
|
||||
@@ -104,9 +104,17 @@
|
||||
new /obj/item/weapon/shard(loc)
|
||||
if(reinf) new /obj/item/stack/rods(loc)
|
||||
del(src)
|
||||
else if (usr.a_intent == "hurt")
|
||||
playsound(src.loc, 'Glassknock.ogg', 80, 1)
|
||||
usr.visible_message("\red [usr.name] bangs against the [src.name]!", \
|
||||
"\red You bang against the [src.name]!", \
|
||||
"You hear a banging sound.")
|
||||
else
|
||||
user.visible_message("<span class='notice'>[user] knocks on [src].</span>")
|
||||
playsound(loc, 'sound/effects/Glasshit.ogg', 50, 1)
|
||||
playsound(src.loc, 'Glassknock.ogg', 80, 1)
|
||||
usr.visible_message("[usr.name] knocks on the [src.name].", \
|
||||
"You knock on the [src.name].", \
|
||||
"You hear a knocking sound.")
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/window/attack_paw(mob/user as mob)
|
||||
|
||||
@@ -11,6 +11,19 @@
|
||||
src << "You can't commit suicide before the game starts!"
|
||||
return
|
||||
|
||||
|
||||
var/permitted = 0
|
||||
var/list/allowed = list("Syndicate","traitor","Wizard","Head Revolutionary","Cultist","Changeling")
|
||||
for(var/T in allowed)
|
||||
if(mind.special_role == T)
|
||||
permitted = 1
|
||||
break
|
||||
|
||||
if(!permitted)
|
||||
message_admins("[ckey] has tried to suicide, but they were not permitted due to not being antagonist as human.", 1)
|
||||
src << "No. Adminhelp if there is a legitimate reason."
|
||||
return
|
||||
|
||||
if (suiciding)
|
||||
src << "You're already committing suicide! Be patient!"
|
||||
return
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
//Chief Engineer's rig
|
||||
/obj/item/clothing/head/helmet/space/rig/elite
|
||||
name = "advanced hardsuit helmet"
|
||||
desc = "A special suit that protects against hazardous, low pressure environments. Shines with a high polish."
|
||||
desc = "An advanced helmet designed for work in a hazardous, low pressure environment. Shines with a high polish."
|
||||
icon_state = "rig0-white"
|
||||
item_state = "ce_helm"
|
||||
color = "white"
|
||||
@@ -58,12 +58,14 @@
|
||||
/obj/item/clothing/suit/space/rig/elite
|
||||
icon_state = "rig-white"
|
||||
name = "advanced hardsuit"
|
||||
desc = "An advanced suit that protects against hazardous, low pressure environments. Shines with a high polish."
|
||||
item_state = "ce_hardsuit"
|
||||
|
||||
|
||||
//Mining rig
|
||||
/obj/item/clothing/head/helmet/space/rig/mining
|
||||
name = "mining hardsuit helmet"
|
||||
desc = "A special helmet designed for work in a hazardous, low pressure environment. Has reinforced plating."
|
||||
icon_state = "rig0-mining"
|
||||
item_state = "mining_helm"
|
||||
color = "mining"
|
||||
@@ -71,6 +73,7 @@
|
||||
/obj/item/clothing/suit/space/rig/mining
|
||||
icon_state = "rig-mining"
|
||||
name = "mining hardsuit"
|
||||
desc = "A special suit that protects against hazardous, low pressure environments. Has reinforced plating."
|
||||
item_state = "mining_hardsuit"
|
||||
|
||||
|
||||
@@ -78,6 +81,7 @@
|
||||
//Syndicate rig
|
||||
/obj/item/clothing/head/helmet/space/rig/syndi
|
||||
name = "blood-red hardsuit helmet"
|
||||
desc = "An advanced helmet designed for work in special operations. Property of Gorlex Marauders."
|
||||
icon_state = "rig0-syndi"
|
||||
item_state = "syndie_helm"
|
||||
color = "syndi"
|
||||
@@ -87,6 +91,7 @@
|
||||
/obj/item/clothing/suit/space/rig/syndi
|
||||
icon_state = "rig-syndi"
|
||||
name = "blood-red hardsuit"
|
||||
desc = "An advanced suit that protects against injuries during special operations. Property of Gorlex Marauders."
|
||||
item_state = "syndie_hardsuit"
|
||||
slowdown = 1
|
||||
w_class = 3
|
||||
@@ -97,6 +102,7 @@
|
||||
//Wizard Rig
|
||||
/obj/item/clothing/head/helmet/space/rig/wizard
|
||||
name = "gem-encrusted hardsuit helmet"
|
||||
desc = "A bizarre gem-encrusted helmet that radiates magical energies."
|
||||
icon_state = "rig0-wiz"
|
||||
item_state = "wiz_helm"
|
||||
color = "wiz"
|
||||
@@ -106,6 +112,7 @@
|
||||
/obj/item/clothing/suit/space/rig/wizard
|
||||
icon_state = "rig-wiz"
|
||||
name = "gem-encrusted hardsuit"
|
||||
desc = "A bizarre gem-encrusted suit that radiates magical energies."
|
||||
item_state = "wiz_hardsuit"
|
||||
slowdown = 1
|
||||
w_class = 3
|
||||
@@ -116,6 +123,7 @@
|
||||
//Medical Rig
|
||||
/obj/item/clothing/head/helmet/space/rig/medical
|
||||
name = "medical hardsuit helmet"
|
||||
desc = "A special helmet designed for work in a hazardous, low pressure environment. Has minor radiation shielding."
|
||||
icon_state = "rig0-medical"
|
||||
item_state = "medical_helm"
|
||||
color = "medical"
|
||||
@@ -123,6 +131,7 @@
|
||||
/obj/item/clothing/suit/space/rig/medical
|
||||
icon_state = "rig-medical"
|
||||
name = "medical hardsuit"
|
||||
desc = "A special suit that protects against hazardous, low pressure environments. Has minor radiation shielding."
|
||||
item_state = "medical_hardsuit"
|
||||
allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank,/obj/item/weapon/storage/firstaid,/obj/item/device/healthanalyzer,/obj/item/stack/medical)
|
||||
|
||||
@@ -130,6 +139,7 @@
|
||||
//Security
|
||||
/obj/item/clothing/head/helmet/space/rig/security
|
||||
name = "security hardsuit helmet"
|
||||
desc = "A special helmet designed for work in a hazardous, low pressure environment. Has an additional layer of armor."
|
||||
icon_state = "rig0-sec"
|
||||
item_state = "sec_helm"
|
||||
color = "sec"
|
||||
@@ -138,6 +148,7 @@
|
||||
/obj/item/clothing/suit/space/rig/security
|
||||
icon_state = "rig-sec"
|
||||
name = "security hardsuit"
|
||||
desc = "A special suit that protects against hazardous, low pressure environments. Has an additional layer of armor."
|
||||
item_state = "sec_hardsuit"
|
||||
armor = list(melee = 60, bullet = 10, laser = 30, energy = 5, bomb = 45, bio = 100, rad = 10)
|
||||
allowed = list(/obj/item/weapon/gun,/obj/item/device/flashlight,/obj/item/weapon/tank,/obj/item/weapon/melee/baton)
|
||||
|
||||
@@ -11,13 +11,14 @@
|
||||
break
|
||||
|
||||
/datum/event/pda_spam/tick()
|
||||
if(!useMS.active)
|
||||
if(!useMS || !useMS.active)
|
||||
useMS = null
|
||||
if(!useMS && message_servers)
|
||||
for (var/obj/machinery/message_server/MS in message_servers)
|
||||
if(MS.active)
|
||||
useMS = MS
|
||||
break
|
||||
if(message_servers)
|
||||
for (var/obj/machinery/message_server/MS in message_servers)
|
||||
if(MS.active)
|
||||
useMS = MS
|
||||
break
|
||||
|
||||
if(useMS)
|
||||
time_failed = world.time
|
||||
if(prob(2))
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
/datum/event/prison_break/announce()
|
||||
if(prisonAreas && prisonAreas.len > 0)
|
||||
command_alert("[pick("Gr3y.T1d3 virus","Malignant trojan","Syndicate malware")] detected in [station_name()] imprisonment subroutines. Recommend station AI involvement.", "Security Alert")
|
||||
command_alert("[pick("Gr3y.T1d3 virus","Malignant trojan")] detected in [station_name()] imprisonment subroutines. Recommend station AI involvement.", "Security Alert")
|
||||
else
|
||||
world.log << "ERROR: Could not initate grey-tide. Unable find prison or brig area."
|
||||
kill()
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
else if(prob(50))
|
||||
msg = "Contact has been lost with a combat drone wing operating out of the NMV Icarus. If any are sighted in the area, approach with caution."
|
||||
else
|
||||
msg = "Syndicate saboteurs have targetted a combat drone wing deployed from the NMV Icarus. If any are sighted in the area, approach with caution."
|
||||
msg = "Unidentified hackers have targetted a combat drone wing deployed from the NMV Icarus. If any are sighted in the area, approach with caution."
|
||||
command_alert(msg, "Rogue drone alert")
|
||||
|
||||
/datum/event/rogue_drone/tick()
|
||||
|
||||
@@ -193,6 +193,10 @@ proc/move_mining_shuttle()
|
||||
var/digspeed = 40 //moving the delay to an item var so R&D can make improved picks. --NEO
|
||||
origin_tech = "materials=1;engineering=1"
|
||||
attack_verb = list("hit", "pierced", "sliced", "attacked")
|
||||
var/drill_sound = 'sound/weapons/Genhit.ogg'
|
||||
var/drill_verb = "picking"
|
||||
|
||||
var/excavation_amount = 100
|
||||
|
||||
hammer
|
||||
name = "sledgehammer"
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
/**********************Mineral deposits**************************/
|
||||
|
||||
#define XENOARCH_SPAWN_CHANCE 0.5
|
||||
#define XENOARCH_SPREAD_CHANCE 15
|
||||
#define ARTIFACT_SPAWN_CHANCE 20
|
||||
|
||||
/turf/simulated/mineral //wall piece
|
||||
name = "Rock"
|
||||
icon = 'icons/turf/walls.dmi'
|
||||
@@ -14,9 +18,18 @@
|
||||
var/mineralAmt = 0
|
||||
var/spread = 0 //will the seam spread?
|
||||
var/spreadChance = 0 //the percentual chance of an ore spreading to the neighbouring tiles
|
||||
var/artifactChance = 0.3 //percent chance to spawn a xenoarchaelogical artifact
|
||||
var/last_act = 0
|
||||
|
||||
var/datum/geosample/geological_data
|
||||
var/excavation_level = 0
|
||||
var/list/finds = list()
|
||||
var/list/excavation_minerals = list()
|
||||
var/next_rock = 0
|
||||
var/archaeo_overlay = ""
|
||||
var/excav_overlay = ""
|
||||
var/obj/item/weapon/last_find
|
||||
var/datum/artifact_find/artifact_find
|
||||
|
||||
/turf/simulated/mineral/Del()
|
||||
return
|
||||
|
||||
@@ -55,24 +68,89 @@
|
||||
T.overlays += image('icons/turf/walls.dmi', "rock_side_e", layer=6)
|
||||
|
||||
if (mineralName && mineralAmt && spread && spreadChance)
|
||||
if(prob(spreadChance))
|
||||
if(istype(get_step(src, SOUTH), /turf/simulated/mineral/random))
|
||||
new src.type(get_step(src, SOUTH))
|
||||
if(prob(spreadChance))
|
||||
if(istype(get_step(src, NORTH), /turf/simulated/mineral/random))
|
||||
new src.type(get_step(src, NORTH))
|
||||
if(prob(spreadChance))
|
||||
if(istype(get_step(src, WEST), /turf/simulated/mineral/random))
|
||||
new src.type(get_step(src, WEST))
|
||||
if(prob(spreadChance))
|
||||
if(istype(get_step(src, EAST), /turf/simulated/mineral/random))
|
||||
new src.type(get_step(src, EAST))
|
||||
for(var/trydir in list(1,2,4,8))
|
||||
if(prob(spreadChance))
|
||||
if(istype(get_step(src, trydir), /turf/simulated/mineral/random))
|
||||
var/turf/simulated/mineral/T = get_step(src, trydir)
|
||||
var/turf/simulated/mineral/M = new src.type(T)
|
||||
//keep any digsite data as constant as possible
|
||||
if(T.finds.len && !M.finds.len)
|
||||
M.finds = T.finds
|
||||
if(T.archaeo_overlay)
|
||||
M.overlays += archaeo_overlay
|
||||
|
||||
|
||||
//---- Xenoarchaeology BEGIN
|
||||
|
||||
//put into spawn so that digsite data can be preserved over the turf replacements via spreading mineral veins
|
||||
spawn(0)
|
||||
if(mineralAmt > 0 && !excavation_minerals.len)
|
||||
for(var/i=0, i<mineralAmt, i++)
|
||||
excavation_minerals.Add(rand(5,95))
|
||||
excavation_minerals = insertion_sort_numeric_list_descending(excavation_minerals)
|
||||
|
||||
if(!finds.len && prob(XENOARCH_SPAWN_CHANCE))
|
||||
//create a new archaeological deposit
|
||||
var/digsite = get_random_digsite_type()
|
||||
|
||||
var/list/turfs_to_process = list(src)
|
||||
var/list/processed_turfs = list()
|
||||
while(turfs_to_process.len)
|
||||
var/turf/simulated/mineral/M = turfs_to_process[1]
|
||||
for(var/turf/simulated/mineral/T in orange(1, M))
|
||||
if(T.finds.len)
|
||||
continue
|
||||
if(T in processed_turfs)
|
||||
continue
|
||||
if(prob(XENOARCH_SPREAD_CHANCE))
|
||||
turfs_to_process.Add(T)
|
||||
|
||||
turfs_to_process.Remove(M)
|
||||
processed_turfs.Add(M)
|
||||
if(!M.finds.len)
|
||||
if(prob(50))
|
||||
M.finds.Add(new/datum/find(digsite, rand(5,95)))
|
||||
else if(prob(75))
|
||||
M.finds.Add(new/datum/find(digsite, rand(5,45)))
|
||||
M.finds.Add(new/datum/find(digsite, rand(55,95)))
|
||||
else
|
||||
M.finds.Add(new/datum/find(digsite, rand(5,30)))
|
||||
M.finds.Add(new/datum/find(digsite, rand(35,75)))
|
||||
M.finds.Add(new/datum/find(digsite, rand(75,95)))
|
||||
|
||||
//sometimes a find will be close enough to the surface to show
|
||||
var/datum/find/F = M.finds[1]
|
||||
if(F.excavation_required <= F.view_range)
|
||||
archaeo_overlay = "overlay_archaeo[rand(1,3)]"
|
||||
M.overlays += archaeo_overlay
|
||||
|
||||
//dont create artifact machinery in animal or plant digsites, or if we already have one
|
||||
if(!artifact_find && digsite != 1 && digsite != 2 && prob(ARTIFACT_SPAWN_CHANCE))
|
||||
artifact_find = new()
|
||||
artifact_spawning_turfs.Add(src)
|
||||
|
||||
if(!src.geological_data)
|
||||
src.geological_data = new/datum/geosample(src)
|
||||
src.geological_data.UpdateTurf(src)
|
||||
|
||||
//for excavated turfs placeable in the map editor
|
||||
/*if(excavation_level > 0)
|
||||
if(excavation_level < 25)
|
||||
src.overlays += image('icons/obj/xenoarchaeology.dmi', "overlay_excv1_[rand(1,3)]")
|
||||
else if(excavation_level < 50)
|
||||
src.overlays += image('icons/obj/xenoarchaeology.dmi', "overlay_excv2_[rand(1,3)]")
|
||||
else if(excavation_level < 75)
|
||||
src.overlays += image('icons/obj/xenoarchaeology.dmi', "overlay_excv3_[rand(1,3)]")
|
||||
else
|
||||
src.overlays += image('icons/obj/xenoarchaeology.dmi', "overlay_excv4_[rand(1,3)]")
|
||||
desc = "It appears to be partially excavated."*/
|
||||
|
||||
return
|
||||
|
||||
/turf/simulated/mineral/random
|
||||
name = "Mineral deposit"
|
||||
var/mineralAmtList = list("Uranium" = 5, "Iron" = 5, "Diamond" = 5, "Gold" = 5, "Silver" = 5, "Plasma" = 5, "Archaeo" = 3/*, "Adamantine" = 5*/)
|
||||
var/mineralSpawnChanceList = list("Uranium" = 5, "Iron" = 50, "Diamond" = 1, "Gold" = 5, "Silver" = 5, "Plasma" = 25, "Archaeo" = 5/*, "Adamantine" =5*/)//Currently, Adamantine won't spawn as it has no uses. -Durandan
|
||||
var/mineralAmtList = list("Uranium" = 5, "Iron" = 5, "Diamond" = 5, "Gold" = 5, "Silver" = 5, "Plasma" = 5/*, "Adamantine" = 5*/)
|
||||
var/mineralSpawnChanceList = list("Uranium" = 5, "Iron" = 50, "Diamond" = 1, "Gold" = 5, "Silver" = 5, "Plasma" = 25/*, "Adamantine" =5*/)//Currently, Adamantine won't spawn as it has no uses. -Durandan
|
||||
var/mineralChance = 10 //means 10% chance of this plot changing to a mineral deposit
|
||||
|
||||
/turf/simulated/mineral/random/New()
|
||||
@@ -95,16 +173,22 @@
|
||||
M = new/turf/simulated/mineral/silver(src)
|
||||
if("Plasma")
|
||||
M = new/turf/simulated/mineral/plasma(src)
|
||||
if("Archaeo")
|
||||
M = new/turf/simulated/mineral/archaeo(src)
|
||||
/*if("Adamantine")
|
||||
M = new/turf/simulated/mineral/adamantine(src)*/
|
||||
if(M)
|
||||
src = M
|
||||
M.levelupdate()
|
||||
else if (prob(artifactChance))
|
||||
//spawn a rare, xeno-arch artifact here
|
||||
new/obj/machinery/artifact(src)
|
||||
|
||||
//preserve archaeo data
|
||||
M.geological_data = src.geological_data
|
||||
M.excavation_minerals = src.excavation_minerals
|
||||
M.overlays = src.overlays
|
||||
M.artifact_find = src.artifact_find
|
||||
M.archaeo_overlay = src.archaeo_overlay
|
||||
M.excav_overlay = src.excav_overlay
|
||||
|
||||
/*else if (prob(artifactChance))
|
||||
new/obj/machinery/artifact(src)*/
|
||||
return
|
||||
|
||||
/turf/simulated/mineral/random/high_chance
|
||||
@@ -169,15 +253,6 @@
|
||||
spread = 1
|
||||
|
||||
|
||||
/turf/simulated/mineral/archaeo
|
||||
name = "Strange rock formation"
|
||||
icon_state = "rock_Archaeo"
|
||||
mineralName = "Archaeo"
|
||||
mineralAmt = 3
|
||||
spreadChance = 25
|
||||
spread = 1
|
||||
|
||||
|
||||
/turf/simulated/mineral/clown
|
||||
name = "Bananium deposit"
|
||||
icon_state = "rock_Clown"
|
||||
@@ -222,6 +297,24 @@ commented out in r5061, I left it because of the shroom thingies
|
||||
usr << "\red You don't have the dexterity to do this!"
|
||||
return
|
||||
|
||||
if (istype(W, /obj/item/device/core_sampler))
|
||||
src.geological_data.UpdateNearbyArtifactInfo(src)
|
||||
var/obj/item/device/core_sampler/C = W
|
||||
C.sample_item(src, user)
|
||||
return
|
||||
|
||||
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,40))
|
||||
user << "\blue \icon[P] [src] has been excavated to a depth of [2*src.excavation_level]cm."
|
||||
return
|
||||
|
||||
if (istype(W, /obj/item/weapon/pickaxe))
|
||||
var/turf/T = user.loc
|
||||
if (!( istype(T, /turf) ))
|
||||
@@ -233,56 +326,276 @@ commented out in r5061, I left it because of the shroom thingies
|
||||
return
|
||||
*/
|
||||
//Watch your tabbing, microwave. --NEO
|
||||
if(last_act+W:digspeed > world.time)//prevents message spam
|
||||
|
||||
var/obj/item/weapon/pickaxe/P = W
|
||||
if(last_act+P.digspeed > world.time)//prevents message spam
|
||||
return
|
||||
last_act = world.time
|
||||
user << "\red You start picking."
|
||||
playsound(user, 'sound/weapons/Genhit.ogg', 20, 1)
|
||||
|
||||
if(do_after(user,W:digspeed))
|
||||
user << "\blue You finish cutting into the rock."
|
||||
gets_drilled()
|
||||
playsound(user, P.drill_sound, 20, 1)
|
||||
|
||||
//handle any archaeological finds we might uncover
|
||||
var/fail_message
|
||||
if(src.finds.len)
|
||||
var/datum/find/F = src.finds[1]
|
||||
if(src.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)
|
||||
if(prob(50))
|
||||
if(prob(25))
|
||||
excavate_find(5, src.finds[1])
|
||||
else if(prob(50))
|
||||
src.finds.Remove(src.finds[1])
|
||||
|
||||
if(do_after(user,P.digspeed))
|
||||
user << "\blue You finish [P.drill_verb] the rock."
|
||||
|
||||
if(finds.len)
|
||||
var/datum/find/F = src.finds[1]
|
||||
if(round(src.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(src.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(src.excavation_level + P.excavation_amount > F.excavation_required - F.clearance_range)
|
||||
//just pull the surrounding rock out
|
||||
excavate_find(0, F)
|
||||
|
||||
if( src.excavation_level + P.excavation_amount >= 100 || (!finds.len && !excavation_minerals.len) )
|
||||
//if players have been excavating this turf, have a chance to leave some rocky debris behind
|
||||
var/boulder_prob = 0
|
||||
var/obj/structure/boulder/B
|
||||
|
||||
if(src.excavation_level > 15)
|
||||
boulder_prob = 10
|
||||
if(artifact_find)
|
||||
boulder_prob += 25
|
||||
if(src.excavation_level >= 100)
|
||||
boulder_prob += 40
|
||||
else if(src.excavation_level > 95)
|
||||
boulder_prob += 25
|
||||
else if(src.excavation_level > 90)
|
||||
boulder_prob += 10
|
||||
if(prob(boulder_prob))
|
||||
B = new(src)
|
||||
if(artifact_find)
|
||||
B.artifact_find = artifact_find
|
||||
else if(src.excavation_level + P.excavation_amount >= 100)
|
||||
artifact_debris()
|
||||
|
||||
gets_drilled(B ? 0 : 1)
|
||||
return
|
||||
else
|
||||
src.excavation_level += P.excavation_amount
|
||||
|
||||
//archaeo overlays
|
||||
if(!archaeo_overlay && finds.len)
|
||||
var/datum/find/F = src.finds[1]
|
||||
if(F.excavation_required <= src.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(src.excavation_level >= 75)
|
||||
if(src.excavation_level - P.excavation_amount < 75)
|
||||
update_excav_overlay = 1
|
||||
else if(src.excavation_level >= 50)
|
||||
if(src.excavation_level - P.excavation_amount < 50)
|
||||
update_excav_overlay = 1
|
||||
else if(src.excavation_level >= 25)
|
||||
if(src.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
|
||||
|
||||
//extract pesky minerals while we're excavating
|
||||
while(excavation_minerals.len && src.excavation_level > excavation_minerals[excavation_minerals.len])
|
||||
drop_mineral()
|
||||
//have a 50% chance to extract bonus minerals this way
|
||||
//if(prob(50))
|
||||
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)
|
||||
src.geological_data.UpdateNearbyArtifactInfo(src)
|
||||
O.geological_data = src.geological_data
|
||||
|
||||
else
|
||||
return attack_hand(user)
|
||||
return
|
||||
|
||||
/turf/simulated/mineral/proc/gets_drilled()
|
||||
var/destroyed = 0 //used for breaking strange rocks
|
||||
/turf/simulated/mineral/proc/drop_mineral()
|
||||
var/obj/item/weapon/ore/O
|
||||
if (src.mineralName == "Uranium")
|
||||
O = new /obj/item/weapon/ore/uranium(src)
|
||||
if (src.mineralName == "Iron")
|
||||
O = new /obj/item/weapon/ore/iron(src)
|
||||
if (src.mineralName == "Gold")
|
||||
O = new /obj/item/weapon/ore/gold(src)
|
||||
if (src.mineralName == "Silver")
|
||||
O = new /obj/item/weapon/ore/silver(src)
|
||||
if (src.mineralName == "Plasma")
|
||||
O = new /obj/item/weapon/ore/plasma(src)
|
||||
if (src.mineralName == "Diamond")
|
||||
O = new /obj/item/weapon/ore/diamond(src)
|
||||
/*if (src.mineralName == "Archaeo")
|
||||
//new /obj/item/weapon/archaeological_find(src)
|
||||
//if(prob(10) || delicate)
|
||||
if(prob(50)) //Don't have delicate tools (hand pick/excavation tool) yet, temporarily change to 50% instead of 10% -Mij
|
||||
O = new /obj/item/weapon/ore/strangerock(src)
|
||||
else
|
||||
destroyed = 1*/
|
||||
if (src.mineralName == "Clown")
|
||||
O = new /obj/item/weapon/ore/clown(src)
|
||||
if(O)
|
||||
src.geological_data.UpdateNearbyArtifactInfo(src)
|
||||
O.geological_data = src.geological_data
|
||||
return O
|
||||
|
||||
/turf/simulated/mineral/proc/gets_drilled(var/artifact_fail = 0)
|
||||
//var/destroyed = 0 //used for breaking strange rocks
|
||||
if ((src.mineralName != "") && (src.mineralAmt > 0) && (src.mineralAmt < 11))
|
||||
var/i
|
||||
for (i=0;i<mineralAmt;i++)
|
||||
if (src.mineralName == "Uranium")
|
||||
new /obj/item/weapon/ore/uranium(src)
|
||||
if (src.mineralName == "Iron")
|
||||
new /obj/item/weapon/ore/iron(src)
|
||||
if (src.mineralName == "Gold")
|
||||
new /obj/item/weapon/ore/gold(src)
|
||||
if (src.mineralName == "Silver")
|
||||
new /obj/item/weapon/ore/silver(src)
|
||||
if (src.mineralName == "Plasma")
|
||||
new /obj/item/weapon/ore/plasma(src)
|
||||
if (src.mineralName == "Diamond")
|
||||
new /obj/item/weapon/ore/diamond(src)
|
||||
if (src.mineralName == "Archaeo")
|
||||
//spawn strange rocks here
|
||||
//if(prob(10) || delicate)
|
||||
if(prob(50)) //Don't have delicate tools (hand pick/excavation tool) yet, temporarily change to 50% instead of 10% -Mij
|
||||
new /obj/item/weapon/ore/strangerock(src)
|
||||
else
|
||||
destroyed = 1
|
||||
if (src.mineralName == "Clown")
|
||||
new /obj/item/weapon/ore/clown(src)
|
||||
if (prob(src.artifactChance))
|
||||
|
||||
//if the turf has already been excavated, some of it's ore has been removed
|
||||
for (var/i=0;i<mineralAmt;i++)
|
||||
drop_mineral()
|
||||
|
||||
//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 fadaing 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)
|
||||
|
||||
/*if (prob(src.artifactChance))
|
||||
//spawn a rare artifact here
|
||||
new /obj/machinery/artifact(src)
|
||||
new /obj/machinery/artifact(src)*/
|
||||
var/turf/simulated/floor/plating/airless/asteroid/N = ChangeTurf(/turf/simulated/floor/plating/airless/asteroid)
|
||||
N.fullUpdateMineralOverlays()
|
||||
|
||||
if(destroyed) //Display message about being a terrible miner
|
||||
usr << "\red You destroy some of the rocks!"
|
||||
/*if(destroyed) //Display message about being a terrible miner
|
||||
usr << "\red You destroy some of the rocks!"*/
|
||||
return
|
||||
|
||||
/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)
|
||||
src.geological_data.UpdateNearbyArtifactInfo(src)
|
||||
X:geological_data = src.geological_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
|
||||
|
||||
//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)
|
||||
src.visible_message("\red<b>[pick("[display_name] crumbles away into dust","[display_name] breaks apart","[display_name] collapses onto itself")].</b>")
|
||||
del(X)
|
||||
|
||||
src.finds.Remove(F)
|
||||
|
||||
/turf/simulated/mineral/proc/artifact_debris()
|
||||
//cael's patented random limited drop componentized loot system!
|
||||
var/materials = 0
|
||||
var/list/viable_materials = list(1,2,4,8,16,32,64,128,256)
|
||||
|
||||
var/num_materials = rand(1,5)
|
||||
for(var/i=0, i<num_materials, i++)
|
||||
var/chosen = pick(viable_materials)
|
||||
materials |= chosen
|
||||
viable_materials.Remove(chosen)
|
||||
|
||||
if(materials & 1)
|
||||
var/quantity = rand(0,3)
|
||||
for(var/i=0, i<quantity, i++)
|
||||
var/obj/item/stack/rods/R = new(src)
|
||||
R.amount = rand(5,25)
|
||||
|
||||
if(materials & 2)
|
||||
var/quantity = pick(0, 0, 1)
|
||||
for(var/i=0, i<quantity, i++)
|
||||
var/obj/item/stack/tile/R = new(src)
|
||||
R.amount = rand(1,5)
|
||||
|
||||
if(materials & 4)
|
||||
var/quantity = rand(0,3)
|
||||
for(var/i=0, i<quantity, i++)
|
||||
var/obj/item/stack/sheet/metal/R = new(src)
|
||||
R.amount = rand(5,25)
|
||||
|
||||
if(materials & 8)
|
||||
var/quantity = rand(0,3)
|
||||
for(var/i=0, i<quantity, i++)
|
||||
var/obj/item/stack/sheet/plasteel/R = new(src)
|
||||
R.amount = rand(5,25)
|
||||
|
||||
if(materials & 16)
|
||||
var/quantity = rand(0,3)
|
||||
for(var/i=0, i<quantity, i++)
|
||||
new /obj/item/weapon/shard(src)
|
||||
|
||||
if(materials & 32)
|
||||
var/quantity = rand(0,3)
|
||||
for(var/i=0, i<quantity, i++)
|
||||
new /obj/item/weapon/shard/plasma(src)
|
||||
|
||||
if(materials & 64)
|
||||
var/quantity = rand(0,3)
|
||||
for(var/i=0, i<quantity, i++)
|
||||
var/obj/item/stack/sheet/mineral/uranium/R = new(src)
|
||||
R.amount = rand(5,25)
|
||||
|
||||
if(materials & 128)
|
||||
var/quantity = rand(0,3)
|
||||
for(var/i=0, i<quantity, i++)
|
||||
var/obj/item/stack/sheet/mineral/mythril/R = new(src)
|
||||
R.amount = rand(5,25)
|
||||
|
||||
if(materials & 256)
|
||||
var/quantity = rand(0,3)
|
||||
for(var/i=0, i<quantity, i++)
|
||||
var/obj/item/stack/sheet/mineral/adamantine/R = new(src)
|
||||
R.amount = rand(5,25)
|
||||
|
||||
/*
|
||||
/turf/simulated/mineral/proc/setRandomMinerals()
|
||||
var/s = pickweight(list("uranium" = 5, "iron" = 50, "gold" = 5, "silver" = 5, "plasma" = 50, "diamond" = 1))
|
||||
@@ -448,7 +761,6 @@ commented out in r5061, I left it because of the shroom thingies
|
||||
if(istype(get_step(src, WEST), /turf/simulated/mineral))
|
||||
src.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))
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/obj/item/weapon/ore
|
||||
name = "Rock"
|
||||
icon = 'icons/obj/mining.dmi'
|
||||
icon_state = "ore"
|
||||
|
||||
icon_state = "ore2"
|
||||
var/datum/geosample/geological_data
|
||||
|
||||
/obj/item/weapon/ore/uranium
|
||||
name = "Uranium ore"
|
||||
@@ -59,19 +59,16 @@
|
||||
desc = "Completely useless"
|
||||
icon_state = "slag"
|
||||
|
||||
/obj/item/weapon/ore/strangerock //see artifact_archaeo.dm in modules/research for more info
|
||||
name = "Strange rock"
|
||||
desc = "Seems to have some unusal strata evident throughout it."
|
||||
icon_state = "strange"
|
||||
var/obj/inside
|
||||
var/method // 0 = fire, 1+ = acid
|
||||
origin_tech = "materials=5"
|
||||
//unacidable = 1 //This can prevent acid from gooey grey massing
|
||||
|
||||
/obj/item/weapon/ore/New()
|
||||
pixel_x = rand(0,16)-8
|
||||
pixel_y = rand(0,8)-8
|
||||
|
||||
/obj/item/weapon/ore/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W,/obj/item/device/core_sampler))
|
||||
var/obj/item/device/core_sampler/C = W
|
||||
C.sample_item(src, user)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/*****************************Coin********************************/
|
||||
|
||||
@@ -152,4 +149,4 @@
|
||||
overlays = list()
|
||||
string_attached = null
|
||||
user << "\blue You detach the string from the coin."
|
||||
else ..()
|
||||
else ..()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// All mobs should have custom emote, really..
|
||||
mob/proc/custom_emote(var/m_type=1,var/message = null)
|
||||
|
||||
if(!emote_allowed && usr == src)
|
||||
if(!use_me && usr == src)
|
||||
usr << "You are unable to emote."
|
||||
return
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
var/ghost_name = "Unknown"
|
||||
var/creating_blob = 0
|
||||
faction = "blob"
|
||||
use_me = 0 //Blobs can't emote
|
||||
|
||||
|
||||
New()
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
#define X_SUIT_LAYER 2
|
||||
#define X_L_HAND_LAYER 3
|
||||
#define X_R_HAND_LAYER 4
|
||||
#define X_TOTAL_LAYERS 4
|
||||
#define TARGETED_LAYER 5
|
||||
#define X_TOTAL_LAYERS 5
|
||||
/////////////////////////////////
|
||||
|
||||
/mob/living/carbon/alien/humanoid
|
||||
@@ -132,10 +133,22 @@
|
||||
overlays_standing[X_L_HAND_LAYER] = null
|
||||
if(update_icons) update_icons()
|
||||
|
||||
//Call when target overlay should be added/removed
|
||||
/mob/living/carbon/alien/humanoid/update_targeted(var/update_icons=1)
|
||||
if (targeted_by && target_locked)
|
||||
overlays_lying[TARGETED_LAYER] = target_locked
|
||||
overlays_standing[TARGETED_LAYER] = target_locked
|
||||
else if (!targeted_by && target_locked)
|
||||
del(target_locked)
|
||||
if (!targeted_by)
|
||||
overlays_lying[TARGETED_LAYER] = null
|
||||
overlays_standing[TARGETED_LAYER] = null
|
||||
if(update_icons) update_icons()
|
||||
|
||||
//Xeno Overlays Indexes//////////
|
||||
#undef X_HEAD_LAYER
|
||||
#undef X_SUIT_LAYER
|
||||
#undef X_L_HAND_LAYER
|
||||
#undef X_R_HAND_LAYER
|
||||
#undef TARGETED_LAYER
|
||||
#undef X_TOTAL_LAYERS
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
var/timeofhostdeath = 0
|
||||
var/emp_damage = 0//Handles a type of MMI damage
|
||||
var/alert = null
|
||||
use_me = 0 //Can't use the me verb, it's a freaking immobile brain
|
||||
|
||||
New()
|
||||
var/datum/reagents/R = new/datum/reagents(1000)
|
||||
@@ -48,6 +49,8 @@
|
||||
|
||||
|
||||
/mob/living/carbon/brain/update_canmove()
|
||||
if(in_contents_of(/obj/mecha)) canmove = 1
|
||||
if(in_contents_of(/obj/mecha))
|
||||
canmove = 1
|
||||
use_me = 1 //If it can move, let it emote
|
||||
else canmove = 0
|
||||
return canmove
|
||||
@@ -1,4 +1,4 @@
|
||||
/obj/item/device/posibrain
|
||||
/obj/item/device/mmi/posibrain
|
||||
name = "positronic brain"
|
||||
desc = "A cube of shining metal, four inches to a side and covered in shallow grooves."
|
||||
icon = 'icons/obj/assemblies.dmi'
|
||||
@@ -6,14 +6,15 @@
|
||||
w_class = 3
|
||||
origin_tech = "engineering=4;materials=4;bluespace=2;programming=4"
|
||||
|
||||
var/list/construction_cost = list("metal"=500,"glass"=500,"silver"=200,"gold"=200,"plasma"=100,"diamond"=10)
|
||||
var/construction_time = 75
|
||||
construction_cost = list("metal"=500,"glass"=500,"silver"=200,"gold"=200,"plasma"=100,"diamond"=10)
|
||||
construction_time = 75
|
||||
var/searching = 0
|
||||
var/askDelay = 10 * 60 * 1
|
||||
var/mob/living/carbon/brain/brainmob = null
|
||||
mob/living/carbon/brain/brainmob = null
|
||||
req_access = list(access_robotics)
|
||||
var/locked = 0
|
||||
var/obj/mecha = null//This does not appear to be used outside of reference in mecha.dm.
|
||||
locked = 0
|
||||
mecha = null//This does not appear to be used outside of reference in mecha.dm.
|
||||
|
||||
|
||||
attack_self(mob/user as mob)
|
||||
if(!brainmob.key && searching == 0)
|
||||
@@ -73,7 +74,7 @@
|
||||
for (var/mob/M in viewers(T))
|
||||
M.show_message("\blue The positronic brain buzzes quietly, and the golden lights fade away. Perhaps you could try again?")
|
||||
|
||||
/obj/item/device/posibrain/examine()
|
||||
/obj/item/device/mmi/posibrain/examine()
|
||||
|
||||
set src in oview()
|
||||
|
||||
@@ -97,20 +98,20 @@
|
||||
usr << msg
|
||||
return
|
||||
|
||||
/obj/item/device/posibrain/emp_act(severity)
|
||||
if(!brainmob)
|
||||
/obj/item/device/mmi/posibrain/emp_act(severity)
|
||||
if(!src.brainmob)
|
||||
return
|
||||
else
|
||||
switch(severity)
|
||||
if(1)
|
||||
brainmob.emp_damage += rand(20,30)
|
||||
src.brainmob.emp_damage += rand(20,30)
|
||||
if(2)
|
||||
brainmob.emp_damage += rand(10,20)
|
||||
src.brainmob.emp_damage += rand(10,20)
|
||||
if(3)
|
||||
brainmob.emp_damage += rand(0,10)
|
||||
src.brainmob.emp_damage += rand(0,10)
|
||||
..()
|
||||
|
||||
/obj/item/device/posibrain/New()
|
||||
/obj/item/device/mmi/posibrain/New()
|
||||
|
||||
src.brainmob = new(src)
|
||||
src.brainmob.name = "[pick(list("PBU","HIU","SINA","ARMA","OSI"))]-[rand(100, 999)]"
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
if (silent)
|
||||
return
|
||||
|
||||
if(!(container && (istype(container, /obj/item/device/mmi) || istype(container, /obj/item/device/posibrain))))
|
||||
if(!(container && (istype(container, /obj/item/device/mmi) || istype(container, /obj/item/device/mmi/posibrain))))
|
||||
return //No MMI, can't speak, bucko./N
|
||||
else
|
||||
if ((copytext(message, 1, 3) == ":b") || (copytext(message, 1, 3) == ":B") && (container && istype(container, /obj/item/device/posibrain)))
|
||||
if ((copytext(message, 1, 3) == ":b") || (copytext(message, 1, 3) == ":B") && (container && istype(container, /obj/item/device/mmi/posibrain)))
|
||||
message = copytext(message, 3)
|
||||
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
|
||||
robot_talk(message)
|
||||
|
||||
@@ -413,8 +413,35 @@
|
||||
|
||||
|
||||
msg += "<span class = 'deptradio'>Criminal status:</span> <a href='?src=\ref[src];criminal=1'>\[[criminal]\]</a>\n"
|
||||
msg += "<span class = 'deptradio'>Security records:</span> <a href='?src=\ref[src];secrecord=`'>\[View\]</a>\n"
|
||||
//msg += "\[Set Hostile Identification\]\n"
|
||||
|
||||
if(istype(usr, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = usr
|
||||
if(istype(H.glasses, /obj/item/clothing/glasses/hud/health))
|
||||
var/perpname = "wot"
|
||||
var/medical = "None"
|
||||
|
||||
if(wear_id)
|
||||
if(istype(wear_id,/obj/item/weapon/card/id))
|
||||
perpname = wear_id:registered_name
|
||||
else if(istype(wear_id,/obj/item/device/pda))
|
||||
var/obj/item/device/pda/tempPda = wear_id
|
||||
perpname = tempPda.owner
|
||||
else
|
||||
perpname = src.name
|
||||
|
||||
for (var/datum/data/record/E in data_core.general)
|
||||
if (E.fields["name"] == perpname)
|
||||
for (var/datum/data/record/R in data_core.general)
|
||||
if (R.fields["id"] == E.fields["id"])
|
||||
medical = R.fields["p_stat"]
|
||||
|
||||
|
||||
msg += "<span class = 'deptradio'>Physical status:</span> <a href='?src=\ref[src];medical=1'>\[[medical]\]</a>\n"
|
||||
msg += "<span class = 'deptradio'>Medical records:</span> <a href='?src=\ref[src];medrecord=`'>\[View\]</a>\n"
|
||||
|
||||
|
||||
if(print_flavor_text()) msg += "[print_flavor_text()]\n"
|
||||
|
||||
msg += "*---------*</span>"
|
||||
|
||||
@@ -485,9 +485,30 @@
|
||||
mymob.zone_sel.overlays.Cut()
|
||||
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
|
||||
|
||||
//Handle the gun settings buttons
|
||||
mymob.gun_setting_icon = new /obj/screen/gun/mode(null)
|
||||
if (mymob.client)
|
||||
if (mymob.client.gun_mode) // If in aim mode, correct the sprite
|
||||
mymob.gun_setting_icon.dir = 2
|
||||
for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons
|
||||
if (G.target)
|
||||
mymob.item_use_icon = new /obj/screen/gun/item(null)
|
||||
if (mymob.client.target_can_click)
|
||||
mymob.item_use_icon.dir = 1
|
||||
src.adding += mymob.item_use_icon
|
||||
mymob.gun_move_icon = new /obj/screen/gun/move(null)
|
||||
if (mymob.client.target_can_move)
|
||||
mymob.gun_move_icon.dir = 1
|
||||
mymob.gun_run_icon = new /obj/screen/gun/run(null)
|
||||
if (mymob.client.target_can_run)
|
||||
mymob.gun_run_icon.dir = 1
|
||||
src.adding += mymob.gun_run_icon
|
||||
src.adding += mymob.gun_move_icon
|
||||
|
||||
|
||||
mymob.client.screen = null
|
||||
|
||||
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.pressure, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.healths, mymob.nutrition_icon, mymob.pullin, mymob.blind, mymob.flash, mymob.damageoverlay) //, mymob.hands, mymob.rest, mymob.sleep) //, mymob.mach )
|
||||
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.pressure, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.healths, mymob.nutrition_icon, mymob.pullin, mymob.blind, mymob.flash, mymob.damageoverlay, mymob.gun_setting_icon) //, mymob.hands, mymob.rest, mymob.sleep) //, mymob.mach )
|
||||
mymob.client.screen += src.adding + src.hotkeybuttons
|
||||
inventory_shown = 0;
|
||||
|
||||
|
||||
@@ -5,10 +5,6 @@
|
||||
icon = 'icons/mob/human.dmi'
|
||||
icon_state = "body_m_s"
|
||||
|
||||
var/datum/reagents/vessel
|
||||
// TODO: make this actually affect the way the mob is rendered
|
||||
var/pale = 0
|
||||
|
||||
|
||||
/mob/living/carbon/human/dummy
|
||||
real_name = "Test Dummy"
|
||||
@@ -24,101 +20,14 @@
|
||||
if(!dna)
|
||||
dna = new /datum/dna(null)
|
||||
|
||||
//initialise organs
|
||||
organs = list()
|
||||
organs_by_name["chest"] = new/datum/organ/external/chest()
|
||||
organs_by_name["groin"] = new/datum/organ/external/groin(organs_by_name["chest"])
|
||||
organs_by_name["head"] = new/datum/organ/external/head(organs_by_name["chest"])
|
||||
organs_by_name["l_arm"] = new/datum/organ/external/l_arm(organs_by_name["chest"])
|
||||
organs_by_name["r_arm"] = new/datum/organ/external/r_arm(organs_by_name["chest"])
|
||||
organs_by_name["r_leg"] = new/datum/organ/external/r_leg(organs_by_name["groin"])
|
||||
organs_by_name["l_leg"] = new/datum/organ/external/l_leg(organs_by_name["groin"])
|
||||
organs_by_name["l_hand"] = new/datum/organ/external/l_hand(organs_by_name["l_arm"])
|
||||
organs_by_name["r_hand"] = new/datum/organ/external/r_hand(organs_by_name["r_arm"])
|
||||
organs_by_name["l_foot"] = new/datum/organ/external/l_foot(organs_by_name["l_leg"])
|
||||
organs_by_name["r_foot"] = new/datum/organ/external/r_foot(organs_by_name["r_leg"])
|
||||
|
||||
new/datum/organ/internal/heart(src)
|
||||
new/datum/organ/internal/lungs(src)
|
||||
new/datum/organ/internal/liver(src)
|
||||
new/datum/organ/internal/kidney(src)
|
||||
|
||||
|
||||
// connect feet to legs and hands to arms
|
||||
/* var/datum/organ/external/organ = organs_by_name["l_hand"]
|
||||
organ.parent = organs_by_name["l_arm"]
|
||||
organ = organs_by_name["r_hand"]
|
||||
organ.parent = organs_by_name["r_arm"]
|
||||
organ = organs_by_name["l_foot"]
|
||||
organ.parent = organs_by_name["l_leg"]
|
||||
organ = organs_by_name["r_foot"]
|
||||
organ.parent = organs_by_name["r_leg"]
|
||||
organ = organs_by_name["r_foot"]
|
||||
organ.parent = organs_by_name["r_leg"]
|
||||
organ = organs_by_name["head"]
|
||||
organ.parent = organs_by_name["chest"]
|
||||
organ = organs_by_name["groin"]
|
||||
organ.parent = organs_by_name["chest"]
|
||||
organ = organs_by_name["r_leg"]
|
||||
organ.parent = organs_by_name["groin"]
|
||||
organ = organs_by_name["l_leg"]
|
||||
organ.parent = organs_by_name["groin"]
|
||||
organ = organs_by_name["r_arm"]
|
||||
organ.parent = organs_by_name["chest"]
|
||||
organ = organs_by_name["l_arm"]
|
||||
organ.parent = organs_by_name["chest"]
|
||||
*/
|
||||
for(var/name in organs_by_name)
|
||||
organs += organs_by_name[name]
|
||||
|
||||
for(var/datum/organ/external/O in organs)
|
||||
O.owner = src
|
||||
|
||||
..()
|
||||
|
||||
if(dna)
|
||||
dna.real_name = real_name
|
||||
|
||||
prev_gender = gender // Debug for plural genders
|
||||
|
||||
|
||||
vessel = new/datum/reagents(600)
|
||||
vessel.my_atom = src
|
||||
vessel.add_reagent("blood",560)
|
||||
spawn(1)
|
||||
fixblood()
|
||||
|
||||
/mob/living/carbon/human/proc/drip(var/amt as num)
|
||||
if(!amt)
|
||||
return
|
||||
|
||||
var/amm = 0.1 * amt
|
||||
var/turf/T = get_turf(src)
|
||||
var/list/obj/effect/decal/cleanable/blood/drip/nums = list()
|
||||
var/list/iconL = list("1","2","3","4","5")
|
||||
|
||||
vessel.remove_reagent("blood",amm)
|
||||
|
||||
for(var/obj/effect/decal/cleanable/blood/drip/G in T)
|
||||
nums += G
|
||||
iconL.Remove(G.icon_state)
|
||||
|
||||
if (nums.len < 5)
|
||||
var/obj/effect/decal/cleanable/blood/drip/this = new(T)
|
||||
this.icon_state = pick(iconL)
|
||||
this.blood_DNA = list()
|
||||
this.blood_DNA[dna.unique_enzymes] = dna.b_type
|
||||
else
|
||||
for(var/obj/effect/decal/cleanable/blood/drip/G in nums)
|
||||
del G
|
||||
T.add_blood(src)
|
||||
|
||||
|
||||
/mob/living/carbon/human/proc/fixblood()
|
||||
for(var/datum/reagent/blood/B in vessel.reagent_list)
|
||||
if(B.id == "blood")
|
||||
B.data = list("donor"=src,"viruses"=null,"blood_DNA"=dna.unique_enzymes,"blood_type"=dna.b_type,"resistances"=null,"trace_chem"=null, "virus2" = null, "antobodies" = null)
|
||||
|
||||
make_organs()
|
||||
make_blood()
|
||||
|
||||
/mob/living/carbon/human/Bump(atom/movable/AM as mob|obj, yes)
|
||||
if ((!( yes ) || now_pushing))
|
||||
@@ -632,6 +541,103 @@
|
||||
|
||||
if(!modified)
|
||||
usr << "\red Unable to locate a data core entry for this person."
|
||||
|
||||
if (href_list["secrecord"])
|
||||
if(istype(usr, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = usr
|
||||
if(istype(H.glasses, /obj/item/clothing/glasses/hud/security) || istype(H.glasses, /obj/item/clothing/glasses/sunglasses/sechud))
|
||||
var/perpname = "wot"
|
||||
var/read = 0
|
||||
|
||||
if(wear_id)
|
||||
if(istype(wear_id,/obj/item/weapon/card/id))
|
||||
perpname = wear_id:registered_name
|
||||
else if(istype(wear_id,/obj/item/device/pda))
|
||||
var/obj/item/device/pda/tempPda = wear_id
|
||||
perpname = tempPda.owner
|
||||
else
|
||||
perpname = src.name
|
||||
for (var/datum/data/record/E in data_core.general)
|
||||
if (E.fields["name"] == perpname)
|
||||
for (var/datum/data/record/R in data_core.security)
|
||||
if (R.fields["id"] == E.fields["id"])
|
||||
if(istype(H.glasses, /obj/item/clothing/glasses/hud/security) || istype(H.glasses, /obj/item/clothing/glasses/sunglasses/sechud))
|
||||
usr << "<b>Name:</b> [R.fields["name"]] <b>Criminal Status:</b> [R.fields["criminal"]]"
|
||||
usr << "<b>Minor Crimes:</b> [R.fields["mi_crim"]]"
|
||||
usr << "<b>Details:</b> [R.fields["mi_crim_d"]]"
|
||||
usr << "<b>Major Crimes:</b> [R.fields["ma_crim"]]"
|
||||
usr << "<b>Details:</b> [R.fields["ma_crim_d"]]"
|
||||
usr << "<b>Notes:</b> [R.fields["notes"]]"
|
||||
read = 1
|
||||
|
||||
if(!read)
|
||||
usr << "\red Unable to locate a data core entry for this person."
|
||||
|
||||
if (href_list["medical"])
|
||||
if(istype(usr, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = usr
|
||||
if(istype(H.glasses, /obj/item/clothing/glasses/hud/health))
|
||||
var/perpname = "wot"
|
||||
var/modified = 0
|
||||
|
||||
if(wear_id)
|
||||
if(istype(wear_id,/obj/item/weapon/card/id))
|
||||
perpname = wear_id:registered_name
|
||||
else if(istype(wear_id,/obj/item/device/pda))
|
||||
var/obj/item/device/pda/tempPda = wear_id
|
||||
perpname = tempPda.owner
|
||||
else
|
||||
perpname = src.name
|
||||
|
||||
for (var/datum/data/record/E in data_core.general)
|
||||
if (E.fields["name"] == perpname)
|
||||
for (var/datum/data/record/R in data_core.general)
|
||||
if (R.fields["id"] == E.fields["id"])
|
||||
|
||||
var/setmedical = input(usr, "Specify a new criminal status for this person.", "Medical HUD", R.fields["p_stat"]) in list("*Deceased*", "*Unconscious*", "Physically Unfit", "Active", "Cancel")
|
||||
|
||||
if(istype(H.glasses, /obj/item/clothing/glasses/hud/health))
|
||||
if(setmedical != "Cancel")
|
||||
R.fields["p_stat"] = setmedical
|
||||
modified = 1
|
||||
|
||||
spawn()
|
||||
H.handle_regular_hud_updates()
|
||||
|
||||
if(!modified)
|
||||
usr << "\red Unable to locate a data core entry for this person."
|
||||
|
||||
if (href_list["medrecord"])
|
||||
if(istype(usr, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = usr
|
||||
if(istype(H.glasses, /obj/item/clothing/glasses/hud/health))
|
||||
var/perpname = "wot"
|
||||
var/read = 0
|
||||
|
||||
if(wear_id)
|
||||
if(istype(wear_id,/obj/item/weapon/card/id))
|
||||
perpname = wear_id:registered_name
|
||||
else if(istype(wear_id,/obj/item/device/pda))
|
||||
var/obj/item/device/pda/tempPda = wear_id
|
||||
perpname = tempPda.owner
|
||||
else
|
||||
perpname = src.name
|
||||
for (var/datum/data/record/E in data_core.general)
|
||||
if (E.fields["name"] == perpname)
|
||||
for (var/datum/data/record/R in data_core.medical)
|
||||
if (R.fields["id"] == E.fields["id"])
|
||||
if(istype(H.glasses, /obj/item/clothing/glasses/hud/health))
|
||||
usr << "<b>Name:</b> [R.fields["name"]] <b>Blood Type:</b> [R.fields["b_type"]]"
|
||||
usr << "<b>DNA:</b> [R.fields["b_dna"]]"
|
||||
usr << "<b>Minor Disabilities:</b> [R.fields["mi_dis"]]"
|
||||
usr << "<b>Details:</b> [R.fields["mi_dis_d"]]"
|
||||
usr << "<b>Major Disabilities:</b> [R.fields["ma_dis"]]"
|
||||
usr << "<b>Details:</b> [R.fields["ma_dis_d"]]"
|
||||
usr << "<b>Notes:</b> [R.fields["notes"]]"
|
||||
read = 1
|
||||
|
||||
if(!read)
|
||||
usr << "\red Unable to locate a data core entry for this person."
|
||||
..()
|
||||
return
|
||||
|
||||
@@ -678,7 +684,7 @@
|
||||
if(dna)
|
||||
switch(dna.mutantrace)
|
||||
if("lizard")
|
||||
return "Soghun"
|
||||
return "Unathi"
|
||||
if("tajaran")
|
||||
return "Tajaran"
|
||||
if("skrell")
|
||||
@@ -693,7 +699,7 @@
|
||||
/mob/living/carbon/get_species()
|
||||
if(src.dna)
|
||||
if(src.dna.mutantrace == "lizard")
|
||||
return "Soghun"
|
||||
return "Unathi"
|
||||
else if(src.dna.mutantrace == "skrell")
|
||||
return "Skrell"
|
||||
else if(src.dna.mutantrace == "tajaran")
|
||||
|
||||
@@ -15,6 +15,15 @@
|
||||
ChangeToHusk()
|
||||
return
|
||||
|
||||
/mob/living/carbon/human/getBrainLoss()
|
||||
var/res = brainloss
|
||||
var/datum/organ/internal/brain/sponge = internal_organs["brain"]
|
||||
if (sponge.is_bruised())
|
||||
res += 20
|
||||
if (sponge.is_broken())
|
||||
res += 50
|
||||
res = min(res,maxHealth*2)
|
||||
return res
|
||||
|
||||
//These procs fetch a cumulative total damage from all organs
|
||||
/mob/living/carbon/human/getBruteLoss()
|
||||
|
||||
@@ -47,9 +47,6 @@
|
||||
var/icon/stand_icon = null
|
||||
var/icon/lying_icon = null
|
||||
|
||||
var/list/organs = list() //Gets filled up in the constructor (human.dm, New() proc, line 24. I'm sick and tired of missing comments. -Agouri
|
||||
var/list/organs_by_name = list() // map organ names to organs
|
||||
|
||||
var/miming = null //Toggle for the mime's abilities.
|
||||
var/special_voice = "" // For changing our voice. Used by a symptom.
|
||||
|
||||
|
||||
@@ -21,11 +21,6 @@
|
||||
#define COLD_GAS_DAMAGE_LEVEL_2 1.5 //Amount of damage applied when the current breath's temperature passes the 200K point
|
||||
#define COLD_GAS_DAMAGE_LEVEL_3 3 //Amount of damage applied when the current breath's temperature passes the 120K point
|
||||
|
||||
var/const/BLOOD_VOLUME_SAFE = 501
|
||||
var/const/BLOOD_VOLUME_OKAY = 336
|
||||
var/const/BLOOD_VOLUME_BAD = 224
|
||||
var/const/BLOOD_VOLUME_SURVIVE = 122
|
||||
|
||||
/mob/living/carbon/human
|
||||
var/oxygen_alert = 0
|
||||
var/toxins_alert = 0
|
||||
@@ -89,6 +84,8 @@ var/const/BLOOD_VOLUME_SURVIVE = 122
|
||||
//Random events (vomiting etc)
|
||||
handle_random_events()
|
||||
|
||||
handle_virus_updates()
|
||||
|
||||
//Handle temperature/pressure differences between body and environment
|
||||
handle_environment(environment)
|
||||
|
||||
@@ -133,98 +130,6 @@ var/const/BLOOD_VOLUME_SURVIVE = 122
|
||||
|
||||
/mob/living/carbon/human
|
||||
|
||||
proc/handle_blood()
|
||||
// take care of blood and blood loss
|
||||
if(stat < 2 && bodytemperature >= 170)
|
||||
var/blood_volume = round(vessel.get_reagent_amount("blood"))
|
||||
if(blood_volume < 560 && blood_volume)
|
||||
var/datum/reagent/blood/B = locate() in vessel.reagent_list //Grab some blood
|
||||
if(B) // Make sure there's some blood at all
|
||||
if(B.data["donor"] != src) //If it's not theirs, then we look for theirs
|
||||
for(var/datum/reagent/blood/D in vessel.reagent_list)
|
||||
if(D.data["donor"] == src)
|
||||
B = D
|
||||
break
|
||||
var/datum/reagent/nutriment/F = locate() in reagents.reagent_list
|
||||
if(F != null)
|
||||
if(F.volume >= 1)
|
||||
// nutriment speeds it up quite a bit
|
||||
B.volume += 0.4
|
||||
F.volume -= 0.1
|
||||
else
|
||||
//At this point, we dun care which blood we are adding to, as long as they get more blood.
|
||||
B.volume = B.volume + 0.1 // regenerate blood VERY slowly
|
||||
|
||||
// Damaged heart virtually reduces the blood volume, as the blood isn't
|
||||
// being pumped properly anymore.
|
||||
var/datum/organ/internal/heart/heart = internal_organs["heart"]
|
||||
switch(heart.damage)
|
||||
if(5 to 10)
|
||||
blood_volume *= 0.8
|
||||
if(11 to 20)
|
||||
blood_volume *= 0.5
|
||||
if(21 to INFINITY)
|
||||
blood_volume *= 0.3
|
||||
|
||||
switch(blood_volume)
|
||||
if(BLOOD_VOLUME_SAFE to 10000)
|
||||
if(pale)
|
||||
pale = 0
|
||||
update_body()
|
||||
if(BLOOD_VOLUME_OKAY to BLOOD_VOLUME_SAFE)
|
||||
if(!pale)
|
||||
pale = 1
|
||||
update_body()
|
||||
var/word = pick("dizzy","woosey","faint")
|
||||
src << "\red You feel [word]"
|
||||
if(prob(1))
|
||||
var/word = pick("dizzy","woosey","faint")
|
||||
src << "\red You feel [word]"
|
||||
if(oxyloss < 20)
|
||||
// hint that they're getting close to suffocation
|
||||
oxyloss += 3
|
||||
if(BLOOD_VOLUME_BAD to BLOOD_VOLUME_OKAY)
|
||||
if(!pale)
|
||||
pale = 1
|
||||
update_body()
|
||||
eye_blurry += 6
|
||||
if(oxyloss < 50)
|
||||
oxyloss += 10
|
||||
oxyloss += 1
|
||||
if(prob(15))
|
||||
Paralyse(rand(1,3))
|
||||
var/word = pick("dizzy","woosey","faint")
|
||||
src << "\red You feel extremely [word]"
|
||||
if(BLOOD_VOLUME_SURVIVE to BLOOD_VOLUME_BAD)
|
||||
oxyloss += 5
|
||||
toxloss += 5
|
||||
if(prob(15))
|
||||
var/word = pick("dizzy","woosey","faint")
|
||||
src << "\red You feel extremely [word]"
|
||||
if(0 to BLOOD_VOLUME_SURVIVE)
|
||||
// There currently is a strange bug here. If the mob is not below -100 health
|
||||
// when death() is called, apparently they will be just fine, and this way it'll
|
||||
// spam deathgasp. Adjusting toxloss ensures the mob will stay dead.
|
||||
toxloss += 300 // just to be safe!
|
||||
death()
|
||||
|
||||
// Without enough blood you slowly go hungry.
|
||||
if(blood_volume < BLOOD_VOLUME_SAFE)
|
||||
if(nutrition >= 300)
|
||||
nutrition -= 10
|
||||
else if(nutrition >= 200)
|
||||
nutrition -= 3
|
||||
|
||||
var/blood_max = 0
|
||||
for(var/datum/organ/external/temp in organs)
|
||||
if(!(temp.status & ORGAN_BLEEDING) || temp.status & ORGAN_ROBOT)
|
||||
continue
|
||||
for(var/datum/wound/W in temp.wounds) if(W.bleeding())
|
||||
blood_max += W.damage / 4
|
||||
if(temp.status & ORGAN_DESTROYED && !(temp.status & ORGAN_GAUZED) && !temp.amputated)
|
||||
blood_max += 20 //Yer missing a fucking limb.
|
||||
drip(blood_max)
|
||||
|
||||
proc/handle_disabilities()
|
||||
if (disabilities & EPILEPSY)
|
||||
if ((prob(1) && paralysis < 1))
|
||||
@@ -261,7 +166,8 @@ var/const/BLOOD_VOLUME_SURVIVE = 122
|
||||
if (disabilities & NERVOUS)
|
||||
if (prob(10))
|
||||
stuttering = max(10, stuttering)
|
||||
if (getBrainLoss() >= 60 && stat != 2)
|
||||
// No. -- cib
|
||||
/*if (getBrainLoss() >= 60 && stat != 2)
|
||||
if (prob(3))
|
||||
switch(pick(1,2,3))
|
||||
if(1)
|
||||
@@ -270,108 +176,25 @@ var/const/BLOOD_VOLUME_SURVIVE = 122
|
||||
say(pick("FUS RO DAH","fucking 4rries!", "stat me", ">my face", "roll it easy!", "waaaaaagh!!!", "red wonz go fasta", "FOR TEH EMPRAH", "lol2cat", "dem dwarfs man, dem dwarfs", "SPESS MAHREENS", "hwee did eet fhor khayosss", "lifelike texture ;_;", "luv can bloooom", "PACKETS!!!"))
|
||||
if(3)
|
||||
emote("drool")
|
||||
*/
|
||||
|
||||
proc/handle_organs()
|
||||
// take care of organ related updates, such as broken and missing limbs
|
||||
|
||||
// recalculate number of wounds
|
||||
number_wounds = 0
|
||||
for(var/datum/organ/external/E in organs)
|
||||
if(!E)
|
||||
world << name
|
||||
continue
|
||||
number_wounds += E.number_wounds
|
||||
|
||||
var/leg_tally = 2
|
||||
var/canstand_l = 1 //Can stand on left leg
|
||||
var/canstand_r = 1 //Can stand on right leg
|
||||
var/hasleg_l = 1 //Have left leg
|
||||
var/hasleg_r = 1 //Have right leg
|
||||
var/hasarm_l = 1 //Have left arm
|
||||
var/hasarm_r = 1 //Have right arm
|
||||
for(var/datum/organ/external/E in organs)
|
||||
E.process()
|
||||
if(E.status & ORGAN_ROBOT && prob(E.brute_dam + E.burn_dam))
|
||||
if(E.name == "l_hand" || E.name == "l_arm")
|
||||
if(hand && equipped())
|
||||
drop_item()
|
||||
emote("me", 1, "drops what they were holding, their [E.display_name?"[E.display_name]":"[E]"] malfunctioning!")
|
||||
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
|
||||
spark_system.set_up(5, 0, src)
|
||||
spark_system.attach(src)
|
||||
spark_system.start()
|
||||
spawn(10)
|
||||
del(spark_system)
|
||||
else if(E.name == "r_hand" || E.name == "r_arm")
|
||||
if(!hand && equipped())
|
||||
drop_item()
|
||||
emote("me", 1, "drops what they were holding, their [E.display_name?"[E.display_name]":"[E]"] malfunctioning!")
|
||||
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
|
||||
spark_system.set_up(5, 0, src)
|
||||
spark_system.attach(src)
|
||||
spark_system.start()
|
||||
spawn(10)
|
||||
del(spark_system)
|
||||
else if(E.name == "l_leg" || E.name == "l_foot" \
|
||||
|| E.name == "r_leg" || E.name == "r_foot" && !lying)
|
||||
leg_tally-- // let it fail even if just foot&leg
|
||||
if(E.status & ORGAN_BROKEN || (E.status & ORGAN_DESTROYED && !E.amputated))
|
||||
if(E.name == "l_hand" || E.name == "l_arm")
|
||||
if(hand && equipped())
|
||||
if(E.status & ORGAN_SPLINTED && prob(10))
|
||||
drop_item()
|
||||
emote("scream")
|
||||
else
|
||||
drop_item()
|
||||
emote("scream")
|
||||
else if(E.name == "r_hand" || E.name == "r_arm")
|
||||
if(!hand && equipped())
|
||||
if(E.status & ORGAN_SPLINTED && prob(10))
|
||||
drop_item()
|
||||
emote("scream")
|
||||
else
|
||||
drop_item()
|
||||
emote("scream")
|
||||
else if(E.name == "l_leg" || E.name == "l_foot" \
|
||||
|| E.name == "r_leg" || E.name == "r_foot" && !lying)
|
||||
if(!(E.status & ORGAN_SPLINTED))
|
||||
leg_tally-- // let it fail even if just foot&leg
|
||||
|
||||
// standing is poor
|
||||
if(leg_tally <= 0 && !paralysis && !(lying || resting) && prob(5))
|
||||
emote("scream")
|
||||
emote("collapse")
|
||||
paralysis = 10
|
||||
|
||||
|
||||
//Check arms and legs for existence
|
||||
var/datum/organ/external/E
|
||||
E = get_organ("l_leg")
|
||||
if(E.status & ORGAN_DESTROYED && !(E.status & ORGAN_SPLINTED))
|
||||
canstand_l = 0
|
||||
hasleg_l = 0
|
||||
E = get_organ("r_leg")
|
||||
if(E.status & ORGAN_DESTROYED && !(E.status & ORGAN_SPLINTED))
|
||||
canstand_r = 0
|
||||
hasleg_r = 0
|
||||
E = get_organ("l_foot")
|
||||
if(E.status & ORGAN_DESTROYED && !(E.status & ORGAN_SPLINTED))
|
||||
canstand_l = 0
|
||||
E = get_organ("r_foot")
|
||||
if(E.status & ORGAN_DESTROYED && !(E.status & ORGAN_SPLINTED))
|
||||
canstand_r = 0
|
||||
E = get_organ("l_arm")
|
||||
if(E.status & ORGAN_DESTROYED && !(E.status & ORGAN_SPLINTED))
|
||||
hasarm_l = 0
|
||||
E = get_organ("r_arm")
|
||||
if(E.status & ORGAN_DESTROYED && !(E.status & ORGAN_SPLINTED))
|
||||
hasarm_r = 0
|
||||
|
||||
// Can stand if have at least one full leg (with leg and foot parts present)
|
||||
// Has limbs to move around if at least one arm or leg is at least partially there
|
||||
can_stand = canstand_l||canstand_r
|
||||
has_limbs = hasleg_l||hasleg_r||hasarm_l||hasarm_r
|
||||
|
||||
if(stat != 2)
|
||||
var/rn = rand(0, 200)
|
||||
if(getBrainLoss() >= 5)
|
||||
if(0 <= rn && rn <= 3)
|
||||
custom_pain("Your head feels numb and painful.")
|
||||
if(getBrainLoss() >= 15)
|
||||
if(4 <= rn && rn <= 6) if(eye_blurry <= 0)
|
||||
src << "\red It becomes hard to see for some reason."
|
||||
eye_blurry = 10
|
||||
if(getBrainLoss() >= 35)
|
||||
if(7 <= rn && rn <= 9) if(hand && equipped())
|
||||
src << "\red Your hand won't respond properly, you drop what you're holding."
|
||||
drop_item()
|
||||
if(getBrainLoss() >= 50)
|
||||
if(10 <= rn && rn <= 12) if(!lying)
|
||||
src << "\red Your legs won't respond properly, you fall down."
|
||||
lying = 1
|
||||
|
||||
proc/handle_mutations_and_radiation()
|
||||
if(getFireLoss())
|
||||
@@ -435,20 +258,14 @@ var/const/BLOOD_VOLUME_SURVIVE = 122
|
||||
if(reagents.has_reagent("lexorin")) return
|
||||
if(istype(loc, /obj/machinery/atmospherics/unary/cryo_cell)) return
|
||||
|
||||
var/lung_ruptured = is_lung_ruptured()
|
||||
|
||||
if(lung_ruptured && prob(2))
|
||||
spawn emote("me", 1, "coughs up blood!")
|
||||
src.drip(10)
|
||||
var/datum/organ/internal/lungs/L = internal_organs["lungs"]
|
||||
L.process()
|
||||
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
var/datum/gas_mixture/breath
|
||||
// HACK NEED CHANGING LATER
|
||||
if(health < 0)
|
||||
losebreath++
|
||||
if(lung_ruptured && prob(4))
|
||||
spawn emote("me", 1, "gasps for air!")
|
||||
losebreath += 5
|
||||
if(losebreath>0) //Suffocating so do not take a breath
|
||||
losebreath--
|
||||
if (prob(10)) //Gasp per 10 ticks? Sounds about right.
|
||||
@@ -478,7 +295,7 @@ var/const/BLOOD_VOLUME_SURVIVE = 122
|
||||
breath = loc.remove_air(breath_moles)
|
||||
|
||||
|
||||
if(!lung_ruptured)
|
||||
if(!is_lung_ruptured())
|
||||
if(!breath || breath.total_moles < BREATH_MOLES / 5 || breath.total_moles > BREATH_MOLES * 5)
|
||||
if(prob(5))
|
||||
rupture_lung()
|
||||
@@ -1041,34 +858,10 @@ var/const/BLOOD_VOLUME_SURVIVE = 122
|
||||
dizziness = max(0, dizziness - 3)
|
||||
jitteriness = max(0, jitteriness - 3)
|
||||
|
||||
handle_trace_chems()
|
||||
|
||||
if(life_tick % 10 == 0)
|
||||
// handle trace chemicals for autopsy
|
||||
for(var/datum/organ/O in organs)
|
||||
for(var/chemID in O.trace_chemicals)
|
||||
O.trace_chemicals[chemID] = O.trace_chemicals[chemID] - 1
|
||||
if(O.trace_chemicals[chemID] <= 0)
|
||||
O.trace_chemicals.Remove(chemID)
|
||||
for(var/datum/reagent/A in reagents.reagent_list)
|
||||
// add chemistry traces to a random organ
|
||||
var/datum/organ/O = pick(organs)
|
||||
O.trace_chemicals[A.name] = 100
|
||||
|
||||
var/damaged_liver_process_accuracy = 10
|
||||
if(life_tick % damaged_liver_process_accuracy == 0)
|
||||
// Damaged liver means some chemicals are very dangerous
|
||||
var/datum/organ/internal/liver/liver = internal_organs["liver"]
|
||||
if(liver.damage >= liver.min_bruised_damage)
|
||||
for(var/datum/reagent/R in src.reagents.reagent_list)
|
||||
// Ethanol and all drinks are bad
|
||||
if(istype(R, /datum/reagent/ethanol))
|
||||
adjustToxLoss(0.1 * damaged_liver_process_accuracy)
|
||||
|
||||
// Can't cope with toxins at all
|
||||
for(var/toxin in list("toxin", "plasma", "sacid", "pacid", "cyanide", "lexorin", "amatoxin", "chloralhydrate", "carpotoxin", "zombiepowder", "mindbreaker"))
|
||||
if(src.reagents.has_reagent(toxin))
|
||||
adjustToxLoss(0.3 * damaged_liver_process_accuracy)
|
||||
|
||||
var/datum/organ/internal/liver/liver = internal_organs["liver"]
|
||||
liver.process()
|
||||
|
||||
updatehealth()
|
||||
|
||||
@@ -1471,6 +1264,7 @@ var/const/BLOOD_VOLUME_SURVIVE = 122
|
||||
if(bodytemperature > 406)
|
||||
for(var/datum/disease/D in viruses)
|
||||
D.cure()
|
||||
if(virus2) virus2.cure(src)
|
||||
if(!virus2)
|
||||
for(var/obj/effect/decal/cleanable/blood/B in view(1,src))
|
||||
if(B.virus2 && get_infection_chance())
|
||||
|
||||
@@ -64,6 +64,7 @@ There are several things that need to be remembered:
|
||||
update_body() //Handles updating your mob's icon to reflect their gender/race/complexion etc
|
||||
update_hair() //Handles updating your hair overlay (used to be update_face, but mouth and
|
||||
...eyes were merged into update_body)
|
||||
update_targeted() // Updates the target overlay when someone points a gun at you
|
||||
|
||||
> All of these procs update our overlays_lying and overlays_standing, and then call update_icons() by default.
|
||||
If you wish to update several overlays at once, you can set the argument to 0 to disable the update and call
|
||||
@@ -117,7 +118,8 @@ Please contact me on #coderbus IRC. ~Carn x
|
||||
#define L_HAND_LAYER 19
|
||||
#define R_HAND_LAYER 20
|
||||
#define TAIL_LAYER 21 //bs12 specific. this hack is probably gonna come back to haunt me
|
||||
#define TOTAL_LAYERS 21
|
||||
#define TARGETED_LAYER 22 //BS12: Layer for the target overlay from weapon targeting system
|
||||
#define TOTAL_LAYERS 22
|
||||
//////////////////////////////////
|
||||
|
||||
/mob/living/carbon/human
|
||||
@@ -130,7 +132,6 @@ Please contact me on #coderbus IRC. ~Carn x
|
||||
//this proc is messy as I was forced to include some old laggy cloaking code to it so that I don't break cloakers
|
||||
//I'll work on removing that stuff by rewriting some of the cloaking stuff at a later date.
|
||||
/mob/living/carbon/human/update_icons()
|
||||
|
||||
lying_prev = lying //so we don't update overlays for lying/standing unless our stance changes again
|
||||
update_hud() //TODO: remove the need for this
|
||||
overlays.Cut()
|
||||
@@ -472,6 +473,19 @@ proc/get_damage_icon_part(damage_state, body_part)
|
||||
update_hair(0)
|
||||
if(update_icons) update_icons()
|
||||
|
||||
//Call when target overlay should be added/removed
|
||||
/mob/living/carbon/human/update_targeted(var/update_icons=1)
|
||||
if (targeted_by && target_locked)
|
||||
overlays_lying[TARGETED_LAYER] = target_locked
|
||||
overlays_standing[TARGETED_LAYER] = target_locked
|
||||
else if (!targeted_by && target_locked)
|
||||
del(target_locked)
|
||||
if (!targeted_by)
|
||||
overlays_lying[TARGETED_LAYER] = null
|
||||
overlays_standing[TARGETED_LAYER] = null
|
||||
if(update_icons) update_icons()
|
||||
|
||||
|
||||
/* --------------------------------------- */
|
||||
//For legacy support.
|
||||
/mob/living/carbon/human/regenerate_icons()
|
||||
@@ -858,4 +872,5 @@ proc/get_damage_icon_part(damage_state, body_part)
|
||||
#undef L_HAND_LAYER
|
||||
#undef R_HAND_LAYER
|
||||
#undef TAIL_LAYER
|
||||
#undef TOTAL_LAYERS
|
||||
#undef TARGETED_LAYER
|
||||
#undef TOTAL_LAYERS
|
||||
|
||||
@@ -140,5 +140,5 @@
|
||||
for (var/mob/M in dead_mob_list)
|
||||
if (!(M.client))
|
||||
continue
|
||||
if (M.stat > 1 && !(M in heard_a))
|
||||
if (M.stat > 1 && !(M in heard_a) && (M.client.prefs.toggles & CHAT_GHOSTEARS))
|
||||
M.show_message(rendered, 2)
|
||||
|
||||
@@ -220,9 +220,29 @@
|
||||
mymob.zone_sel.overlays.Cut()
|
||||
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
|
||||
|
||||
//Handle the gun settings buttons
|
||||
mymob.gun_setting_icon = new /obj/screen/gun/mode(null)
|
||||
if (mymob.client)
|
||||
if (mymob.client.gun_mode) // If in aim mode, correct the sprite
|
||||
mymob.gun_setting_icon.dir = 2
|
||||
for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons
|
||||
if (G.target)
|
||||
mymob.item_use_icon = new /obj/screen/gun/item(null)
|
||||
if (mymob.client.target_can_click)
|
||||
mymob.item_use_icon.dir = 1
|
||||
src.adding += mymob.item_use_icon
|
||||
mymob.gun_move_icon = new /obj/screen/gun/move(null)
|
||||
if (mymob.client.target_can_move)
|
||||
mymob.gun_move_icon.dir = 1
|
||||
mymob.gun_run_icon = new /obj/screen/gun/run(null)
|
||||
if (mymob.client.target_can_run)
|
||||
mymob.gun_run_icon.dir = 1
|
||||
src.adding += mymob.gun_run_icon
|
||||
src.adding += mymob.gun_move_icon
|
||||
|
||||
mymob.client.screen = null
|
||||
|
||||
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.pressure, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.healths, mymob.pullin, mymob.blind, mymob.flash) //, mymob.hands, mymob.rest, mymob.sleep, mymob.mach )
|
||||
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.pressure, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.healths, mymob.pullin, mymob.blind, mymob.flash, mymob.gun_setting_icon) //, mymob.hands, mymob.rest, mymob.sleep, mymob.mach )
|
||||
mymob.client.screen += src.adding + src.other
|
||||
|
||||
return
|
||||
|
||||
@@ -42,6 +42,9 @@
|
||||
//Disabilities
|
||||
handle_disabilities()
|
||||
|
||||
//Virus updates, duh
|
||||
handle_virus_updates()
|
||||
|
||||
//Apparently, the person who wrote this code designed it so that
|
||||
//blinded get reset each cycle and then get activated later in the
|
||||
//code. Very ugly. I dont care. Moving this stuff here so its easy
|
||||
@@ -147,6 +150,28 @@
|
||||
emote("gasp")
|
||||
updatehealth()
|
||||
|
||||
proc/handle_virus_updates()//copypaste from mob/carbon/human/life.dm
|
||||
if(bodytemperature > 406)
|
||||
for(var/datum/disease/D in viruses)
|
||||
D.cure()
|
||||
if(!virus2)
|
||||
for(var/obj/effect/decal/cleanable/blood/B in view(1,src))
|
||||
if(B.virus2 && get_infection_chance())
|
||||
infect_virus2(src,B.virus2)
|
||||
for(var/obj/effect/decal/cleanable/mucus/M in view(1,src))
|
||||
if(M.virus2 && get_infection_chance())
|
||||
infect_virus2(src,M.virus2)
|
||||
else
|
||||
if(isnull(virus2)) // Trying to figure out a runtime error that keeps repeating
|
||||
CRASH("virus2 nulled before calling activate()")
|
||||
else
|
||||
virus2.activate(src)
|
||||
|
||||
// activate may have deleted the virus
|
||||
if(!virus2) return
|
||||
|
||||
// check if we're immune
|
||||
if(virus2.antigen & src.antibodies) virus2.dead = 1
|
||||
|
||||
proc/breathe()
|
||||
if(reagents)
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
#define M_HANDCUFF_LAYER 3
|
||||
#define M_L_HAND_LAYER 4
|
||||
#define M_R_HAND_LAYER 5
|
||||
#define M_TOTAL_LAYERS 5
|
||||
#define TARGETED_LAYER 6
|
||||
#define M_TOTAL_LAYERS 6
|
||||
/////////////////////////////////
|
||||
|
||||
/mob/living/carbon/monkey
|
||||
@@ -101,11 +102,24 @@
|
||||
if (client)
|
||||
client.screen |= contents
|
||||
|
||||
//Call when target overlay should be added/removed
|
||||
/mob/living/carbon/monkey/update_targeted(var/update_icons=1)
|
||||
if (targeted_by && target_locked)
|
||||
overlays_lying[TARGETED_LAYER] = target_locked
|
||||
overlays_standing[TARGETED_LAYER] = target_locked
|
||||
else if (!targeted_by && target_locked)
|
||||
del(target_locked)
|
||||
if (!targeted_by)
|
||||
overlays_lying[TARGETED_LAYER] = null
|
||||
overlays_standing[TARGETED_LAYER] = null
|
||||
if(update_icons) update_icons()
|
||||
|
||||
//Monkey Overlays Indexes////////
|
||||
#undef M_MASK_LAYER
|
||||
#undef M_BACK_LAYER
|
||||
#undef M_HANDCUFF_LAYER
|
||||
#undef M_L_HAND_LAYER
|
||||
#undef M_R_HAND_LAYER
|
||||
#undef TARGETED_LAYER
|
||||
#undef M_TOTAL_LAYERS
|
||||
|
||||
|
||||
@@ -239,7 +239,7 @@
|
||||
src.updatehealth()
|
||||
|
||||
// damage MANY external organs, in random order
|
||||
/mob/living/proc/take_overall_damage(var/brute, var/burn)
|
||||
/mob/living/proc/take_overall_damage(var/brute, var/burn, var/used_weapon = null)
|
||||
adjustBruteLoss(brute)
|
||||
adjustFireLoss(burn)
|
||||
src.updatehealth()
|
||||
|
||||
@@ -142,6 +142,9 @@ var/list/department_radio_keys = list(
|
||||
// Check changed so that parrots can use headsets. Other simple animals do not have ears and will cause runtimes.
|
||||
// And borgs -Sieve
|
||||
|
||||
if(src.stunned > 2 || (traumatic_shock > 61 && prob(50)))
|
||||
message_mode = "" //Stunned people shouldn't be able to physically turn on their radio/hold down the button to speak into it
|
||||
|
||||
if (!message)
|
||||
return
|
||||
|
||||
@@ -179,12 +182,14 @@ var/list/department_radio_keys = list(
|
||||
var/is_speaking_skrell = 0
|
||||
var/is_speaking_soghun = 0
|
||||
var/is_speaking_taj = 0
|
||||
var/is_speaking_radio = 0
|
||||
|
||||
switch (message_mode)
|
||||
if ("headset")
|
||||
if (src:ears)
|
||||
src:ears.talk_into(src, message)
|
||||
used_radios += src:ears
|
||||
is_speaking_radio = 1
|
||||
|
||||
message_range = 1
|
||||
italics = 1
|
||||
@@ -194,6 +199,7 @@ var/list/department_radio_keys = list(
|
||||
if (src:ears)
|
||||
src:ears.talk_into(src, message, 1)
|
||||
used_radios += src:ears
|
||||
is_speaking_radio = 1
|
||||
|
||||
message_range = 1
|
||||
italics = 1
|
||||
@@ -202,6 +208,7 @@ var/list/department_radio_keys = list(
|
||||
if (r_hand)
|
||||
r_hand.talk_into(src, message)
|
||||
used_radios += src:r_hand
|
||||
is_speaking_radio = 1
|
||||
|
||||
message_range = 1
|
||||
italics = 1
|
||||
@@ -210,6 +217,7 @@ var/list/department_radio_keys = list(
|
||||
if (l_hand)
|
||||
l_hand.talk_into(src, message)
|
||||
used_radios += src:l_hand
|
||||
is_speaking_radio = 1
|
||||
|
||||
message_range = 1
|
||||
italics = 1
|
||||
@@ -218,6 +226,7 @@ var/list/department_radio_keys = list(
|
||||
for (var/obj/item/device/radio/intercom/I in view(1, null))
|
||||
I.talk_into(src, message)
|
||||
used_radios += I
|
||||
is_speaking_radio = 1
|
||||
|
||||
message_range = 1
|
||||
italics = 1
|
||||
@@ -244,6 +253,7 @@ var/list/department_radio_keys = list(
|
||||
if (src:ears)
|
||||
src:ears.talk_into(src, message, message_mode)
|
||||
used_radios += src:ears
|
||||
is_speaking_radio = 1
|
||||
else if(istype(src, /mob/living/silicon/robot))
|
||||
if (src:radio)
|
||||
src:radio.talk_into(src, message, message_mode)
|
||||
@@ -375,6 +385,10 @@ var/list/department_radio_keys = list(
|
||||
var/image/speech_bubble = image('icons/mob/talk.dmi',src,"h[speech_bubble_test]")
|
||||
spawn(30) del(speech_bubble)
|
||||
|
||||
for(var/mob/M in hearers(5, src))
|
||||
if(M != src && is_speaking_radio)
|
||||
M:show_message("<span class='notice'>[src] talks into [used_radios.len ? used_radios[1] : "radio"]</span>")
|
||||
|
||||
var/rendered = null
|
||||
if (length(heard_a))
|
||||
var/message_a = say_quote(message,is_speaking_soghun,is_speaking_skrell,is_speaking_taj)
|
||||
@@ -383,7 +397,6 @@ var/list/department_radio_keys = list(
|
||||
message_a = "<i>[message_a]</i>"
|
||||
|
||||
rendered = "<span class='game say'><span class='name'>[GetVoice()]</span>[alt_name] <span class='message'>[message_a]</span></span>"
|
||||
|
||||
for (var/M in heard_a)
|
||||
if(hascall(M,"show_message"))
|
||||
var/deaf_message = ""
|
||||
@@ -437,9 +450,10 @@ var/list/department_radio_keys = list(
|
||||
del(B)
|
||||
*/
|
||||
|
||||
//talking crystals
|
||||
for(var/obj/item/weapon/talkingcrystal/O in view(3,src))
|
||||
O.catchMessage(message,src)
|
||||
//talking items
|
||||
for(var/obj/item/weapon/O in view(3,src))
|
||||
if(O.listening_to_players)
|
||||
O.catchMessage(message, src)
|
||||
|
||||
log_say("[name]/[key] : [message]")
|
||||
|
||||
|
||||
@@ -143,9 +143,29 @@
|
||||
mymob.zone_sel.overlays.Cut()
|
||||
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
|
||||
|
||||
//Handle the gun settings buttons
|
||||
mymob.gun_setting_icon = new /obj/screen/gun/mode(null)
|
||||
if (mymob.client)
|
||||
if (mymob.client.gun_mode) // If in aim mode, correct the sprite
|
||||
mymob.gun_setting_icon.dir = 2
|
||||
for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons
|
||||
if (G.target)
|
||||
mymob.item_use_icon = new /obj/screen/gun/item(null)
|
||||
if (mymob.client.target_can_click)
|
||||
mymob.item_use_icon.dir = 1
|
||||
src.adding += mymob.item_use_icon
|
||||
mymob.gun_move_icon = new /obj/screen/gun/move(null)
|
||||
if (mymob.client.target_can_move)
|
||||
mymob.gun_move_icon.dir = 1
|
||||
mymob.gun_run_icon = new /obj/screen/gun/run(null)
|
||||
if (mymob.client.target_can_run)
|
||||
mymob.gun_run_icon.dir = 1
|
||||
src.adding += mymob.gun_run_icon
|
||||
src.adding += mymob.gun_move_icon
|
||||
|
||||
mymob.client.screen = null
|
||||
|
||||
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.fire, mymob.hands, mymob.healths, mymob:cells, mymob.pullin, mymob.blind, mymob.flash) //, mymob.rest, mymob.sleep, mymob.mach )
|
||||
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.fire, mymob.hands, mymob.healths, mymob:cells, mymob.pullin, mymob.blind, mymob.flash, mymob.gun_setting_icon) //, mymob.rest, mymob.sleep, mymob.mach )
|
||||
mymob.client.screen += src.adding + src.other
|
||||
|
||||
return
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/mob/living/silicon/robot
|
||||
name = "Cyborg"
|
||||
real_name = "Cyborg"
|
||||
icon = 'icons/mob/robots.dmi'//
|
||||
icon = 'icons/mob/robots.dmi'
|
||||
icon_state = "robot"
|
||||
maxHealth = 300
|
||||
health = 300
|
||||
@@ -194,7 +194,7 @@
|
||||
|
||||
/mob/living/silicon/robot/proc/updatename(var/prefix as text)
|
||||
|
||||
if(istype(mmi, /obj/item/device/posibrain))
|
||||
if(istype(mmi, /obj/item/device/mmi/posibrain))
|
||||
braintype = "Android"
|
||||
else
|
||||
braintype = "Cyborg"
|
||||
@@ -806,7 +806,13 @@
|
||||
overlays += "ov-openpanel -c"
|
||||
return
|
||||
|
||||
|
||||
//Call when target overlay should be added/removed
|
||||
/mob/living/silicon/robot/update_targeted()
|
||||
if(!targeted_by && target_locked)
|
||||
del(target_locked)
|
||||
updateicon()
|
||||
if (targeted_by && target_locked)
|
||||
overlays += target_locked
|
||||
|
||||
/mob/living/silicon/robot/proc/installed_modules()
|
||||
if(weapon_lock)
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
regenerate_icons()
|
||||
|
||||
/mob/living/simple_animal/corgi/show_inv(mob/user as mob)
|
||||
/*
|
||||
/* If you're turning this back on, scroll down and uncomment target_updated
|
||||
user.set_machine(src)
|
||||
if(user.stat) return
|
||||
|
||||
@@ -404,7 +404,6 @@
|
||||
return
|
||||
|
||||
|
||||
|
||||
/mob/living/simple_animal/corgi/puppy
|
||||
name = "\improper corgi puppy"
|
||||
real_name = "corgi"
|
||||
|
||||
@@ -140,7 +140,7 @@
|
||||
var/list/responses = list( "[src] looks at you imploringly.",
|
||||
"[src] looks at you pleadingly",
|
||||
"[src] looks at you with a resigned expression.",
|
||||
"[src] seems resigned to it's fate.")
|
||||
"[src] seems resigned to its fate.")
|
||||
M << pick(responses)
|
||||
else
|
||||
..()
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
/mob/living/simple_animal/spiderbot/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
|
||||
if(istype(O, /obj/item/device/mmi) || istype(O, /obj/item/device/posibrain))
|
||||
if(istype(O, /obj/item/device/mmi) || istype(O, /obj/item/device/mmi/posibrain))
|
||||
var/obj/item/device/mmi/B = O
|
||||
if(src.mmi) //There's already a brain in it.
|
||||
user << "\red There's already a brain in [src]!"
|
||||
@@ -281,14 +281,14 @@
|
||||
return 0
|
||||
|
||||
if(istype(held_item, /obj/item/weapon/grenade))
|
||||
visible_message("\red [src] launches the [held_item]!", "\red You launch the [held_item]!", "You hear a skittering noise and a thump!")
|
||||
visible_message("\red [src] launches \the [held_item]!", "\red You launch \the [held_item]!", "You hear a skittering noise and a thump!")
|
||||
var/obj/item/weapon/grenade/G = held_item
|
||||
G.loc = src.loc
|
||||
G.prime()
|
||||
held_item = null
|
||||
return 1
|
||||
|
||||
visible_message("\blue [src] drops the [held_item]!", "\blue You drop the [held_item]!", "You hear a skittering noise and a soft thump.")
|
||||
visible_message("\blue [src] drops \the [held_item]!", "\blue You drop \the [held_item]!", "You hear a skittering noise and a soft thump.")
|
||||
|
||||
held_item.loc = src.loc
|
||||
held_item = null
|
||||
@@ -305,7 +305,7 @@
|
||||
return -1
|
||||
|
||||
if(held_item)
|
||||
src << "\red You are already holding the [held_item]"
|
||||
src << "\red You are already holding \the [held_item]"
|
||||
return 1
|
||||
|
||||
var/list/items = list()
|
||||
@@ -316,10 +316,13 @@
|
||||
var/obj/selection = input("Select an item.", "Pickup") in items
|
||||
|
||||
if(selection)
|
||||
held_item = selection
|
||||
selection.loc = src
|
||||
visible_message("\blue [src] scoops up the [held_item]!", "\blue You grab the [held_item]!", "You hear a skittering noise and a clink.")
|
||||
return held_item
|
||||
for(var/obj/item/I in view(1, src))
|
||||
if(selection == I)
|
||||
held_item = selection
|
||||
selection.loc = src
|
||||
visible_message("\blue [src] scoops up \the [held_item]!", "\blue You grab \the [held_item]!", "You hear a skittering noise and a clink.")
|
||||
return held_item
|
||||
src << "\red \The [selection] is too far away."
|
||||
|
||||
src << "\red There is nothing of interest to take."
|
||||
return 0
|
||||
@@ -456,4 +456,12 @@
|
||||
var/obj/machinery/bot/B = target_mob
|
||||
if(B.health > 0)
|
||||
return (0)
|
||||
return (1)
|
||||
return (1)
|
||||
|
||||
//Call when target overlay should be added/removed
|
||||
/mob/living/simple_animal/update_targeted()
|
||||
if(!targeted_by && target_locked)
|
||||
del(target_locked)
|
||||
overlays = null
|
||||
if (targeted_by && target_locked)
|
||||
overlays += target_locked
|
||||
@@ -27,6 +27,10 @@
|
||||
var/obj/screen/pressure = null
|
||||
var/obj/screen/damageoverlay = null
|
||||
var/obj/screen/pain = null
|
||||
var/obj/screen/gun/item/item_use_icon = null
|
||||
var/obj/screen/gun/move/gun_move_icon = null
|
||||
var/obj/screen/gun/run/gun_run_icon = null
|
||||
var/obj/screen/gun/mode/gun_setting_icon = null
|
||||
|
||||
/*A bunch of this stuff really needs to go under their own defines instead of being globally attached to mob.
|
||||
A variable should only be globally attached to turfs/objects/whatever, when it is in fact needed as such.
|
||||
@@ -36,6 +40,7 @@
|
||||
*/
|
||||
var/obj/screen/zone_sel/zone_sel = null
|
||||
|
||||
var/use_me = 1 //Allows all mobs to use the me verb by default, will have to manually specify they cannot
|
||||
var/damageoverlaytemp = 0
|
||||
var/computer_id = null
|
||||
var/lastattacker = null
|
||||
@@ -210,4 +215,4 @@
|
||||
var/has_limbs = 1 //Whether this mob have any limbs he can move with
|
||||
var/can_stand = 1 //Whether this mob have ability to stand
|
||||
|
||||
var/immune_to_ssd = 0
|
||||
var/immune_to_ssd = 0
|
||||
|
||||
@@ -280,7 +280,7 @@
|
||||
return 0
|
||||
|
||||
move_delay = world.time//set move delay
|
||||
|
||||
mob.last_move_intent = world.time + 10
|
||||
switch(mob.m_intent)
|
||||
if("run")
|
||||
if(mob.drowsyness > 0)
|
||||
|
||||
@@ -129,7 +129,10 @@
|
||||
return
|
||||
|
||||
if(client.prefs.species != "Human")
|
||||
if(!is_alien_whitelisted(src, client.prefs.species) && config.usealienwhitelist)
|
||||
|
||||
var/S = client.prefs.species
|
||||
if(S == "Unathi") S = "Soghun"
|
||||
if(!is_alien_whitelisted(src, S) && config.usealienwhitelist)
|
||||
src << alert("You are currently not whitelisted to play [client.prefs.species].")
|
||||
return 0
|
||||
|
||||
@@ -144,7 +147,9 @@
|
||||
usr << "\blue There is an administrative lock on entering the game!"
|
||||
return
|
||||
|
||||
if(!is_alien_whitelisted(src, client.prefs.species) && config.usealienwhitelist)
|
||||
var/S = client.prefs.species
|
||||
if(S == "Unathi") S = "Soghun"
|
||||
if(!is_alien_whitelisted(src, S) && config.usealienwhitelist)
|
||||
src << alert("You are currently not whitelisted to play [client.prefs.species].")
|
||||
return 0
|
||||
|
||||
@@ -286,13 +291,7 @@
|
||||
proc/AnnounceArrival(var/mob/living/carbon/human/character, var/rank)
|
||||
if (ticker.current_state == GAME_STATE_PLAYING)
|
||||
var/obj/item/device/radio/intercom/a = new /obj/item/device/radio/intercom(null)// BS12 EDIT Arrivals Announcement Computer, rather than the AI.
|
||||
|
||||
//unlikely for this to be an issue, but just in case
|
||||
if(istype(character.wear_id, /obj/item/weapon/card/id))
|
||||
var/obj/item/weapon/card/id/I = character.wear_id
|
||||
a.autosay("\"[character.real_name],[I.assignment ? " [I.assignment]," : "" ] has arrived on the station.\"", "Arrivals Announcement Computer")
|
||||
else
|
||||
a.autosay("\"[character.real_name], visitor, has arrived on the station.\"", "Arrivals Announcement Computer")
|
||||
a.autosay("[character.real_name],[rank ? " [rank]," : " visitor," ] has arrived on the station.", "Arrivals Announcement Computer")
|
||||
del(a)
|
||||
|
||||
proc/LateChoices()
|
||||
@@ -331,15 +330,15 @@
|
||||
new_character.lastarea = get_area(loc)
|
||||
|
||||
if(client.prefs.species == "Tajaran") //This is like the worst, but it works, so meh. - Erthilo
|
||||
if(is_alien_whitelisted(src, "Tajaran") || !config.usealienwhitelist)
|
||||
if(is_alien_whitelisted(src, "Tajaran"|| !config.usealienwhitelist))
|
||||
new_character.dna.mutantrace = "tajaran"
|
||||
new_character.tajaran_talk_understand = 1
|
||||
if(client.prefs.species == "Unathi")
|
||||
if(is_alien_whitelisted(src, "Soghun") || !config.usealienwhitelist)
|
||||
if(is_alien_whitelisted(src, "Soghun"|| !config.usealienwhitelist))
|
||||
new_character.dna.mutantrace = "lizard"
|
||||
new_character.soghun_talk_understand = 1
|
||||
if(client.prefs.species == "Skrell")
|
||||
if(is_alien_whitelisted(src, "Skrell") || !config.usealienwhitelist)
|
||||
if(is_alien_whitelisted(src, "Skrell"|| !config.usealienwhitelist))
|
||||
new_character.dna.mutantrace = "skrell"
|
||||
new_character.skrell_talk_understand = 1
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
|
||||
|
||||
if(ishuman(src) || isrobot(src))
|
||||
if(use_me)
|
||||
usr.emote("me",1,message)
|
||||
else
|
||||
usr.emote(message)
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
unacidable = 1
|
||||
var/id = 0.0
|
||||
var/obj/master
|
||||
var/gun_click_time = -100 //I'm lazy.
|
||||
|
||||
/obj/screen/text
|
||||
icon = null
|
||||
@@ -72,6 +73,33 @@
|
||||
var/selecting = "chest"
|
||||
screen_loc = ui_zonesel
|
||||
|
||||
/obj/screen/gun
|
||||
name = "gun"
|
||||
icon = 'screen1.dmi'
|
||||
master = null
|
||||
dir = 2
|
||||
|
||||
move
|
||||
name = "Allow Walking"
|
||||
icon_state = "no_walk0"
|
||||
screen_loc = ui_gun2
|
||||
|
||||
run
|
||||
name = "Allow Running"
|
||||
icon_state = "no_run0"
|
||||
screen_loc = ui_gun3
|
||||
|
||||
item
|
||||
name = "Allow Item Use"
|
||||
icon_state = "no_item0"
|
||||
screen_loc = ui_gun1
|
||||
|
||||
mode
|
||||
name = "Toggle Gun Mode"
|
||||
icon_state = "gun0"
|
||||
screen_loc = ui_gun_select
|
||||
//dir = 1
|
||||
|
||||
|
||||
/obj/screen/zone_sel/MouseDown(location, control,params)
|
||||
// Changes because of 4.0
|
||||
@@ -460,6 +488,64 @@
|
||||
usr:inv3.icon_state = "inv3"
|
||||
usr:module_active = null
|
||||
|
||||
if("Allow Walking")
|
||||
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
|
||||
return
|
||||
if(!istype(usr.equipped(),/obj/item/weapon/gun))
|
||||
usr << "You need your gun in your active hand to do that!"
|
||||
return
|
||||
usr.client.AllowTargetMove()
|
||||
gun_click_time = world.time
|
||||
|
||||
if("Disallow Walking")
|
||||
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
|
||||
return
|
||||
if(!istype(usr.equipped(),/obj/item/weapon/gun))
|
||||
usr << "You need your gun in your active hand to do that!"
|
||||
return
|
||||
usr.client.AllowTargetMove()
|
||||
gun_click_time = world.time
|
||||
|
||||
if("Allow Running")
|
||||
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
|
||||
return
|
||||
if(!istype(usr.equipped(),/obj/item/weapon/gun))
|
||||
usr << "You need your gun in your active hand to do that!"
|
||||
return
|
||||
usr.client.AllowTargetRun()
|
||||
gun_click_time = world.time
|
||||
|
||||
if("Disallow Running")
|
||||
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
|
||||
return
|
||||
if(!istype(usr.equipped(),/obj/item/weapon/gun))
|
||||
usr << "You need your gun in your active hand to do that!"
|
||||
return
|
||||
usr.client.AllowTargetRun()
|
||||
gun_click_time = world.time
|
||||
|
||||
if("Allow Item Use")
|
||||
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
|
||||
return
|
||||
if(!istype(usr.equipped(),/obj/item/weapon/gun))
|
||||
usr << "You need your gun in your active hand to do that!"
|
||||
return
|
||||
usr.client.AllowTargetClick()
|
||||
gun_click_time = world.time
|
||||
|
||||
|
||||
if("Disallow Item Use")
|
||||
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
|
||||
return
|
||||
if(!istype(usr.equipped(),/obj/item/weapon/gun))
|
||||
usr << "You need your gun in your active hand to do that!"
|
||||
return
|
||||
usr.client.AllowTargetClick()
|
||||
gun_click_time = world.time
|
||||
|
||||
if("Toggle Gun Mode")
|
||||
usr.client.ToggleGunMode()
|
||||
|
||||
else
|
||||
DblClick()
|
||||
return
|
||||
|
||||
@@ -63,3 +63,6 @@
|
||||
|
||||
/mob/proc/update_inv_ears()
|
||||
return
|
||||
|
||||
/mob/proc/update_targeted()
|
||||
return
|
||||
|
||||
220
code/modules/organs/blood.dm
Normal file
220
code/modules/organs/blood.dm
Normal file
@@ -0,0 +1,220 @@
|
||||
/****************************************************
|
||||
BLOOD SYSTEM
|
||||
****************************************************/
|
||||
//Blood levels
|
||||
var/const/BLOOD_VOLUME_SAFE = 501
|
||||
var/const/BLOOD_VOLUME_OKAY = 336
|
||||
var/const/BLOOD_VOLUME_BAD = 224
|
||||
var/const/BLOOD_VOLUME_SURVIVE = 122
|
||||
|
||||
/mob/living/carbon/human/var/datum/reagents/vessel //Container for blood and BLOOD ONLY. Do not transfer other chems here.
|
||||
/mob/living/carbon/human/var/var/pale = 0 //Should affect how mob sprite is drawn, but currently doesn't.
|
||||
|
||||
//Initializes blood vessels
|
||||
/mob/living/carbon/human/proc/make_blood()
|
||||
if (vessel)
|
||||
return
|
||||
vessel = new/datum/reagents(600)
|
||||
vessel.my_atom = src
|
||||
vessel.add_reagent("blood",560)
|
||||
spawn(1)
|
||||
fixblood()
|
||||
|
||||
//Resets blood data
|
||||
/mob/living/carbon/human/proc/fixblood()
|
||||
for(var/datum/reagent/blood/B in vessel.reagent_list)
|
||||
if(B.id == "blood")
|
||||
B.data = list( "donor"=src,"viruses"=null,"blood_DNA"=dna.unique_enzymes,"blood_type"=dna.b_type, \
|
||||
"resistances"=null,"trace_chem"=null, "virus2" = null, "antibodies" = null)
|
||||
|
||||
// Takes care blood loss and regeneration
|
||||
/mob/living/carbon/human/proc/handle_blood()
|
||||
if(stat != DEAD && bodytemperature >= 170) //Dead or cryosleep people do not pump the blood.
|
||||
|
||||
var/blood_volume = round(vessel.get_reagent_amount("blood"))
|
||||
|
||||
//Blood regeneration if there is some space
|
||||
if(blood_volume < 560 && blood_volume)
|
||||
var/datum/reagent/blood/B = locate() in vessel.reagent_list //Grab some blood
|
||||
if(B) // Make sure there's some blood at all
|
||||
if(B.data["donor"] != src) //If it's not theirs, then we look for theirs
|
||||
for(var/datum/reagent/blood/D in vessel.reagent_list)
|
||||
if(D.data["donor"] == src)
|
||||
B = D
|
||||
break
|
||||
|
||||
B.volume += 0.1 // regenerate blood VERY slowly
|
||||
if (reagents.has_reagent("nutriment")) //Getting food speeds it up
|
||||
B.volume += 0.4
|
||||
reagents.remove_reagent("nutriment", 0.1)
|
||||
if (reagents.has_reagent("iron")) //Hematogen candy anyone?
|
||||
B.volume += 0.8
|
||||
reagents.remove_reagent("iron", 0.1)
|
||||
|
||||
// Damaged heart virtually reduces the blood volume, as the blood isn't
|
||||
// being pumped properly anymore.
|
||||
var/datum/organ/internal/heart/heart = internal_organs["heart"]
|
||||
switch(heart.damage)
|
||||
if(5 to 10)
|
||||
blood_volume *= 0.8
|
||||
if(11 to 20)
|
||||
blood_volume *= 0.5
|
||||
if(21 to INFINITY)
|
||||
blood_volume *= 0.3
|
||||
|
||||
//Effects of bloodloss
|
||||
switch(blood_volume)
|
||||
if(BLOOD_VOLUME_SAFE to 10000)
|
||||
if(pale)
|
||||
pale = 0
|
||||
update_body()
|
||||
if(BLOOD_VOLUME_OKAY to BLOOD_VOLUME_SAFE)
|
||||
if(!pale)
|
||||
pale = 1
|
||||
update_body()
|
||||
var/word = pick("dizzy","woosey","faint")
|
||||
src << "\red You feel [word]"
|
||||
if(prob(1))
|
||||
var/word = pick("dizzy","woosey","faint")
|
||||
src << "\red You feel [word]"
|
||||
if(oxyloss < 20)
|
||||
oxyloss += 3
|
||||
if(BLOOD_VOLUME_BAD to BLOOD_VOLUME_OKAY)
|
||||
if(!pale)
|
||||
pale = 1
|
||||
update_body()
|
||||
eye_blurry += 6
|
||||
if(oxyloss < 50)
|
||||
oxyloss += 10
|
||||
oxyloss += 1
|
||||
if(prob(15))
|
||||
Paralyse(rand(1,3))
|
||||
var/word = pick("dizzy","woosey","faint")
|
||||
src << "\red You feel extremely [word]"
|
||||
if(BLOOD_VOLUME_SURVIVE to BLOOD_VOLUME_BAD)
|
||||
oxyloss += 5
|
||||
toxloss += 5
|
||||
if(prob(15))
|
||||
var/word = pick("dizzy","woosey","faint")
|
||||
src << "\red You feel extremely [word]"
|
||||
if(0 to BLOOD_VOLUME_SURVIVE)
|
||||
// There currently is a strange bug here. If the mob is not below -100 health
|
||||
// when death() is called, apparently they will be just fine, and this way it'll
|
||||
// spam deathgasp. Adjusting toxloss ensures the mob will stay dead.
|
||||
toxloss += 300 // just to be safe!
|
||||
death()
|
||||
|
||||
// Without enough blood you slowly go hungry.
|
||||
if(blood_volume < BLOOD_VOLUME_SAFE)
|
||||
if(nutrition >= 300)
|
||||
nutrition -= 10
|
||||
else if(nutrition >= 200)
|
||||
nutrition -= 3
|
||||
|
||||
//Bleeding out
|
||||
var/blood_max = 0
|
||||
for(var/datum/organ/external/temp in organs)
|
||||
if(!(temp.status & ORGAN_BLEEDING) || temp.status & ORGAN_ROBOT)
|
||||
continue
|
||||
for(var/datum/wound/W in temp.wounds) if(W.bleeding())
|
||||
blood_max += W.damage / 4
|
||||
if(temp.status & ORGAN_DESTROYED && !(temp.status & ORGAN_GAUZED) && !temp.amputated)
|
||||
blood_max += 20 //Yer missing a fucking limb.
|
||||
if (temp.open)
|
||||
blood_max += 2 //Yer stomach is cut open
|
||||
drip(blood_max)
|
||||
|
||||
//Makes a blood drop, leaking certain amount of blood from the mob
|
||||
/mob/living/carbon/human/proc/drip(var/amt as num)
|
||||
if(!amt)
|
||||
return
|
||||
|
||||
var/amm = 0.1 * amt
|
||||
var/turf/T = get_turf(src)
|
||||
var/list/obj/effect/decal/cleanable/blood/drip/nums = list()
|
||||
var/list/iconL = list("1","2","3","4","5")
|
||||
|
||||
vessel.remove_reagent("blood",amm)
|
||||
|
||||
for(var/obj/effect/decal/cleanable/blood/drip/G in T)
|
||||
nums += G
|
||||
iconL.Remove(G.icon_state)
|
||||
|
||||
if (nums.len < 5)
|
||||
var/obj/effect/decal/cleanable/blood/drip/this = new(T)
|
||||
this.icon_state = pick(iconL)
|
||||
this.blood_DNA = list()
|
||||
this.blood_DNA[dna.unique_enzymes] = dna.b_type
|
||||
else
|
||||
for(var/obj/effect/decal/cleanable/blood/drip/G in nums)
|
||||
del G
|
||||
T.add_blood(src)
|
||||
|
||||
/****************************************************
|
||||
BLOOD TRANSFERS
|
||||
****************************************************/
|
||||
|
||||
//Gets blood from mob to the container, preserving all data in it.
|
||||
/mob/living/carbon/proc/take_blood(obj/item/weapon/reagent_containers/container, var/amount)
|
||||
var/datum/reagent/B = get_blood(container.reagents)
|
||||
if(!B) B = new /datum/reagent/blood
|
||||
B.holder = container
|
||||
B.volume += amount
|
||||
|
||||
//set reagent data
|
||||
B.data["donor"] = src
|
||||
if(src.virus2)
|
||||
B.data["virus2"] = src.virus2.getcopy()
|
||||
B.data["antibodies"] = src.antibodies
|
||||
B.data["blood_DNA"] = copytext(src.dna.unique_enzymes,1,0)
|
||||
if(src.resistances && src.resistances.len)
|
||||
if(B.data["resistances"])
|
||||
B.data["resistances"] |= src.resistances.Copy()
|
||||
else
|
||||
B.data["resistances"] = src.resistances.Copy()
|
||||
B.data["blood_type"] = copytext(src.dna.b_type,1,0)
|
||||
|
||||
var/list/temp_chem = list()
|
||||
for(var/datum/reagent/R in src.reagents.reagent_list)
|
||||
temp_chem += R.id
|
||||
temp_chem[R.id] = R.volume
|
||||
B.data["trace_chem"] = list2params(temp_chem)
|
||||
return B
|
||||
|
||||
//For humans, blood does not appear from blue, it comes from vessels.
|
||||
/mob/living/carbon/human/take_blood(obj/item/weapon/reagent_containers/container, var/amount)
|
||||
if(vessel.get_reagent_amount("blood") < amount)
|
||||
return null
|
||||
. = ..()
|
||||
vessel.remove_reagent("blood",amount) // Removes blood if human
|
||||
|
||||
//Transfers blood from container ot vessels, respecting blood types compatability.
|
||||
/mob/living/carbon/human/proc/inject_blood(obj/item/weapon/reagent_containers/container, var/amount)
|
||||
var/datum/reagent/blood/our = get_blood(vessel)
|
||||
var/datum/reagent/blood/injected = get_blood(container.reagents)
|
||||
|
||||
if(blood_incompatible(injected.data["blood_type"],our.data["blood_type"]) )
|
||||
reagents.add_reagent("toxin",amount * 0.5)
|
||||
reagents.update_total()
|
||||
else
|
||||
vessel.add_reagent("blood", amount, injected.data)
|
||||
vessel.update_total()
|
||||
|
||||
var/list/chems = list()
|
||||
chems = params2list(injected.data["trace_chem"])
|
||||
for(var/C in chems)
|
||||
src.reagents.add_reagent(C, (text2num(chems[C]) / 560) * amount)//adds trace chemicals to owner's blood
|
||||
//world << "added [(text2num(chems[C])/560) * amount] = [text2num(chems[C])]/560*[amount] units of [C] to [src]" //DEBUG
|
||||
reagents.update_total()
|
||||
|
||||
container.reagents.remove_reagent("blood", amount)
|
||||
|
||||
//Gets human's own blood.
|
||||
/mob/living/carbon/proc/get_blood(datum/reagents/container)
|
||||
var/datum/reagent/blood/res = locate() in container.reagent_list //Grab some blood
|
||||
if(res) // Make sure there's some blood at all
|
||||
if(res.data["donor"] != src) //If it's not theirs, then we look for theirs
|
||||
for(var/datum/reagent/blood/D in container.reagent_list)
|
||||
if(D.data["donor"] == src)
|
||||
return D
|
||||
return res
|
||||
148
code/modules/organs/organ.dm
Normal file
148
code/modules/organs/organ.dm
Normal file
@@ -0,0 +1,148 @@
|
||||
/datum/organ
|
||||
var/name = "organ"
|
||||
var/mob/living/carbon/human/owner = null
|
||||
|
||||
var/list/datum/autopsy_data/autopsy_data = list()
|
||||
var/list/trace_chemicals = list() // traces of chemicals in the organ,
|
||||
// links chemical IDs to number of ticks for which they'll stay in the blood
|
||||
proc/process()
|
||||
return 0
|
||||
|
||||
proc/receive_chem(chemical as obj)
|
||||
return 0
|
||||
|
||||
//Handles chem traces
|
||||
/mob/living/carbon/human/proc/handle_trace_chems()
|
||||
//New are added for reagents to random organs.
|
||||
for(var/datum/reagent/A in reagents.reagent_list)
|
||||
var/datum/organ/O = pick(organs)
|
||||
O.trace_chemicals[A.name] = 100
|
||||
|
||||
//Adds autopsy data for used_weapon.
|
||||
/datum/organ/proc/add_autopsy_data(var/used_weapon, var/damage)
|
||||
var/datum/autopsy_data/W = autopsy_data[used_weapon]
|
||||
if(!W)
|
||||
W = new()
|
||||
W.weapon = used_weapon
|
||||
autopsy_data[used_weapon] = W
|
||||
|
||||
W.hits += 1
|
||||
W.damage += damage
|
||||
W.time_inflicted = world.time
|
||||
|
||||
/mob/living/carbon/human/var/list/organs = list()
|
||||
/mob/living/carbon/human/var/list/organs_by_name = list() // map organ names to organs
|
||||
|
||||
//Creates and initializes and connects external and internal organs
|
||||
/mob/living/carbon/human/proc/make_organs()
|
||||
organs = list()
|
||||
organs_by_name["chest"] = new/datum/organ/external/chest()
|
||||
organs_by_name["groin"] = new/datum/organ/external/groin(organs_by_name["chest"])
|
||||
organs_by_name["head"] = new/datum/organ/external/head(organs_by_name["chest"])
|
||||
organs_by_name["l_arm"] = new/datum/organ/external/l_arm(organs_by_name["chest"])
|
||||
organs_by_name["r_arm"] = new/datum/organ/external/r_arm(organs_by_name["chest"])
|
||||
organs_by_name["r_leg"] = new/datum/organ/external/r_leg(organs_by_name["groin"])
|
||||
organs_by_name["l_leg"] = new/datum/organ/external/l_leg(organs_by_name["groin"])
|
||||
organs_by_name["l_hand"] = new/datum/organ/external/l_hand(organs_by_name["l_arm"])
|
||||
organs_by_name["r_hand"] = new/datum/organ/external/r_hand(organs_by_name["r_arm"])
|
||||
organs_by_name["l_foot"] = new/datum/organ/external/l_foot(organs_by_name["l_leg"])
|
||||
organs_by_name["r_foot"] = new/datum/organ/external/r_foot(organs_by_name["r_leg"])
|
||||
|
||||
new/datum/organ/internal/heart(src)
|
||||
new/datum/organ/internal/lungs(src)
|
||||
new/datum/organ/internal/liver(src)
|
||||
new/datum/organ/internal/kidney(src)
|
||||
new/datum/organ/internal/brain(src)
|
||||
|
||||
for(var/name in organs_by_name)
|
||||
organs += organs_by_name[name]
|
||||
|
||||
for(var/datum/organ/external/O in organs)
|
||||
O.owner = src
|
||||
|
||||
// Takes care of organ related updates, such as broken and missing limbs
|
||||
/mob/living/carbon/human/proc/handle_organs()
|
||||
number_wounds = 0
|
||||
var/leg_tally = 2
|
||||
for(var/datum/organ/external/E in organs)
|
||||
if(!E)
|
||||
continue
|
||||
E.process()
|
||||
number_wounds += E.number_wounds
|
||||
|
||||
//Robotic limb malfunctions
|
||||
var/malfunction = 0
|
||||
if (E.status & ORGAN_ROBOT && prob(E.brute_dam + E.burn_dam))
|
||||
malfunction = 1
|
||||
|
||||
//Broken limbs hurt too
|
||||
var/broken = 0
|
||||
if(E.status & ORGAN_BROKEN && !(E.status & ORGAN_SPLINTED && prob(10)) )
|
||||
broken = 1
|
||||
|
||||
//Special effects for limbs.
|
||||
if(E.name in list("l_hand","l_arm","r_hand","r_arm"))
|
||||
var/obj/item/c_hand //Getting what's in this hand
|
||||
if(E.name == "l_hand" || E.name == "l_arm")
|
||||
c_hand = l_hand
|
||||
if(E.name == "r_hand" || E.name == "r_arm")
|
||||
c_hand = r_hand
|
||||
|
||||
if (c_hand)
|
||||
if (broken||malfunction)
|
||||
u_equip(c_hand)
|
||||
|
||||
if(broken)
|
||||
emote("me", 1, "screams in pain and drops what they were holding in their [E.display_name?"[E.display_name]":"[E]"]!")
|
||||
if(malfunction)
|
||||
emote("me", 1, "drops what they were holding, their [E.display_name?"[E.display_name]":"[E]"] malfunctioning!")
|
||||
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
|
||||
spark_system.set_up(5, 0, src)
|
||||
spark_system.attach(src)
|
||||
spark_system.start()
|
||||
spawn(10)
|
||||
del(spark_system)
|
||||
|
||||
else if(E.name in list("l_leg","l_foot","r_leg","r_foot") && !lying)
|
||||
if (E.status & ORGAN_DESTROYED || malfunction || (broken && !(E.status & ORGAN_SPLINTED)))
|
||||
leg_tally-- // let it fail even if just foot&leg
|
||||
|
||||
// standing is poor
|
||||
if(leg_tally <= 0 && !paralysis && !(lying || resting) && prob(5))
|
||||
emote("scream")
|
||||
emote("collapse")
|
||||
paralysis = 10
|
||||
|
||||
//Check arms and legs for existence
|
||||
var/canstand_l = 1 //Can stand on left leg
|
||||
var/canstand_r = 1 //Can stand on right leg
|
||||
var/hasleg_l = 1 //Have left leg
|
||||
var/hasleg_r = 1 //Have right leg
|
||||
var/hasarm_l = 1 //Have left arm
|
||||
var/hasarm_r = 1 //Have right arm
|
||||
var/datum/organ/external/E
|
||||
E = get_organ("l_leg")
|
||||
if(E.status & ORGAN_DESTROYED && !(E.status & ORGAN_SPLINTED))
|
||||
canstand_l = 0
|
||||
hasleg_l = 0
|
||||
E = get_organ("r_leg")
|
||||
if(E.status & ORGAN_DESTROYED && !(E.status & ORGAN_SPLINTED))
|
||||
canstand_r = 0
|
||||
hasleg_r = 0
|
||||
E = get_organ("l_foot")
|
||||
if(E.status & ORGAN_DESTROYED && !(E.status & ORGAN_SPLINTED))
|
||||
canstand_l = 0
|
||||
E = get_organ("r_foot")
|
||||
if(E.status & ORGAN_DESTROYED && !(E.status & ORGAN_SPLINTED))
|
||||
canstand_r = 0
|
||||
E = get_organ("l_arm")
|
||||
if(E.status & ORGAN_DESTROYED && !(E.status & ORGAN_SPLINTED))
|
||||
hasarm_l = 0
|
||||
E = get_organ("r_arm")
|
||||
if(E.status & ORGAN_DESTROYED && !(E.status & ORGAN_SPLINTED))
|
||||
hasarm_r = 0
|
||||
|
||||
// Can stand if have at least one full leg (with leg and foot parts present)
|
||||
// Has limbs to move around if at least one arm or leg is at least partially there
|
||||
can_stand = canstand_l||canstand_r
|
||||
has_limbs = hasleg_l||hasleg_r||hasarm_l||hasarm_r
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,116 +1,83 @@
|
||||
/****************************************************
|
||||
INTERNAL ORGANS
|
||||
****************************************************/
|
||||
|
||||
/*
|
||||
/datum/organ/internal
|
||||
name = "internal"
|
||||
var/damage = 0
|
||||
var/max_damage = 100
|
||||
|
||||
/datum/organ/internal/skeleton
|
||||
name = "spooky scary skeleton"
|
||||
max_damage = 200
|
||||
|
||||
/datum/organ/internal/skin
|
||||
name = "skin"
|
||||
max_damage = 100
|
||||
|
||||
/datum/organ/internal/blood_vessels
|
||||
name = "blood vessels"
|
||||
var/heart = null
|
||||
var/lungs = null
|
||||
var/kidneys = null
|
||||
|
||||
/datum/organ/internal/brain
|
||||
name = "brain"
|
||||
var/head = null
|
||||
|
||||
/datum/organ/internal/excretory
|
||||
name = "excretory"
|
||||
var/excretory = 7.0
|
||||
var/blood_vessels = null
|
||||
|
||||
/datum/organ/internal/heart
|
||||
name = "heart"
|
||||
|
||||
/datum/organ/internal/immune_system
|
||||
name = "immune system"
|
||||
var/blood_vessels = null
|
||||
var/isys = null
|
||||
|
||||
/datum/organ/internal/intestines
|
||||
name = "intestines"
|
||||
var/intestines = 3.0
|
||||
var/blood_vessels = null
|
||||
|
||||
/datum/organ/internal/liver
|
||||
name = "liver"
|
||||
var/intestines = null
|
||||
var/blood_vessels = null
|
||||
|
||||
/datum/organ/internal/lungs
|
||||
name = "lungs"
|
||||
var/lungs = 3.0
|
||||
var/throat = null
|
||||
var/blood_vessels = null
|
||||
|
||||
/datum/organ/internal/stomach
|
||||
name = "stomach"
|
||||
var/intestines = null
|
||||
|
||||
/datum/organ/internal/throat
|
||||
name = "throat"
|
||||
var/lungs = null
|
||||
var/stomach = null
|
||||
|
||||
*/
|
||||
|
||||
/mob/living/carbon/human/var/list/internal_organs = list()
|
||||
|
||||
/datum/organ/internal
|
||||
// amount of damage to the organ
|
||||
var/damage = 0
|
||||
var/min_bruised_damage = 10
|
||||
var/min_broken_damage = 30
|
||||
var/parent_organ = "chest"
|
||||
|
||||
/datum/organ/internal/proc/is_bruised()
|
||||
return damage >= min_bruised_damage
|
||||
|
||||
/datum/organ/internal/proc/is_broken()
|
||||
return damage >= min_broken_damage
|
||||
|
||||
|
||||
/datum/organ/internal/New(mob/living/carbon/human/H)
|
||||
..()
|
||||
var/datum/organ/external/E = H.organs_by_name[src.parent_organ]
|
||||
if(E.internal_organs == null)
|
||||
E.internal_organs = list()
|
||||
E.internal_organs += src
|
||||
H.internal_organs[src.name] = src
|
||||
src.owner = H
|
||||
|
||||
/datum/organ/internal/proc/take_damage(amount)
|
||||
src.damage += amount
|
||||
|
||||
var/datum/organ/external/parent = owner.get_organ(parent_organ)
|
||||
owner.custom_pain("Something inside your [parent.display_name] hurts a lot.", 1)
|
||||
|
||||
/datum/organ/internal/heart
|
||||
name = "heart"
|
||||
parent_organ = "chest"
|
||||
|
||||
|
||||
/datum/organ/internal/lungs
|
||||
name = "lungs"
|
||||
parent_organ = "chest"
|
||||
|
||||
/datum/organ/internal/liver
|
||||
name = "liver"
|
||||
parent_organ = "chest"
|
||||
|
||||
|
||||
/datum/organ/internal/kidney
|
||||
name = "kidney"
|
||||
parent_organ = "chest"
|
||||
/****************************************************
|
||||
INTERNAL ORGANS
|
||||
****************************************************/
|
||||
|
||||
/mob/living/carbon/human/var/list/internal_organs = list()
|
||||
|
||||
/datum/organ/internal
|
||||
// amount of damage to the organ
|
||||
var/damage = 0
|
||||
var/min_bruised_damage = 10
|
||||
var/min_broken_damage = 30
|
||||
var/parent_organ = "chest"
|
||||
|
||||
/datum/organ/internal/proc/is_bruised()
|
||||
return damage >= min_bruised_damage
|
||||
|
||||
/datum/organ/internal/proc/is_broken()
|
||||
return damage >= min_broken_damage
|
||||
|
||||
|
||||
/datum/organ/internal/New(mob/living/carbon/human/H)
|
||||
..()
|
||||
var/datum/organ/external/E = H.organs_by_name[src.parent_organ]
|
||||
if(E.internal_organs == null)
|
||||
E.internal_organs = list()
|
||||
E.internal_organs += src
|
||||
H.internal_organs[src.name] = src
|
||||
src.owner = H
|
||||
|
||||
/datum/organ/internal/proc/take_damage(amount)
|
||||
src.damage += amount
|
||||
|
||||
var/datum/organ/external/parent = owner.get_organ(parent_organ)
|
||||
owner.custom_pain("Something inside your [parent.display_name] hurts a lot.", 1)
|
||||
|
||||
/****************************************************
|
||||
INTERNAL ORGANS DEFINES
|
||||
****************************************************/
|
||||
|
||||
/datum/organ/internal/heart
|
||||
name = "heart"
|
||||
parent_organ = "chest"
|
||||
|
||||
|
||||
/datum/organ/internal/lungs
|
||||
name = "lungs"
|
||||
parent_organ = "chest"
|
||||
|
||||
process()
|
||||
if(is_bruised())
|
||||
if(prob(2))
|
||||
spawn owner.emote("me", 1, "coughs up blood!")
|
||||
owner.drip(10)
|
||||
if(prob(4))
|
||||
spawn owner.emote("me", 1, "gasps for air!")
|
||||
owner.losebreath += 5
|
||||
|
||||
/datum/organ/internal/liver
|
||||
name = "liver"
|
||||
parent_organ = "chest"
|
||||
var/process_accuracy = 10
|
||||
|
||||
process()
|
||||
if(owner.life_tick % process_accuracy == 0)
|
||||
// Damaged liver means some chemicals are very dangerous
|
||||
if(src.damage >= src.min_bruised_damage)
|
||||
for(var/datum/reagent/R in owner.reagents.reagent_list)
|
||||
// Ethanol and all drinks are bad
|
||||
if(istype(R, /datum/reagent/ethanol))
|
||||
owner.adjustToxLoss(0.1 * process_accuracy)
|
||||
|
||||
// Can't cope with toxins at all
|
||||
for(var/toxin in list("toxin", "plasma", "sacid", "pacid", "cyanide", "lexorin", "amatoxin", "chloralhydrate", "carpotoxin", "zombiepowder", "mindbreaker"))
|
||||
if(owner.reagents.has_reagent(toxin))
|
||||
owner.adjustToxLoss(0.3 * process_accuracy)
|
||||
|
||||
/datum/organ/internal/kidney
|
||||
name = "kidney"
|
||||
parent_organ = "chest"
|
||||
|
||||
/datum/organ/internal/brain
|
||||
name = "brain"
|
||||
parent_organ = "head"
|
||||
@@ -56,7 +56,12 @@ mob/living/carbon/human/proc/custom_pain(var/message, var/flash_strength)
|
||||
var/msg = "\red <b>[message]</b>"
|
||||
if(flash_strength >= 1)
|
||||
msg = "\red <font size=3><b>[message]</b></font>"
|
||||
src << msg
|
||||
|
||||
// Anti message spam checks
|
||||
if(msg && ((msg != last_pain_message) || (world.time >= next_pain_time)))
|
||||
last_pain_message = msg
|
||||
src << msg
|
||||
next_pain_time = world.time + 100
|
||||
|
||||
mob/living/carbon/human/proc/handle_pain()
|
||||
// not when sleeping
|
||||
@@ -87,4 +92,26 @@ mob/living/carbon/human/proc/handle_pain()
|
||||
var/datum/organ/internal/I = internal_organs[organ_name]
|
||||
if(I.damage > 2) if(prob(2))
|
||||
var/datum/organ/external/parent = get_organ(I.parent_organ)
|
||||
src.custom_pain("You feel a sharp pain in your [parent.display_name]", 1)
|
||||
src.custom_pain("You feel a sharp pain in your [parent.display_name]", 1)
|
||||
|
||||
var/toxDamageMessage = null
|
||||
var/toxMessageProb = 1
|
||||
switch(getToxLoss())
|
||||
if(1 to 5)
|
||||
toxMessageProb = 1
|
||||
toxDamageMessage = "Your body stings slightly."
|
||||
if(6 to 10)
|
||||
toxMessageProb = 2
|
||||
toxDamageMessage = "Your whole body hurts a little."
|
||||
if(11 to 15)
|
||||
toxMessageProb = 2
|
||||
toxDamageMessage = "Your whole body hurts."
|
||||
if(15 to 25)
|
||||
toxMessageProb = 3
|
||||
toxDamageMessage = "Your whole body hurts badly."
|
||||
if(26 to INFINITY)
|
||||
toxMessageProb = 5
|
||||
toxDamageMessage = "Your body aches all over, it's driving you mad."
|
||||
|
||||
if(toxDamageMessage && prob(toxMessageProb))
|
||||
src.custom_pain(toxDamageMessage, getToxLoss() >= 15)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user