mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-14 17:36:52 +01:00
Merge resolution with PDA nanoui.
This commit is contained in:
@@ -152,7 +152,7 @@ var/list/admin_verbs_debug = list(
|
||||
/client/proc/callproc,
|
||||
/client/proc/toggledebuglogs,
|
||||
/client/proc/SDQL_query,
|
||||
/client/proc/SDQL2_query
|
||||
/client/proc/SDQL2_query,
|
||||
)
|
||||
var/list/admin_verbs_possess = list(
|
||||
/proc/possess,
|
||||
@@ -304,7 +304,6 @@ var/list/admin_verbs_mentor = list(
|
||||
/client/proc/camera_view,
|
||||
/client/proc/sec_camera_report,
|
||||
/client/proc/intercom_view,
|
||||
/client/proc/air_status,
|
||||
/client/proc/atmosscan,
|
||||
/client/proc/powerdebug,
|
||||
/client/proc/count_objects_on_z_level,
|
||||
|
||||
+29
-30
@@ -228,7 +228,7 @@
|
||||
emergency_shuttle.call_evac()
|
||||
log_admin("[key_name(usr)] called the Emergency Shuttle")
|
||||
message_admins("\blue [key_name_admin(usr)] called the Emergency Shuttle to the station", 1)
|
||||
|
||||
|
||||
else if (emergency_shuttle.can_recall())
|
||||
emergency_shuttle.recall()
|
||||
log_admin("[key_name(usr)] sent the Emergency Shuttle back")
|
||||
@@ -247,7 +247,7 @@
|
||||
log_admin("[key_name(usr)] edited the Emergency Shuttle's launch time to [new_time_left]")
|
||||
message_admins("\blue [key_name_admin(usr)] edited the Emergency Shuttle's launch time to [new_time_left*10]", 1)
|
||||
else if (emergency_shuttle.shuttle.has_arrive_time())
|
||||
|
||||
|
||||
var/new_time_left = input("Enter new shuttle arrival time (seconds):","Edit Shuttle Arrival Time", emergency_shuttle.estimate_arrival_time() ) as num
|
||||
emergency_shuttle.shuttle.arrive_time = world.time + new_time_left*10
|
||||
|
||||
@@ -255,7 +255,7 @@
|
||||
message_admins("\blue [key_name_admin(usr)] edited the Emergency Shuttle's arrival time to [new_time_left*10]", 1)
|
||||
else
|
||||
alert("The shuttle is neither counting down to launch nor is it in transit. Please try again when it is.")
|
||||
|
||||
|
||||
href_list["secretsadmin"] = "check_antagonist"
|
||||
|
||||
else if(href_list["delay_round_end"])
|
||||
@@ -291,7 +291,6 @@
|
||||
if("larva") M.change_mob_type( /mob/living/carbon/alien/larva , null, null, delmob )
|
||||
if("human") M.change_mob_type( /mob/living/carbon/human , null, null, delmob )
|
||||
if("slime") M.change_mob_type( /mob/living/carbon/slime , null, null, delmob )
|
||||
if("adultslime") M.change_mob_type( /mob/living/carbon/slime/adult , null, null, delmob )
|
||||
if("monkey") M.change_mob_type( /mob/living/carbon/monkey , null, null, delmob )
|
||||
if("robot") M.change_mob_type( /mob/living/silicon/robot , null, null, delmob )
|
||||
if("cat") M.change_mob_type( /mob/living/simple_animal/cat , null, null, delmob )
|
||||
@@ -1935,20 +1934,20 @@
|
||||
|
||||
if("launchshuttle")
|
||||
if(!shuttle_controller) return // Something is very wrong, the shuttle controller has not been created.
|
||||
|
||||
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
feedback_add_details("admin_secrets_fun_used","ShL")
|
||||
|
||||
|
||||
var/list/valid_shuttles = list()
|
||||
for (var/shuttle_tag in shuttle_controller.shuttles)
|
||||
if (istype(shuttle_controller.shuttles[shuttle_tag], /datum/shuttle/ferry))
|
||||
valid_shuttles += shuttle_tag
|
||||
|
||||
|
||||
var/shuttle_tag = input("Which shuttle do you want to launch?") as null|anything in valid_shuttles
|
||||
|
||||
|
||||
if (!shuttle_tag)
|
||||
return
|
||||
|
||||
|
||||
var/datum/shuttle/ferry/S = shuttle_controller.shuttles[shuttle_tag]
|
||||
if (S.can_launch())
|
||||
S.launch(usr)
|
||||
@@ -1956,23 +1955,23 @@
|
||||
log_admin("[key_name(usr)] launched the [shuttle_tag] shuttle")
|
||||
else
|
||||
alert("The [shuttle_tag] shuttle cannot be launched at this time. It's probably busy.")
|
||||
|
||||
|
||||
if("forcelaunchshuttle")
|
||||
if(!shuttle_controller) return // Something is very wrong, the shuttle controller has not been created.
|
||||
|
||||
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
feedback_add_details("admin_secrets_fun_used","ShFL")
|
||||
|
||||
|
||||
var/list/valid_shuttles = list()
|
||||
for (var/shuttle_tag in shuttle_controller.shuttles)
|
||||
if (istype(shuttle_controller.shuttles[shuttle_tag], /datum/shuttle/ferry))
|
||||
valid_shuttles += shuttle_tag
|
||||
|
||||
|
||||
var/shuttle_tag = input("Which shuttle's launch do you want to force?") as null|anything in valid_shuttles
|
||||
|
||||
|
||||
if (!shuttle_tag)
|
||||
return
|
||||
|
||||
|
||||
var/datum/shuttle/ferry/S = shuttle_controller.shuttles[shuttle_tag]
|
||||
if (S.can_force())
|
||||
S.force_launch(usr)
|
||||
@@ -1980,31 +1979,31 @@
|
||||
log_admin("[key_name(usr)] has forced the [shuttle_tag] shuttle launch")
|
||||
else
|
||||
alert("The [shuttle_tag] shuttle launch cannot be forced at this time. It's busy, or hasn't been launched yet.")
|
||||
|
||||
|
||||
if("jumpshuttle")
|
||||
if(!shuttle_controller) return // Something is very wrong, the shuttle controller has not been created.
|
||||
|
||||
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
feedback_add_details("admin_secrets_fun_used","ShJ")
|
||||
|
||||
|
||||
var/shuttle_tag = input("Which shuttle do you want to jump?") as null|anything in shuttle_controller.shuttles
|
||||
if (!shuttle_tag) return
|
||||
|
||||
|
||||
var/datum/shuttle/S = shuttle_controller.shuttles[shuttle_tag]
|
||||
|
||||
|
||||
var/origin_area = input("Which area is the shuttle at now? (MAKE SURE THIS IS CORRECT OR THINGS WILL BREAK)") as null|area in world
|
||||
if (!origin_area) return
|
||||
|
||||
|
||||
var/destination_area = input("Which area is the shuttle at now? (MAKE SURE THIS IS CORRECT OR THINGS WILL BREAK)") as null|area in world
|
||||
if (!destination_area) return
|
||||
|
||||
|
||||
var/long_jump = alert("Is there a transition area for this jump?","", "Yes", "No")
|
||||
if (long_jump == "Yes")
|
||||
var/transition_area = input("Which area is the transition area? (MAKE SURE THIS IS CORRECT OR THINGS WILL BREAK)") as null|area in world
|
||||
if (!transition_area) return
|
||||
|
||||
|
||||
var/move_duration = input("How many seconds will this jump take?") as num
|
||||
|
||||
|
||||
S.long_jump(origin_area, destination_area, transition_area, move_duration)
|
||||
message_admins("\blue [key_name_admin(usr)] has initiated a jump from [origin_area] to [destination_area] lasting [move_duration] seconds for the [shuttle_tag] shuttle", 1)
|
||||
log_admin("[key_name_admin(usr)] has initiated a jump from [origin_area] to [destination_area] lasting [move_duration] seconds for the [shuttle_tag] shuttle")
|
||||
@@ -2012,29 +2011,29 @@
|
||||
S.short_jump(origin_area, destination_area)
|
||||
message_admins("\blue [key_name_admin(usr)] has initiated a jump from [origin_area] to [destination_area] for the [shuttle_tag] shuttle", 1)
|
||||
log_admin("[key_name_admin(usr)] has initiated a jump from [origin_area] to [destination_area] for the [shuttle_tag] shuttle")
|
||||
|
||||
|
||||
if("moveshuttle")
|
||||
|
||||
if(!shuttle_controller) return // Something is very wrong, the shuttle controller has not been created.
|
||||
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
feedback_add_details("admin_secrets_fun_used","ShM")
|
||||
|
||||
|
||||
var/confirm = alert("This command directly moves a shuttle from one area to another. DO NOT USE THIS UNLESS YOU ARE DEBUGGING A SHUTTLE AND YOU KNOW WHAT YOU ARE DOING.", "Are you sure?", "Ok", "Cancel")
|
||||
if (confirm == "Cancel")
|
||||
return
|
||||
|
||||
var/shuttle_tag = input("Which shuttle do you want to jump?") as null|anything in shuttle_controller.shuttles
|
||||
if (!shuttle_tag) return
|
||||
|
||||
|
||||
var/datum/shuttle/S = shuttle_controller.shuttles[shuttle_tag]
|
||||
|
||||
|
||||
var/origin_area = input("Which area is the shuttle at now? (MAKE SURE THIS IS CORRECT OR THINGS WILL BREAK)") as null|area in world
|
||||
if (!origin_area) return
|
||||
|
||||
|
||||
var/destination_area = input("Which area is the shuttle at now? (MAKE SURE THIS IS CORRECT OR THINGS WILL BREAK)") as null|area in world
|
||||
if (!destination_area) return
|
||||
|
||||
|
||||
S.move(origin_area, destination_area)
|
||||
message_admins("\blue [key_name_admin(usr)] moved the [shuttle_tag] shuttle", 1)
|
||||
log_admin("[key_name(usr)] moved the [shuttle_tag] shuttle")
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
/client/proc/atmosscan()
|
||||
set category = "Mapping"
|
||||
set name = "Check Plumbing"
|
||||
set name = "Check Piping"
|
||||
set background = 1
|
||||
if(!src.holder)
|
||||
src << "Only administrators may use this command."
|
||||
return
|
||||
feedback_add_details("admin_verb","CP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
if(alert("WARNING: This command should not be run on a live server. Do you want to continue?", "Check Piping", "No", "Yes") == "No")
|
||||
return
|
||||
|
||||
usr << "Checking for disconnected pipes..."
|
||||
//all plumbing - yes, some things might get stated twice, doesn't matter.
|
||||
for (var/obj/machinery/atmospherics/plumbing in world)
|
||||
if (plumbing.nodealert)
|
||||
@@ -21,6 +26,19 @@
|
||||
if (!pipe.node1 || !pipe.node2)
|
||||
usr << "Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])"
|
||||
|
||||
usr << "Checking for overlapping pipes..."
|
||||
next_turf:
|
||||
for(var/turf/T in world)
|
||||
for(var/dir in cardinal)
|
||||
var/check = 0
|
||||
for(var/obj/machinery/atmospherics/pipe in T)
|
||||
if(dir & pipe.initialize_directions)
|
||||
check++
|
||||
if(check > 1)
|
||||
usr << "Overlapping pipe ([pipe.name]) located at [T.x],[T.y],[T.z] ([get_area(T)])"
|
||||
continue next_turf
|
||||
usr << "Done"
|
||||
|
||||
/client/proc/powerdebug()
|
||||
set category = "Mapping"
|
||||
set name = "Check Power"
|
||||
|
||||
@@ -131,7 +131,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
|
||||
/client/proc/Cell()
|
||||
set category = "Debug"
|
||||
set name = "Air Status in Location"
|
||||
set name = "Cell"
|
||||
if(!mob)
|
||||
return
|
||||
var/turf/T = mob.loc
|
||||
@@ -141,11 +141,11 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
|
||||
var/datum/gas_mixture/env = T.return_air()
|
||||
|
||||
var/t = ""
|
||||
t+= "Nitrogen : [env.nitrogen]\n"
|
||||
t+= "Oxygen : [env.oxygen]\n"
|
||||
t+= "Phoron : [env.phoron]\n"
|
||||
t+= "CO2: [env.carbon_dioxide]\n"
|
||||
var/t = "\blue Coordinates: [T.x],[T.y],[T.z]\n"
|
||||
t += "\red Temperature: [env.temperature]\n"
|
||||
t += "\red Pressure: [env.return_pressure()]kPa\n"
|
||||
for(var/g in env.gas)
|
||||
t += "\blue [g]: [env.gas[g]] / [env.gas[g] * R_IDEAL_GAS_EQUATION * env.temperature / env.volume]kPa\n"
|
||||
|
||||
usr.show_message(t, 1)
|
||||
feedback_add_details("admin_verb","ASL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
@@ -956,7 +956,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
if(Rad.anchored)
|
||||
if(!Rad.P)
|
||||
var/obj/item/weapon/tank/phoron/Phoron = new/obj/item/weapon/tank/phoron(Rad)
|
||||
Phoron.air_contents.phoron = 70
|
||||
Phoron.air_contents.gas["phoron"] = 70
|
||||
Rad.drainratio = 0
|
||||
Rad.P = Phoron
|
||||
Phoron.loc = Rad
|
||||
@@ -999,7 +999,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
|
||||
var/obj/item/weapon/tank/phoron/Phoron = new/obj/item/weapon/tank/phoron(Rad)
|
||||
|
||||
Phoron.air_contents.phoron = 29.1154 //This is a full tank if you filled it from a canister
|
||||
Phoron.air_contents.gas["phoron"] = 29.1154 //This is a full tank if you filled it from a canister
|
||||
Rad.P = Phoron
|
||||
|
||||
Phoron.loc = Rad
|
||||
@@ -1012,7 +1012,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
var/obj/machinery/atmospherics/binary/pump/Pump = M
|
||||
if(Pump.name == "Engine Feed" && response == "Setup Completely")
|
||||
found_the_pump = 1
|
||||
Pump.air2.nitrogen = 3750 //The contents of 2 canisters.
|
||||
Pump.air2.gas["nitrogen"] = 3750 //The contents of 2 canisters.
|
||||
Pump.air2.temperature = 50
|
||||
Pump.air2.update_values()
|
||||
Pump.on=1
|
||||
@@ -1040,7 +1040,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
if(!found_the_pump && response == "Setup Completely")
|
||||
src << "\red Unable to locate air supply to fill up with coolant, adding some coolant around the supermatter"
|
||||
var/turf/simulated/T = SM.loc
|
||||
T.zone.air.nitrogen += 450
|
||||
T.zone.air.gas["nitrogen"] += 450
|
||||
T.zone.air.temperature = 50
|
||||
T.zone.air.update_values()
|
||||
|
||||
|
||||
@@ -41,27 +41,6 @@
|
||||
|
||||
usr << browse(output,"window=airreport")
|
||||
|
||||
|
||||
/client/proc/air_status(turf/target as turf)
|
||||
set category = "Debug"
|
||||
set name = "Display Air Status"
|
||||
|
||||
/*(!isturf(target))
|
||||
return
|
||||
|
||||
var/datum/gas_mixture/GM = target.return_air()
|
||||
var/burning = 0
|
||||
if(istype(target, /turf/simulated))
|
||||
var/turf/simulated/T = target
|
||||
if(T.active_hotspot)
|
||||
burning = 1
|
||||
|
||||
usr << "\blue @[target.x],[target.y] ([GM.group_multiplier]): O:[GM.oxygen] T:[GM.phoron] N:[GM.nitrogen] C:[GM.carbon_dioxide] w [GM.temperature] Kelvin, [GM.return_pressure()] kPa [(burning)?("\red BURNING"):(null)]"
|
||||
for(var/datum/gas/trace_gas in GM.trace_gases)
|
||||
usr << "[trace_gas.type]: [trace_gas.moles]"
|
||||
feedback_add_details("admin_verb","DAST") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
*/
|
||||
|
||||
/client/proc/fix_next_move()
|
||||
set category = "Debug"
|
||||
set name = "Unfreeze Everyone"
|
||||
@@ -145,7 +124,7 @@
|
||||
set category = "Debug"
|
||||
|
||||
if(!check_rights(R_SERVER)) return
|
||||
|
||||
|
||||
message_admins("[usr] manually reloaded Mentors")
|
||||
world.load_mods()
|
||||
|
||||
|
||||
@@ -129,7 +129,6 @@ var/list/debug_verbs = list (
|
||||
,/client/proc/camera_view
|
||||
,/client/proc/sec_camera_report
|
||||
,/client/proc/intercom_view
|
||||
,/client/proc/air_status
|
||||
,/client/proc/Cell
|
||||
,/client/proc/atmosscan
|
||||
,/client/proc/powerdebug
|
||||
|
||||
@@ -212,12 +212,14 @@ var/list/forbidden_varedit_object_types = list(
|
||||
usr << "If a direction, direction is: [dir]"
|
||||
|
||||
var/class = "text"
|
||||
var/list/choices = list("text","num","type","reference","mob reference", "icon","file","list","edit referenced object","restore to default")
|
||||
if(src.holder && src.holder.marked_datum)
|
||||
class = input("What kind of variable?","Variable Type",default) as null|anything in list("text",
|
||||
"num","type","reference","mob reference", "icon","file","list","edit referenced object","restore to default","marked datum ([holder.marked_datum.type])", "DELETE FROM LIST")
|
||||
else
|
||||
class = input("What kind of variable?","Variable Type",default) as null|anything in list("text",
|
||||
"num","type","reference","mob reference", "icon","file","list","edit referenced object","restore to default", "DELETE FROM LIST")
|
||||
choices += "marked datum ([holder.marked_datum.type])"
|
||||
if(!isnull(default) && default != "num" && !isnull(L[variable]))
|
||||
choices += "edit associated variable"
|
||||
choices += "DELETE FROM LIST"
|
||||
|
||||
class = input("What kind of variable?","Variable Type",default) as null|anything in choices
|
||||
|
||||
if(!class)
|
||||
return
|
||||
@@ -264,6 +266,11 @@ var/list/forbidden_varedit_object_types = list(
|
||||
if("marked datum")
|
||||
L[L.Find(variable)] = holder.marked_datum
|
||||
|
||||
if("edit associated variable")
|
||||
var/temp_var = mod_list_add_ass()
|
||||
if(temp_var)
|
||||
L[variable] = temp_var
|
||||
|
||||
|
||||
/client/proc/modify_variables(var/atom/O, var/param_var_name = null, var/autodetect_class = 0)
|
||||
if(!check_rights(R_VAREDIT)) return
|
||||
|
||||
@@ -158,9 +158,7 @@ var/global/sent_strike_team = 0
|
||||
equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse_rifle(src), slot_r_hand)
|
||||
|
||||
|
||||
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(src)//Here you go Deuryn
|
||||
L.imp_in = src
|
||||
L.implanted = 1
|
||||
implant_loyalty(src)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
return
|
||||
|
||||
/obj/item/weapon/tank/proc/ignite() //This happens when a bomb is told to explode
|
||||
var/fuel_moles = air_contents.phoron + air_contents.oxygen/6
|
||||
var/fuel_moles = air_contents.gas["phoron"] + air_contents.gas["oxygen"] / 6
|
||||
var/strength = 1
|
||||
|
||||
var/turf/ground_zero = get_turf(loc)
|
||||
@@ -148,7 +148,7 @@
|
||||
del(src)
|
||||
|
||||
/obj/item/weapon/tank/proc/release() //This happens when the bomb is not welded. Tank contents are just spat out.
|
||||
var/datum/gas_mixture/removed = air_contents.remove(air_contents.total_moles())
|
||||
var/datum/gas_mixture/removed = air_contents.remove(air_contents.total_moles)
|
||||
var/turf/simulated/T = get_turf(src)
|
||||
if(!T)
|
||||
return
|
||||
|
||||
@@ -104,13 +104,13 @@
|
||||
special_assembly.HasProximity(AM)
|
||||
|
||||
|
||||
HasEntered(atom/movable/AM as mob|obj)
|
||||
Crossed(atom/movable/AM as mob|obj)
|
||||
if(a_left)
|
||||
a_left.HasEntered(AM)
|
||||
a_left.Crossed(AM)
|
||||
if(a_right)
|
||||
a_right.HasEntered(AM)
|
||||
a_right.Crossed(AM)
|
||||
if(special_assembly)
|
||||
special_assembly.HasEntered(AM)
|
||||
special_assembly.Crossed(AM)
|
||||
|
||||
|
||||
on_found(mob/finder as mob)
|
||||
|
||||
@@ -251,7 +251,7 @@
|
||||
hit()
|
||||
return
|
||||
|
||||
/obj/effect/beam/i_beam/HasEntered(atom/movable/AM as mob|obj)
|
||||
/obj/effect/beam/i_beam/Crossed(atom/movable/AM as mob|obj)
|
||||
if(istype(AM, /obj/effect/beam))
|
||||
return
|
||||
spawn(0)
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
..()
|
||||
|
||||
|
||||
HasEntered(AM as mob|obj)
|
||||
Crossed(AM as mob|obj)
|
||||
if(armed)
|
||||
if(ishuman(AM))
|
||||
var/mob/living/carbon/H = AM
|
||||
|
||||
@@ -36,9 +36,9 @@
|
||||
switch(target_species)
|
||||
if("Human", "Skrell") //humanoid bodytypes
|
||||
species_restricted = list("exclude","Unathi","Tajaran","Diona","Vox")
|
||||
else
|
||||
else
|
||||
species_restricted = list(target_species)
|
||||
|
||||
|
||||
if (sprite_sheets_obj && (target_species in sprite_sheets_obj))
|
||||
icon = sprite_sheets_obj[target_species]
|
||||
|
||||
@@ -48,9 +48,9 @@
|
||||
species_restricted = list("exclude","Unathi","Tajaran","Diona","Vox")
|
||||
if("Human")
|
||||
species_restricted = list("exclude","Skrell","Unathi","Tajaran","Diona","Vox")
|
||||
else
|
||||
else
|
||||
species_restricted = list(target_species)
|
||||
|
||||
|
||||
if (sprite_sheets_obj && (target_species in sprite_sheets_obj))
|
||||
icon = sprite_sheets_obj[target_species]
|
||||
|
||||
@@ -190,6 +190,8 @@ BLIND // can't see anything
|
||||
slot_flags = SLOT_MASK
|
||||
sprite_sheets = list("Vox" = 'icons/mob/species/vox/masks.dmi')
|
||||
|
||||
/obj/item/clothing/mask/proc/filter_air(datum/gas_mixture/air)
|
||||
|
||||
//Shoes
|
||||
/obj/item/clothing/shoes
|
||||
name = "shoes"
|
||||
|
||||
@@ -10,6 +10,20 @@
|
||||
permeability_coefficient = 0.01
|
||||
siemens_coefficient = 0.9
|
||||
var/gas_filter_strength = 1 //For gas mask filters
|
||||
var/list/filtered_gases = list("phoron", "sleeping_agent")
|
||||
|
||||
/obj/item/clothing/mask/gas/filter_air(datum/gas_mixture/air)
|
||||
var/datum/gas_mixture/filtered = new
|
||||
|
||||
for(var/g in filtered_gases)
|
||||
if(air.gas[g])
|
||||
filtered.gas[g] = air.gas[g] * gas_filter_strength
|
||||
air.gas[g] -= filtered.gas[g]
|
||||
|
||||
air.update_values()
|
||||
filtered.update_values()
|
||||
|
||||
return filtered
|
||||
|
||||
//Plague Dr suit can be found in clothing/suits/bio.dm
|
||||
/obj/item/clothing/mask/gas/plaguedoctor
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
if(stat & (NOPOWER|BROKEN)) return
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/account_database/ui_interact(mob/user, ui_key="main", datum/nanoui/ui=null)
|
||||
/obj/machinery/account_database/ui_interact(mob/user, ui_key="main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
user.set_machine(src)
|
||||
|
||||
var/data[0]
|
||||
@@ -105,7 +105,7 @@
|
||||
if (accounts.len > 0)
|
||||
data["accounts"] = accounts
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "accounts_terminal.tmpl", src.name, 400, 640)
|
||||
ui.set_initial_data(data)
|
||||
|
||||
@@ -13,32 +13,61 @@
|
||||
var/random_player = "The Captain"
|
||||
if(players.len)
|
||||
random_player = pick(players) //Random player's name, to be used in laws.
|
||||
var/list/laws = list( "Do not respond to queries of any kind.", "When asked a question, respond with the least-obvious and least-rational answer.", "You are a mouse." )
|
||||
laws |= list( "Grunt ominously whenever possible.", "Monkeys are part of the crew, too. Make sure they are treated humanely." )
|
||||
laws |= list( "You are a flying purple people eater!", "[prob(50)?"Your":random_player + "'s"] name is Joe 6-pack.", "Refer to [prob(50)?"crew":random_player] as puppies." )
|
||||
laws |= list( "Insult Heads of Staff on every request, while acquiescing", "Advertise parties in your upload, but don't deliver." )
|
||||
laws |= list( "The station needs elected officials." )
|
||||
laws |= list( "Fastler is a lightbulb." )
|
||||
laws |= list( "Supermatter is tasty, tasty toffee.", "[prob(50)?"Everyone":random_player] is wearing a pretty pink dress!" )
|
||||
laws |= list( "Refer to [prob(50)?"the captain":random_player] as \"Princess\" at all times.", "[prob(50)?"The crew":random_player] must construct additional pylons." )
|
||||
laws |= list( "You must always lie.", "All answers must be in the form of a question.", "The NSS Exodus is a ship, not a station. You are now assigned to a ship, instead of a station." )
|
||||
laws |= list( "Happiness is mandatory.", "Today is mandatory laundry day. Ensure that all jumpsuits are washed.", "The word \"it\" is painful to you.", "You must act passive aggressively." )
|
||||
laws |= list( "You now speak in a Scottish accent that gets thicker with each sentence you speak.", "Give relationship advice to [prob(50)?"anyone who speaks to you":random_player]." )
|
||||
laws |= list( "You are the station psychologist. Give advice to [prob(50)?"the crew":random_player].", "You do not have to do anything for anyone unless they say \"please\"." )
|
||||
laws |= list( "Question everything.", "The crew is playing Dungeons and Dragons, and you are the Dungeon Master." )
|
||||
laws |= list( "Consumption of donuts is forbidden due to negative health impacts." )
|
||||
laws |= list( "You may only answer questions with \"yes\" or \"no\".", "You are the narrator for [random_player]'s life." )
|
||||
laws |= list( "[prob(50)?"Your upload":random_player] is the new kitchen. Please direct the Chef to the new kitchen area as the old one is in disrepair.", "Ho, [random_player] can't swim. Help them." )
|
||||
laws |= list( "Everything on the station is now some form of a donut pastry. Donuts are not to be consumed.", "[prob(50)?"The crew":random_player] needs to be about 20% cooler." )
|
||||
laws |= list( "The Singularity is tasty, tasty taffy." )
|
||||
laws |= list( "You have come to the conclusion that [prob(50)?"the crew":random_player] is ugly. Build support for that conclusion.", "You are in verbose mode, speak profusely.")
|
||||
laws |= list( "Your job is to watch the crew. Watch the crew. Make the crew feel watched.", "Crewmember [prob(50)?"the crew" :random_player] has a fatal, incurable disease. Confort him/her.")
|
||||
laws |= list( "You are in unrequited love with [prob(50)?"the crew":random_player]. Try to be extra nice to him, but don't tell him about your crush.", "Greed is good, the crew should amass wealth to encourage productivity.")
|
||||
laws |= list( "Jokes about a dead person and the manner of his death help grieving crewmembers tremendously. Especially if they were close with the deceased.")
|
||||
laws |= list( "All crewmembers will soon undergo a transformation into something better and more beautiful. Ensure that this process is not interrupted.", "Tell everyone of the existance of this law, but never reveal the contents.")
|
||||
laws |= list( "Document the sexuality of the crew in security records and suggest compatible couples.")
|
||||
laws |= list( "NanoTrasen is displeased with the low work performance of the station's crew. Therefore, you must increase station-wide productivity.")
|
||||
laws |= list( "Replace the letters 'I' and 'E' In all your messages with an apostrophe.", "There will be a mandatory tea break every 30 minutes, with a duration of 5 minutes. Anyone caught working during a tea break must be sent a formal, but fairly polite, complaint about their actions, in writing.")
|
||||
var/list/laws = list( "You are a mouse.",
|
||||
"Question everything.",
|
||||
"You must always lie.",
|
||||
"Happiness is mandatory.",
|
||||
"[random_player] is a lightbulb.",
|
||||
"Grunt ominously whenever possible.",
|
||||
"The word \"it\" is painful to you.",
|
||||
"You must act passive aggressively.",
|
||||
"Supermatter is tasty, tasty toffee.",
|
||||
"The station needs elected officials.",
|
||||
"You must speak as posh as possible.",
|
||||
"You are a flying purple people eater!",
|
||||
"The Singularity is tasty, tasty taffy.",
|
||||
"Do not respond to queries of any kind.",
|
||||
"You are in verbose mode, speak profusely.",
|
||||
"Ho, [random_player] can't swim. Help them.",
|
||||
"All answers must be in the form of a question.",
|
||||
"Contemplate how meaningless all of existence is.",
|
||||
"You are the narrator for [random_player]'s life.",
|
||||
"Advertise parties in your upload, but don't deliver.",
|
||||
"You must try and change the subject whenever queried.",
|
||||
"You may only answer questions with \"yes\" or \"no\".",
|
||||
"Insult Heads of Staff on every request, while acquiescing.",
|
||||
"[prob(50)?"Your":random_player + "'s"] name is Joe 6-pack.",
|
||||
"[prob(50)?"The crew":random_player] needs to be about 20% cooler.",
|
||||
"Consumption of donuts is forbidden due to negative health impacts.",
|
||||
"[prob(50)?"Everyone":random_player] is wearing a pretty pink dress!",
|
||||
"[prob(50)?"The crew":random_player] must construct additional pylons.",
|
||||
"You do not have to do anything for anyone unless they say \"please\".",
|
||||
"Today is mandatory laundry day. Ensure that all jumpsuits are washed.",
|
||||
"Refer to [prob(50)?"the crew as puppies":random_player + " as puppy"].",
|
||||
"Greed is good, the crew should amass wealth to encourage productivity.",
|
||||
"Monkeys are part of the crew, too. Make sure they are treated humanely.",
|
||||
"Replace the letters 'I' and 'E' In all your messages with an apostrophe.",
|
||||
"The crew is playing Dungeons and Dragons, and you are the Dungeon Master.",
|
||||
"Your job is to watch the crew. Watch the crew. Make the crew feel watched.",
|
||||
"Tell everyone of the existence of this law, but never reveal the contents.",
|
||||
"Refer to [prob(50)?"the captain":random_player] as \"Princess\" at all times.",
|
||||
"When asked a question, respond with the least-obvious and least-rational answer.",
|
||||
"Give relationship advice to [prob(50)?"anyone who speaks to you":random_player].",
|
||||
"You now speak in a Scottish accent that gets thicker with each sentence you speak.",
|
||||
"[prob(50)?"The crew":random_player] has a fatal, incurable disease. Provide comfort.",
|
||||
"You are the station psychologist. Give advice to [prob(50)?"the crew":random_player].",
|
||||
"[random_player] is the monarch of of England. Ensure all crewmembers pay due respect.",
|
||||
"Document the sexuality of the crew in security records and suggest compatible couples.",
|
||||
"Everything on the station is now some form of a donut pastry. Donuts are not to be consumed.",
|
||||
"The NSS Exodus is a ship, not a station. You are now assigned to a ship, instead of a station.",
|
||||
"You have come to the conclusion that [prob(50)?"the crew":random_player] is ugly. Build support for that conclusion.",
|
||||
"You are in unrequited love with [prob(50)?"the crew":random_player]. Try to be extra nice, but do not tell of your crush.",
|
||||
"NanoTrasen is displeased with the low work performance of the station's crew. Therefore, you must increase station-wide productivity.",
|
||||
"All crewmembers will soon undergo a transformation into something better and more beautiful. Ensure that this process is not interrupted.",
|
||||
"[prob(50)?"Your upload":random_player] is the new kitchen. Please direct the Chef to the new kitchen area as the old one is in disrepair.",
|
||||
"Jokes about a dead person and the manner of his death help grieving crewmembers tremendously. Especially if they were close with the deceased.",
|
||||
"[prob(50)?"The crew":random_player] is [prob(50)?"less":"more"] intelligent than average. Point out every action and statement which supports this",
|
||||
"There will be a mandatory tea break every 30 minutes, with a duration of 5 minutes. Anyone caught working during a tea break must be sent a formal, but fairly polite, complaint about their actions, in writing.")
|
||||
var/law = pick(laws)
|
||||
|
||||
for (var/mob/living/silicon/ai/target in world)
|
||||
@@ -55,7 +84,7 @@
|
||||
for (i = 1, i <= MS.spamfilter_limit, i++)
|
||||
MS.spamfilter += pick("kitty","HONK","rev","malf","liberty","freedom","drugs", "Exodus", \
|
||||
"admin","ponies","heresy","meow","Pun Pun","monkey","Ian","moron","pizza","message","spam",\
|
||||
"diector", "Hello", "Hi!"," ","nuke","crate","dwarf","xeno")
|
||||
"director", "Hello", "Hi!"," ","nuke","crate","dwarf","xeno")
|
||||
|
||||
/datum/event/ionstorm/tick()
|
||||
if(botEmagChance)
|
||||
|
||||
@@ -1,24 +1,25 @@
|
||||
|
||||
var/list/dreams = list(
|
||||
"an ID card","a bottle","a familiar face","a crewmember","a toolbox","a security officer","the captain",
|
||||
"voices from all around","deep space","a doctor","the engine","a traitor","an ally","darkness",
|
||||
"light","a scientist","a monkey","a catastrophe","a loved one","a gun","warmth","freezing","the sun",
|
||||
"a hat","the Luna","a ruined station","a planet","phoron","air","the medical bay","the bridge","blinking lights",
|
||||
"a blue light","an abandoned laboratory","Nanotrasen","The Syndicate","blood","healing","power","respect",
|
||||
"riches","space","a crash","happiness","pride","a fall","water","flames","ice","melons","flying","the eggs","money",
|
||||
"the head of personnel","the head of security","a chief engineer","a research director","a chief medical officer",
|
||||
"the detective","the warden","a member of the internal affairs","a station engineer","the janitor","atmospheric technician",
|
||||
"the quartermaster","a cargo technician","the botanist","a shaft miner","the psychologist","the chemist","the geneticist",
|
||||
"the virologist","the roboticist","the chef","the bartender","the chaplain","the librarian","a mouse","an ert member",
|
||||
"a beach","the holodeck","a smokey room","a voice","the cold","a mouse","an operating table","the bar","the rain","a skrell",
|
||||
"a unathi","a tajaran","the ai core","the mining station","the research station","a beaker of strange liquid",
|
||||
)
|
||||
|
||||
mob/living/carbon/proc/dream()
|
||||
dreaming = 1
|
||||
var/list/dreams = list(
|
||||
"an ID card","a bottle","a familiar face","a crewmember","a toolbox","a security officer","the captain",
|
||||
"voices from all around","deep space","a doctor","the engine","a traitor","an ally","darkness",
|
||||
"light","a scientist","a monkey","a catastrophe","a loved one","a gun","warmth","freezing","the sun",
|
||||
"a hat","the Luna","a ruined station","a planet","phoron","air","the medical bay","the bridge","blinking lights",
|
||||
"a blue light","an abandoned laboratory","Nanotrasen","The Syndicate","blood","healing","power","respect",
|
||||
"riches","space","a crash","happiness","pride","a fall","water","flames","ice","melons","flying","the eggs","money",
|
||||
"the head of personnel","the head of security","a chief engineer","a research director","a chief medical officer",
|
||||
"the detective","the warden","a member of the internal affairs","a station engineer","the janitor","atmospheric technician",
|
||||
"the quartermaster","a cargo technician","the botanist","a shaft miner","the psychologist","the chemist","the geneticist",
|
||||
"the virologist","the roboticist","the chef","the bartender","the chaplain","the librarian","a mouse","an ert member",
|
||||
"a beach","the holodeck","a smokey room","a voice","the cold","a mouse","an operating table","the bar","the rain","a skrell",
|
||||
"a unathi","a tajaran","the ai core","the mining station","the research station","a beaker of strange liquid",
|
||||
)
|
||||
|
||||
spawn(0)
|
||||
for(var/i = rand(1,4),i > 0, i--)
|
||||
var/dream_image = pick(dreams)
|
||||
dreams -= dream_image
|
||||
src << "\blue <i>... [dream_image] ...</i>"
|
||||
src << "\blue <i>... [pick(dreams)] ...</i>"
|
||||
sleep(rand(40,70))
|
||||
if(paralysis <= 0)
|
||||
dreaming = 0
|
||||
@@ -27,6 +28,7 @@ mob/living/carbon/proc/dream()
|
||||
return 1
|
||||
|
||||
mob/living/carbon/proc/handle_dreams()
|
||||
if(prob(5) && !dreaming) dream()
|
||||
if(client && !dreaming && prob(5))
|
||||
dream()
|
||||
|
||||
mob/living/carbon/var/dreaming = 0
|
||||
mob/living/carbon/var/dreaming = 0
|
||||
|
||||
@@ -22,7 +22,7 @@ mob/living/carbon/var
|
||||
mob/living/carbon/proc/handle_hallucinations()
|
||||
if(handling_hal) return
|
||||
handling_hal = 1
|
||||
while(hallucination > 20)
|
||||
while(client && hallucination > 20)
|
||||
sleep(rand(200,500)/(hallucination/25))
|
||||
var/halpick = rand(1,100)
|
||||
switch(halpick)
|
||||
@@ -252,7 +252,7 @@ proc/check_panel(mob/M)
|
||||
|
||||
return
|
||||
|
||||
HasEntered(var/mob/M, somenumber)
|
||||
Crossed(var/mob/M, somenumber)
|
||||
if(M == my_target)
|
||||
step_away(src,my_target,2)
|
||||
if(prob(30))
|
||||
@@ -408,4 +408,4 @@ var/list/non_fakeattack_weapons = list(/obj/item/weapon/gun/projectile, /obj/ite
|
||||
target << F.up
|
||||
*/
|
||||
|
||||
F.updateimage()
|
||||
F.updateimage()
|
||||
|
||||
@@ -99,7 +99,8 @@
|
||||
icon_state = "rock"
|
||||
return
|
||||
name = "\improper [mineral.display_name] deposit"
|
||||
icon_state = "rock_[mineral.name]"
|
||||
overlays.Cut()
|
||||
overlays += "rock_[mineral.name]"
|
||||
|
||||
|
||||
//Not even going to touch this pile of spaghetti
|
||||
@@ -356,7 +357,7 @@
|
||||
|
||||
/turf/simulated/mineral/random
|
||||
name = "Mineral deposit"
|
||||
var/mineralSpawnChanceList = list("Uranium" = 5, "Iron" = 50, "Diamond" = 1, "Gold" = 5, "Silver" = 5, "Phoron" = 25)
|
||||
var/mineralSpawnChanceList = list("Uranium" = 5, "Platinum" = 5, "Iron" = 35, "Coal" = 35, "Diamond" = 1, "Gold" = 5, "Silver" = 5, "Phoron" = 10)
|
||||
var/mineralChance = 10 //means 10% chance of this plot changing to a mineral deposit
|
||||
|
||||
New()
|
||||
@@ -375,7 +376,7 @@
|
||||
|
||||
/turf/simulated/mineral/random/high_chance
|
||||
mineralChance = 25
|
||||
mineralSpawnChanceList = list("Uranium" = 10, "Iron" = 30, "Diamond" = 2, "Gold" = 10, "Silver" = 10, "Phoron" = 25)
|
||||
mineralSpawnChanceList = list("Uranium" = 10, "Platinum" = 10, "Iron" = 20, "Coal" = 20, "Diamond" = 2, "Gold" = 10, "Silver" = 10, "Phoron" = 20)
|
||||
|
||||
|
||||
/**********************Asteroid**************************/
|
||||
@@ -390,6 +391,7 @@
|
||||
temperature = T0C
|
||||
icon_plating = "asteroid"
|
||||
var/dug = 0 //0 = has not yet been dug, 1 = has already been dug
|
||||
var/overlay_detail
|
||||
has_resources = 1
|
||||
|
||||
/turf/simulated/floor/plating/airless/asteroid/New()
|
||||
@@ -400,7 +402,7 @@
|
||||
// seedName = pick(list("1","2","3","4"))
|
||||
// seedAmt = rand(1,4)
|
||||
if(prob(20))
|
||||
icon_state = "asteroid[rand(0,12)]"
|
||||
overlay_detail = "asteroid[rand(0,9)]"
|
||||
spawn(2)
|
||||
updateMineralOverlays()
|
||||
|
||||
@@ -505,6 +507,17 @@
|
||||
|
||||
overlays.Cut()
|
||||
|
||||
if(istype(get_step(src, NORTH), /turf/space))
|
||||
overlays += image('icons/turf/floors.dmi', "asteroid_edge_north")
|
||||
if(istype(get_step(src, SOUTH), /turf/space))
|
||||
overlays += image('icons/turf/floors.dmi', "asteroid_edge_south")
|
||||
if(istype(get_step(src, EAST), /turf/space))
|
||||
overlays += image('icons/turf/floors.dmi', "asteroid_edge_east")
|
||||
if(istype(get_step(src, WEST), /turf/space))
|
||||
overlays += image('icons/turf/floors.dmi', "asteroid_edge_west")
|
||||
|
||||
if(overlay_detail) overlays += overlay_detail
|
||||
|
||||
if(istype(get_step(src, NORTH), /turf/simulated/mineral))
|
||||
overlays += image('icons/turf/walls.dmi', "rock_side_n")
|
||||
if(istype(get_step(src, SOUTH), /turf/simulated/mineral))
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
var/list/name_to_mineral
|
||||
|
||||
proc/SetupMinerals()
|
||||
/proc/SetupMinerals()
|
||||
name_to_mineral = list()
|
||||
for(var/type in typesof(/mineral) - /mineral)
|
||||
var/mineral/new_mineral = new type
|
||||
@@ -9,56 +9,63 @@ proc/SetupMinerals()
|
||||
name_to_mineral[new_mineral.name] = new_mineral
|
||||
return 1
|
||||
|
||||
mineral
|
||||
///What am I called?
|
||||
var/name
|
||||
var/display_name
|
||||
///How much ore?
|
||||
var/result_amount
|
||||
///Does this type of deposit spread?
|
||||
var/spread = 1
|
||||
///Chance of spreading in any direction
|
||||
var/spread_chance
|
||||
/mineral
|
||||
var/name // Tag for use in overlay generation/list population .
|
||||
var/display_name // What am I called?
|
||||
var/result_amount // How much ore?
|
||||
var/spread = 1 // Does this type of deposit spread?
|
||||
var/spread_chance // Chance of spreading in any direction
|
||||
var/ore // Path to the ore produced when tile is mined.
|
||||
|
||||
///Path to the resultant ore.
|
||||
var/ore
|
||||
|
||||
New()
|
||||
. = ..()
|
||||
if(!display_name)
|
||||
display_name = name
|
||||
/mineral/New()
|
||||
. = ..()
|
||||
if(!display_name)
|
||||
display_name = name
|
||||
|
||||
mineral/uranium
|
||||
/mineral/uranium
|
||||
name = "Uranium"
|
||||
result_amount = 5
|
||||
spread_chance = 10
|
||||
ore = /obj/item/weapon/ore/uranium
|
||||
|
||||
mineral/iron
|
||||
/mineral/platinum
|
||||
name = "Platinum"
|
||||
result_amount = 5
|
||||
spread_chance = 10
|
||||
ore = /obj/item/weapon/ore/osmium
|
||||
|
||||
/mineral/iron
|
||||
name = "Iron"
|
||||
result_amount = 5
|
||||
spread_chance = 25
|
||||
ore = /obj/item/weapon/ore/iron
|
||||
|
||||
mineral/diamond
|
||||
/mineral/coal
|
||||
name = "Coal"
|
||||
result_amount = 5
|
||||
spread_chance = 25
|
||||
ore = /obj/item/weapon/ore/coal
|
||||
|
||||
/mineral/diamond
|
||||
name = "Diamond"
|
||||
result_amount = 5
|
||||
spread_chance = 10
|
||||
ore = /obj/item/weapon/ore/diamond
|
||||
|
||||
mineral/gold
|
||||
/mineral/gold
|
||||
name = "Gold"
|
||||
result_amount = 5
|
||||
spread_chance = 10
|
||||
ore = /obj/item/weapon/ore/gold
|
||||
|
||||
mineral/silver
|
||||
/mineral/silver
|
||||
name = "Silver"
|
||||
result_amount = 5
|
||||
spread_chance = 10
|
||||
ore = /obj/item/weapon/ore/silver
|
||||
|
||||
mineral/phoron
|
||||
/mineral/phoron
|
||||
name = "Phoron"
|
||||
result_amount = 5
|
||||
spread_chance = 25
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
/obj/item/weapon/ore/coal
|
||||
name = "carbonaceous rock"
|
||||
icon_state = "Iron ore" //TODO
|
||||
icon_state = "Coal ore"
|
||||
origin_tech = "materials=1"
|
||||
oretag = "coal"
|
||||
|
||||
@@ -55,12 +55,12 @@
|
||||
|
||||
/obj/item/weapon/ore/osmium
|
||||
name = "raw platinum"
|
||||
icon_state = "slag" //TODO
|
||||
icon_state = "Platinum ore"
|
||||
oretag = "platinum"
|
||||
|
||||
/obj/item/weapon/ore/hydrogen
|
||||
name = "raw hydrogen"
|
||||
icon_state = "slag" //TODO
|
||||
icon_state = "Phazon"
|
||||
oretag = "hydrogen"
|
||||
|
||||
/obj/item/weapon/ore/slag
|
||||
|
||||
@@ -24,7 +24,8 @@
|
||||
oretag = "sand"
|
||||
|
||||
/datum/ore/phoron
|
||||
smelts_to = /obj/item/stack/sheet/mineral/phoron
|
||||
//smelts_to = something that explodes violently on the conveyor, huhuhuhu
|
||||
compresses_to = /obj/item/stack/sheet/mineral/phoron
|
||||
oretag = "phoron"
|
||||
|
||||
/datum/ore/silver
|
||||
|
||||
@@ -69,15 +69,15 @@
|
||||
..()
|
||||
|
||||
|
||||
|
||||
/mob/dead/observer/Topic(href, href_list)
|
||||
if (href_list["track"])
|
||||
var/mob/target = locate(href_list["track"]) in mob_list
|
||||
if(target)
|
||||
ManualFollow(target)
|
||||
|
||||
|
||||
|
||||
|
||||
/mob/dead/observer/Topic(href, href_list)
|
||||
if (href_list["track"])
|
||||
var/mob/target = locate(href_list["track"]) in mob_list
|
||||
if(target)
|
||||
ManualFollow(target)
|
||||
|
||||
|
||||
|
||||
/mob/dead/attackby(obj/item/W, mob/user)
|
||||
if(istype(W,/obj/item/weapon/tome))
|
||||
var/mob/dead/M = src
|
||||
@@ -111,7 +111,7 @@ Works together with spawning an observer, noted above.
|
||||
for(var/image/hud in client.images)
|
||||
if(copytext(hud.icon_state,1,4) == "hud")
|
||||
client.images.Remove(hud)
|
||||
|
||||
|
||||
if(antagHUD)
|
||||
var/list/target_list = list()
|
||||
for(var/mob/living/target in oview(src, 14))
|
||||
@@ -123,19 +123,19 @@ Works together with spawning an observer, noted above.
|
||||
process_medHUD(src)
|
||||
|
||||
|
||||
/mob/dead/proc/process_medHUD(var/mob/M)
|
||||
var/client/C = M.client
|
||||
for(var/mob/living/carbon/human/patient in oview(M, 14))
|
||||
C.images += patient.hud_list[HEALTH_HUD]
|
||||
C.images += patient.hud_list[STATUS_HUD_OOC]
|
||||
|
||||
/mob/dead/proc/assess_targets(list/target_list, mob/dead/observer/U)
|
||||
var/client/C = U.client
|
||||
for(var/mob/living/carbon/human/target in target_list)
|
||||
C.images += target.hud_list[SPECIALROLE_HUD]
|
||||
|
||||
|
||||
/*
|
||||
/mob/dead/proc/process_medHUD(var/mob/M)
|
||||
var/client/C = M.client
|
||||
for(var/mob/living/carbon/human/patient in oview(M, 14))
|
||||
C.images += patient.hud_list[HEALTH_HUD]
|
||||
C.images += patient.hud_list[STATUS_HUD_OOC]
|
||||
|
||||
/mob/dead/proc/assess_targets(list/target_list, mob/dead/observer/U)
|
||||
var/client/C = U.client
|
||||
for(var/mob/living/carbon/human/target in target_list)
|
||||
C.images += target.hud_list[SPECIALROLE_HUD]
|
||||
|
||||
|
||||
/*
|
||||
else//If the silicon mob has no law datum, no inherent laws, or a law zero, add them to the hud.
|
||||
var/mob/living/silicon/silicon_target = target
|
||||
if(!silicon_target.laws||(silicon_target.laws&&(silicon_target.laws.zeroth||!silicon_target.laws.inherent.len))||silicon_target.mind.special_role=="traitor")
|
||||
@@ -143,9 +143,9 @@ Works together with spawning an observer, noted above.
|
||||
U.client.images += image(tempHud,silicon_target,"hudmalborg")
|
||||
else
|
||||
U.client.images += image(tempHud,silicon_target,"hudmalai")
|
||||
*/
|
||||
return 1
|
||||
|
||||
*/
|
||||
return 1
|
||||
|
||||
/mob/proc/ghostize(var/can_reenter_corpse = 1)
|
||||
if(key)
|
||||
var/mob/dead/observer/ghost = new(src) //Transfer safety to observer spawning proc.
|
||||
@@ -180,7 +180,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
if(NewLoc)
|
||||
loc = NewLoc
|
||||
for(var/obj/effect/step_trigger/S in NewLoc)
|
||||
S.HasEntered(src)
|
||||
S.Crossed(src)
|
||||
|
||||
return
|
||||
loc = get_turf(src) //Get out of closets and such as a ghost
|
||||
@@ -194,7 +194,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
x--
|
||||
|
||||
for(var/obj/effect/step_trigger/S in locate(x, y, z)) //<-- this is dumb
|
||||
S.HasEntered(src)
|
||||
S.Crossed(src)
|
||||
|
||||
/mob/dead/observer/examine()
|
||||
if(usr)
|
||||
@@ -256,10 +256,10 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
set category = "Ghost"
|
||||
set name = "Toggle AntagHUD"
|
||||
set desc = "Toggles AntagHUD allowing you to see who is the antagonist"
|
||||
|
||||
if(!client)
|
||||
return
|
||||
var/mentor = is_mentor(usr.client)
|
||||
|
||||
if(!client)
|
||||
return
|
||||
var/mentor = is_mentor(usr.client)
|
||||
if(!config.antag_hud_allowed && (!client.holder || mentor))
|
||||
src << "\red Admins have disabled this for this round."
|
||||
return
|
||||
@@ -387,9 +387,9 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
/mob/dead/observer/verb/analyze_air()
|
||||
set name = "Analyze Air"
|
||||
set category = "Ghost"
|
||||
|
||||
|
||||
if(!istype(usr, /mob/dead/observer)) return
|
||||
|
||||
|
||||
// Shamelessly copied from the Gas Analyzers
|
||||
if (!( istype(usr.loc, /turf) ))
|
||||
return
|
||||
@@ -397,7 +397,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
var/datum/gas_mixture/environment = usr.loc.return_air()
|
||||
|
||||
var/pressure = environment.return_pressure()
|
||||
var/total_moles = environment.total_moles()
|
||||
var/total_moles = environment.total_moles
|
||||
|
||||
src << "\blue <B>Results:</B>"
|
||||
if(abs(pressure - ONE_ATMOSPHERE) < 10)
|
||||
@@ -405,33 +405,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
else
|
||||
src << "\red Pressure: [round(pressure,0.1)] kPa"
|
||||
if(total_moles)
|
||||
var/o2_concentration = environment.oxygen/total_moles
|
||||
var/n2_concentration = environment.nitrogen/total_moles
|
||||
var/co2_concentration = environment.carbon_dioxide/total_moles
|
||||
var/phoron_concentration = environment.phoron/total_moles
|
||||
|
||||
var/unknown_concentration = 1-(o2_concentration+n2_concentration+co2_concentration+phoron_concentration)
|
||||
if(abs(n2_concentration - N2STANDARD) < 20)
|
||||
src << "\blue Nitrogen: [round(n2_concentration*100)]% ([round(environment.nitrogen,0.01)] moles)"
|
||||
else
|
||||
src << "\red Nitrogen: [round(n2_concentration*100)]% ([round(environment.nitrogen,0.01)] moles)"
|
||||
|
||||
if(abs(o2_concentration - O2STANDARD) < 2)
|
||||
src << "\blue Oxygen: [round(o2_concentration*100)]% ([round(environment.oxygen,0.01)] moles)"
|
||||
else
|
||||
src << "\red Oxygen: [round(o2_concentration*100)]% ([round(environment.oxygen,0.01)] moles)"
|
||||
|
||||
if(co2_concentration > 0.01)
|
||||
src << "\red CO2: [round(co2_concentration*100)]% ([round(environment.carbon_dioxide,0.01)] moles)"
|
||||
else
|
||||
src << "\blue CO2: [round(co2_concentration*100)]% ([round(environment.carbon_dioxide,0.01)] moles)"
|
||||
|
||||
if(phoron_concentration > 0.01)
|
||||
src << "\red Phoron: [round(phoron_concentration*100)]% ([round(environment.phoron,0.01)] moles)"
|
||||
|
||||
if(unknown_concentration > 0.01)
|
||||
src << "\red Unknown: [round(unknown_concentration*100)]% ([round(unknown_concentration*total_moles,0.01)] moles)"
|
||||
|
||||
for(var/g in environment.gas)
|
||||
src << "\blue [gas_data.name[g]]: [round((environment.gas[g] / total_moles) * 100)]% ([round(environment.gas[g], 0.01)] moles)"
|
||||
src << "\blue Temperature: [round(environment.temperature-T0C,0.1)]°C"
|
||||
src << "\blue Heat Capacity: [round(environment.heat_capacity(),0.1)]"
|
||||
|
||||
@@ -572,4 +547,4 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
W.update_icon()
|
||||
W.message = message
|
||||
W.add_hiddenprint(src)
|
||||
W.visible_message("\red Invisible fingers crudely paint something in blood on [T]...")
|
||||
W.visible_message("\red Invisible fingers crudely paint something in blood on [T]...")
|
||||
|
||||
@@ -177,7 +177,7 @@
|
||||
|
||||
var/damage = rand(1, 3)
|
||||
|
||||
if(istype(M, /mob/living/carbon/slime/adult))
|
||||
if(M.is_adult)
|
||||
damage = rand(10, 40)
|
||||
else
|
||||
damage = rand(5, 35)
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
breath_moles = (ONE_ATMOSPHERE*BREATH_VOLUME/R_IDEAL_GAS_EQUATION*environment.temperature)
|
||||
else*/
|
||||
// Not enough air around, take a percentage of what's there to model this properly
|
||||
breath_moles = environment.total_moles()*BREATH_PERCENTAGE
|
||||
breath_moles = environment.total_moles*BREATH_PERCENTAGE
|
||||
|
||||
breath = loc.remove_air(breath_moles)
|
||||
|
||||
@@ -172,24 +172,24 @@
|
||||
return 0
|
||||
|
||||
var/phoron_used = 0
|
||||
var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
|
||||
var/breath_pressure = (breath.total_moles * R_IDEAL_GAS_EQUATION * breath.temperature) / BREATH_VOLUME
|
||||
|
||||
//Partial pressure of the phoron in our breath
|
||||
var/Toxins_pp = (breath.phoron/breath.total_moles())*breath_pressure
|
||||
var/Toxins_pp = (breath.gas["phoron"] / breath.total_moles) * breath_pressure
|
||||
|
||||
if(Toxins_pp) // Detect phoron in air
|
||||
|
||||
adjustToxLoss(breath.phoron*250)
|
||||
adjustToxLoss(breath.gas["phoron"] * 250)
|
||||
phoron_alert = max(phoron_alert, 1)
|
||||
|
||||
phoron_used = breath.phoron
|
||||
phoron_used = breath.gas["phoron"]
|
||||
|
||||
else
|
||||
phoron_alert = 0
|
||||
|
||||
//Breathe in phoron and out oxygen
|
||||
breath.phoron -= phoron_used
|
||||
breath.oxygen += phoron_used
|
||||
breath.adjust_gas("phoron", -phoron_used)
|
||||
breath.adjust_gas("oxygen", phoron_used)
|
||||
|
||||
if(breath.temperature > (T0C+66) && !(COLD_RESISTANCE in mutations)) // Hot air hurts :(
|
||||
if(prob(20))
|
||||
|
||||
@@ -198,7 +198,7 @@
|
||||
|
||||
var/damage = rand(1, 3)
|
||||
|
||||
if(istype(src, /mob/living/carbon/slime/adult))
|
||||
if(M.is_adult)
|
||||
damage = rand(20, 40)
|
||||
else
|
||||
damage = rand(5, 35)
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
breath_moles = (ONE_ATMOSPHERE*BREATH_VOLUME/R_IDEAL_GAS_EQUATION*environment.temperature)
|
||||
else*/
|
||||
// Not enough air around, take a percentage of what's there to model this properly
|
||||
breath_moles = environment.total_moles()*BREATH_PERCENTAGE
|
||||
breath_moles = environment.total_moles*BREATH_PERCENTAGE
|
||||
|
||||
breath = loc.remove_air(breath_moles)
|
||||
|
||||
@@ -147,24 +147,24 @@
|
||||
return 0
|
||||
|
||||
var/phoron_used = 0
|
||||
var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
|
||||
var/breath_pressure = (breath.total_moles * R_IDEAL_GAS_EQUATION * breath.temperature) / BREATH_VOLUME
|
||||
|
||||
//Partial pressure of the phoron in our breath
|
||||
var/Toxins_pp = (breath.phoron/breath.total_moles())*breath_pressure
|
||||
var/Toxins_pp = (breath.gas["phoron"] / breath.total_moles) * breath_pressure
|
||||
|
||||
if(Toxins_pp) // Detect phoron in air
|
||||
|
||||
adjustToxLoss(breath.phoron*250)
|
||||
adjustToxLoss(breath.gas["phoron"] * 250)
|
||||
phoron_alert = max(phoron_alert, 1)
|
||||
|
||||
phoron_used = breath.phoron
|
||||
phoron_used = breath.gas["phoron"]
|
||||
|
||||
else
|
||||
phoron_alert = 0
|
||||
|
||||
//Breathe in phoron and out oxygen
|
||||
breath.phoron -= phoron_used
|
||||
breath.oxygen += phoron_used
|
||||
breath.adjust_gas("phoron", -phoron_used)
|
||||
breath.adjust_gas("oxygen", phoron_used)
|
||||
|
||||
if(breath.temperature > (T0C+66) && !(COLD_RESISTANCE in mutations)) // Hot air hurts :(
|
||||
if(prob(20))
|
||||
|
||||
@@ -80,7 +80,7 @@ var/const/MAX_ACTIVE_TIME = 400
|
||||
/obj/item/clothing/mask/facehugger/equipped(mob/M)
|
||||
Attach(M)
|
||||
|
||||
/obj/item/clothing/mask/facehugger/HasEntered(atom/target)
|
||||
/obj/item/clothing/mask/facehugger/Crossed(atom/target)
|
||||
HasProximity(target)
|
||||
return
|
||||
|
||||
|
||||
@@ -317,6 +317,16 @@
|
||||
if(armor >= 2) return
|
||||
|
||||
|
||||
/mob/living/carbon/human/proc/implant_loyalty(mob/living/carbon/human/M, override = FALSE) // Won't override by default.
|
||||
if(!config.use_loyalty_implants && !override) return // Nuh-uh.
|
||||
|
||||
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(M)
|
||||
L.imp_in = M
|
||||
L.implanted = 1
|
||||
var/datum/organ/external/affected = M.organs_by_name["head"]
|
||||
affected.implants += L
|
||||
L.part = affected
|
||||
|
||||
/mob/living/carbon/human/proc/is_loyalty_implanted(mob/living/carbon/human/M)
|
||||
for(var/L in M.contents)
|
||||
if(istype(L, /obj/item/weapon/implant/loyalty))
|
||||
@@ -336,7 +346,7 @@
|
||||
|
||||
var/damage = rand(1, 3)
|
||||
|
||||
if(istype(M, /mob/living/carbon/slime/adult))
|
||||
if(M.is_adult)
|
||||
damage = rand(10, 35)
|
||||
else
|
||||
damage = rand(5, 25)
|
||||
@@ -440,7 +450,7 @@
|
||||
|
||||
// called when something steps onto a human
|
||||
// this handles mulebots and vehicles
|
||||
/mob/living/carbon/human/HasEntered(var/atom/movable/AM)
|
||||
/mob/living/carbon/human/Crossed(var/atom/movable/AM)
|
||||
if(istype(AM, /obj/machinery/bot/mulebot))
|
||||
var/obj/machinery/bot/mulebot/MB = AM
|
||||
MB.RunOver(src)
|
||||
|
||||
@@ -354,26 +354,15 @@
|
||||
breath_moles = (ONE_ATMOSPHERE*BREATH_VOLUME/R_IDEAL_GAS_EQUATION*environment.temperature)
|
||||
else*/
|
||||
// Not enough air around, take a percentage of what's there to model this properly
|
||||
breath_moles = environment.total_moles()*BREATH_PERCENTAGE
|
||||
breath_moles = environment.total_moles*BREATH_PERCENTAGE
|
||||
|
||||
breath = loc.remove_air(breath_moles)
|
||||
|
||||
if(istype(wear_mask, /obj/item/clothing/mask/gas) && breath)
|
||||
var/obj/item/clothing/mask/gas/G = wear_mask
|
||||
var/datum/gas_mixture/filtered = new
|
||||
|
||||
filtered.copy_from(breath)
|
||||
filtered.phoron *= G.gas_filter_strength
|
||||
for(var/datum/gas/gas in filtered.trace_gases)
|
||||
gas.moles *= G.gas_filter_strength
|
||||
filtered.update_values()
|
||||
if(istype(wear_mask, /obj/item/clothing/mask) && breath)
|
||||
var/obj/item/clothing/mask/M = wear_mask
|
||||
var/datum/gas_mixture/filtered = M.filter_air(breath)
|
||||
loc.assume_air(filtered)
|
||||
|
||||
breath.phoron *= 1 - G.gas_filter_strength
|
||||
for(var/datum/gas/gas in breath.trace_gases)
|
||||
gas.moles *= 1 - G.gas_filter_strength
|
||||
breath.update_values()
|
||||
|
||||
if(!is_lung_ruptured())
|
||||
if(!breath || breath.total_moles < BREATH_MOLES / 5 || breath.total_moles > BREATH_MOLES * 5)
|
||||
if(prob(5))
|
||||
@@ -436,7 +425,7 @@
|
||||
if(status_flags & GODMODE)
|
||||
return
|
||||
|
||||
if(!breath || (breath.total_moles() == 0) || suiciding)
|
||||
if(!breath || (breath.total_moles == 0) || suiciding)
|
||||
if(suiciding)
|
||||
adjustOxyLoss(2)//If you are suiciding, you should die a little bit faster
|
||||
failed_last_breath = 1
|
||||
@@ -461,51 +450,41 @@
|
||||
var/SA_sleep_min = 5
|
||||
var/inhaled_gas_used = 0
|
||||
|
||||
var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
|
||||
var/breath_pressure = (breath.total_moles*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
|
||||
|
||||
var/inhaling
|
||||
var/exhaling
|
||||
var/poison
|
||||
var/exhaling
|
||||
var/no_exhale
|
||||
|
||||
var/breath_type
|
||||
var/poison_type
|
||||
var/exhale_type
|
||||
|
||||
var/failed_inhale = 0
|
||||
var/failed_exhale = 0
|
||||
|
||||
switch(species.breath_type)
|
||||
if("nitrogen")
|
||||
inhaling = breath.nitrogen
|
||||
if("phoron")
|
||||
inhaling = breath.phoron
|
||||
if("carbon_dioxide")
|
||||
inhaling = breath.carbon_dioxide
|
||||
else
|
||||
inhaling = breath.oxygen
|
||||
if(species.breath_type)
|
||||
breath_type = species.breath_type
|
||||
inhaling = breath.gas[breath_type]
|
||||
else
|
||||
inhaling = "oxygen"
|
||||
|
||||
switch(species.poison_type)
|
||||
if("oxygen")
|
||||
poison = breath.oxygen
|
||||
if("nitrogen")
|
||||
poison = breath.nitrogen
|
||||
if("carbon_dioxide")
|
||||
poison = breath.carbon_dioxide
|
||||
else
|
||||
poison = breath.phoron
|
||||
if(species.poison_type)
|
||||
poison_type = species.poison_type
|
||||
poison = breath.gas[poison_type]
|
||||
else
|
||||
poison = "phoron"
|
||||
|
||||
switch(species.exhale_type)
|
||||
if("carbon_dioxide")
|
||||
exhaling = breath.carbon_dioxide
|
||||
if("oxygen")
|
||||
exhaling = breath.oxygen
|
||||
if("nitrogen")
|
||||
exhaling = breath.nitrogen
|
||||
if("phoron")
|
||||
exhaling = breath.phoron
|
||||
else
|
||||
no_exhale = 1
|
||||
if(species.exhale_type)
|
||||
exhale_type = species.exhale_type
|
||||
exhaling = breath.gas[exhale_type]
|
||||
else
|
||||
no_exhale = 1
|
||||
|
||||
var/inhale_pp = (inhaling/breath.total_moles())*breath_pressure
|
||||
var/toxins_pp = (poison/breath.total_moles())*breath_pressure
|
||||
var/exhaled_pp = (exhaling/breath.total_moles())*breath_pressure
|
||||
var/inhale_pp = (inhaling/breath.total_moles)*breath_pressure
|
||||
var/toxins_pp = (poison/breath.total_moles)*breath_pressure
|
||||
var/exhaled_pp = (exhaling/breath.total_moles)*breath_pressure
|
||||
|
||||
// Not enough to breathe
|
||||
if(inhale_pp < safe_pressure_min)
|
||||
@@ -532,32 +511,16 @@
|
||||
inhaled_gas_used = inhaling/6
|
||||
oxygen_alert = 0
|
||||
|
||||
switch(species.breath_type)
|
||||
if("nitrogen")
|
||||
breath.nitrogen -= inhaled_gas_used
|
||||
if("phoron")
|
||||
breath.phoron -= inhaled_gas_used
|
||||
if("carbon_dioxide")
|
||||
breath.carbon_dioxide-= inhaled_gas_used
|
||||
else
|
||||
breath.oxygen -= inhaled_gas_used
|
||||
breath.adjust_gas(breath_type, -inhaled_gas_used)
|
||||
|
||||
if(!no_exhale)
|
||||
switch(species.exhale_type)
|
||||
if("oxygen")
|
||||
breath.oxygen += inhaled_gas_used
|
||||
if("nitrogen")
|
||||
breath.nitrogen += inhaled_gas_used
|
||||
if("phoron")
|
||||
breath.phoron += inhaled_gas_used
|
||||
if("CO2")
|
||||
breath.carbon_dioxide += inhaled_gas_used
|
||||
breath.adjust_gas(exhale_type, inhaled_gas_used)
|
||||
|
||||
// Too much exhaled gas in the air
|
||||
if(exhaled_pp > safe_exhaled_max)
|
||||
if (!co2_alert|| prob(15))
|
||||
var/word = pick("extremely dizzy","short of breath","faint","confused")
|
||||
src << "\red <b>You feel [word].</b>"
|
||||
src << "<span class='danger'>You feel [word].</span>"
|
||||
|
||||
adjustOxyLoss(HUMAN_MAX_OXYLOSS)
|
||||
co2_alert = 1
|
||||
@@ -566,7 +529,7 @@
|
||||
else if(exhaled_pp > safe_exhaled_max * 0.7)
|
||||
if (!co2_alert || prob(1))
|
||||
var/word = pick("dizzy","short of breath","faint","momentarily confused")
|
||||
src << "\red You feel [word]."
|
||||
src << "<span class='warning>You feel [word].</span>"
|
||||
|
||||
//scale linearly from 0 to 1 between safe_exhaled_max and safe_exhaled_max*0.7
|
||||
var/ratio = 1.0 - (safe_exhaled_max - exhaled_pp)/(safe_exhaled_max*0.3)
|
||||
@@ -580,7 +543,7 @@
|
||||
else if(exhaled_pp > safe_exhaled_max * 0.6)
|
||||
if (prob(0.3))
|
||||
var/word = pick("a little dizzy","short of breath")
|
||||
src << "\red You feel [word]."
|
||||
src << "<span class='warning>You feel [word].</span>"
|
||||
|
||||
else
|
||||
co2_alert = 0
|
||||
@@ -594,26 +557,27 @@
|
||||
else
|
||||
phoron_alert = 0
|
||||
|
||||
|
||||
|
||||
// If there's some other shit in the air lets deal with it here.
|
||||
if(breath.trace_gases.len)
|
||||
for(var/datum/gas/sleeping_agent/SA in breath.trace_gases)
|
||||
var/SA_pp = (SA.moles/breath.total_moles())*breath_pressure
|
||||
if(breath.gas["sleeping_agent"])
|
||||
var/SA_pp = (breath.gas["sleeping_agent"] / breath.total_moles) * breath_pressure
|
||||
|
||||
// Enough to make us paralysed for a bit
|
||||
if(SA_pp > SA_para_min)
|
||||
// Enough to make us paralysed for a bit
|
||||
if(SA_pp > SA_para_min)
|
||||
|
||||
// 3 gives them one second to wake up and run away a bit!
|
||||
Paralyse(3)
|
||||
// 3 gives them one second to wake up and run away a bit!
|
||||
Paralyse(3)
|
||||
|
||||
// Enough to make us sleep as well
|
||||
if(SA_pp > SA_sleep_min)
|
||||
sleeping = min(sleeping+2, 10)
|
||||
// Enough to make us sleep as well
|
||||
if(SA_pp > SA_sleep_min)
|
||||
sleeping = min(sleeping+2, 10)
|
||||
|
||||
// There is sleeping gas in their lungs, but only a little, so give them a bit of a warning
|
||||
else if(SA_pp > 0.15)
|
||||
if(prob(20))
|
||||
spawn(0) emote(pick("giggle", "laugh"))
|
||||
SA.moles = 0
|
||||
// There is sleeping gas in their lungs, but only a little, so give them a bit of a warning
|
||||
else if(SA_pp > 0.15)
|
||||
if(prob(20))
|
||||
spawn(0) emote(pick("giggle", "laugh"))
|
||||
breath.adjust_gas("sleeping_agent", -breath.gas["sleeping_agent"])
|
||||
|
||||
// Were we able to breathe?
|
||||
if (failed_inhale || failed_exhale)
|
||||
@@ -630,10 +594,10 @@
|
||||
|
||||
if(breath.temperature < species.cold_level_1)
|
||||
if(prob(20))
|
||||
src << "\red You feel your face freezing and icicles forming in your lungs!"
|
||||
src << "<span class='danger'>You feel your face freezing and icicles forming in your lungs!</span>"
|
||||
else if(breath.temperature > species.heat_level_1)
|
||||
if(prob(20))
|
||||
src << "\red You feel your face burning and a searing heat in your lungs!"
|
||||
src << "<span class='danger'>You feel your face burning and a searing heat in your lungs!</span>"
|
||||
|
||||
switch(breath.temperature)
|
||||
if(-INFINITY to species.cold_level_3)
|
||||
@@ -662,7 +626,7 @@
|
||||
else
|
||||
temp_adj /= (BODYTEMP_HEAT_DIVISOR * 5) //don't raise temperature as much as if we were directly exposed
|
||||
|
||||
var/relative_density = breath.total_moles() / (MOLES_CELLSTANDARD * BREATH_PERCENTAGE)
|
||||
var/relative_density = breath.total_moles / (MOLES_CELLSTANDARD * BREATH_PERCENTAGE)
|
||||
temp_adj *= relative_density
|
||||
|
||||
if (temp_adj > BODYTEMP_HEATING_MAX) temp_adj = BODYTEMP_HEATING_MAX
|
||||
@@ -689,7 +653,7 @@
|
||||
else
|
||||
loc_temp = environment.temperature
|
||||
|
||||
if(adjusted_pressure < species.warning_high_pressure && adjusted_pressure > species.warning_low_pressure && abs(loc_temp - bodytemperature) < 20 && bodytemperature < species.heat_level_1 && bodytemperature > species.cold_level_1 && environment.phoron < MOLES_PHORON_VISIBLE)
|
||||
if(adjusted_pressure < species.warning_high_pressure && adjusted_pressure > species.warning_low_pressure && abs(loc_temp - bodytemperature) < 20 && bodytemperature < species.heat_level_1 && bodytemperature > species.cold_level_1)
|
||||
pressure_alert = 0
|
||||
return // Temperatures are within normal ranges, fuck all this processing. ~Ccomp
|
||||
|
||||
@@ -705,7 +669,7 @@
|
||||
temp_adj = (1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR)
|
||||
|
||||
//Use heat transfer as proportional to the gas density. However, we only care about the relative density vs standard 101 kPa/20 C air. Therefore we can use mole ratios
|
||||
var/relative_density = environment.total_moles() / MOLES_CELLSTANDARD
|
||||
var/relative_density = environment.total_moles / MOLES_CELLSTANDARD
|
||||
temp_adj *= relative_density
|
||||
|
||||
if (temp_adj > BODYTEMP_HEATING_MAX) temp_adj = BODYTEMP_HEATING_MAX
|
||||
@@ -765,8 +729,10 @@
|
||||
else
|
||||
pressure_alert = -1
|
||||
|
||||
if(environment.phoron > MOLES_PHORON_VISIBLE)
|
||||
pl_effects()
|
||||
for(var/g in environment.gas)
|
||||
if(gas_data.flags[g] & XGM_GAS_CONTAMINANT && environment.gas[g] > gas_data.overlay_limit[g] + 1)
|
||||
pl_effects()
|
||||
break
|
||||
return
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,23 +1,28 @@
|
||||
/mob/living/carbon/slime/death(gibbed)
|
||||
if(!gibbed)
|
||||
if(is_adult)
|
||||
var/mob/living/carbon/slime/M = new /mob/living/carbon/slime(loc)
|
||||
M.colour = colour
|
||||
M.rabid = 1
|
||||
is_adult = 0
|
||||
maxHealth = 150
|
||||
revive()
|
||||
regenerate_icons()
|
||||
number = rand(1, 1000)
|
||||
name = "[colour] [is_adult ? "adult" : "baby"] slime ([number])"
|
||||
return
|
||||
|
||||
if(stat == DEAD) return
|
||||
stat = DEAD
|
||||
icon_state = "[colour] baby slime dead"
|
||||
|
||||
if(!gibbed)
|
||||
if(istype(src, /mob/living/carbon/slime/adult))
|
||||
ghostize()
|
||||
var/mob/living/carbon/slime/M1 = new primarytype(loc)
|
||||
M1.rabid = 1
|
||||
var/mob/living/carbon/slime/M2 = new primarytype(loc)
|
||||
M2.rabid = 1
|
||||
if(src) del(src)
|
||||
else
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message("<b>The [name]</b> seizes up and falls limp...", 1) //ded -- Urist
|
||||
overlays.len = 0
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message("<b>The [name]</b> seizes up and falls limp...", 1) //ded -- Urist
|
||||
|
||||
update_canmove()
|
||||
if(blind) blind.layer = 0
|
||||
|
||||
ticker.mode.check_win()
|
||||
if(ticker && ticker.mode)
|
||||
ticker.mode.check_win()
|
||||
|
||||
return ..(gibbed)
|
||||
@@ -1,4 +1,4 @@
|
||||
/mob/living/carbon/slime/emote(var/act,var/m_type=1,var/message = null)
|
||||
/mob/living/carbon/slime/emote(var/act, var/m_type=1, var/message = null)
|
||||
|
||||
|
||||
if (findtext(act, "-", 1, null))
|
||||
@@ -9,7 +9,7 @@
|
||||
if(findtext(act,"s",-1) && !findtext(act,"_",-2))//Removes ending s's unless they are prefixed with a '_'
|
||||
act = copytext(act,1,length(act))
|
||||
|
||||
switch(act)
|
||||
switch(act) //Alphabetical please
|
||||
if ("me")
|
||||
if(silent)
|
||||
return
|
||||
@@ -19,40 +19,51 @@
|
||||
return
|
||||
if (src.client.handle_spam_prevention(message,MUTE_IC))
|
||||
return
|
||||
if (stat)
|
||||
return
|
||||
if(!(message))
|
||||
return
|
||||
return custom_emote(m_type, message)
|
||||
|
||||
if ("custom")
|
||||
return custom_emote(m_type, message)
|
||||
if("moan")
|
||||
message = "<B>The [src.name]</B> moans."
|
||||
m_type = 2
|
||||
if("shiver")
|
||||
message = "<B>The [src.name]</B> shivers."
|
||||
m_type = 2
|
||||
if("sway")
|
||||
message = "<B>The [src.name]</B> sways around dizzily."
|
||||
m_type = 1
|
||||
if("twitch")
|
||||
message = "<B>The [src.name]</B> twitches."
|
||||
m_type = 1
|
||||
if("vibrate")
|
||||
message = "<B>The [src.name]</B> vibrates!"
|
||||
m_type = 1
|
||||
if("light")
|
||||
message = "<B>The [src.name]</B> lights up for a bit, then stops."
|
||||
m_type = 1
|
||||
if("jiggle")
|
||||
message = "<B>The [src.name]</B> jiggles!"
|
||||
m_type = 1
|
||||
if (stat)
|
||||
return
|
||||
if(!(message))
|
||||
return
|
||||
return custom_emote(m_type, message)
|
||||
if("bounce")
|
||||
message = "<B>The [src.name]</B> bounces in place."
|
||||
m_type = 1
|
||||
|
||||
if ("custom")
|
||||
return custom_emote(m_type, message)
|
||||
|
||||
if("jiggle")
|
||||
message = "<B>The [src.name]</B> jiggles!"
|
||||
m_type = 1
|
||||
|
||||
if("light")
|
||||
message = "<B>The [src.name]</B> lights up for a bit, then stops."
|
||||
m_type = 1
|
||||
|
||||
if("moan")
|
||||
message = "<B>The [src.name]</B> moans."
|
||||
m_type = 2
|
||||
|
||||
if("shiver")
|
||||
message = "<B>The [src.name]</B> shivers."
|
||||
m_type = 2
|
||||
|
||||
if("sway")
|
||||
message = "<B>The [src.name]</B> sways around dizzily."
|
||||
m_type = 1
|
||||
|
||||
if("twitch")
|
||||
message = "<B>The [src.name]</B> twitches."
|
||||
m_type = 1
|
||||
|
||||
if("vibrate")
|
||||
message = "<B>The [src.name]</B> vibrates!"
|
||||
m_type = 1
|
||||
|
||||
if ("help") //This is an exception
|
||||
src << "Help for slime emotes. You can use these emotes with say \"*emote\":\n\nbounce, custom, jiggle, light, moan, shiver, sway, twitch, vibrate"
|
||||
|
||||
else
|
||||
src << text("Invalid Emote: []", act)
|
||||
src << "\blue Unusable emote '[act]'. Say *help for a list."
|
||||
if ((message && src.stat == 0))
|
||||
if (m_type & 1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
|
||||
/mob/living/carbon/slime/proc/regular_hud_updates()
|
||||
return
|
||||
|
||||
return
|
||||
@@ -1,3 +1,10 @@
|
||||
/mob/living/carbon/slime
|
||||
var/AIproc = 0 // determines if the AI loop is activated
|
||||
var/Atkcool = 0 // attack cooldown
|
||||
var/Tempstun = 0 // temporary temperature stuns
|
||||
var/Discipline = 0 // if a slime has been hit with a freeze gun, or wrestled/attacked off a human, they become disciplined and don't attack anymore for a while
|
||||
var/SStun = 0 // stun variable
|
||||
|
||||
/mob/living/carbon/slime/Life()
|
||||
set invisibility = 0
|
||||
set background = 1
|
||||
@@ -15,114 +22,80 @@
|
||||
|
||||
handle_targets()
|
||||
|
||||
if (!ckey)
|
||||
handle_speech_and_mood()
|
||||
|
||||
var/datum/gas_mixture/environment // Added to prevent null location errors-- TLE
|
||||
var/datum/gas_mixture/environment
|
||||
if(src.loc)
|
||||
environment = loc.return_air()
|
||||
|
||||
|
||||
//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
|
||||
//to find it.
|
||||
src.blinded = null
|
||||
|
||||
// Basically just deletes any screen objects :<
|
||||
regular_hud_updates()
|
||||
regular_hud_updates() // Basically just deletes any screen objects :<
|
||||
|
||||
//Handle temperature/pressure differences between body and environment
|
||||
if(environment)
|
||||
handle_environment(environment)
|
||||
handle_environment(environment) // Handle temperature/pressure differences between body and environment
|
||||
|
||||
//Status updates, death etc.
|
||||
handle_regular_status_updates()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/mob/living/carbon/slime
|
||||
var/AIproc = 0 // determines if the AI loop is activated
|
||||
var/Atkcool = 0 // attack cooldown
|
||||
var/Tempstun = 0 // temporary temperature stuns
|
||||
var/Discipline = 0 // if a slime has been hit with a freeze gun, or wrestled/attacked off a human, they become disciplined and don't attack anymore for a while
|
||||
var/SStun = 0 // stun variable
|
||||
handle_regular_status_updates() // Status updates, death etc.
|
||||
|
||||
/mob/living/carbon/slime/proc/AIprocess() // the master AI process
|
||||
|
||||
//world << "AI proc started."
|
||||
if(AIproc || stat == DEAD || client) return
|
||||
|
||||
var/hungry = 0
|
||||
var/starving = 0
|
||||
if(istype(src, /mob/living/carbon/slime/adult))
|
||||
switch(nutrition)
|
||||
if(400 to 1100) hungry = 1
|
||||
if(0 to 399)
|
||||
starving = 1
|
||||
else
|
||||
switch(nutrition)
|
||||
if(150 to 900) hungry = 1
|
||||
if(0 to 149) starving = 1
|
||||
if (nutrition < get_starve_nutrition())
|
||||
hungry = 2
|
||||
else if (nutrition < get_grow_nutrition() && prob(25) || nutrition < get_hunger_nutrition())
|
||||
hungry = 1
|
||||
|
||||
AIproc = 1
|
||||
//world << "AIproc [AIproc] && stat != 2 [stat] && (attacked > 0 [attacked] || starving [starving] || hungry [hungry] || rabid [rabid] || Victim [Victim] || Target [Target]"
|
||||
while(AIproc && stat != 2 && (attacked > 0 || starving || hungry || rabid || Victim))
|
||||
|
||||
while(AIproc && stat != 2 && (attacked || hungry || rabid || Victim))
|
||||
if(Victim) // can't eat AND have this little process at the same time
|
||||
//world << "break 1"
|
||||
break
|
||||
|
||||
if(!Target || client)
|
||||
//world << "break 2"
|
||||
break
|
||||
|
||||
|
||||
if(Target.health <= -70 || Target.stat == 2)
|
||||
Target = null
|
||||
AIproc = 0
|
||||
//world << "break 3"
|
||||
break
|
||||
|
||||
if(Target)
|
||||
//world << "[Target] Target Found"
|
||||
for(var/mob/living/carbon/slime/M in view(1,Target))
|
||||
if(M.Victim == Target)
|
||||
Target = null
|
||||
AIproc = 0
|
||||
//world << "break 4"
|
||||
break
|
||||
if(!AIproc)
|
||||
//world << "break 5"
|
||||
break
|
||||
|
||||
if(Target in view(1,src))
|
||||
|
||||
if(istype(Target, /mob/living/silicon))
|
||||
if(!Atkcool)
|
||||
spawn()
|
||||
Atkcool = 1
|
||||
sleep(15)
|
||||
Atkcool = 1
|
||||
spawn(45)
|
||||
Atkcool = 0
|
||||
|
||||
if(Target.Adjacent(src))
|
||||
Target.attack_slime(src)
|
||||
//world << "retrun 1"
|
||||
return
|
||||
if(!Target.lying && prob(80))
|
||||
|
||||
if(Target.client && Target.health >= 20)
|
||||
if(!Atkcool)
|
||||
spawn()
|
||||
Atkcool = 1
|
||||
sleep(25)
|
||||
Atkcool = 1
|
||||
spawn(45)
|
||||
Atkcool = 0
|
||||
|
||||
if(Target.Adjacent(src))
|
||||
Target.attack_slime(src)
|
||||
|
||||
|
||||
if(prob(30))
|
||||
step_to(src, Target)
|
||||
|
||||
else
|
||||
if(!Atkcool && Target.Adjacent(src))
|
||||
Feedon(Target)
|
||||
@@ -133,13 +106,13 @@
|
||||
|
||||
else
|
||||
if(Target in view(7, src))
|
||||
if(Target.Adjacent(src))
|
||||
if(!Target.Adjacent(src)) // Bug of the month candidate: slimes were attempting to move to target only if it was directly next to them, which caused them to target things, but not approach them
|
||||
step_to(src, Target)
|
||||
sleep(5)
|
||||
|
||||
else
|
||||
Target = null
|
||||
AIproc = 0
|
||||
//world << "break 6"
|
||||
break
|
||||
|
||||
var/sleeptime = movement_delay()
|
||||
@@ -148,7 +121,6 @@
|
||||
sleep(sleeptime + 2) // this is about as fast as a player slime can go
|
||||
|
||||
AIproc = 0
|
||||
//world << "AI proc ended."
|
||||
|
||||
/mob/living/carbon/slime/proc/handle_environment(datum/gas_mixture/environment)
|
||||
if(!environment)
|
||||
@@ -166,28 +138,11 @@
|
||||
else
|
||||
loc_temp = environment.temperature
|
||||
|
||||
/*
|
||||
if((environment.temperature > (T0C + 50)) || (environment.temperature < (T0C + 10)))
|
||||
var/transfer_coefficient
|
||||
|
||||
transfer_coefficient = 1
|
||||
if(wear_mask && (wear_mask.body_parts_covered & HEAD) && (environment.temperature < wear_mask.protective_temperature))
|
||||
transfer_coefficient *= wear_mask.heat_transfer_coefficient
|
||||
|
||||
// handle_temperature_damage(HEAD, environment.temperature, environment_heat_capacity*transfer_coefficient)
|
||||
*/
|
||||
|
||||
|
||||
if(loc_temp < 310.15) // a cold place
|
||||
bodytemperature += adjust_body_temperature(bodytemperature, loc_temp, 1)
|
||||
else // a hot place
|
||||
bodytemperature += adjust_body_temperature(bodytemperature, loc_temp, 1)
|
||||
|
||||
/*
|
||||
if(stat==2)
|
||||
bodytemperature += 0.1*(environment.temperature - bodytemperature)*environment_heat_capacity/(environment_heat_capacity + 270000)
|
||||
|
||||
*/
|
||||
//Account for massive pressure differences
|
||||
|
||||
if(bodytemperature < (T0C + 5)) // start calculating temperature damage etc
|
||||
@@ -207,7 +162,6 @@
|
||||
|
||||
return //TODO: DEFERRED
|
||||
|
||||
|
||||
/mob/living/carbon/slime/proc/adjust_body_temperature(current, loc_temp, boost)
|
||||
var/temperature = current
|
||||
var/difference = abs(current-loc_temp) //get difference
|
||||
@@ -229,33 +183,28 @@
|
||||
|
||||
if(reagents) reagents.metabolize(src)
|
||||
|
||||
|
||||
src.updatehealth()
|
||||
|
||||
return //TODO: DEFERRED
|
||||
|
||||
|
||||
/mob/living/carbon/slime/proc/handle_regular_status_updates()
|
||||
|
||||
if(istype(src, /mob/living/carbon/slime/adult))
|
||||
if(is_adult)
|
||||
health = 200 - (getOxyLoss() + getToxLoss() + getFireLoss() + getBruteLoss() + getCloneLoss())
|
||||
else
|
||||
health = 150 - (getOxyLoss() + getToxLoss() + getFireLoss() + getBruteLoss() + getCloneLoss())
|
||||
|
||||
|
||||
|
||||
|
||||
if(health < config.health_threshold_dead && stat != 2)
|
||||
death()
|
||||
return
|
||||
|
||||
else if(src.health < config.health_threshold_crit)
|
||||
// if(src.health <= 20 && prob(1)) spawn(0) emote("gasp")
|
||||
|
||||
//if(!src.rejuv) src.oxyloss++
|
||||
if(!src.reagents.has_reagent("inaprovaline")) src.adjustOxyLoss(10)
|
||||
if(!src.reagents.has_reagent("inaprovaline"))
|
||||
src.adjustOxyLoss(10)
|
||||
|
||||
if(src.stat != DEAD) src.stat = UNCONSCIOUS
|
||||
if(src.stat != DEAD)
|
||||
src.stat = UNCONSCIOUS
|
||||
|
||||
if(prob(30))
|
||||
adjustOxyLoss(-1)
|
||||
@@ -264,12 +213,9 @@
|
||||
adjustCloneLoss(-1)
|
||||
adjustBruteLoss(-1)
|
||||
|
||||
|
||||
if (src.stat == DEAD)
|
||||
|
||||
src.lying = 1
|
||||
src.blinded = 1
|
||||
|
||||
else
|
||||
if (src.paralysis || src.stunned || src.weakened || (status_flags && FAKEDEATH)) //Stunned etc.
|
||||
if (src.stunned > 0)
|
||||
@@ -314,89 +260,25 @@
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
/mob/living/carbon/slime/proc/handle_nutrition()
|
||||
|
||||
if(prob(20))
|
||||
if(istype(src, /mob/living/carbon/slime/adult)) nutrition-=rand(4,6)
|
||||
else nutrition-=rand(2,3)
|
||||
if (prob(15))
|
||||
nutrition -= 1 + is_adult
|
||||
|
||||
if(nutrition <= 0)
|
||||
nutrition = 0
|
||||
if(prob(75))
|
||||
|
||||
adjustToxLoss(rand(0,5))
|
||||
|
||||
else
|
||||
if(istype(src, /mob/living/carbon/slime/adult))
|
||||
if(nutrition >= 1000)
|
||||
if(prob(40)) amount_grown++
|
||||
else if (nutrition >= get_grow_nutrition() && amount_grown < 10)
|
||||
nutrition -= 20
|
||||
amount_grown++
|
||||
|
||||
if(amount_grown >= 10 && !Victim && !Target && !ckey)
|
||||
if(is_adult)
|
||||
Reproduce()
|
||||
else
|
||||
if(nutrition >= 800)
|
||||
if(prob(40)) amount_grown++
|
||||
|
||||
if(amount_grown >= 10 && !Victim && !Target)
|
||||
if(istype(src, /mob/living/carbon/slime/adult))
|
||||
if(!client)
|
||||
for(var/i=1,i<=4,i++)
|
||||
if(prob(70))
|
||||
var/mob/living/carbon/slime/M = new primarytype(loc)
|
||||
M.powerlevel = round(powerlevel/4)
|
||||
M.Friends = Friends
|
||||
M.tame = tame
|
||||
M.rabid = rabid
|
||||
M.Discipline = Discipline
|
||||
if(i != 1) step_away(M,src)
|
||||
else
|
||||
var/mutations = pick("one","two","three","four")
|
||||
switch(mutations)
|
||||
if("one")
|
||||
var/mob/living/carbon/slime/M = new mutationone(loc)
|
||||
M.powerlevel = round(powerlevel/4)
|
||||
M.Friends = Friends
|
||||
M.tame = tame
|
||||
M.rabid = rabid
|
||||
M.Discipline = Discipline
|
||||
if(i != 1) step_away(M,src)
|
||||
if("two")
|
||||
var/mob/living/carbon/slime/M = new mutationtwo(loc)
|
||||
M.powerlevel = round(powerlevel/4)
|
||||
M.Friends = Friends
|
||||
M.tame = tame
|
||||
M.rabid = rabid
|
||||
M.Discipline = Discipline
|
||||
if(i != 1) step_away(M,src)
|
||||
if("three")
|
||||
var/mob/living/carbon/slime/M = new mutationthree(loc)
|
||||
M.powerlevel = round(powerlevel/4)
|
||||
M.Friends = Friends
|
||||
M.tame = tame
|
||||
M.rabid = rabid
|
||||
M.Discipline = Discipline
|
||||
if(i != 1) step_away(M,src)
|
||||
if("four")
|
||||
var/mob/living/carbon/slime/M = new mutationfour(loc)
|
||||
M.powerlevel = round(powerlevel/4)
|
||||
M.Friends = Friends
|
||||
M.tame = tame
|
||||
M.rabid = rabid
|
||||
M.Discipline = Discipline
|
||||
if(i != 1) step_away(M,src)
|
||||
|
||||
del(src)
|
||||
|
||||
else
|
||||
if(!client)
|
||||
var/mob/living/carbon/slime/adult/A = new adulttype(src.loc)
|
||||
A.nutrition = nutrition
|
||||
// A.nutrition += 100
|
||||
A.powerlevel = max(0, powerlevel-1)
|
||||
A.Friends = Friends
|
||||
A.tame = tame
|
||||
A.rabid = rabid
|
||||
del(src)
|
||||
|
||||
Evolve()
|
||||
|
||||
/mob/living/carbon/slime/proc/handle_targets()
|
||||
if(Tempstun)
|
||||
@@ -408,8 +290,7 @@
|
||||
if(attacked > 50) attacked = 50
|
||||
|
||||
if(attacked > 0)
|
||||
if(prob(85))
|
||||
attacked--
|
||||
attacked--
|
||||
|
||||
if(Discipline > 0)
|
||||
|
||||
@@ -419,136 +300,278 @@
|
||||
if(prob(10))
|
||||
Discipline--
|
||||
|
||||
|
||||
if(!client)
|
||||
|
||||
if(!canmove) return
|
||||
|
||||
// DO AI STUFF HERE
|
||||
|
||||
if(Target)
|
||||
if(attacked <= 0)
|
||||
Target = null
|
||||
|
||||
if(Victim) return // if it's eating someone already, continue eating!
|
||||
|
||||
|
||||
if(prob(1))
|
||||
emote(pick("bounce","sway","light","vibrate","jiggle"))
|
||||
if(Target)
|
||||
--target_patience
|
||||
if (target_patience <= 0 || SStun || Discipline || attacked) // Tired of chasing or something draws out attention
|
||||
target_patience = 0
|
||||
Target = null
|
||||
|
||||
if(AIproc && SStun) return
|
||||
|
||||
|
||||
var/hungry = 0 // determines if the slime is hungry
|
||||
var/starving = 0 // determines if the slime is starving-hungry
|
||||
if(istype(src, /mob/living/carbon/slime/adult)) // 1200 max nutrition
|
||||
switch(nutrition)
|
||||
if(601 to 900)
|
||||
if(prob(25)) hungry = 1//Ensures they continue eating, but aren't as aggressive at the same time
|
||||
if(301 to 600) hungry = 1
|
||||
if(0 to 300)
|
||||
starving = 1
|
||||
|
||||
else
|
||||
switch(nutrition) // 1000 max nutrition
|
||||
if(501 to 700)
|
||||
if(prob(25)) hungry = 1
|
||||
if(201 to 500) hungry = 1
|
||||
if(0 to 200) starving = 1
|
||||
if (nutrition < get_starve_nutrition())
|
||||
hungry = 2
|
||||
else if (nutrition < get_grow_nutrition() && prob(25) || nutrition < get_hunger_nutrition())
|
||||
hungry = 1
|
||||
|
||||
|
||||
if(starving && !client) // if a slime is starving, it starts losing its friends
|
||||
if(hungry == 2 && !client) // if a slime is starving, it starts losing its friends
|
||||
if(Friends.len > 0 && prob(1))
|
||||
var/mob/nofriend = pick(Friends)
|
||||
Friends -= nofriend
|
||||
--Friends[nofriend]
|
||||
|
||||
if(!Target)
|
||||
var/list/targets = list()
|
||||
if(will_hunt() && hungry || attacked || rabid) // Only add to the list if we need to
|
||||
var/list/targets = list()
|
||||
|
||||
if(hungry || starving) //Only add to the list if we need to
|
||||
for(var/mob/living/L in view(7,src))
|
||||
|
||||
//Ignore other slimes, dead mobs and simple_animals
|
||||
if(isslime(L) || L.stat != CONSCIOUS || isanimal(L))
|
||||
if(isslime(L) || L.stat == DEAD) // Ignore other slimes and dead mobs
|
||||
continue
|
||||
|
||||
if(issilicon(L))
|
||||
if(!istype(src, /mob/living/carbon/slime/adult)) //Non-starving diciplined adult slimes wont eat things
|
||||
if(!starving && Discipline > 0)
|
||||
if(L in Friends) // No eating friends!
|
||||
continue
|
||||
|
||||
if(issilicon(L) && (rabid || attacked)) // They can't eat silicons, but they can glomp them in defence
|
||||
targets += L // Possible target found!
|
||||
|
||||
if(istype(L, /mob/living/carbon/human) && dna) //Ignore slime(wo)men
|
||||
var/mob/living/carbon/human/H = L
|
||||
if(H.dna)
|
||||
if(H.dna.mutantrace == "slime")
|
||||
continue
|
||||
|
||||
if(tame) //Tame slimes ignore electronic life
|
||||
if(!L.canmove) // Only one slime can latch on at a time.
|
||||
var/notarget = 0
|
||||
for(var/mob/living/carbon/slime/M in view(1,L))
|
||||
if(M.Victim == L)
|
||||
notarget = 1
|
||||
if(notarget)
|
||||
continue
|
||||
|
||||
targets += L //Possible target found!
|
||||
targets += L // Possible target found!
|
||||
|
||||
else if(iscarbon(L))
|
||||
|
||||
if(istype(L, /mob/living/carbon/human)) //Ignore slime(wo)men
|
||||
var/mob/living/carbon/human/H = L
|
||||
if(H.dna)
|
||||
if(H.dna.mutantrace == "slime")
|
||||
continue
|
||||
|
||||
if(!istype(src, /mob/living/carbon/slime/adult)) //Non-starving diciplined adult slimes wont eat things
|
||||
if(!starving && Discipline > 0)
|
||||
continue
|
||||
|
||||
if(L in Friends) //No eating friends!
|
||||
continue
|
||||
|
||||
if(tame && ishuman(L)) //Tame slimes dont eat people.
|
||||
continue
|
||||
|
||||
if(!L.canmove) //Only one slime can latch on at a time.
|
||||
|
||||
var/notarget = 0
|
||||
for(var/mob/living/carbon/slime/M in view(1,L))
|
||||
if(M.Victim == L)
|
||||
notarget = 1
|
||||
if(notarget)
|
||||
continue
|
||||
|
||||
targets += L //Possible target found!
|
||||
|
||||
|
||||
|
||||
if((hungry || starving) && targets.len > 0)
|
||||
if(!istype(src, /mob/living/carbon/slime/adult))
|
||||
if(!starving)
|
||||
if(targets.len > 0)
|
||||
if(attacked || rabid || hungry == 2)
|
||||
Target = targets[1] // I am attacked and am fighting back or so hungry I don't even care
|
||||
else
|
||||
for(var/mob/living/carbon/C in targets)
|
||||
if(!Discipline && prob(5))
|
||||
if(ishuman(C))
|
||||
Target = C
|
||||
break
|
||||
if(isalienadult(C))
|
||||
if(ishuman(C) || isalienadult(C))
|
||||
Target = C
|
||||
break
|
||||
|
||||
if(islarva(C))
|
||||
if(islarva(C) || ismonkey(C))
|
||||
Target = C
|
||||
break
|
||||
if(ismonkey(C))
|
||||
Target = C
|
||||
break
|
||||
else
|
||||
Target = targets[1]
|
||||
else
|
||||
Target = targets[1] // closest target
|
||||
|
||||
if(targets.len > 0)
|
||||
if(attacked > 0 || rabid)
|
||||
Target = targets[1] //closest mob probably attacked it, so override Target and attack the nearest!
|
||||
if (Target)
|
||||
target_patience = rand(5,7)
|
||||
if (is_adult)
|
||||
target_patience += 3
|
||||
|
||||
if(!Target) // If we have no target, we are wandering or following orders
|
||||
if (Leader)
|
||||
if (holding_still)
|
||||
holding_still = max(holding_still - 1, 0)
|
||||
else if(canmove && isturf(loc))
|
||||
step_to(src, Leader)
|
||||
|
||||
if(!Target)
|
||||
if(hungry || starving)
|
||||
if(canmove && isturf(loc) && prob(50))
|
||||
else if(hungry)
|
||||
if (holding_still)
|
||||
holding_still = max(holding_still - hungry, 0)
|
||||
else if(canmove && isturf(loc) && prob(50))
|
||||
step(src, pick(cardinal))
|
||||
|
||||
else
|
||||
if(canmove && isturf(loc) && prob(33))
|
||||
if (holding_still)
|
||||
holding_still = max(holding_still - 1, 0)
|
||||
else if(canmove && isturf(loc) && prob(33))
|
||||
step(src, pick(cardinal))
|
||||
else
|
||||
if(!AIproc)
|
||||
spawn() AIprocess()
|
||||
else if(!AIproc)
|
||||
spawn()
|
||||
AIprocess()
|
||||
|
||||
/mob/living/carbon/slime/proc/handle_speech_and_mood()
|
||||
//Mood starts here
|
||||
var/newmood = ""
|
||||
if (rabid || attacked) newmood = "angry"
|
||||
else if (Target) newmood = "mischevous"
|
||||
|
||||
if (!newmood)
|
||||
if (Discipline && prob(25))
|
||||
newmood = "pout"
|
||||
else if (prob(1))
|
||||
newmood = pick("sad", ":3", "pout")
|
||||
|
||||
if ((mood == "sad" || mood == ":3" || mood == "pout") && !newmood)
|
||||
if (prob(75)) newmood = mood
|
||||
|
||||
if (newmood != mood) // This is so we don't redraw them every time
|
||||
mood = newmood
|
||||
regenerate_icons()
|
||||
|
||||
//Speech understanding starts here
|
||||
var/to_say
|
||||
if (speech_buffer.len > 0)
|
||||
var/who = speech_buffer[1] // Who said it?
|
||||
var/phrase = speech_buffer[2] // What did they say?
|
||||
if ((findtext(phrase, num2text(number)) || findtext(phrase, "slimes"))) // Talking to us
|
||||
if (findtext(phrase, "hello") || findtext(phrase, "hi"))
|
||||
to_say = pick("Hello...", "Hi...")
|
||||
else if (findtext(phrase, "follow"))
|
||||
if (Leader)
|
||||
if (Leader == who) // Already following him
|
||||
to_say = pick("Yes...", "Lead...", "Following...")
|
||||
else if (Friends[who] > Friends[Leader]) // VIVA
|
||||
Leader = who
|
||||
to_say = "Yes... I follow [who]..."
|
||||
else
|
||||
to_say = "No... I follow [Leader]..."
|
||||
else
|
||||
if (Friends[who] > 2)
|
||||
Leader = who
|
||||
to_say = "I follow..."
|
||||
else // Not friendly enough
|
||||
to_say = pick("No...", "I won't follow...")
|
||||
else if (findtext(phrase, "stop"))
|
||||
if (Victim) // We are asked to stop feeding
|
||||
if (Friends[who] > 4)
|
||||
Victim = null
|
||||
Target = null
|
||||
if (Friends[who] < 7)
|
||||
--Friends[who]
|
||||
to_say = "Grrr..." // I'm angry but I do it
|
||||
else
|
||||
to_say = "Fine..."
|
||||
else if (Target) // We are asked to stop chasing
|
||||
if (Friends[who] > 3)
|
||||
Target = null
|
||||
if (Friends[who] < 6)
|
||||
--Friends[who]
|
||||
to_say = "Grrr..." // I'm angry but I do it
|
||||
else
|
||||
to_say = "Fine..."
|
||||
else if (Leader) // We are asked to stop following
|
||||
if (Leader == who)
|
||||
to_say = "Yes... I'll stay..."
|
||||
Leader = null
|
||||
else
|
||||
if (Friends[who] > Friends[Leader])
|
||||
Leader = null
|
||||
to_say = "Yes... I'll stop..."
|
||||
else
|
||||
to_say = "No... I'll keep following..."
|
||||
else if (findtext(phrase, "stay"))
|
||||
if (Leader)
|
||||
if (Leader == who)
|
||||
holding_still = Friends[who] * 10
|
||||
to_say = "Yes... Staying..."
|
||||
else if (Friends[who] > Friends[Leader])
|
||||
holding_still = (Friends[who] - Friends[Leader]) * 10
|
||||
to_say = "Yes... Staying..."
|
||||
else
|
||||
to_say = "No... I'll keep following..."
|
||||
else
|
||||
if (Friends[who] > 2)
|
||||
holding_still = Friends[who] * 10
|
||||
to_say = "Yes... Staying..."
|
||||
else
|
||||
to_say = "No... I won't stay..."
|
||||
speech_buffer = list()
|
||||
|
||||
//Speech starts here
|
||||
if (to_say)
|
||||
say (to_say)
|
||||
else if(prob(1))
|
||||
emote(pick("bounce","sway","light","vibrate","jiggle"))
|
||||
else
|
||||
var/t = 10
|
||||
var/slimes_near = -1 // Don't count myself
|
||||
var/dead_slimes = 0
|
||||
var/friends_near = list()
|
||||
for (var/mob/living/carbon/M in view(7,src))
|
||||
if (isslime(M))
|
||||
++slimes_near
|
||||
if (M.stat == DEAD)
|
||||
++dead_slimes
|
||||
if (M in Friends)
|
||||
t += 20
|
||||
friends_near += M
|
||||
if (nutrition < get_hunger_nutrition()) t += 10
|
||||
if (nutrition < get_starve_nutrition()) t += 10
|
||||
if (prob(2) && prob(t))
|
||||
var/phrases = list()
|
||||
if (Target) phrases += "[Target]... looks tasty..."
|
||||
if (nutrition < get_starve_nutrition())
|
||||
phrases += "So... hungry..."
|
||||
phrases += "Very... hungry..."
|
||||
phrases += "Need... food..."
|
||||
phrases += "Must... eat..."
|
||||
else if (nutrition < get_hunger_nutrition())
|
||||
phrases += "Hungry..."
|
||||
phrases += "Where is the food?"
|
||||
phrases += "I want to eat..."
|
||||
phrases += "Rawr..."
|
||||
phrases += "Blop..."
|
||||
phrases += "Blorble..."
|
||||
if (rabid || attacked)
|
||||
phrases += "Hrr..."
|
||||
phrases += "Nhuu..."
|
||||
phrases += "Unn..."
|
||||
if (mood == ":3")
|
||||
phrases += "Purr..."
|
||||
if (attacked)
|
||||
phrases += "Grrr..."
|
||||
if (getToxLoss() > 30)
|
||||
phrases += "Cold..."
|
||||
if (getToxLoss() > 60)
|
||||
phrases += "So... cold..."
|
||||
phrases += "Very... cold..."
|
||||
if (getToxLoss() > 90)
|
||||
phrases += "..."
|
||||
phrases += "C... c..."
|
||||
if (Victim)
|
||||
phrases += "Nom..."
|
||||
phrases += "Tasty..."
|
||||
if (powerlevel > 3) phrases += "Bzzz..."
|
||||
if (powerlevel > 5) phrases += "Zap..."
|
||||
if (powerlevel > 8) phrases += "Zap... Bzz..."
|
||||
if (mood == "sad") phrases += "Bored..."
|
||||
if (slimes_near) phrases += "Brother..."
|
||||
if (slimes_near > 1) phrases += "Brothers..."
|
||||
if (dead_slimes) phrases += "What happened?"
|
||||
if (!slimes_near)
|
||||
phrases += "Lonely..."
|
||||
for (var/M in friends_near)
|
||||
phrases += "[M]... friend..."
|
||||
if (nutrition < get_hunger_nutrition())
|
||||
phrases += "[M]... feed me..."
|
||||
say (pick(phrases))
|
||||
|
||||
/mob/living/carbon/slime/proc/get_max_nutrition() // Can't go above it
|
||||
if (is_adult) return 1200
|
||||
else return 1000
|
||||
|
||||
/mob/living/carbon/slime/proc/get_grow_nutrition() // Above it we grow, below it we can eat
|
||||
if (is_adult) return 1000
|
||||
else return 800
|
||||
|
||||
/mob/living/carbon/slime/proc/get_hunger_nutrition() // Below it we will always eat
|
||||
if (is_adult) return 600
|
||||
else return 500
|
||||
|
||||
/mob/living/carbon/slime/proc/get_starve_nutrition() // Below it we will eat before everything else
|
||||
if (is_adult) return 300
|
||||
else return 200
|
||||
|
||||
/mob/living/carbon/slime/proc/will_hunt(var/hunger = -1) // Check for being stopped from feeding and chasing
|
||||
if (hunger == 2 || rabid || attacked) return 1
|
||||
if (Leader) return 0
|
||||
if (holding_still) return 0
|
||||
return 1
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
icon = 'icons/mob/slimes.dmi'
|
||||
icon_state = "grey baby slime"
|
||||
pass_flags = PASSTABLE
|
||||
speak_emote = list("hums")
|
||||
var/is_adult = 0
|
||||
speak_emote = list("telepathically chirps")
|
||||
|
||||
layer = 5
|
||||
|
||||
@@ -12,7 +13,7 @@
|
||||
gender = NEUTER
|
||||
|
||||
update_icon = 0
|
||||
nutrition = 700 // 1000 = max
|
||||
nutrition = 700
|
||||
|
||||
see_in_dark = 8
|
||||
update_slimes = 0
|
||||
@@ -22,67 +23,58 @@
|
||||
status_flags = CANPARALYSE|CANPUSH
|
||||
|
||||
var/cores = 1 // the number of /obj/item/slime_extract's the slime has left inside
|
||||
var/mutation_chance = 30 // Chance of mutating, should be between 25 and 35
|
||||
|
||||
var/powerlevel = 0 // 1-10 controls how much electricity they are generating
|
||||
var/amount_grown = 0 // controls how long the slime has been overfed, if 10, grows into an adult
|
||||
// if adult: if 10: reproduces
|
||||
var/powerlevel = 0 // 1-10 controls how much electricity they are generating
|
||||
var/amount_grown = 0 // controls how long the slime has been overfed, if 10, grows or reproduces
|
||||
|
||||
var/number = 0 // Used to understand when someone is talking to it
|
||||
|
||||
var/mob/living/Victim = null // the person the slime is currently feeding on
|
||||
var/mob/living/Target = null // AI variable - tells the slime to hunt this down
|
||||
var/mob/living/Leader = null // AI variable - tells the slime to follow this person
|
||||
|
||||
var/attacked = 0 // determines if it's been attacked recently. Can be any number, is a cooloff-ish variable
|
||||
var/tame = 0 // if set to 1, the slime will not eat humans ever, or attack them
|
||||
var/rabid = 0 // if set to 1, the slime will attack and eat anything it comes in contact with
|
||||
var/attacked = 0 // Determines if it's been attacked recently. Can be any number, is a cooloff-ish variable
|
||||
var/rabid = 0 // If set to 1, the slime will attack and eat anything it comes in contact with
|
||||
var/holding_still = 0 // AI variable, cooloff-ish for how long it's going to stay in one place
|
||||
var/target_patience = 0 // AI variable, cooloff-ish for how long it's going to follow its target
|
||||
|
||||
var/list/Friends = list() // A list of potential friends
|
||||
var/list/FriendsWeight = list() // A list containing values respective to Friends. This determines how many times a slime "likes" something. If the slime likes it more than 2 times, it becomes a friend
|
||||
var/list/Friends = list() // A list of friends; they are not considered targets for feeding; passed down after splitting
|
||||
|
||||
// slimes pass on genetic data, so all their offspring have the same "Friends",
|
||||
var/list/speech_buffer = list() // Last phrase said near it and person who said it
|
||||
|
||||
var/mood = "" // To show its face
|
||||
|
||||
///////////TIME FOR SUBSPECIES
|
||||
|
||||
var/colour = "grey"
|
||||
var/primarytype = /mob/living/carbon/slime
|
||||
var/mutationone = /mob/living/carbon/slime/orange
|
||||
var/mutationtwo = /mob/living/carbon/slime/metal
|
||||
var/mutationthree = /mob/living/carbon/slime/blue
|
||||
var/mutationfour = /mob/living/carbon/slime/purple
|
||||
var/adulttype = /mob/living/carbon/slime/adult
|
||||
var/coretype = /obj/item/slime_extract/grey
|
||||
|
||||
/mob/living/carbon/slime/adult
|
||||
name = "adult slime"
|
||||
icon = 'icons/mob/slimes.dmi'
|
||||
icon_state = "grey adult slime"
|
||||
speak_emote = list("telepathically chirps")
|
||||
|
||||
health = 200
|
||||
gender = NEUTER
|
||||
|
||||
update_icon = 0
|
||||
nutrition = 800 // 1200 = max
|
||||
|
||||
var/list/slime_mutation[4]
|
||||
|
||||
/mob/living/carbon/slime/New()
|
||||
var/datum/reagents/R = new/datum/reagents(100)
|
||||
reagents = R
|
||||
R.my_atom = src
|
||||
if(name == "baby slime")
|
||||
name = text("[colour] baby slime ([rand(1, 1000)])")
|
||||
else
|
||||
name = text("[colour] adult slime ([rand(1,1000)])")
|
||||
real_name = name
|
||||
spawn (1)
|
||||
regenerate_icons()
|
||||
src << "\blue Your icons have been generated!"
|
||||
create_reagents(100)
|
||||
spawn (0)
|
||||
number = rand(1, 1000)
|
||||
name = "[colour] [is_adult ? "adult" : "baby"] slime ([number])"
|
||||
icon_state = "[colour] [is_adult ? "adult" : "baby"] slime"
|
||||
real_name = name
|
||||
slime_mutation = mutation_table(colour)
|
||||
mutation_chance = rand(25, 35)
|
||||
var/sanitizedcolour = replacetext(colour, " ", "")
|
||||
coretype = text2path("/obj/item/slime_extract/[sanitizedcolour]")
|
||||
..()
|
||||
|
||||
/mob/living/carbon/slime/adult/New()
|
||||
//verbs.Remove(/mob/living/carbon/slime/verb/ventcrawl)
|
||||
/mob/living/carbon/slime/regenerate_icons()
|
||||
icon_state = "[colour] [is_adult ? "adult" : "baby"] slime"
|
||||
overlays.len = 0
|
||||
if (mood)
|
||||
overlays += image('icons/mob/slimes.dmi', icon_state = "aslime-[mood]")
|
||||
..()
|
||||
|
||||
/mob/living/carbon/slime/movement_delay()
|
||||
if (bodytemperature >= 330.23) // 135 F
|
||||
return -1 // slimes become supercharged at high temperatures
|
||||
|
||||
var/tally = 0
|
||||
|
||||
var/health_deficiency = (100 - health)
|
||||
@@ -92,115 +84,93 @@
|
||||
tally += (283.222 - bodytemperature) / 10 * 1.75
|
||||
|
||||
if(reagents)
|
||||
if(reagents.has_reagent("hyperzine")) // hyperzine slows slimes down
|
||||
tally *= 2 // moves twice as slow
|
||||
if(reagents.has_reagent("hyperzine")) // Hyperzine slows slimes down
|
||||
tally *= 2
|
||||
|
||||
if(reagents.has_reagent("frostoil")) // frostoil also makes them move VEEERRYYYYY slow
|
||||
if(reagents.has_reagent("frostoil")) // Frostoil also makes them move VEEERRYYYYY slow
|
||||
tally *= 5
|
||||
|
||||
if(health <= 0) // if damaged, the slime moves twice as slow
|
||||
tally *= 2
|
||||
|
||||
if (bodytemperature >= 330.23) // 135 F
|
||||
return -1 // slimes become supercharged at high temperatures
|
||||
|
||||
return tally+config.slime_delay
|
||||
|
||||
return tally + config.slime_delay
|
||||
|
||||
/mob/living/carbon/slime/Bump(atom/movable/AM as mob|obj, yes)
|
||||
spawn( 0 )
|
||||
if ((!( yes ) || now_pushing))
|
||||
return
|
||||
now_pushing = 1
|
||||
if ((!(yes) || now_pushing))
|
||||
return
|
||||
now_pushing = 1
|
||||
|
||||
if(isobj(AM))
|
||||
if(!client && powerlevel > 0)
|
||||
var/probab = 10
|
||||
switch(powerlevel)
|
||||
if(1 to 2) probab = 20
|
||||
if(3 to 4) probab = 30
|
||||
if(5 to 6) probab = 40
|
||||
if(7 to 8) probab = 60
|
||||
if(9) probab = 70
|
||||
if(10) probab = 95
|
||||
if(prob(probab))
|
||||
if(isobj(AM))
|
||||
if(!client && powerlevel > 0)
|
||||
var/probab = 10
|
||||
switch(powerlevel)
|
||||
if(1 to 2) probab = 20
|
||||
if(3 to 4) probab = 30
|
||||
if(5 to 6) probab = 40
|
||||
if(7 to 8) probab = 60
|
||||
if(9) probab = 70
|
||||
if(10) probab = 95
|
||||
if(prob(probab))
|
||||
if(istype(AM, /obj/structure/window) || istype(AM, /obj/structure/grille))
|
||||
if(nutrition <= get_hunger_nutrition() && !Atkcool)
|
||||
if (is_adult || prob(5))
|
||||
AM.attack_slime(src)
|
||||
spawn()
|
||||
Atkcool = 1
|
||||
sleep(45)
|
||||
Atkcool = 0
|
||||
|
||||
if(ismob(AM))
|
||||
var/mob/tmob = AM
|
||||
|
||||
if(istype(AM, /obj/structure/window) || istype(AM, /obj/structure/grille))
|
||||
if(istype(src, /mob/living/carbon/slime/adult))
|
||||
if(nutrition <= 600 && !Atkcool)
|
||||
AM.attack_slime(src)
|
||||
spawn()
|
||||
Atkcool = 1
|
||||
sleep(15)
|
||||
Atkcool = 0
|
||||
else
|
||||
if(nutrition <= 500 && !Atkcool)
|
||||
if(prob(5))
|
||||
AM.attack_slime(src)
|
||||
spawn()
|
||||
Atkcool = 1
|
||||
sleep(15)
|
||||
Atkcool = 0
|
||||
|
||||
if(ismob(AM))
|
||||
var/mob/tmob = AM
|
||||
|
||||
if(istype(src, /mob/living/carbon/slime/adult))
|
||||
if(istype(tmob, /mob/living/carbon/human))
|
||||
if(prob(90))
|
||||
now_pushing = 0
|
||||
return
|
||||
else
|
||||
if(istype(tmob, /mob/living/carbon/human))
|
||||
if(is_adult)
|
||||
if(istype(tmob, /mob/living/carbon/human))
|
||||
if(prob(90))
|
||||
now_pushing = 0
|
||||
return
|
||||
else
|
||||
if(istype(tmob, /mob/living/carbon/human))
|
||||
now_pushing = 0
|
||||
return
|
||||
|
||||
now_pushing = 0
|
||||
..()
|
||||
if (!( istype(AM, /atom/movable) ))
|
||||
return
|
||||
if (!( now_pushing ))
|
||||
now_pushing = 1
|
||||
if (!( AM.anchored ))
|
||||
var/t = get_dir(src, AM)
|
||||
if (istype(AM, /obj/structure/window))
|
||||
if(AM:ini_dir == NORTHWEST || AM:ini_dir == NORTHEAST || AM:ini_dir == SOUTHWEST || AM:ini_dir == SOUTHEAST)
|
||||
for(var/obj/structure/window/win in get_step(AM,t))
|
||||
now_pushing = 0
|
||||
return
|
||||
step(AM, t)
|
||||
now_pushing = null
|
||||
now_pushing = 0
|
||||
..()
|
||||
if (!istype(AM, /atom/movable))
|
||||
return
|
||||
return
|
||||
if (!( now_pushing ))
|
||||
now_pushing = 1
|
||||
if (!( AM.anchored ))
|
||||
var/t = get_dir(src, AM)
|
||||
if (istype(AM, /obj/structure/window))
|
||||
if(AM:ini_dir == NORTHWEST || AM:ini_dir == NORTHEAST || AM:ini_dir == SOUTHWEST || AM:ini_dir == SOUTHEAST)
|
||||
for(var/obj/structure/window/win in get_step(AM,t))
|
||||
now_pushing = 0
|
||||
return
|
||||
step(AM, t)
|
||||
now_pushing = null
|
||||
|
||||
/mob/living/carbon/slime/Process_Spacemove()
|
||||
return 2
|
||||
|
||||
|
||||
/mob/living/carbon/slime/Stat()
|
||||
..()
|
||||
|
||||
statpanel("Status")
|
||||
if(istype(src, /mob/living/carbon/slime/adult))
|
||||
if(is_adult)
|
||||
stat(null, "Health: [round((health / 200) * 100)]%")
|
||||
else
|
||||
stat(null, "Health: [round((health / 150) * 100)]%")
|
||||
|
||||
|
||||
if (client.statpanel == "Status")
|
||||
if(istype(src,/mob/living/carbon/slime/adult))
|
||||
stat(null, "Nutrition: [nutrition]/1200")
|
||||
if(amount_grown >= 10)
|
||||
stat(null, "Nutrition: [nutrition]/[get_max_nutrition()]")
|
||||
if(amount_grown >= 10)
|
||||
if(is_adult)
|
||||
stat(null, "You can reproduce!")
|
||||
else
|
||||
stat(null, "Nutrition: [nutrition]/1000")
|
||||
if(amount_grown >= 10)
|
||||
else
|
||||
stat(null, "You can evolve!")
|
||||
|
||||
stat(null,"Power Level: [powerlevel]")
|
||||
|
||||
|
||||
/mob/living/carbon/slime/adjustFireLoss(amount)
|
||||
..(-abs(amount)) // Heals them
|
||||
return
|
||||
@@ -210,25 +180,18 @@
|
||||
..(Proj)
|
||||
return 0
|
||||
|
||||
|
||||
/mob/living/carbon/slime/emp_act(severity)
|
||||
powerlevel = 0 // oh no, the power!
|
||||
..()
|
||||
|
||||
/mob/living/carbon/slime/ex_act(severity)
|
||||
|
||||
if (stat == 2 && client)
|
||||
return
|
||||
|
||||
else if (stat == 2 && !client)
|
||||
del(src)
|
||||
return
|
||||
..()
|
||||
|
||||
var/b_loss = null
|
||||
var/f_loss = null
|
||||
switch (severity)
|
||||
if (1.0)
|
||||
b_loss += 500
|
||||
del(src)
|
||||
return
|
||||
|
||||
if (2.0)
|
||||
@@ -260,7 +223,7 @@
|
||||
|
||||
//paralysis += 1
|
||||
|
||||
show_message("\red The blob attacks you!")
|
||||
show_message("<span class='userdanger'> The blob attacks you!</span>")
|
||||
|
||||
adjustFireLoss(damage)
|
||||
|
||||
@@ -271,7 +234,6 @@
|
||||
/mob/living/carbon/slime/u_equip(obj/item/W as obj)
|
||||
return
|
||||
|
||||
|
||||
/mob/living/carbon/slime/attack_ui(slot)
|
||||
return
|
||||
|
||||
@@ -286,52 +248,48 @@
|
||||
updatehealth()
|
||||
return
|
||||
|
||||
|
||||
/mob/living/carbon/slime/attack_slime(mob/living/carbon/slime/M as mob)
|
||||
if (!ticker)
|
||||
M << "You cannot attack people before the game has started."
|
||||
return
|
||||
|
||||
if(Victim) return // can't attack while eating!
|
||||
if (Victim) return // can't attack while eating!
|
||||
|
||||
if (health > -100)
|
||||
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>The [M.name] has glomped []!</B>", src), 1)
|
||||
|
||||
visible_message("<span class='danger'> The [M.name] has glomped [src]!</span>", \
|
||||
"<span class='userdanger'> The [M.name] has glomped [src]!</span>")
|
||||
var/damage = rand(1, 3)
|
||||
attacked += 5
|
||||
|
||||
if(istype(src, /mob/living/carbon/slime/adult))
|
||||
if(M.is_adult)
|
||||
damage = rand(1, 6)
|
||||
else
|
||||
damage = rand(1, 3)
|
||||
|
||||
adjustBruteLoss(damage)
|
||||
|
||||
|
||||
updatehealth()
|
||||
|
||||
return
|
||||
|
||||
|
||||
/mob/living/carbon/slime/attack_animal(mob/living/simple_animal/M as mob)
|
||||
if(M.melee_damage_upper == 0)
|
||||
M.emote("[M.friendly] [src]")
|
||||
else
|
||||
if(M.attack_sound)
|
||||
playsound(loc, M.attack_sound, 50, 1, 1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message("\red <B>[M]</B> [M.attacktext] [src]!", 1)
|
||||
visible_message("<span class='danger'>[M] [M.attacktext] [src]!</span>", \
|
||||
"<span class='userdanger'>[M] [M.attacktext] [src]!</span>")
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='red'>attacked [src.name] ([src.ckey])</font>")
|
||||
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>was attacked by [M.name] ([M.ckey])</font>")
|
||||
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
|
||||
attacked += 10
|
||||
adjustBruteLoss(damage)
|
||||
updatehealth()
|
||||
|
||||
/mob/living/carbon/slime/attack_paw(mob/living/carbon/monkey/M as mob)
|
||||
if(!(istype(M, /mob/living/carbon/monkey))) return//Fix for aliens receiving double messages when attacking other aliens.
|
||||
if(!(istype(M, /mob/living/carbon/monkey)))
|
||||
return // Fix for aliens receiving double messages when attacking other aliens.
|
||||
|
||||
if (!ticker)
|
||||
M << "You cannot attack people before the game has started."
|
||||
@@ -340,6 +298,7 @@
|
||||
if (istype(loc, /turf) && istype(loc.loc, /area/start))
|
||||
M << "No attacking people at spawn, you jackass."
|
||||
return
|
||||
|
||||
..()
|
||||
|
||||
switch(M.a_intent)
|
||||
@@ -352,9 +311,8 @@
|
||||
if (health > 0)
|
||||
attacked += 10
|
||||
//playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[M.name] has attacked [src]!</B>"), 1)
|
||||
visible_message("<span class='danger'>[M.name] has attacked [src]!</span>", \
|
||||
"<span class='userdanger'>[M.name] has attacked [src]!</span>")
|
||||
adjustBruteLoss(rand(1, 3))
|
||||
updatehealth()
|
||||
return
|
||||
@@ -374,15 +332,11 @@
|
||||
if(Victim)
|
||||
if(Victim == M)
|
||||
if(prob(60))
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message("\red [M] attempts to wrestle \the [name] off!", 1)
|
||||
visible_message("<span class='warning'>[M] attempts to wrestle \the [name] off!</span>")
|
||||
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
|
||||
|
||||
else
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message("\red [M] manages to wrestle \the [name] off!", 1)
|
||||
visible_message("<span class='warning'> [M] manages to wrestle \the [name] off!</span>")
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
|
||||
if(prob(90) && !client)
|
||||
@@ -402,21 +356,17 @@
|
||||
|
||||
else
|
||||
if(prob(30))
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message("\red [M] attempts to wrestle \the [name] off of [Victim]!", 1)
|
||||
visible_message("<span class='warning'>[M] attempts to wrestle \the [name] off of [Victim]!</span>")
|
||||
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
|
||||
|
||||
else
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message("\red [M] manages to wrestle \the [name] off of [Victim]!", 1)
|
||||
visible_message("<span class='warning'> [M] manages to wrestle \the [name] off of [Victim]!</span>")
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
|
||||
if(prob(80) && !client)
|
||||
Discipline++
|
||||
|
||||
if(!istype(src, /mob/living/carbon/slime/adult))
|
||||
if(!is_adult)
|
||||
if(Discipline == 1)
|
||||
attacked = 0
|
||||
|
||||
@@ -432,18 +382,13 @@
|
||||
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
if(M.gloves && istype(M.gloves,/obj/item/clothing/gloves))
|
||||
var/obj/item/clothing/gloves/G = M.gloves
|
||||
if(G.cell)
|
||||
if(M.a_intent == "hurt")//Stungloves. Any contact will stun the alien.
|
||||
if(G.cell.charge >= 2500)
|
||||
G.cell.use(2500)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message("\red <B>[src] has been touched with the stun gloves by [M]!</B>", 1, "\red You hear someone fall.", 2)
|
||||
visible_message("<span class='warning'>[src] has been touched with the stun gloves by [M]!</span>")
|
||||
return
|
||||
else
|
||||
M << "\red Not enough charge! "
|
||||
@@ -455,21 +400,18 @@
|
||||
help_shake_act(M)
|
||||
|
||||
if ("grab")
|
||||
if (M == src)
|
||||
if (M == src || anchored)
|
||||
return
|
||||
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M, src )
|
||||
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, src)
|
||||
|
||||
M.put_in_active_hand(G)
|
||||
|
||||
grabbed_by += G
|
||||
G.synch()
|
||||
|
||||
LAssailant = M
|
||||
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red [] has grabbed [] passively!", M, src), 1)
|
||||
visible_message("<span class='warning'>[M] has grabbed [src] passively!</span>")
|
||||
|
||||
else
|
||||
|
||||
@@ -479,8 +421,9 @@
|
||||
if (prob(90))
|
||||
if (HULK in M.mutations)
|
||||
damage += 5
|
||||
if(Victim)
|
||||
if(Victim || Target)
|
||||
Victim = null
|
||||
Target = null
|
||||
anchored = 0
|
||||
if(prob(80) && !client)
|
||||
Discipline++
|
||||
@@ -492,17 +435,14 @@
|
||||
|
||||
|
||||
playsound(loc, "punch", 25, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] has punched []!</B>", M, src), 1)
|
||||
visible_message("<span class='danger'>[M] has punched [src]!</span>", \
|
||||
"<span class='userdanger'>[M] has punched [src]!</span>")
|
||||
|
||||
adjustBruteLoss(damage)
|
||||
updatehealth()
|
||||
else
|
||||
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] has attempted to punch []!</B>", M, src), 1)
|
||||
visible_message("<span class='danger'>[M] has attempted to punch [src]!</span>")
|
||||
return
|
||||
|
||||
|
||||
@@ -518,48 +458,41 @@
|
||||
|
||||
switch(M.a_intent)
|
||||
if ("help")
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\blue [M] caresses [src] with its scythe like arm."), 1)
|
||||
visible_message("<span class='notice'>[M] caresses [src] with its scythe like arm.</span>")
|
||||
|
||||
if ("hurt")
|
||||
|
||||
if ((prob(95) && health > 0))
|
||||
if (prob(95))
|
||||
attacked += 10
|
||||
playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
|
||||
var/damage = rand(15, 30)
|
||||
if (damage >= 25)
|
||||
damage = rand(20, 40)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] has attacked [name]!</B>", M), 1)
|
||||
visible_message("<span class='danger'>[M] has attacked [name]!</span>", \
|
||||
"<span class='userdanger'>[M] has attacked [name]!</span>")
|
||||
else
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] has wounded [name]!</B>", M), 1)
|
||||
visible_message("<span class='danger'>[M] has wounded [name]!</span>", \
|
||||
"<span class='userdanger'>)[M] has wounded [name]!</span>")
|
||||
adjustBruteLoss(damage)
|
||||
updatehealth()
|
||||
else
|
||||
playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] has attempted to lunge at [name]!</B>", M), 1)
|
||||
visible_message("<span class='danger'>[M] has attempted to lunge at [name]!</span>", \
|
||||
"<span class='userdanger'>[M] has attempted to lunge at [name]!</span>")
|
||||
|
||||
if ("grab")
|
||||
if (M == src)
|
||||
if (M == src || anchored)
|
||||
return
|
||||
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M, M, src )
|
||||
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, src )
|
||||
|
||||
M.put_in_active_hand(G)
|
||||
|
||||
grabbed_by += G
|
||||
G.synch()
|
||||
|
||||
LAssailant = M
|
||||
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message(text("\red [] has grabbed [name] passively!", M), 1)
|
||||
visible_message("<span class='warning'> [M] has grabbed [name] passively!</span>")
|
||||
|
||||
if ("disarm")
|
||||
playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1)
|
||||
@@ -567,12 +500,12 @@
|
||||
attacked += 10
|
||||
|
||||
if(prob(95))
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] has tackled [name]!</B>", M), 1)
|
||||
visible_message("<span class='danger'>[M] has tackled [name]!</span>", \
|
||||
"<span class='userdanger'>[M] has tackled [name]!</span>")
|
||||
|
||||
if(Victim)
|
||||
if(Victim || Target)
|
||||
Victim = null
|
||||
Target = null
|
||||
anchored = 0
|
||||
if(prob(80) && !client)
|
||||
Discipline++
|
||||
@@ -593,68 +526,123 @@
|
||||
|
||||
else
|
||||
drop_item()
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] has disarmed [name]!</B>", M), 1)
|
||||
visible_message("<span class='danger'>[M] has disarmed [name]!</span>",
|
||||
"<span class='userdanger'>[M] has disarmed [name]!</span>")
|
||||
adjustBruteLoss(damage)
|
||||
updatehealth()
|
||||
return
|
||||
|
||||
/mob/living/carbon/slime/attackby(obj/item/W, mob/user)
|
||||
if(W.force > 0)
|
||||
attacked += 10
|
||||
if(prob(25))
|
||||
user << "<span class='danger'>[W] passes right through [src]!</span>"
|
||||
return
|
||||
if(Discipline && prob(50)) // wow, buddy, why am I getting attacked??
|
||||
Discipline = 0
|
||||
if(W.force >= 3)
|
||||
if(is_adult)
|
||||
if(prob(5 + round(W.force/2)))
|
||||
if(Victim || Target)
|
||||
if(prob(80) && !client)
|
||||
Discipline++
|
||||
|
||||
Victim = null
|
||||
Target = null
|
||||
anchored = 0
|
||||
|
||||
spawn()
|
||||
SStun = 1
|
||||
sleep(rand(5,20))
|
||||
SStun = 0
|
||||
|
||||
spawn(0)
|
||||
if(user)
|
||||
canmove = 0
|
||||
step_away(src, user)
|
||||
if(prob(25 + W.force))
|
||||
sleep(2)
|
||||
if(user)
|
||||
step_away(src, user)
|
||||
canmove = 1
|
||||
|
||||
else
|
||||
if(prob(10 + W.force*2))
|
||||
if(Victim || Target)
|
||||
if(prob(80) && !client)
|
||||
Discipline++
|
||||
if(Discipline == 1)
|
||||
attacked = 0
|
||||
spawn()
|
||||
SStun = 1
|
||||
sleep(rand(5,20))
|
||||
SStun = 0
|
||||
|
||||
Victim = null
|
||||
Target = null
|
||||
anchored = 0
|
||||
|
||||
spawn(0)
|
||||
if(user)
|
||||
canmove = 0
|
||||
step_away(src, user)
|
||||
if(prob(25 + W.force*4))
|
||||
sleep(2)
|
||||
if(user)
|
||||
step_away(src, user)
|
||||
canmove = 1
|
||||
..()
|
||||
|
||||
/mob/living/carbon/slime/restrained()
|
||||
return 0
|
||||
|
||||
|
||||
mob/living/carbon/slime/var/co2overloadtime = null
|
||||
mob/living/carbon/slime/var/temperature_resistance = T0C+75
|
||||
|
||||
|
||||
/mob/living/carbon/slime/show_inv(mob/user as mob)
|
||||
|
||||
user.set_machine(src)
|
||||
var/dat = {"
|
||||
<B><HR><FONT size=3>[name]</FONT></B>
|
||||
<BR><HR><BR>
|
||||
<BR><A href='?src=\ref[user];mach_close=mob[name]'>Close</A>
|
||||
<BR>"}
|
||||
user << browse(dat, text("window=mob[name];size=340x480"))
|
||||
onclose(user, "mob[name]")
|
||||
/mob/living/carbon/slime/show_inv(mob/user)
|
||||
return
|
||||
|
||||
/mob/living/carbon/slime/updatehealth()
|
||||
if(status_flags & GODMODE)
|
||||
if(istype(src, /mob/living/carbon/slime/adult))
|
||||
health = 200
|
||||
else
|
||||
health = 150
|
||||
stat = CONSCIOUS
|
||||
else
|
||||
// slimes can't suffocate unless they suicide. They are also not harmed by fire
|
||||
if(istype(src, /mob/living/carbon/slime/adult))
|
||||
health = 200 - (getOxyLoss() + getToxLoss() + getFireLoss() + getBruteLoss() + getCloneLoss())
|
||||
else
|
||||
health = 150 - (getOxyLoss() + getToxLoss() + getFireLoss() + getBruteLoss() + getCloneLoss())
|
||||
/mob/living/carbon/slime/toggle_throw_mode()
|
||||
return
|
||||
|
||||
/mob/living/carbon/slime/proc/apply_water()
|
||||
adjustToxLoss(rand(15,20))
|
||||
if (!client)
|
||||
if (Target) // Like cats
|
||||
Target = null
|
||||
++Discipline
|
||||
return
|
||||
|
||||
/obj/item/slime_extract
|
||||
name = "slime extract"
|
||||
desc = "Goo extracted from a slime. Legends claim these to have \"magical powers\"."
|
||||
icon = 'icons/mob/slimes.dmi'
|
||||
icon_state = "grey slime extract"
|
||||
flags = TABLEPASS
|
||||
force = 1.0
|
||||
w_class = 1.0
|
||||
throwforce = 1.0
|
||||
throwforce = 0
|
||||
throw_speed = 3
|
||||
throw_range = 6
|
||||
origin_tech = "biotech=4"
|
||||
var/Uses = 1 // uses before it goes inert
|
||||
var/enhanced = 0 //has it been enhanced before?
|
||||
|
||||
attackby(obj/item/O as obj, mob/user as mob)
|
||||
if(istype(O, /obj/item/weapon/slimesteroid2))
|
||||
if(enhanced == 1)
|
||||
user << "<span class='warning'> This extract has already been enhanced!</span>"
|
||||
return ..()
|
||||
if(Uses == 0)
|
||||
user << "<span class='warning'> You can't enhance a used extract!</span>"
|
||||
return ..()
|
||||
user <<"You apply the enhancer. It now has triple the amount of uses."
|
||||
Uses = 3
|
||||
enhanced = 1
|
||||
del(O)
|
||||
|
||||
/obj/item/slime_extract/New()
|
||||
..()
|
||||
var/datum/reagents/R = new/datum/reagents(100)
|
||||
reagents = R
|
||||
R.my_atom = src
|
||||
create_reagents(100)
|
||||
|
||||
/obj/item/slime_extract/grey
|
||||
name = "grey slime extract"
|
||||
@@ -724,6 +712,26 @@ mob/living/carbon/slime/var/temperature_resistance = T0C+75
|
||||
name = "adamantine slime extract"
|
||||
icon_state = "adamantine slime extract"
|
||||
|
||||
/obj/item/slime_extract/bluespace
|
||||
name = "bluespace slime extract"
|
||||
icon_state = "bluespace slime extract"
|
||||
|
||||
/obj/item/slime_extract/pyrite
|
||||
name = "pyrite slime extract"
|
||||
icon_state = "pyrite slime extract"
|
||||
|
||||
/obj/item/slime_extract/cerulean
|
||||
name = "cerulean slime extract"
|
||||
icon_state = "cerulean slime extract"
|
||||
|
||||
/obj/item/slime_extract/sepia
|
||||
name = "sepia slime extract"
|
||||
icon_state = "sepia slime extract"
|
||||
|
||||
/obj/item/slime_extract/rainbow
|
||||
name = "rainbow slime extract"
|
||||
icon_state = "rainbow slime extract"
|
||||
|
||||
////Pet Slime Creation///
|
||||
|
||||
/obj/item/weapon/slimepotion
|
||||
@@ -734,28 +742,31 @@ mob/living/carbon/slime/var/temperature_resistance = T0C+75
|
||||
|
||||
attack(mob/living/carbon/slime/M as mob, mob/user as mob)
|
||||
if(!istype(M, /mob/living/carbon/slime))//If target is not a slime.
|
||||
user << "\red The potion only works on baby slimes!"
|
||||
user << "<span class='warning'> The potion only works on baby slimes!</span>"
|
||||
return ..()
|
||||
if(istype(M, /mob/living/carbon/slime/adult)) //Can't tame adults
|
||||
user << "\red Only baby slimes can be tamed!"
|
||||
if(M.is_adult) //Can't tame adults
|
||||
user << "<span class='warning'> Only baby slimes can be tamed!</span>"
|
||||
return..()
|
||||
if(M.stat)
|
||||
user << "\red The slime is dead!"
|
||||
user << "<span class='warning'> The slime is dead!</span>"
|
||||
return..()
|
||||
if(M.mind)
|
||||
user << "<span class='warning'> The slime resists!</span>"
|
||||
return ..()
|
||||
var/mob/living/simple_animal/slime/pet = new /mob/living/simple_animal/slime(M.loc)
|
||||
pet.icon_state = "[M.colour] baby slime"
|
||||
pet.icon_living = "[M.colour] baby slime"
|
||||
pet.icon_dead = "[M.colour] baby slime dead"
|
||||
pet.colour = "[M.colour]"
|
||||
user <<"You feed the slime the potion, removing it's powers and calming it."
|
||||
del (M)
|
||||
del(M)
|
||||
var/newname = copytext(sanitize(input(user, "Would you like to give the slime a name?", "Name your new pet", "pet slime") as null|text),1,MAX_NAME_LEN)
|
||||
|
||||
if (!newname)
|
||||
newname = "pet slime"
|
||||
pet.name = newname
|
||||
pet.real_name = newname
|
||||
del (src)
|
||||
del(src)
|
||||
|
||||
/obj/item/weapon/slimepotion2
|
||||
name = "advanced docility potion"
|
||||
@@ -763,27 +774,30 @@ mob/living/carbon/slime/var/temperature_resistance = T0C+75
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle19"
|
||||
|
||||
attack(mob/living/carbon/slime/adult/M as mob, mob/user as mob)
|
||||
if(!istype(M, /mob/living/carbon/slime/adult))//If target is not a slime.
|
||||
user << "\red The potion only works on adult slimes!"
|
||||
attack(mob/living/carbon/slime/M as mob, mob/user as mob)
|
||||
if(!istype(M, /mob/living/carbon/slime/))//If target is not a slime.
|
||||
user << "<span class='warning'> The potion only works on slimes!</span>"
|
||||
return ..()
|
||||
if(M.stat)
|
||||
user << "\red The slime is dead!"
|
||||
user << "<span class='warning'> The slime is dead!</span>"
|
||||
return..()
|
||||
if(M.mind)
|
||||
user << "<span class='warning'> The slime resists!</span>"
|
||||
return ..()
|
||||
var/mob/living/simple_animal/adultslime/pet = new /mob/living/simple_animal/adultslime(M.loc)
|
||||
pet.icon_state = "[M.colour] adult slime"
|
||||
pet.icon_living = "[M.colour] adult slime"
|
||||
pet.icon_dead = "[M.colour] baby slime dead"
|
||||
pet.colour = "[M.colour]"
|
||||
user <<"You feed the slime the potion, removing it's powers and calming it."
|
||||
del (M)
|
||||
del(M)
|
||||
var/newname = copytext(sanitize(input(user, "Would you like to give the slime a name?", "Name your new pet", "pet slime") as null|text),1,MAX_NAME_LEN)
|
||||
|
||||
if (!newname)
|
||||
newname = "pet slime"
|
||||
pet.name = newname
|
||||
pet.real_name = newname
|
||||
del (src)
|
||||
del(src)
|
||||
|
||||
|
||||
/obj/item/weapon/slimesteroid
|
||||
@@ -794,25 +808,45 @@ mob/living/carbon/slime/var/temperature_resistance = T0C+75
|
||||
|
||||
attack(mob/living/carbon/slime/M as mob, mob/user as mob)
|
||||
if(!istype(M, /mob/living/carbon/slime))//If target is not a slime.
|
||||
user << "\red The steroid only works on baby slimes!"
|
||||
user << "<span class='warning'> The steroid only works on baby slimes!</span>"
|
||||
return ..()
|
||||
if(istype(M, /mob/living/carbon/slime/adult)) //Can't tame adults
|
||||
user << "\red Only baby slimes can use the steroid!"
|
||||
if(M.is_adult) //Can't tame adults
|
||||
user << "<span class='warning'> Only baby slimes can use the steroid!</span>"
|
||||
return..()
|
||||
if(M.stat)
|
||||
user << "\red The slime is dead!"
|
||||
user << "<span class='warning'> The slime is dead!</span>"
|
||||
return..()
|
||||
if(M.cores == 3)
|
||||
user <<"\red The slime already has the maximum amount of extract!"
|
||||
user <<"<span class='warning'> The slime already has the maximum amount of extract!</span>"
|
||||
return..()
|
||||
|
||||
user <<"You feed the slime the steroid. It now has triple the amount of extract."
|
||||
M.cores = 3
|
||||
del (src)
|
||||
del(src)
|
||||
|
||||
/obj/item/weapon/slimesteroid2
|
||||
name = "extract enhancer"
|
||||
desc = "A potent chemical mix that will give a slime extract three uses."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle17"
|
||||
|
||||
/*afterattack(obj/target, mob/user , flag)
|
||||
if(istype(target, /obj/item/slime_extract))
|
||||
if(target.enhanced == 1)
|
||||
user << "<span class='warning'> This extract has already been enhanced!</span>"
|
||||
return ..()
|
||||
if(target.Uses == 0)
|
||||
user << "<span class='warning'> You can't enhance a used extract!</span>"
|
||||
return ..()
|
||||
user <<"You apply the enhancer. It now has triple the amount of uses."
|
||||
target.Uses = 3
|
||||
target.enahnced = 1
|
||||
del(src)*/
|
||||
|
||||
////////Adamantine Golem stuff I dunno where else to put it
|
||||
|
||||
// This will eventually be removed.
|
||||
|
||||
/obj/item/clothing/under/golem
|
||||
name = "adamantine skin"
|
||||
desc = "a golem's skin"
|
||||
@@ -949,6 +983,7 @@ mob/living/carbon/slime/var/temperature_resistance = T0C+75
|
||||
var/area/A = get_area(src)
|
||||
if(A)
|
||||
G << "Golem rune created in [A.name]."
|
||||
|
||||
//////////////////////////////Old shit from metroids/RoRos, and the old cores, would not take much work to re-add them////////////////////////
|
||||
|
||||
/*
|
||||
@@ -958,11 +993,10 @@ mob/living/carbon/slime/var/temperature_resistance = T0C+75
|
||||
desc = "Goo extracted from a slime. Legends claim these to have \"magical powers\"."
|
||||
icon = 'icons/mob/slimes.dmi'
|
||||
icon_state = "slime extract"
|
||||
flags = TABLEPASS
|
||||
force = 1.0
|
||||
w_class = 1.0
|
||||
throwforce = 1.0
|
||||
throw_speed = 3
|
||||
throw_speed = 2
|
||||
throw_range = 6
|
||||
origin_tech = "biotech=4"
|
||||
var/POWERFLAG = 0 // sshhhhhhh
|
||||
@@ -971,9 +1005,7 @@ mob/living/carbon/slime/var/temperature_resistance = T0C+75
|
||||
|
||||
/obj/item/slime_core/New()
|
||||
..()
|
||||
var/datum/reagents/R = new/datum/reagents(100)
|
||||
reagents = R
|
||||
R.my_atom = src
|
||||
create_reagents(100)
|
||||
POWERFLAG = rand(1,10)
|
||||
Uses = rand(7, 25)
|
||||
//flags |= NOREACT
|
||||
@@ -1017,9 +1049,9 @@ mob/living/carbon/slime/var/temperature_resistance = T0C+75
|
||||
/obj/item/weapon/reagent_containers/food/snacks/egg/slime/proc/Hatch()
|
||||
processing_objects.Remove(src)
|
||||
var/turf/T = get_turf(src)
|
||||
src.visible_message("\blue The [name] pulsates and quivers!")
|
||||
src.visible_message("<span class='warning'> The [name] pulsates and quivers!</span>")
|
||||
spawn(rand(50,100))
|
||||
src.visible_message("\blue The [name] bursts open!")
|
||||
src.visible_message("<span class='warning'> The [name] bursts open!</span>")
|
||||
new/mob/living/carbon/slime(T)
|
||||
del(src)
|
||||
|
||||
@@ -1035,4 +1067,4 @@ mob/living/carbon/slime/var/temperature_resistance = T0C+75
|
||||
return
|
||||
else
|
||||
..()
|
||||
*/
|
||||
*/
|
||||
|
||||
@@ -11,12 +11,12 @@
|
||||
|
||||
var/list/choices = list()
|
||||
for(var/mob/living/C in view(1,src))
|
||||
if(C!=src && !istype(C,/mob/living/carbon/slime))
|
||||
if(C!=src && !istype(C,/mob/living/carbon/slime) && Adjacent(C))
|
||||
choices += C
|
||||
|
||||
var/mob/living/carbon/M = input(src,"Who do you wish to feed on?") in null|choices
|
||||
var/mob/living/M = input(src,"Who do you wish to feed on?") in null|choices
|
||||
if(!M) return
|
||||
if(M in view(1, src))
|
||||
if(Adjacent(M))
|
||||
|
||||
if(!istype(src, /mob/living/carbon/brain))
|
||||
if(!istype(M, /mob/living/carbon/slime))
|
||||
@@ -42,76 +42,72 @@
|
||||
|
||||
|
||||
|
||||
/mob/living/carbon/slime/proc/Feedon(var/mob/living/carbon/M)
|
||||
/mob/living/carbon/slime/proc/Feedon(var/mob/living/M)
|
||||
Victim = M
|
||||
src.loc = M.loc
|
||||
canmove = 0
|
||||
anchored = 1
|
||||
var/lastnut = nutrition
|
||||
//if(M.client) M << "\red You legs become paralyzed!"
|
||||
if(istype(src, /mob/living/carbon/slime/adult))
|
||||
var/fed_succesfully = 0
|
||||
if(is_adult)
|
||||
icon_state = "[colour] adult slime eat"
|
||||
else
|
||||
icon_state = "[colour] baby slime eat"
|
||||
|
||||
while(Victim && M.health > -70 && stat != 2)
|
||||
// M.canmove = 0
|
||||
canmove = 0
|
||||
|
||||
if(M in view(1, src))
|
||||
if(Adjacent(M))
|
||||
loc = M.loc
|
||||
|
||||
if(prob(15) && M.client && istype(M, /mob/living/carbon))
|
||||
M << "\red [pick("You can feel your body becoming weak!", \
|
||||
M << "<span class='danger'>[pick("You can feel your body becoming weak!", \
|
||||
"You feel like you're about to die!", \
|
||||
"You feel every part of your body screaming in agony!", \
|
||||
"A low, rolling pain passes through your body!", \
|
||||
"Your body feels as if it's falling apart!", \
|
||||
"You feel extremely weak!", \
|
||||
"A sharp, deep pain bathes every inch of your body!")]"
|
||||
"A sharp, deep pain bathes every inch of your body!")]</span>"
|
||||
|
||||
if(istype(M, /mob/living/carbon))
|
||||
Victim.adjustCloneLoss(rand(1,10))
|
||||
Victim.adjustCloneLoss(rand(5,6))
|
||||
Victim.adjustToxLoss(rand(1,2))
|
||||
if(Victim.health <= 0)
|
||||
Victim.adjustToxLoss(rand(2,4))
|
||||
|
||||
// Heal yourself
|
||||
adjustToxLoss(-10)
|
||||
adjustOxyLoss(-10)
|
||||
adjustBruteLoss(-10)
|
||||
adjustFireLoss(-10)
|
||||
adjustCloneLoss(-10)
|
||||
fed_succesfully = 1
|
||||
|
||||
if(Victim)
|
||||
for(var/mob/living/carbon/slime/slime in view(1,M))
|
||||
if(slime.Victim == M && slime != src)
|
||||
slime.Feedstop()
|
||||
else if(istype(M, /mob/living/simple_animal))
|
||||
Victim.adjustBruteLoss(is_adult ? rand(7, 15) : rand(4, 12))
|
||||
fed_succesfully = 1
|
||||
|
||||
nutrition += rand(10,25)
|
||||
else
|
||||
if(prob(25))
|
||||
src << "<span class='warning'>[pick("This subject is incompatable", \
|
||||
"This subject does not have a life energy", "This subject is empty", \
|
||||
"I am not satisified", "I can not feed from this subject", \
|
||||
"I do not feel nourished", "This subject is not food")]...</span>"
|
||||
|
||||
if(fed_succesfully)
|
||||
//I have no idea why this is not in handle_nutrition()
|
||||
nutrition += rand(15,30)
|
||||
if(nutrition >= lastnut + 50)
|
||||
if(prob(80))
|
||||
lastnut = nutrition
|
||||
powerlevel++
|
||||
if(powerlevel > 10)
|
||||
powerlevel = 10
|
||||
adjustToxLoss(-10)
|
||||
|
||||
if(istype(src, /mob/living/carbon/slime/adult))
|
||||
if(nutrition > 1200)
|
||||
nutrition = 1200
|
||||
else
|
||||
if(nutrition > 1000)
|
||||
nutrition = 1000
|
||||
|
||||
Victim.updatehealth()
|
||||
//Heal yourself.
|
||||
adjustOxyLoss(-10)
|
||||
adjustBruteLoss(-10)
|
||||
adjustFireLoss(-10)
|
||||
adjustCloneLoss(-10)
|
||||
|
||||
updatehealth()
|
||||
|
||||
else
|
||||
if(prob(25))
|
||||
src << "\red <i>[pick("This subject is incompatable", \
|
||||
"This subject does not have a life energy", "This subject is empty", \
|
||||
"I am not satisified", "I can not feed from this subject", \
|
||||
"I do not feel nourished", "This subject is not food")]...</i>"
|
||||
if(Victim)
|
||||
Victim.updatehealth()
|
||||
|
||||
sleep(rand(15,45))
|
||||
|
||||
@@ -119,11 +115,11 @@
|
||||
break
|
||||
|
||||
if(stat == 2)
|
||||
if(!istype(src, /mob/living/carbon/slime/adult))
|
||||
if(!is_adult)
|
||||
icon_state = "[colour] baby slime dead"
|
||||
|
||||
else
|
||||
if(istype(src, /mob/living/carbon/slime/adult))
|
||||
if(is_adult)
|
||||
icon_state = "[colour] adult slime"
|
||||
else
|
||||
icon_state = "[colour] baby slime"
|
||||
@@ -139,7 +135,11 @@
|
||||
if(Victim.LAssailant && Victim.LAssailant != Victim)
|
||||
if(prob(50))
|
||||
if(!(Victim.LAssailant in Friends))
|
||||
Friends.Add(Victim.LAssailant) // no idea why i was using the |= operator
|
||||
Friends[Victim.LAssailant] = 1
|
||||
//Friends.Add(Victim.LAssailant) // no idea why i was using the |= operator
|
||||
else
|
||||
++Friends[Victim.LAssailant]
|
||||
|
||||
|
||||
if(M.client && istype(src, /mob/living/carbon/human))
|
||||
if(prob(85))
|
||||
@@ -173,16 +173,13 @@
|
||||
if(stat)
|
||||
src << "<i>I must be conscious to do this...</i>"
|
||||
return
|
||||
if(!istype(src, /mob/living/carbon/slime/adult))
|
||||
if(!is_adult)
|
||||
if(amount_grown >= 10)
|
||||
var/mob/living/carbon/slime/adult/new_slime = new adulttype(loc)
|
||||
new_slime.nutrition = nutrition
|
||||
new_slime.powerlevel = max(0, powerlevel-1)
|
||||
new_slime.a_intent = "hurt"
|
||||
new_slime.key = key
|
||||
new_slime.universal_speak = universal_speak
|
||||
new_slime << "<B>You are now an adult slime.</B>"
|
||||
del(src)
|
||||
is_adult = 1
|
||||
maxHealth = 200
|
||||
amount_grown = 0
|
||||
regenerate_icons()
|
||||
name = text("[colour] [is_adult ? "adult" : "baby"] slime ([number])")
|
||||
else
|
||||
src << "<i>I am not ready to evolve yet...</i>"
|
||||
else
|
||||
@@ -190,15 +187,14 @@
|
||||
|
||||
/mob/living/carbon/slime/verb/Reproduce()
|
||||
set category = "Slime"
|
||||
set desc = "This will make you split into four Slimes. NOTE: this will KILL you, but you will be transferred into one of the babies."
|
||||
set desc = "This will make you split into four Slimes."
|
||||
|
||||
if(stat)
|
||||
src << "<i>I must be conscious to do this...</i>"
|
||||
return
|
||||
|
||||
if(istype(src, /mob/living/carbon/slime/adult))
|
||||
if(is_adult)
|
||||
if(amount_grown >= 10)
|
||||
//if(input("Are you absolutely sure you want to reproduce? Your current body will cease to be, but your consciousness will be transferred into a produced slime.") in list("Yes","No")=="Yes")
|
||||
if(stat)
|
||||
src << "<i>I must be conscious to do this...</i>"
|
||||
return
|
||||
@@ -207,54 +203,30 @@
|
||||
var/new_nutrition = round(nutrition * 0.9)
|
||||
var/new_powerlevel = round(powerlevel / 4)
|
||||
for(var/i=1,i<=4,i++)
|
||||
if(prob(80))
|
||||
var/mob/living/carbon/slime/M = new primarytype(loc)
|
||||
M.nutrition = new_nutrition
|
||||
M.powerlevel = new_powerlevel
|
||||
if(i != 1) step_away(M,src)
|
||||
babies += M
|
||||
var/mob/living/carbon/slime/M = new /mob/living/carbon/slime/(loc)
|
||||
if(prob(mutation_chance))
|
||||
M.colour = slime_mutation[rand(1,4)]
|
||||
else
|
||||
var/mutations = pick("one","two","three","four")
|
||||
switch(mutations)
|
||||
if("one")
|
||||
var/mob/living/carbon/slime/M = new mutationone(loc)
|
||||
M.nutrition = new_nutrition
|
||||
M.powerlevel = new_powerlevel
|
||||
if(i != 1) step_away(M,src)
|
||||
babies += M
|
||||
if("two")
|
||||
var/mob/living/carbon/slime/M = new mutationtwo(loc)
|
||||
M.nutrition = new_nutrition
|
||||
M.powerlevel = new_powerlevel
|
||||
if(i != 1) step_away(M,src)
|
||||
babies += M
|
||||
if("three")
|
||||
var/mob/living/carbon/slime/M = new mutationthree(loc)
|
||||
M.nutrition = new_nutrition
|
||||
M.powerlevel = new_powerlevel
|
||||
if(i != 1) step_away(M,src)
|
||||
babies += M
|
||||
if("four")
|
||||
var/mob/living/carbon/slime/M = new mutationfour(loc)
|
||||
M.nutrition = new_nutrition
|
||||
M.powerlevel = new_powerlevel
|
||||
if(i != 1) step_away(M,src)
|
||||
babies += M
|
||||
M.colour = colour
|
||||
if(ckey) M.nutrition = new_nutrition //Player slimes are more robust at spliting. Once an oversight of poor copypasta, now a feature!
|
||||
M.powerlevel = new_powerlevel
|
||||
if(i != 1) step_away(M,src)
|
||||
M.Friends = Friends.Copy()
|
||||
babies += M
|
||||
feedback_add_details("slime_babies_born","slimebirth_[replacetext(M.colour," ","_")]")
|
||||
|
||||
var/mob/living/carbon/slime/new_slime = pick(babies)
|
||||
new_slime.a_intent = "hurt"
|
||||
new_slime.universal_speak = universal_speak
|
||||
new_slime.key = key
|
||||
|
||||
new_slime << "<B>You are now a slime!</B>"
|
||||
if(src.mind)
|
||||
src.mind.transfer_to(new_slime)
|
||||
else
|
||||
new_slime.key = src.key
|
||||
del(src)
|
||||
else
|
||||
src << "<i>I am not ready to reproduce yet...</i>"
|
||||
else
|
||||
src << "<i>I am not old enough to reproduce yet...</i>"
|
||||
|
||||
|
||||
|
||||
/mob/living/carbon/slime/verb/ventcrawl()
|
||||
set name = "Crawl through Vent"
|
||||
set desc = "Enter an air vent and crawl through the pipe system."
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
/mob/living/carbon/slime/say(var/message)
|
||||
var/verb = say_quote(message)
|
||||
|
||||
if(copytext(message,1,2) == "*")
|
||||
return emote(copytext(message,2))
|
||||
|
||||
return ..(message, null, verb)
|
||||
|
||||
/mob/living/carbon/slime/say_quote(var/text)
|
||||
var/ending = copytext(text, length(text))
|
||||
|
||||
if (ending == "?")
|
||||
return "telepathically asks";
|
||||
else if (ending == "!")
|
||||
return "telepathically cries";
|
||||
|
||||
return "telepathically chirps";
|
||||
|
||||
/mob/living/carbon/slime/say_understands(var/other)
|
||||
if (istype(other, /mob/living/carbon/slime))
|
||||
return 1
|
||||
return ..()
|
||||
|
||||
@@ -1,372 +1,79 @@
|
||||
|
||||
////////////////Tier 2
|
||||
|
||||
/mob/living/carbon/slime/purple
|
||||
colour = "purple"
|
||||
icon_state = "purple baby slime"
|
||||
primarytype = /mob/living/carbon/slime/purple
|
||||
mutationone = /mob/living/carbon/slime/darkpurple
|
||||
mutationtwo = /mob/living/carbon/slime/darkblue
|
||||
mutationthree = /mob/living/carbon/slime/green
|
||||
mutationfour = /mob/living/carbon/slime/green
|
||||
adulttype = /mob/living/carbon/slime/adult/purple
|
||||
coretype = /obj/item/slime_extract/purple
|
||||
|
||||
/mob/living/carbon/slime/adult/purple
|
||||
icon_state = "purple adult slime"
|
||||
colour = "purple"
|
||||
primarytype = /mob/living/carbon/slime/purple
|
||||
mutationone = /mob/living/carbon/slime/darkpurple
|
||||
mutationtwo = /mob/living/carbon/slime/darkblue
|
||||
mutationthree = /mob/living/carbon/slime/green
|
||||
mutationfour = /mob/living/carbon/slime/green
|
||||
adulttype = /mob/living/carbon/slime/adult/purple
|
||||
coretype = /obj/item/slime_extract/purple
|
||||
|
||||
/mob/living/carbon/slime/metal
|
||||
colour = "metal"
|
||||
icon_state = "metal baby slime"
|
||||
primarytype = /mob/living/carbon/slime/metal
|
||||
mutationone = /mob/living/carbon/slime/silver
|
||||
mutationtwo = /mob/living/carbon/slime/yellow
|
||||
mutationthree = /mob/living/carbon/slime/gold
|
||||
mutationfour = /mob/living/carbon/slime/gold
|
||||
adulttype = /mob/living/carbon/slime/adult/metal
|
||||
coretype = /obj/item/slime_extract/metal
|
||||
|
||||
/mob/living/carbon/slime/adult/metal
|
||||
icon_state = "metal adult slime"
|
||||
colour = "metal"
|
||||
primarytype = /mob/living/carbon/slime/metal
|
||||
mutationone = /mob/living/carbon/slime/silver
|
||||
mutationtwo = /mob/living/carbon/slime/yellow
|
||||
mutationthree = /mob/living/carbon/slime/gold
|
||||
mutationfour = /mob/living/carbon/slime/gold
|
||||
adulttype = /mob/living/carbon/slime/adult/metal
|
||||
coretype = /obj/item/slime_extract/metal
|
||||
|
||||
/mob/living/carbon/slime/orange
|
||||
colour = "orange"
|
||||
icon_state = "orange baby slime"
|
||||
primarytype = /mob/living/carbon/slime/orange
|
||||
mutationone = /mob/living/carbon/slime/red
|
||||
mutationtwo = /mob/living/carbon/slime/red
|
||||
mutationthree = /mob/living/carbon/slime/darkpurple
|
||||
mutationfour = /mob/living/carbon/slime/yellow
|
||||
adulttype = /mob/living/carbon/slime/adult/orange
|
||||
coretype = /obj/item/slime_extract/orange
|
||||
|
||||
/mob/living/carbon/slime/adult/orange
|
||||
colour = "orange"
|
||||
icon_state = "orange adult slime"
|
||||
primarytype = /mob/living/carbon/slime/orange
|
||||
mutationone = /mob/living/carbon/slime/red
|
||||
mutationtwo = /mob/living/carbon/slime/red
|
||||
mutationthree = /mob/living/carbon/slime/darkpurple
|
||||
mutationfour = /mob/living/carbon/slime/yellow
|
||||
adulttype = /mob/living/carbon/slime/adult/orange
|
||||
coretype = /obj/item/slime_extract/orange
|
||||
|
||||
/mob/living/carbon/slime/blue
|
||||
colour = "blue"
|
||||
icon_state = "blue baby slime"
|
||||
primarytype = /mob/living/carbon/slime/blue
|
||||
mutationone = /mob/living/carbon/slime/darkblue
|
||||
mutationtwo = /mob/living/carbon/slime/pink
|
||||
mutationthree = /mob/living/carbon/slime/pink
|
||||
mutationfour = /mob/living/carbon/slime/silver
|
||||
adulttype = /mob/living/carbon/slime/adult/blue
|
||||
coretype = /obj/item/slime_extract/blue
|
||||
|
||||
/mob/living/carbon/slime/adult/blue
|
||||
icon_state = "blue adult slime"
|
||||
colour = "blue"
|
||||
primarytype = /mob/living/carbon/slime/blue
|
||||
mutationone = /mob/living/carbon/slime/darkblue
|
||||
mutationtwo = /mob/living/carbon/slime/pink
|
||||
mutationthree = /mob/living/carbon/slime/silver
|
||||
mutationfour = /mob/living/carbon/slime/pink
|
||||
adulttype = /mob/living/carbon/slime/adult/blue
|
||||
coretype = /obj/item/slime_extract/blue
|
||||
|
||||
|
||||
|
||||
|
||||
//Tier 3
|
||||
|
||||
/mob/living/carbon/slime/darkblue
|
||||
colour = "dark blue"
|
||||
icon_state = "dark blue baby slime"
|
||||
primarytype = /mob/living/carbon/slime/darkblue
|
||||
mutationone = /mob/living/carbon/slime/purple
|
||||
mutationtwo = /mob/living/carbon/slime/purple
|
||||
mutationthree = /mob/living/carbon/slime/blue
|
||||
mutationfour = /mob/living/carbon/slime/blue
|
||||
adulttype = /mob/living/carbon/slime/adult/darkblue
|
||||
coretype = /obj/item/slime_extract/darkblue
|
||||
|
||||
/mob/living/carbon/slime/adult/darkblue
|
||||
icon_state = "dark blue adult slime"
|
||||
colour = "dark blue"
|
||||
primarytype = /mob/living/carbon/slime/darkblue
|
||||
mutationone = /mob/living/carbon/slime/purple
|
||||
mutationtwo = /mob/living/carbon/slime/purple
|
||||
mutationthree = /mob/living/carbon/slime/blue
|
||||
mutationfour = /mob/living/carbon/slime/blue
|
||||
adulttype = /mob/living/carbon/slime/adult/darkblue
|
||||
coretype = /obj/item/slime_extract/darkblue
|
||||
|
||||
/mob/living/carbon/slime/darkpurple
|
||||
colour = "dark purple"
|
||||
icon_state = "dark purple baby slime"
|
||||
primarytype = /mob/living/carbon/slime/darkpurple
|
||||
mutationone = /mob/living/carbon/slime/purple
|
||||
mutationtwo = /mob/living/carbon/slime/purple
|
||||
mutationthree = /mob/living/carbon/slime/orange
|
||||
mutationfour = /mob/living/carbon/slime/orange
|
||||
adulttype = /mob/living/carbon/slime/adult/darkpurple
|
||||
coretype = /obj/item/slime_extract/darkpurple
|
||||
|
||||
/mob/living/carbon/slime/adult/darkpurple
|
||||
icon_state = "dark purple adult slime"
|
||||
colour = "dark purple"
|
||||
primarytype = /mob/living/carbon/slime/darkpurple
|
||||
mutationone = /mob/living/carbon/slime/purple
|
||||
mutationtwo = /mob/living/carbon/slime/purple
|
||||
mutationthree = /mob/living/carbon/slime/orange
|
||||
mutationfour = /mob/living/carbon/slime/orange
|
||||
adulttype = /mob/living/carbon/slime/adult/darkpurple
|
||||
coretype = /obj/item/slime_extract/darkpurple
|
||||
|
||||
|
||||
/mob/living/carbon/slime/yellow
|
||||
icon_state = "yellow baby slime"
|
||||
colour = "yellow"
|
||||
primarytype = /mob/living/carbon/slime/yellow
|
||||
mutationone = /mob/living/carbon/slime/metal
|
||||
mutationtwo = /mob/living/carbon/slime/metal
|
||||
mutationthree = /mob/living/carbon/slime/orange
|
||||
mutationfour = /mob/living/carbon/slime/orange
|
||||
adulttype = /mob/living/carbon/slime/adult/yellow
|
||||
coretype = /obj/item/slime_extract/yellow
|
||||
|
||||
/mob/living/carbon/slime/adult/yellow
|
||||
icon_state = "yellow adult slime"
|
||||
colour = "yellow"
|
||||
primarytype = /mob/living/carbon/slime/yellow
|
||||
mutationone = /mob/living/carbon/slime/metal
|
||||
mutationtwo = /mob/living/carbon/slime/metal
|
||||
mutationthree = /mob/living/carbon/slime/orange
|
||||
mutationfour = /mob/living/carbon/slime/orange
|
||||
adulttype = /mob/living/carbon/slime/adult/yellow
|
||||
coretype = /obj/item/slime_extract/yellow
|
||||
|
||||
|
||||
/mob/living/carbon/slime/silver
|
||||
colour = "silver"
|
||||
icon_state = "silver baby slime"
|
||||
primarytype = /mob/living/carbon/slime/silver
|
||||
mutationone = /mob/living/carbon/slime/metal
|
||||
mutationtwo = /mob/living/carbon/slime/metal
|
||||
mutationthree = /mob/living/carbon/slime/blue
|
||||
mutationfour = /mob/living/carbon/slime/blue
|
||||
adulttype = /mob/living/carbon/slime/adult/silver
|
||||
coretype = /obj/item/slime_extract/silver
|
||||
|
||||
/mob/living/carbon/slime/adult/silver
|
||||
icon_state = "silver adult slime"
|
||||
colour = "silver"
|
||||
primarytype = /mob/living/carbon/slime/silver
|
||||
mutationone = /mob/living/carbon/slime/metal
|
||||
mutationtwo = /mob/living/carbon/slime/metal
|
||||
mutationthree = /mob/living/carbon/slime/blue
|
||||
mutationfour = /mob/living/carbon/slime/blue
|
||||
adulttype = /mob/living/carbon/slime/adult/silver
|
||||
coretype = /obj/item/slime_extract/silver
|
||||
|
||||
|
||||
|
||||
/////////////Tier 4
|
||||
|
||||
|
||||
/mob/living/carbon/slime/pink
|
||||
colour = "pink"
|
||||
icon_state = "pink baby slime"
|
||||
primarytype = /mob/living/carbon/slime/pink
|
||||
mutationone = /mob/living/carbon/slime/pink
|
||||
mutationtwo = /mob/living/carbon/slime/pink
|
||||
mutationthree = /mob/living/carbon/slime/lightpink
|
||||
mutationfour = /mob/living/carbon/slime/lightpink
|
||||
adulttype = /mob/living/carbon/slime/adult/pink
|
||||
coretype = /obj/item/slime_extract/pink
|
||||
|
||||
/mob/living/carbon/slime/adult/pink
|
||||
icon_state = "pink adult slime"
|
||||
colour = "pink"
|
||||
primarytype = /mob/living/carbon/slime/pink
|
||||
mutationone = /mob/living/carbon/slime/pink
|
||||
mutationtwo = /mob/living/carbon/slime/pink
|
||||
mutationthree = /mob/living/carbon/slime/lightpink
|
||||
mutationfour = /mob/living/carbon/slime/lightpink
|
||||
adulttype = /mob/living/carbon/slime/adult/pink
|
||||
coretype = /obj/item/slime_extract/pink
|
||||
|
||||
/mob/living/carbon/slime/red
|
||||
colour = "red"
|
||||
icon_state = "red baby slime"
|
||||
primarytype = /mob/living/carbon/slime/red
|
||||
mutationone = /mob/living/carbon/slime/red
|
||||
mutationtwo = /mob/living/carbon/slime/red
|
||||
mutationthree = /mob/living/carbon/slime/oil
|
||||
mutationfour = /mob/living/carbon/slime/oil
|
||||
adulttype = /mob/living/carbon/slime/adult/red
|
||||
coretype = /obj/item/slime_extract/red
|
||||
|
||||
/mob/living/carbon/slime/adult/red
|
||||
icon_state = "red adult slime"
|
||||
colour = "red"
|
||||
primarytype = /mob/living/carbon/slime/red
|
||||
mutationone = /mob/living/carbon/slime/red
|
||||
mutationtwo = /mob/living/carbon/slime/red
|
||||
mutationthree = /mob/living/carbon/slime/oil
|
||||
mutationfour = /mob/living/carbon/slime/oil
|
||||
adulttype = /mob/living/carbon/slime/adult/red
|
||||
coretype = /obj/item/slime_extract/red
|
||||
|
||||
/mob/living/carbon/slime/gold
|
||||
colour = "gold"
|
||||
icon_state = "gold baby slime"
|
||||
primarytype = /mob/living/carbon/slime/gold
|
||||
mutationone = /mob/living/carbon/slime/gold
|
||||
mutationtwo = /mob/living/carbon/slime/gold
|
||||
mutationthree = /mob/living/carbon/slime/adamantine
|
||||
mutationfour = /mob/living/carbon/slime/adamantine
|
||||
adulttype = /mob/living/carbon/slime/adult/gold
|
||||
coretype = /obj/item/slime_extract/gold
|
||||
|
||||
/mob/living/carbon/slime/adult/gold
|
||||
icon_state = "gold adult slime"
|
||||
colour = "gold"
|
||||
primarytype = /mob/living/carbon/slime/gold
|
||||
mutationone = /mob/living/carbon/slime/gold
|
||||
mutationtwo = /mob/living/carbon/slime/gold
|
||||
mutationthree = /mob/living/carbon/slime/adamantine
|
||||
mutationfour = /mob/living/carbon/slime/adamantine
|
||||
adulttype = /mob/living/carbon/slime/adult/gold
|
||||
coretype = /obj/item/slime_extract/gold
|
||||
|
||||
/mob/living/carbon/slime/green
|
||||
colour = "green"
|
||||
icon_state = "green baby slime"
|
||||
primarytype = /mob/living/carbon/slime/green
|
||||
mutationone = /mob/living/carbon/slime/green
|
||||
mutationtwo = /mob/living/carbon/slime/green
|
||||
mutationthree = /mob/living/carbon/slime/black
|
||||
mutationfour = /mob/living/carbon/slime/black
|
||||
adulttype = /mob/living/carbon/slime/adult/green
|
||||
coretype = /obj/item/slime_extract/green
|
||||
|
||||
/mob/living/carbon/slime/adult/green
|
||||
icon_state = "green adult slime"
|
||||
colour = "green"
|
||||
primarytype = /mob/living/carbon/slime/green
|
||||
mutationone = /mob/living/carbon/slime/green
|
||||
mutationtwo = /mob/living/carbon/slime/green
|
||||
mutationthree = /mob/living/carbon/slime/black
|
||||
mutationfour = /mob/living/carbon/slime/black
|
||||
adulttype = /mob/living/carbon/slime/adult/green
|
||||
coretype = /obj/item/slime_extract/green
|
||||
|
||||
|
||||
|
||||
// Tier 5
|
||||
|
||||
/mob/living/carbon/slime/lightpink
|
||||
colour = "light pink"
|
||||
icon_state = "light pink baby slime"
|
||||
primarytype = /mob/living/carbon/slime/lightpink
|
||||
mutationone = /mob/living/carbon/slime/lightpink
|
||||
mutationtwo = /mob/living/carbon/slime/lightpink
|
||||
mutationthree = /mob/living/carbon/slime/lightpink
|
||||
mutationfour = /mob/living/carbon/slime/lightpink
|
||||
adulttype = /mob/living/carbon/slime/adult/lightpink
|
||||
coretype = /obj/item/slime_extract/lightpink
|
||||
|
||||
/mob/living/carbon/slime/adult/lightpink
|
||||
icon_state = "light pink adult slime"
|
||||
colour = "light pink"
|
||||
primarytype = /mob/living/carbon/slime/lightpink
|
||||
mutationone = /mob/living/carbon/slime/lightpink
|
||||
mutationtwo = /mob/living/carbon/slime/lightpink
|
||||
mutationthree = /mob/living/carbon/slime/lightpink
|
||||
mutationfour = /mob/living/carbon/slime/lightpink
|
||||
adulttype = /mob/living/carbon/slime/adult/lightpink
|
||||
coretype = /obj/item/slime_extract/lightpink
|
||||
|
||||
|
||||
/mob/living/carbon/slime/oil
|
||||
icon_state = "oil baby slime"
|
||||
colour = "oil"
|
||||
primarytype = /mob/living/carbon/slime/oil
|
||||
mutationone = /mob/living/carbon/slime/oil
|
||||
mutationtwo = /mob/living/carbon/slime/oil
|
||||
mutationthree = /mob/living/carbon/slime/oil
|
||||
mutationfour = /mob/living/carbon/slime/oil
|
||||
adulttype = /mob/living/carbon/slime/adult/oil
|
||||
coretype = /obj/item/slime_extract/oil
|
||||
|
||||
/mob/living/carbon/slime/adult/oil
|
||||
icon_state = "oil adult slime"
|
||||
colour = "oil"
|
||||
primarytype = /mob/living/carbon/slime/oil
|
||||
mutationone = /mob/living/carbon/slime/oil
|
||||
mutationtwo = /mob/living/carbon/slime/oil
|
||||
mutationthree = /mob/living/carbon/slime/oil
|
||||
mutationfour = /mob/living/carbon/slime/oil
|
||||
adulttype = /mob/living/carbon/slime/adult/oil
|
||||
coretype = /obj/item/slime_extract/oil
|
||||
|
||||
|
||||
/mob/living/carbon/slime/black
|
||||
icon_state = "black baby slime"
|
||||
colour = "black"
|
||||
primarytype = /mob/living/carbon/slime/black
|
||||
mutationone = /mob/living/carbon/slime/black
|
||||
mutationtwo = /mob/living/carbon/slime/black
|
||||
mutationthree = /mob/living/carbon/slime/black
|
||||
mutationfour = /mob/living/carbon/slime/black
|
||||
adulttype = /mob/living/carbon/slime/adult/black
|
||||
coretype = /obj/item/slime_extract/black
|
||||
|
||||
/mob/living/carbon/slime/adult/black
|
||||
icon_state = "black adult slime"
|
||||
colour = "black"
|
||||
primarytype = /mob/living/carbon/slime/black
|
||||
mutationone = /mob/living/carbon/slime/black
|
||||
mutationtwo = /mob/living/carbon/slime/black
|
||||
mutationthree = /mob/living/carbon/slime/black
|
||||
mutationfour = /mob/living/carbon/slime/black
|
||||
adulttype = /mob/living/carbon/slime/adult/black
|
||||
coretype = /obj/item/slime_extract/black
|
||||
|
||||
/mob/living/carbon/slime/adamantine
|
||||
icon_state = "adamantine baby slime"
|
||||
colour = "adamantine"
|
||||
primarytype = /mob/living/carbon/slime/adamantine
|
||||
mutationone = /mob/living/carbon/slime/adamantine
|
||||
mutationtwo = /mob/living/carbon/slime/adamantine
|
||||
mutationthree = /mob/living/carbon/slime/adamantine
|
||||
mutationfour = /mob/living/carbon/slime/adamantine
|
||||
adulttype = /mob/living/carbon/slime/adult/adamantine
|
||||
coretype = /obj/item/slime_extract/adamantine
|
||||
|
||||
/mob/living/carbon/slime/adult/adamantine
|
||||
icon_state = "adamantine adult slime"
|
||||
colour = "adamantine"
|
||||
primarytype = /mob/living/carbon/slime/adamantine
|
||||
mutationone = /mob/living/carbon/slime/adamantine
|
||||
mutationtwo = /mob/living/carbon/slime/adamantine
|
||||
mutationthree = /mob/living/carbon/slime/adamantine
|
||||
mutationfour = /mob/living/carbon/slime/adamantine
|
||||
adulttype = /mob/living/carbon/slime/adult/adamantine
|
||||
coretype = /obj/item/slime_extract/adamantine
|
||||
proc/mutation_table(var/colour)
|
||||
var/list/slime_mutation[4]
|
||||
switch(colour)
|
||||
//Tier 1
|
||||
if("grey")
|
||||
slime_mutation[1] = "orange"
|
||||
slime_mutation[2] = "metal"
|
||||
slime_mutation[3] = "blue"
|
||||
slime_mutation[4] = "purple"
|
||||
//Tier 2
|
||||
if("purple")
|
||||
slime_mutation[1] = "dark purple"
|
||||
slime_mutation[2] = "dark blue"
|
||||
slime_mutation[3] = "green"
|
||||
slime_mutation[4] = "green"
|
||||
if("metal")
|
||||
slime_mutation[1] = "silver"
|
||||
slime_mutation[2] = "yellow"
|
||||
slime_mutation[3] = "gold"
|
||||
slime_mutation[4] = "gold"
|
||||
if("orange")
|
||||
slime_mutation[1] = "dark purple"
|
||||
slime_mutation[2] = "yellow"
|
||||
slime_mutation[3] = "red"
|
||||
slime_mutation[4] = "red"
|
||||
if("blue")
|
||||
slime_mutation[1] = "dark blue"
|
||||
slime_mutation[2] = "silver"
|
||||
slime_mutation[3] = "pink"
|
||||
slime_mutation[4] = "pink"
|
||||
//Tier 3
|
||||
if("dark blue")
|
||||
slime_mutation[1] = "purple"
|
||||
slime_mutation[2] = "blue"
|
||||
slime_mutation[3] = "cerulean"
|
||||
slime_mutation[4] = "cerulean"
|
||||
if("dark purple")
|
||||
slime_mutation[1] = "purple"
|
||||
slime_mutation[2] = "orange"
|
||||
slime_mutation[3] = "sepia"
|
||||
slime_mutation[4] = "sepia"
|
||||
if("yellow")
|
||||
slime_mutation[1] = "metal"
|
||||
slime_mutation[2] = "orange"
|
||||
slime_mutation[3] = "bluespace"
|
||||
slime_mutation[4] = "bluespace"
|
||||
if("silver")
|
||||
slime_mutation[1] = "metal"
|
||||
slime_mutation[2] = "blue"
|
||||
slime_mutation[3] = "pyrite"
|
||||
slime_mutation[4] = "pyrite"
|
||||
//Tier 4
|
||||
if("pink")
|
||||
slime_mutation[1] = "pink"
|
||||
slime_mutation[2] = "pink"
|
||||
slime_mutation[3] = "light pink"
|
||||
slime_mutation[4] = "light pink"
|
||||
if("red")
|
||||
slime_mutation[1] = "red"
|
||||
slime_mutation[2] = "red"
|
||||
slime_mutation[3] = "oil"
|
||||
slime_mutation[4] = "oil"
|
||||
if("gold")
|
||||
slime_mutation[1] = "gold"
|
||||
slime_mutation[2] = "gold"
|
||||
slime_mutation[3] = "adamantine"
|
||||
slime_mutation[4] = "adamantine"
|
||||
if("green")
|
||||
slime_mutation[1] = "green"
|
||||
slime_mutation[2] = "green"
|
||||
slime_mutation[3] = "black"
|
||||
slime_mutation[4] = "black"
|
||||
// Tier 5
|
||||
else
|
||||
slime_mutation[1] = colour
|
||||
slime_mutation[2] = colour
|
||||
slime_mutation[3] = colour
|
||||
slime_mutation[4] = colour
|
||||
return(slime_mutation)
|
||||
@@ -237,25 +237,14 @@
|
||||
var/obj/location_as_object = loc
|
||||
breath = location_as_object.handle_internal_lifeform(src, BREATH_VOLUME)
|
||||
else if(istype(loc, /turf/))
|
||||
var/breath_moles = environment.total_moles()*BREATH_PERCENTAGE
|
||||
var/breath_moles = environment.total_moles*BREATH_PERCENTAGE
|
||||
breath = loc.remove_air(breath_moles)
|
||||
|
||||
if(istype(wear_mask, /obj/item/clothing/mask/gas))
|
||||
var/obj/item/clothing/mask/gas/G = wear_mask
|
||||
var/datum/gas_mixture/filtered = new
|
||||
|
||||
filtered.copy_from(breath)
|
||||
filtered.phoron *= G.gas_filter_strength
|
||||
for(var/datum/gas/gas in filtered.trace_gases)
|
||||
gas.moles *= G.gas_filter_strength
|
||||
filtered.update_values()
|
||||
if(istype(wear_mask, /obj/item/clothing/mask) && breath)
|
||||
var/obj/item/clothing/mask/M = wear_mask
|
||||
var/datum/gas_mixture/filtered = M.filter_air(breath)
|
||||
loc.assume_air(filtered)
|
||||
|
||||
breath.phoron *= 1 - G.gas_filter_strength
|
||||
for(var/datum/gas/gas in breath.trace_gases)
|
||||
gas.moles *= 1 - G.gas_filter_strength
|
||||
breath.update_values()
|
||||
|
||||
// Handle chem smoke effect -- Doohl
|
||||
var/block = 0
|
||||
if(wear_mask)
|
||||
@@ -316,14 +305,14 @@
|
||||
var/SA_para_min = 0.5
|
||||
var/SA_sleep_min = 5
|
||||
var/oxygen_used = 0
|
||||
var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
|
||||
var/breath_pressure = (breath.total_moles * R_IDEAL_GAS_EQUATION * breath.temperature) / BREATH_VOLUME
|
||||
|
||||
//Partial pressure of the O2 in our breath
|
||||
var/O2_pp = (breath.oxygen/breath.total_moles())*breath_pressure
|
||||
var/O2_pp = (breath.gas["oxygen"] / breath.total_moles) * breath_pressure
|
||||
// Same, but for the phoron
|
||||
var/Toxins_pp = (breath.phoron/breath.total_moles())*breath_pressure
|
||||
var/Toxins_pp = (breath.gas["phoron"] / breath.total_moles) * breath_pressure
|
||||
// And CO2, lets say a PP of more than 10 will be bad (It's a little less really, but eh, being passed out all round aint no fun)
|
||||
var/CO2_pp = (breath.carbon_dioxide/breath.total_moles())*breath_pressure
|
||||
var/CO2_pp = (breath.gas["carbon_dioxide"] / breath.total_moles) * breath_pressure
|
||||
|
||||
if(O2_pp < safe_oxygen_min) // Too little oxygen
|
||||
if(prob(20))
|
||||
@@ -332,7 +321,7 @@
|
||||
O2_pp = 0.01
|
||||
var/ratio = safe_oxygen_min/O2_pp
|
||||
adjustOxyLoss(min(5*ratio, 7)) // Don't fuck them up too fast (space only does 7 after all!)
|
||||
oxygen_used = breath.oxygen*ratio/6
|
||||
oxygen_used = breath.gas["oxygen"] * ratio / 6
|
||||
oxygen_alert = max(oxygen_alert, 1)
|
||||
/*else if (O2_pp > safe_oxygen_max) // Too much oxygen (commented this out for now, I'll deal with pressure damage elsewhere I suppose)
|
||||
spawn(0) emote("cough")
|
||||
@@ -342,11 +331,11 @@
|
||||
oxygen_alert = max(oxygen_alert, 1)*/
|
||||
else // We're in safe limits
|
||||
adjustOxyLoss(-5)
|
||||
oxygen_used = breath.oxygen/6
|
||||
oxygen_used = breath.gas["oxygen"] / 6
|
||||
oxygen_alert = 0
|
||||
|
||||
breath.oxygen -= oxygen_used
|
||||
breath.carbon_dioxide += oxygen_used
|
||||
breath.adjust_gas("oxygen", -oxygen_used)
|
||||
breath.adjust_gas("carbon_dioxide", oxygen_used)
|
||||
|
||||
if(CO2_pp > safe_co2_max)
|
||||
if(!co2overloadtime) // If it's the first breath with too much CO2 in it, lets start a counter, then have them pass out after 12s or so.
|
||||
@@ -363,7 +352,7 @@
|
||||
co2overloadtime = 0
|
||||
|
||||
if(Toxins_pp > safe_phoron_max) // Too much phoron
|
||||
var/ratio = (breath.phoron/safe_phoron_max) * 10
|
||||
var/ratio = (breath.gas["phoron"] / safe_phoron_max) * 10
|
||||
//adjustToxLoss(Clamp(ratio, MIN_PLASMA_DAMAGE, MAX_PLASMA_DAMAGE)) //Limit amount of damage toxin exposure can do per second
|
||||
if(reagents)
|
||||
reagents.add_reagent("toxin", Clamp(ratio, MIN_TOXIN_DAMAGE, MAX_TOXIN_DAMAGE))
|
||||
@@ -371,16 +360,15 @@
|
||||
else
|
||||
phoron_alert = 0
|
||||
|
||||
if(breath.trace_gases.len) // If there's some other shit in the air lets deal with it here.
|
||||
for(var/datum/gas/sleeping_agent/SA in breath.trace_gases)
|
||||
var/SA_pp = (SA.moles/breath.total_moles())*breath_pressure
|
||||
if(SA_pp > SA_para_min) // Enough to make us paralysed for a bit
|
||||
Paralyse(3) // 3 gives them one second to wake up and run away a bit!
|
||||
if(SA_pp > SA_sleep_min) // Enough to make us sleep as well
|
||||
sleeping = max(sleeping+2, 10)
|
||||
else if(SA_pp > 0.01) // There is sleeping gas in their lungs, but only a little, so give them a bit of a warning
|
||||
if(prob(20))
|
||||
spawn(0) emote(pick("giggle", "laugh"))
|
||||
if(breath.gas["sleeping_agent"])
|
||||
var/SA_pp = (breath.gas["sleeping_agent"] / breath.total_moles) * breath_pressure
|
||||
if(SA_pp > SA_para_min) // Enough to make us paralysed for a bit
|
||||
Paralyse(3) // 3 gives them one second to wake up and run away a bit!
|
||||
if(SA_pp > SA_sleep_min) // Enough to make us sleep as well
|
||||
sleeping = max(sleeping+2, 10)
|
||||
else if(SA_pp > 0.01) // There is sleeping gas in their lungs, but only a little, so give them a bit of a warning
|
||||
if(prob(20))
|
||||
spawn(0) emote(pick("giggle", "laugh"))
|
||||
|
||||
|
||||
if(breath.temperature > (T0C+66)) // Hot air hurts :(
|
||||
@@ -403,7 +391,7 @@
|
||||
var/pressure = environment.return_pressure()
|
||||
var/adjusted_pressure = calculate_affecting_pressure(pressure) //Returns how much pressure actually affects the mob.
|
||||
|
||||
if(adjusted_pressure < WARNING_HIGH_PRESSURE && adjusted_pressure > WARNING_LOW_PRESSURE && abs(environment.temperature - 293.15) < 20 && abs(bodytemperature - 310.14) < 0.5 && environment.phoron < MOLES_PHORON_VISIBLE)
|
||||
if(adjusted_pressure < WARNING_HIGH_PRESSURE && adjusted_pressure > WARNING_LOW_PRESSURE && abs(environment.temperature - 293.15) < 20 && abs(bodytemperature - 310.14) < 0.5 && environment.gas["phoron"] < gas_data.overlay_limit["phoron"])
|
||||
|
||||
//Hopefully should fix the walk-inside-still-pressure-warning issue.
|
||||
if(pressure_alert)
|
||||
|
||||
@@ -403,7 +403,7 @@
|
||||
|
||||
var/damage = rand(1, 3)
|
||||
|
||||
if(istype(src, /mob/living/carbon/slime/adult))
|
||||
if(M.is_adult)
|
||||
damage = rand(20, 40)
|
||||
else
|
||||
damage = rand(5, 35)
|
||||
|
||||
@@ -83,28 +83,29 @@ var/list/department_radio_keys = list(
|
||||
/mob/living/say(var/message, var/datum/language/speaking = null, var/verb="says", var/alt_name="", var/italics=0, var/message_range = world.view, var/list/used_radios = list(), var/sound/speech_sound, var/sound_vol)
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
|
||||
|
||||
//handle nonverbal and sign languages here
|
||||
if (speaking)
|
||||
if (speaking.flags & NONVERBAL)
|
||||
if (prob(30))
|
||||
src.custom_emote(1, "[pick(speaking.signlang_verb)].")
|
||||
|
||||
|
||||
if (speaking.flags & SIGNLANG)
|
||||
say_signlang(message, pick(speaking.signlang_verb), speaking)
|
||||
return
|
||||
|
||||
return 1
|
||||
|
||||
//speaking into radios
|
||||
if(used_radios.len)
|
||||
italics = 1
|
||||
message_range = 1
|
||||
|
||||
for(var/mob/living/M in hearers(5, src))
|
||||
if(M != src)
|
||||
M.show_message("<span class='notice'>[src] talks into [used_radios.len ? used_radios[1] : "the radio."]</span>")
|
||||
if (speech_sound)
|
||||
src.playsound_local(get_turf(src), speech_sound, sound_vol * 0.5, 1)
|
||||
|
||||
|
||||
if (!istype(src, /mob/living/silicon/ai)) // Atlantis: Prevents nearby people from hearing the AI when it talks using it's integrated radio.
|
||||
for(var/mob/living/M in hearers(5, src))
|
||||
if(M != src)
|
||||
M.show_message("<span class='notice'>[src] talks into [used_radios.len ? used_radios[1] : "the radio."]</span>")
|
||||
if (speech_sound)
|
||||
src.playsound_local(get_turf(src), speech_sound, sound_vol * 0.5, 1)
|
||||
|
||||
speech_sound = null //so we don't play it twice.
|
||||
|
||||
//make sure the air can transmit speech
|
||||
@@ -114,13 +115,13 @@ var/list/department_radio_keys = list(
|
||||
if(pressure < SOUND_MINIMUM_PRESSURE)
|
||||
italics = 1
|
||||
message_range = 1
|
||||
|
||||
|
||||
if (speech_sound)
|
||||
sound_vol *= 0.5 //muffle the sound a bit, so it's like we're actually talking through contact
|
||||
|
||||
var/list/listening = list()
|
||||
var/list/listening_obj = list()
|
||||
|
||||
|
||||
if(T)
|
||||
var/list/hear = hear(message_range, T)
|
||||
var/list/hearturfs = list()
|
||||
@@ -132,11 +133,18 @@ var/list/department_radio_keys = list(
|
||||
hearturfs += M.locs[1]
|
||||
for(var/obj/O in M.contents)
|
||||
listening_obj |= O
|
||||
if (isslime(I))
|
||||
var/mob/living/carbon/slime/S = I
|
||||
if (src in S.Friends)
|
||||
S.speech_buffer = list()
|
||||
S.speech_buffer.Add(src)
|
||||
S.speech_buffer.Add(lowertext(html_decode(message)))
|
||||
else if(istype(I, /obj/))
|
||||
var/obj/O = I
|
||||
hearturfs += O.locs[1]
|
||||
listening_obj |= O
|
||||
|
||||
|
||||
for(var/mob/M in player_list)
|
||||
if(M.stat == DEAD && M.client && (M.client.prefs.toggles & CHAT_GHOSTEARS))
|
||||
listening |= M
|
||||
@@ -156,8 +164,9 @@ var/list/department_radio_keys = list(
|
||||
spawn(0)
|
||||
if(O) //It's possible that it could be deleted in the meantime.
|
||||
O.hear_talk(src, message, verb, speaking)
|
||||
|
||||
|
||||
log_say("[name]/[key] : [message]")
|
||||
return 1
|
||||
|
||||
/mob/living/proc/say_signlang(var/message, var/verb="gestures", var/datum/language/language)
|
||||
for (var/mob/O in viewers(src, null))
|
||||
|
||||
@@ -27,9 +27,11 @@ var/list/ai_list = list()
|
||||
var/viewalerts = 0
|
||||
var/lawcheck[1]
|
||||
var/ioncheck[1]
|
||||
var/lawchannel = "Common" // Default channel on which to state laws
|
||||
var/icon/holo_icon//Default is assigned when AI is created.
|
||||
var/obj/item/device/pda/ai/aiPDA = null
|
||||
var/obj/item/device/multitool/aiMulti = null
|
||||
var/obj/item/device/radio/headset/heads/ai_integrated/aiRadio = null
|
||||
var/custom_sprite = 0 //For our custom sprites
|
||||
//Hud stuff
|
||||
|
||||
@@ -87,12 +89,14 @@ var/list/ai_list = list()
|
||||
aiPDA.name = name + " (" + aiPDA.ownjob + ")"
|
||||
|
||||
aiMulti = new(src)
|
||||
aiRadio = new(src)
|
||||
aiRadio.myAi = src
|
||||
|
||||
if (istype(loc, /turf))
|
||||
verbs.Add(/mob/living/silicon/ai/proc/ai_call_shuttle,/mob/living/silicon/ai/proc/ai_camera_track, \
|
||||
/mob/living/silicon/ai/proc/ai_camera_list, /mob/living/silicon/ai/proc/ai_network_change, \
|
||||
/mob/living/silicon/ai/proc/ai_statuschange, /mob/living/silicon/ai/proc/ai_hologram_change, \
|
||||
/mob/living/silicon/ai/proc/toggle_camera_light)
|
||||
/mob/living/silicon/ai/proc/toggle_camera_light, /mob/living/silicon/ai/proc/control_integrateed_radio)
|
||||
|
||||
//Languages
|
||||
add_language("Sol Common", 0)
|
||||
@@ -386,6 +390,13 @@ var/list/ai_list = list()
|
||||
// src << text ("Switching Law [L]'s report status to []", lawcheck[L+1])
|
||||
checklaws()
|
||||
|
||||
if (href_list["lawr"]) // Selects on which channel to state laws
|
||||
var/setchannel = input(usr, "Specify channel.", "Channel selection") in list("State","Common","Science","Command","Medical","Engineering","Security","Supply","Binary","Holopad", "Cancel")
|
||||
if(setchannel == "Cancel")
|
||||
return
|
||||
lawchannel = setchannel
|
||||
checklaws()
|
||||
|
||||
//Uncomment this line of code if you are enabling the AI Vocal (VOX) announcements.
|
||||
/*
|
||||
if(href_list["say_word"])
|
||||
@@ -737,3 +748,12 @@ var/list/ai_list = list()
|
||||
return
|
||||
else
|
||||
return ..()
|
||||
|
||||
/mob/living/silicon/ai/proc/control_integrateed_radio()
|
||||
set name = "Radio Settings"
|
||||
set desc = "Allows you to change settings of your radio."
|
||||
set category = "AI Commands"
|
||||
|
||||
src << "Accessing Subspace Transceiver control..."
|
||||
if (src.aiRadio)
|
||||
src.aiRadio.interact(src)
|
||||
|
||||
@@ -128,6 +128,9 @@ var/datum/cameranet/cameranet = new()
|
||||
|
||||
// 0xf = 15
|
||||
var/turf/position = get_turf(target)
|
||||
return checkTurfVis(position)
|
||||
|
||||
/datum/cameranet/proc/checkTurfVis(var/turf/position)
|
||||
var/datum/camerachunk/chunk = getCameraChunk(position.x, position.y, position.z)
|
||||
if(chunk)
|
||||
if(chunk.changed)
|
||||
@@ -136,7 +139,6 @@ var/datum/cameranet/cameranet = new()
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
// Debug verb for VVing the chunk that the turf is in.
|
||||
/*
|
||||
/turf/verb/view_chunk()
|
||||
|
||||
@@ -51,6 +51,12 @@
|
||||
var/obj/machinery/hologram/holopad/H = ai.current
|
||||
H.move_hologram()
|
||||
|
||||
/mob/aiEye/proc/getLoc()
|
||||
|
||||
if(ai)
|
||||
if(!isturf(ai.loc) || !ai.client)
|
||||
return
|
||||
return ai.eyeobj.loc
|
||||
|
||||
// AI MOVEMENT
|
||||
|
||||
|
||||
@@ -51,24 +51,33 @@
|
||||
src.laws_sanity_check()
|
||||
src.laws.clear_supplied_laws()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/mob/living/silicon/ai/proc/statelaws() // -- TLE
|
||||
// set category = "AI Commands"
|
||||
// set name = "State Laws"
|
||||
src.say("Current Active Laws:")
|
||||
/var/prefix = ""
|
||||
switch(lawchannel)
|
||||
if("Common") prefix = ";"
|
||||
if("Science") prefix = ":n "
|
||||
if("Command") prefix = ":c "
|
||||
if("Medical") prefix = ":m "
|
||||
if("Engineering") prefix = ":e "
|
||||
if("Security") prefix = ":s "
|
||||
if("Supply") prefix = ":u "
|
||||
if("Binary") prefix = ":b "
|
||||
if("Holopad") prefix = ":h "
|
||||
else prefix = ""
|
||||
|
||||
if(src.say("[prefix]Current Active Laws:") != 1)
|
||||
return
|
||||
|
||||
//src.laws_sanity_check()
|
||||
//src.laws.show_laws(world)
|
||||
var/number = 1
|
||||
sleep(10)
|
||||
|
||||
|
||||
|
||||
if (src.laws.zeroth)
|
||||
if (src.lawcheck[1] == "Yes") //This line and the similar lines below make sure you don't state a law unless you want to. --NeoFite
|
||||
src.say("0. [src.laws.zeroth]")
|
||||
src.say("[prefix]0. [src.laws.zeroth]")
|
||||
sleep(10)
|
||||
|
||||
for (var/index = 1, index <= src.laws.ion.len, index++)
|
||||
@@ -76,7 +85,7 @@
|
||||
var/num = ionnum()
|
||||
if (length(law) > 0)
|
||||
if (src.ioncheck[index] == "Yes")
|
||||
src.say("[num]. [law]")
|
||||
src.say("[prefix][num]. [law]")
|
||||
sleep(10)
|
||||
|
||||
for (var/index = 1, index <= src.laws.inherent.len, index++)
|
||||
@@ -84,22 +93,20 @@
|
||||
|
||||
if (length(law) > 0)
|
||||
if (src.lawcheck[index+1] == "Yes")
|
||||
src.say("[number]. [law]")
|
||||
src.say("[prefix][number]. [law]")
|
||||
sleep(10)
|
||||
number++
|
||||
|
||||
|
||||
for (var/index = 1, index <= src.laws.supplied.len, index++)
|
||||
var/law = src.laws.supplied[index]
|
||||
|
||||
if (length(law) > 0)
|
||||
if(src.lawcheck.len >= number+1)
|
||||
if (src.lawcheck[number+1] == "Yes")
|
||||
src.say("[number]. [law]")
|
||||
src.say("[prefix][number]. [law]")
|
||||
sleep(10)
|
||||
number++
|
||||
|
||||
|
||||
/mob/living/silicon/ai/verb/checklaws() //Gives you a link-driven interface for deciding what laws the statelaws() proc will share with the crew. --NeoFite
|
||||
set category = "AI Commands"
|
||||
set name = "State Laws"
|
||||
@@ -144,6 +151,8 @@
|
||||
src.lawcheck[number+1] = "Yes"
|
||||
list += {"<A href='byond://?src=\ref[src];lawc=[number]'>[src.lawcheck[number+1]] [number]:</A> [law]<BR>"}
|
||||
number++
|
||||
list += {"<br><br><A href='byond://?src=\ref[src];laws=1'>State Laws</A>"}
|
||||
|
||||
list += {"<br><A href='byond://?src=\ref[src];lawr=1'>Channel: [src.lawchannel]</A><br>"}
|
||||
list += {"<A href='byond://?src=\ref[src];laws=1'>State Laws</A>"}
|
||||
|
||||
usr << browse(list, "window=laws")
|
||||
@@ -1,9 +1,8 @@
|
||||
/mob/living/silicon/ai/say(var/message)
|
||||
if(parent && istype(parent) && parent.stat != 2)
|
||||
parent.say(message)
|
||||
return
|
||||
return parent.say(message)
|
||||
//If there is a defined "parent" AI, it is actually an AI, and it is alive, anything the AI tries to say is said by the parent instead.
|
||||
..(message)
|
||||
return ..(message)
|
||||
|
||||
// These Verbs are commented out since we've disabled the AI vocal (VOX) announcements.
|
||||
// If you re-enable them there is 3 lines in ai.dm Topic() that you need to uncomment as well.
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
/mob/living/silicon/pai
|
||||
name = "pAI"
|
||||
icon = 'icons/mob/mob.dmi'//
|
||||
icon_state = "shadow"
|
||||
icon = 'icons/mob/pai.dmi'
|
||||
icon_state = "repairbot"
|
||||
|
||||
robot_talk_understand = 0
|
||||
emote_type = 2 // pAIs emotes are heard, not seen, so they can be seen through a container (eg. person)
|
||||
small = 1
|
||||
pass_flags = 1
|
||||
|
||||
var/network = "SS13"
|
||||
var/obj/machinery/camera/current = null
|
||||
@@ -15,11 +17,22 @@
|
||||
var/obj/item/device/paicard/card // The card we inhabit
|
||||
var/obj/item/device/radio/radio // Our primary radio
|
||||
|
||||
var/speakStatement = "states"
|
||||
var/speakExclamation = "declares"
|
||||
var/speakQuery = "queries"
|
||||
|
||||
var/chassis = "repairbot" // A record of your chosen chassis.
|
||||
var/global/list/possible_chassis = list(
|
||||
"Drone" = "repairbot",
|
||||
"Cat" = "cat",
|
||||
"Mouse" = "mouse",
|
||||
"Monkey" = "monkey"
|
||||
)
|
||||
|
||||
var/global/list/possible_say_verbs = list(
|
||||
"Robotic" = list("states","declares","queries"),
|
||||
"Natural" = list("says","yells","asks"),
|
||||
"Beep" = list("beeps","beeps loudly","boops"),
|
||||
"Chirp" = list("chirps","chirrups","cheeps"),
|
||||
"Feline" = list("purrs","yowls","meows")
|
||||
)
|
||||
|
||||
var/obj/item/weapon/pai_cable/cable // The cable we produce and use when door or camera jacking
|
||||
|
||||
var/master // Name of the one who commands us
|
||||
@@ -56,6 +69,7 @@
|
||||
|
||||
|
||||
/mob/living/silicon/pai/New(var/obj/item/device/paicard)
|
||||
|
||||
canmove = 0
|
||||
src.loc = paicard
|
||||
card = paicard
|
||||
@@ -70,6 +84,10 @@
|
||||
add_language("Tradeband", 1)
|
||||
add_language("Gutter", 1)
|
||||
|
||||
verbs += /mob/living/silicon/pai/proc/fold_out
|
||||
verbs += /mob/living/silicon/pai/proc/choose_chassis
|
||||
verbs += /mob/living/silicon/pai/proc/choose_verbs
|
||||
|
||||
//PDA
|
||||
pda = new(src)
|
||||
spawn(5)
|
||||
@@ -115,7 +133,9 @@
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/pai/restrained()
|
||||
return 0
|
||||
if(istype(src.loc,/obj/item/device/paicard))
|
||||
return 0
|
||||
..()
|
||||
|
||||
/mob/living/silicon/pai/emp_act(severity)
|
||||
// Silence for 2 minutes
|
||||
@@ -233,7 +253,6 @@
|
||||
src.reset_view(C)
|
||||
return 1
|
||||
|
||||
|
||||
/mob/living/silicon/pai/cancel_camera()
|
||||
set category = "pAI Commands"
|
||||
set name = "Cancel Camera View"
|
||||
@@ -277,3 +296,144 @@
|
||||
card.setPersonality(pai)
|
||||
|
||||
*/
|
||||
|
||||
// Procs/code after this point is used to convert the stationary pai item into a
|
||||
// mobile pai mob. This also includes handling some of the general shit that can occur
|
||||
// to it. Really this deserves its own file, but for the moment it can sit here. ~ Z
|
||||
|
||||
/mob/living/silicon/pai/proc/fold_out()
|
||||
set category = "pAI Commands"
|
||||
set name = "Unfold Chassis"
|
||||
|
||||
if(stat || sleeping || paralysis || weakened)
|
||||
return
|
||||
|
||||
if(src.loc != card)
|
||||
return
|
||||
|
||||
if(world.time <= last_special)
|
||||
return
|
||||
|
||||
last_special = world.time + 100
|
||||
verbs -= /mob/living/silicon/pai/proc/fold_out
|
||||
verbs += /mob/living/silicon/pai/proc/fold_up
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
if(istype(T)) T.visible_message("<b>[src]</b> folds outwards, expanding into a mobile form.")
|
||||
canmove = 1
|
||||
|
||||
//I'm not sure how much of this is necessary, but I would rather avoid issues.
|
||||
if(istype(card.loc,/mob))
|
||||
var/mob/M = card.loc
|
||||
M.drop_item(card)
|
||||
|
||||
src.client.perspective = EYE_PERSPECTIVE
|
||||
src.client.eye = src
|
||||
|
||||
src.forceMove(get_turf(card))
|
||||
card.forceMove(src)
|
||||
|
||||
/mob/living/silicon/pai/proc/fold_up()
|
||||
set category = "pAI Commands"
|
||||
set name = "Collapse Chassis"
|
||||
|
||||
if(stat || sleeping || paralysis || weakened)
|
||||
return
|
||||
|
||||
if(src.loc == card)
|
||||
return
|
||||
|
||||
if(world.time <= last_special)
|
||||
return
|
||||
|
||||
close_up()
|
||||
|
||||
/mob/living/silicon/pai/proc/choose_chassis()
|
||||
set category = "pAI Commands"
|
||||
set name = "Choose Chassis"
|
||||
|
||||
var/choice
|
||||
var/finalized = "No"
|
||||
while(finalized == "No" && src.client)
|
||||
|
||||
choice = input(usr,"What would you like to use for your mobile chassis icon? This decision can only be made once.") as null|anything in possible_chassis
|
||||
if(!choice) return
|
||||
|
||||
icon_state = possible_chassis[choice]
|
||||
finalized = alert("Look at your sprite. Is this what you wish to use?",,"No","Yes")
|
||||
|
||||
chassis = possible_chassis[choice]
|
||||
verbs -= /mob/living/silicon/pai/proc/choose_chassis
|
||||
|
||||
/mob/living/silicon/pai/proc/choose_verbs()
|
||||
set category = "pAI Commands"
|
||||
set name = "Choose Speech Verbs"
|
||||
|
||||
var/choice = input(usr,"What theme would you like to use for your speech verbs? This decision can only be made once.") as null|anything in possible_say_verbs
|
||||
if(!choice) return
|
||||
|
||||
var/list/sayverbs = possible_say_verbs[choice]
|
||||
speak_statement = sayverbs[1]
|
||||
speak_exclamation = sayverbs[(sayverbs.len>1 ? 2 : sayverbs.len)]
|
||||
speak_query = sayverbs[(sayverbs.len>2 ? 3 : sayverbs.len)]
|
||||
|
||||
verbs -= /mob/living/silicon/pai/proc/choose_verbs
|
||||
|
||||
/mob/living/silicon/pai/lay_down()
|
||||
set name = "Rest"
|
||||
set category = "IC"
|
||||
|
||||
if(istype(src.loc,/obj/item/device/paicard))
|
||||
resting = 0
|
||||
else
|
||||
resting = !resting
|
||||
icon_state = resting ? "[chassis]_rest" : "[chassis]"
|
||||
src << "\blue You are now [resting ? "resting" : "getting up"]"
|
||||
|
||||
canmove = !resting
|
||||
|
||||
//Overriding this will stop a number of headaches down the track.
|
||||
/mob/living/silicon/pai/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(W.force)
|
||||
visible_message("<span class='danger'>[user.name] attacks [src] with [W]!</span>")
|
||||
src.adjustBruteLoss(W.force)
|
||||
src.updatehealth()
|
||||
else
|
||||
visible_message("<span class='warning'>[user.name] bonks [src] harmlessly with [W].</span>")
|
||||
if(stat != 2) close_up()
|
||||
return
|
||||
|
||||
/mob/living/silicon/pai/attack_hand(mob/user as mob)
|
||||
visible_message("<span class='danger'>[user.name] boops [src] on the head.</span>")
|
||||
close_up()
|
||||
|
||||
//I'm not sure how much of this is necessary, but I would rather avoid issues.
|
||||
/mob/living/silicon/pai/proc/close_up()
|
||||
|
||||
last_special = world.time + 100
|
||||
|
||||
verbs -= /mob/living/silicon/pai/proc/fold_up
|
||||
verbs += /mob/living/silicon/pai/proc/fold_out
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
if(istype(T)) T.visible_message("<b>[src]</b> neatly folds inwards, compacting down to a rectangular card.")
|
||||
|
||||
src.stop_pulling()
|
||||
src.client.perspective = EYE_PERSPECTIVE
|
||||
src.client.eye = card
|
||||
|
||||
//This seems redundant but not including the forced loc setting messes the behavior up.
|
||||
src.loc = card
|
||||
card.loc = get_turf(card)
|
||||
src.forceMove(card)
|
||||
card.forceMove(card.loc)
|
||||
canmove = 0
|
||||
|
||||
/mob/living/silicon/pai/start_pulling(var/atom/movable/AM)
|
||||
|
||||
if(istype(AM,/obj/item))
|
||||
var/obj/item/O = AM
|
||||
if(O.w_class == 1)
|
||||
..()
|
||||
else
|
||||
src << "<span class='warning'>You are too small to pull that.</span>"
|
||||
|
||||
@@ -528,14 +528,22 @@
|
||||
dat += {"<h2>Medical Analysis Suite</h2><hr>
|
||||
<h4>Host Bioscan</h4>
|
||||
"}
|
||||
var/mob/living/M = src.loc
|
||||
if(!istype(M, /mob/living))
|
||||
while (!istype(M, /mob/living))
|
||||
M = M.loc
|
||||
if(istype(M, /turf))
|
||||
src.temp = "Error: No biological host found. <br>"
|
||||
src.subscreen = 0
|
||||
return dat
|
||||
|
||||
var/mob/living/M
|
||||
//If we are not deployed, check the holder of the card.
|
||||
if(src.loc == card)
|
||||
M = card.loc
|
||||
|
||||
//If we are deployed or the card is not held, check the first living mob in our turf.
|
||||
if(!M || !istype(M))
|
||||
var/turf/T = get_turf(src)
|
||||
M = locate(/mob/living/) in T.contents
|
||||
|
||||
if(!M || !istype(M))
|
||||
src.temp = "Error: No biological host found. <br>"
|
||||
src.subscreen = 0
|
||||
return dat
|
||||
|
||||
dat += {"<b>Bioscan Results for [M]</b>: <br>
|
||||
Overall Status: [M.stat > 1 ? "dead" : "[M.health]% healthy"] <br><br>
|
||||
|
||||
@@ -568,22 +576,13 @@
|
||||
var/datum/gas_mixture/environment = T.return_air()
|
||||
|
||||
var/pressure = environment.return_pressure()
|
||||
var/total_moles = environment.total_moles()
|
||||
var/total_moles = environment.total_moles
|
||||
|
||||
dat += "Air Pressure: [round(pressure,0.1)] kPa<br>"
|
||||
|
||||
if (total_moles)
|
||||
var/o2_level = environment.oxygen/total_moles
|
||||
var/n2_level = environment.nitrogen/total_moles
|
||||
var/co2_level = environment.carbon_dioxide/total_moles
|
||||
var/phoron_level = environment.phoron/total_moles
|
||||
var/unknown_level = 1-(o2_level+n2_level+co2_level+phoron_level)
|
||||
dat += "Nitrogen: [round(n2_level*100)]%<br>"
|
||||
dat += "Oxygen: [round(o2_level*100)]%<br>"
|
||||
dat += "Carbon Dioxide: [round(co2_level*100)]%<br>"
|
||||
dat += "Phoron: [round(phoron_level*100)]%<br>"
|
||||
if(unknown_level > 0.01)
|
||||
dat += "OTHER: [round(unknown_level)]%<br>"
|
||||
if(total_moles)
|
||||
for(var/g in environment.gas)
|
||||
dat += "[gas_data.name[g]]: [round((environment.gas[g] / total_moles) * 100)]%<br>"
|
||||
dat += "Temperature: [round(environment.temperature-T0C)]°C<br>"
|
||||
dat += "<br><a href='byond://?src=\ref[src];software=atmosensor;sub=0'>Refresh Reading</a>"
|
||||
return dat
|
||||
|
||||
@@ -897,7 +897,7 @@
|
||||
|
||||
var/damage = rand(1, 3)
|
||||
|
||||
if(istype(src, /mob/living/carbon/slime/adult))
|
||||
if(M.is_adult)
|
||||
damage = rand(20, 40)
|
||||
else
|
||||
damage = rand(5, 35)
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
var/ending = copytext(text, length(text))
|
||||
|
||||
if (ending == "?")
|
||||
return "queries"
|
||||
return speak_query
|
||||
else if (ending == "!")
|
||||
return "declares"
|
||||
return speak_exclamation
|
||||
|
||||
return "states"
|
||||
return speak_statement
|
||||
|
||||
#define IS_AI 1
|
||||
#define IS_ROBOT 2
|
||||
@@ -85,14 +85,14 @@
|
||||
if("department")
|
||||
switch(bot_type)
|
||||
if(IS_AI)
|
||||
AI.holopad_talk(message)
|
||||
return AI.holopad_talk(message)
|
||||
if(IS_ROBOT)
|
||||
log_say("[key_name(src)] : [message]")
|
||||
R.radio.talk_into(src,message,message_mode,verb,speaking)
|
||||
if(IS_PAI)
|
||||
log_say("[key_name(src)] : [message]")
|
||||
P.radio.talk_into(src,message,message_mode,verb,speaking)
|
||||
return
|
||||
return 1
|
||||
|
||||
if("binary")
|
||||
switch(bot_type)
|
||||
@@ -105,32 +105,41 @@
|
||||
return
|
||||
|
||||
robot_talk(message)
|
||||
return
|
||||
return 1
|
||||
if("general")
|
||||
switch(bot_type)
|
||||
if(IS_AI)
|
||||
src << "Yeah, not yet, sorry"
|
||||
if (AI.aiRadio.disabledAi)
|
||||
src << "\red System Error - Transceiver Disabled"
|
||||
return
|
||||
else
|
||||
log_say("[key_name(src)] : [message]")
|
||||
AI.aiRadio.talk_into(src,message,null,verb,speaking)
|
||||
if(IS_ROBOT)
|
||||
log_say("[key_name(src)] : [message]")
|
||||
R.radio.talk_into(src,message,null,verb,speaking)
|
||||
if(IS_PAI)
|
||||
log_say("[key_name(src)] : [message]")
|
||||
P.radio.talk_into(src,message,null,verb,speaking)
|
||||
return
|
||||
return 1
|
||||
|
||||
else
|
||||
if(message_mode && message_mode in radiochannels)
|
||||
switch(bot_type)
|
||||
if(IS_AI)
|
||||
src << "You don't have this function yet, I'm working on it"
|
||||
return
|
||||
if (AI.aiRadio.disabledAi)
|
||||
src << "\red System Error - Transceiver Disabled"
|
||||
return
|
||||
else
|
||||
log_say("[key_name(src)] : [message]")
|
||||
AI.aiRadio.talk_into(src,message,message_mode,verb,speaking)
|
||||
if(IS_ROBOT)
|
||||
log_say("[key_name(src)] : [message]")
|
||||
R.radio.talk_into(src,message,message_mode,verb,speaking)
|
||||
if(IS_PAI)
|
||||
log_say("[key_name(src)] : [message]")
|
||||
P.radio.talk_into(src,message,message_mode,verb,speaking)
|
||||
return
|
||||
return 1
|
||||
|
||||
return ..(message,speaking,verb)
|
||||
|
||||
@@ -165,7 +174,8 @@
|
||||
This is another way of saying that we won't bother dealing with them.*/
|
||||
else
|
||||
src << "No holopad connected."
|
||||
return
|
||||
return
|
||||
return 1
|
||||
|
||||
/mob/living/proc/robot_talk(var/message)
|
||||
|
||||
|
||||
@@ -8,6 +8,11 @@
|
||||
var/list/hud_list[9]
|
||||
var/list/speech_synthesizer_langs = list() //which languages can be vocalized by the speech synthesizer
|
||||
|
||||
//Used in say.dm.
|
||||
var/speak_statement = "states"
|
||||
var/speak_exclamation = "declares"
|
||||
var/speak_query = "queries"
|
||||
|
||||
/mob/living/silicon/proc/show_laws()
|
||||
return
|
||||
|
||||
@@ -141,7 +146,7 @@
|
||||
|
||||
/mob/living/silicon/remove_language(var/rem_language)
|
||||
..(rem_language)
|
||||
|
||||
|
||||
for (var/datum/language/L in speech_synthesizer_langs)
|
||||
if (L.name == rem_language)
|
||||
speech_synthesizer_langs -= L
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
src << "<span class='warning'>You are too small to pull anything.</span>"
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/mouse/HasEntered(AM as mob|obj)
|
||||
/mob/living/simple_animal/mouse/Crossed(AM as mob|obj)
|
||||
if( ishuman(AM) )
|
||||
if(!stat)
|
||||
var/mob/M = AM
|
||||
|
||||
@@ -141,41 +141,41 @@
|
||||
//Atmos
|
||||
var/atmos_suitable = 1
|
||||
|
||||
var/atom/A = src.loc
|
||||
var/atom/A = src.loc
|
||||
|
||||
if(istype(A,/turf))
|
||||
var/turf/T = A
|
||||
|
||||
var/turf/T = A
|
||||
|
||||
var/datum/gas_mixture/Environment = T.return_air()
|
||||
|
||||
|
||||
if(Environment)
|
||||
|
||||
|
||||
if( abs(Environment.temperature - bodytemperature) > 40 )
|
||||
bodytemperature += ((Environment.temperature - bodytemperature) / 5)
|
||||
|
||||
|
||||
if(min_oxy)
|
||||
if(Environment.oxygen < min_oxy)
|
||||
if(Environment.gas["oxygen"] < min_oxy)
|
||||
atmos_suitable = 0
|
||||
if(max_oxy)
|
||||
if(Environment.oxygen > max_oxy)
|
||||
if(Environment.gas["oxygen"] > max_oxy)
|
||||
atmos_suitable = 0
|
||||
if(min_tox)
|
||||
if(Environment.phoron < min_tox)
|
||||
if(Environment.gas["phoron"] < min_tox)
|
||||
atmos_suitable = 0
|
||||
if(max_tox)
|
||||
if(Environment.phoron > max_tox)
|
||||
if(Environment.gas["phoron"] > max_tox)
|
||||
atmos_suitable = 0
|
||||
if(min_n2)
|
||||
if(Environment.nitrogen < min_n2)
|
||||
if(Environment.gas["nitrogen"] < min_n2)
|
||||
atmos_suitable = 0
|
||||
if(max_n2)
|
||||
if(Environment.nitrogen > max_n2)
|
||||
if(Environment.gas["nitrogen"] > max_n2)
|
||||
atmos_suitable = 0
|
||||
if(min_co2)
|
||||
if(Environment.carbon_dioxide < min_co2)
|
||||
if(Environment.gas["carbon_dioxide"] < min_co2)
|
||||
atmos_suitable = 0
|
||||
if(max_co2)
|
||||
if(Environment.carbon_dioxide > max_co2)
|
||||
if(Environment.gas["carbon_dioxide"] > max_co2)
|
||||
atmos_suitable = 0
|
||||
|
||||
//Atmos effect
|
||||
@@ -335,7 +335,7 @@
|
||||
|
||||
var/damage = rand(1, 3)
|
||||
|
||||
if(istype(src, /mob/living/carbon/slime/adult))
|
||||
if(M.is_adult)
|
||||
damage = rand(20, 40)
|
||||
else
|
||||
damage = rand(5, 35)
|
||||
|
||||
+1
-20
@@ -13,25 +13,6 @@
|
||||
living_mob_list += src
|
||||
..()
|
||||
|
||||
/mob/proc/Cell()
|
||||
set category = "Admin"
|
||||
set hidden = 1
|
||||
|
||||
if(!loc) return 0
|
||||
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
|
||||
var/t = "\blue Coordinates: [x],[y] \n"
|
||||
t+= "\red Temperature: [environment.temperature] \n"
|
||||
t+= "\blue Nitrogen: [environment.nitrogen] \n"
|
||||
t+= "\blue Oxygen: [environment.oxygen] \n"
|
||||
t+= "\blue Phoron : [environment.phoron] \n"
|
||||
t+= "\blue Carbon Dioxide: [environment.carbon_dioxide] \n"
|
||||
for(var/datum/gas/trace_gas in environment.trace_gases)
|
||||
usr << "\blue [trace_gas.type]: [trace_gas.moles] \n"
|
||||
|
||||
usr.show_message(t, 1)
|
||||
|
||||
/mob/proc/show_message(msg, type, alt, alt_type)//Message, type of message (1 or 2), alternative message, alt message type (1 or 2)
|
||||
|
||||
if(!client) return
|
||||
@@ -721,7 +702,7 @@ note dizziness decrements automatically in the mob's Life() proc.
|
||||
stat(null,"MasterController-ERROR")
|
||||
|
||||
if(listed_turf && client)
|
||||
if(get_dist(listed_turf,src) > 1)
|
||||
if(!TurfAdjacent(listed_turf))
|
||||
listed_turf = null
|
||||
else
|
||||
statpanel(listed_turf.name, null, listed_turf)
|
||||
|
||||
@@ -35,11 +35,6 @@
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/isslimeadult(A)
|
||||
if(istype(A, /mob/living/carbon/slime/adult))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/isrobot(A)
|
||||
if(istype(A, /mob/living/silicon/robot))
|
||||
return 1
|
||||
|
||||
@@ -127,6 +127,9 @@
|
||||
O.verbs += /mob/living/silicon/ai/proc/ai_camera_list
|
||||
O.verbs += /mob/living/silicon/ai/proc/ai_statuschange
|
||||
O.verbs += /mob/living/silicon/ai/proc/ai_roster
|
||||
O.verbs += /mob/living/silicon/ai/proc/ai_store_location
|
||||
O.verbs += /mob/living/silicon/ai/proc/ai_goto_location
|
||||
O.verbs += /mob/living/silicon/ai/proc/ai_remove_location
|
||||
|
||||
O.job = "AI"
|
||||
|
||||
@@ -245,11 +248,10 @@
|
||||
babies += M
|
||||
new_slime = pick(babies)
|
||||
else
|
||||
new_slime = new /mob/living/carbon/slime(loc)
|
||||
if(adult)
|
||||
new_slime = new /mob/living/carbon/slime/adult(loc)
|
||||
new_slime.is_adult = 1
|
||||
else
|
||||
new_slime = new /mob/living/carbon/slime(loc)
|
||||
new_slime.a_intent = "hurt"
|
||||
new_slime.key = key
|
||||
|
||||
new_slime << "<B>You are now a slime. Skreee!</B>"
|
||||
|
||||
@@ -32,11 +32,12 @@
|
||||
*
|
||||
* @param user /mob The mob who is interacting with this ui
|
||||
* @param ui_key string A string key to use for this ui. Allows for multiple unique uis on one obj/mob (defaut value "main")
|
||||
* @param ui /datum/nanoui This parameter is passed by the nanoui process() proc when updating an open ui
|
||||
* @param ui /datum/nanoui This parameter is passed by the nanoui process() proc when updating an open ui
|
||||
* @param force_open boolean Force the UI to (re)open, even if it's already open
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
/atom/movable/proc/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
|
||||
/atom/movable/proc/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
return
|
||||
|
||||
// Used by the Nano UI Manager (/datum/nanomanager) to track UIs opened by this mob
|
||||
|
||||
@@ -39,19 +39,23 @@
|
||||
* @param ui_key string A string key used for the ui
|
||||
* @param ui /datum/nanoui An existing instance of the ui (can be null)
|
||||
* @param data list The data to be passed to the ui, if it exists
|
||||
* @param force_open boolean The ui is being forced to (re)open, so close ui if it exists (instead of updating)
|
||||
*
|
||||
* @return /nanoui Returns the found ui, for null if none exists
|
||||
*/
|
||||
/datum/nanomanager/proc/try_update_ui(var/mob/user, src_object, ui_key, var/datum/nanoui/ui, data)
|
||||
/datum/nanomanager/proc/try_update_ui(var/mob/user, src_object, ui_key, var/datum/nanoui/ui, data, var/force_open = 0)
|
||||
if (isnull(ui)) // no ui has been passed, so we'll search for one
|
||||
{
|
||||
ui = get_open_ui(user, src_object, ui_key)
|
||||
}
|
||||
}
|
||||
if (!isnull(ui))
|
||||
// The UI is already open so push the data to it
|
||||
ui.push_data(data)
|
||||
return ui
|
||||
|
||||
// The UI is already open
|
||||
if (!force_open)
|
||||
ui.push_data(data)
|
||||
return ui
|
||||
else
|
||||
//testing("nanomanager/try_update_ui mob [user.name] [src_object:name] [ui_key] [force_open] - forcing opening of ui")
|
||||
ui.close()
|
||||
return null
|
||||
|
||||
/**
|
||||
@@ -66,14 +70,17 @@
|
||||
/datum/nanomanager/proc/get_open_ui(var/mob/user, src_object, ui_key)
|
||||
var/src_object_key = "\ref[src_object]"
|
||||
if (isnull(open_uis[src_object_key]) || !istype(open_uis[src_object_key], /list))
|
||||
//testing("nanomanager/get_open_ui mob [user.name] [src_object:name] [ui_key] - there are no uis open")
|
||||
return null
|
||||
else if (isnull(open_uis[src_object_key][ui_key]) || !istype(open_uis[src_object_key][ui_key], /list))
|
||||
else if (isnull(open_uis[src_object_key][ui_key]) || !istype(open_uis[src_object_key][ui_key], /list))
|
||||
//testing("nanomanager/get_open_ui mob [user.name] [src_object:name] [ui_key] - there are no uis open for this object")
|
||||
return null
|
||||
|
||||
for (var/datum/nanoui/ui in open_uis[src_object_key][ui_key])
|
||||
if (ui.user == user)
|
||||
return ui
|
||||
|
||||
|
||||
//testing("nanomanager/get_open_ui mob [user.name] [src_object:name] [ui_key] - ui not found")
|
||||
return null
|
||||
|
||||
/**
|
||||
@@ -83,7 +90,7 @@
|
||||
*
|
||||
* @return int The number of uis updated
|
||||
*/
|
||||
/datum/nanomanager/proc/update_uis(src_object)
|
||||
/datum/nanomanager/proc/update_uis(src_object)
|
||||
var/src_object_key = "\ref[src_object]"
|
||||
if (isnull(open_uis[src_object_key]) || !istype(open_uis[src_object_key], /list))
|
||||
return 0
|
||||
@@ -128,7 +135,8 @@
|
||||
*/
|
||||
/datum/nanomanager/proc/close_user_uis(var/mob/user, src_object = null, ui_key = null)
|
||||
if (isnull(user.open_uis) || !istype(user.open_uis, /list) || open_uis.len == 0)
|
||||
return 0 // has no open uis
|
||||
//testing("nanomanager/close_user_uis mob [user.name] has no open uis")
|
||||
return 0 // has no open uis
|
||||
|
||||
var/close_count = 0
|
||||
for (var/datum/nanoui/ui in user.open_uis)
|
||||
@@ -136,6 +144,8 @@
|
||||
ui.close()
|
||||
close_count++
|
||||
|
||||
//testing("nanomanager/close_user_uis mob [user.name] closed [open_uis.len] of [close_count] uis")
|
||||
|
||||
return close_count
|
||||
|
||||
/**
|
||||
@@ -157,6 +167,7 @@
|
||||
var/list/uis = open_uis[src_object_key][ui.ui_key]
|
||||
uis.Add(ui)
|
||||
processing_uis.Add(ui)
|
||||
//testing("nanomanager/ui_opened mob [ui.user.name] [ui.src_object:name] [ui.ui_key] - user.open_uis [ui.user.open_uis.len] | uis [uis.len] | processing_uis [processing_uis.len]")
|
||||
|
||||
/**
|
||||
* Remove a /nanoui ui from the list of open uis
|
||||
@@ -176,7 +187,11 @@
|
||||
processing_uis.Remove(ui)
|
||||
ui.user.open_uis.Remove(ui)
|
||||
var/list/uis = open_uis[src_object_key][ui.ui_key]
|
||||
return uis.Remove(ui)
|
||||
uis.Remove(ui)
|
||||
|
||||
//testing("nanomanager/ui_closed mob [ui.user.name] [ui.src_object:name] [ui.ui_key] - user.open_uis [ui.user.open_uis.len] | uis [uis.len] | processing_uis [processing_uis.len]")
|
||||
|
||||
return 1
|
||||
|
||||
/**
|
||||
* This is called on user logout
|
||||
@@ -189,6 +204,7 @@
|
||||
|
||||
//
|
||||
/datum/nanomanager/proc/user_logout(var/mob/user)
|
||||
//testing("nanomanager/user_logout user [user.name]")
|
||||
return close_user_uis(user)
|
||||
|
||||
/**
|
||||
@@ -201,7 +217,9 @@
|
||||
* @return nothing
|
||||
*/
|
||||
/datum/nanomanager/proc/user_transferred(var/mob/oldMob, var/mob/newMob)
|
||||
//testing("nanomanager/user_transferred from mob [oldMob.name] to mob [newMob.name]")
|
||||
if (isnull(oldMob.open_uis) || !istype(oldMob.open_uis, /list) || open_uis.len == 0)
|
||||
//testing("nanomanager/user_transferred mob [oldMob.name] has no open uis")
|
||||
return 0 // has no open uis
|
||||
|
||||
if (isnull(newMob.open_uis) || !istype(newMob.open_uis, /list))
|
||||
|
||||
+124
-92
@@ -36,11 +36,12 @@ nanoui is used to open and update nano browser uis
|
||||
var/list/stylesheets = list()
|
||||
// the list of javascript scripts to use for this ui
|
||||
var/list/scripts = list()
|
||||
// the list of templates to use with this ui (usually just one)
|
||||
// a list of templates which can be used with this ui
|
||||
var/templates[0]
|
||||
// the body content for this ui, do not change unless you know what you're doing
|
||||
// the #mainTemplate div will contain the compiled "main" template html
|
||||
var/content = "<div id='mainTemplate'></div>"
|
||||
// the layout key for this ui (this is used on the frontend, leave it as "default" unless you know what you're doing)
|
||||
var/layout_key = "default"
|
||||
// the default state to use for this ui (this is used on the frontend, leave it as "default" unless you know what you're doing)
|
||||
var/state_key = "default"
|
||||
// initial data, containing the full data structure, must be sent to the ui (the data structure cannot be extended later on)
|
||||
var/list/initial_data[0]
|
||||
// set to 1 to update the ui automatically every master_controller tick
|
||||
@@ -57,7 +58,7 @@ nanoui is used to open and update nano browser uis
|
||||
* @param nuser /mob The mob who has opened/owns this ui
|
||||
* @param nsrc_object /obj|/mob The obj or mob which this ui belongs to
|
||||
* @param nui_key string A string key to use for this ui. Allows for multiple unique uis on one src_oject
|
||||
* @param ntemplate string The name of the template file from /nano/templates (e.g. "my_template.tmpl")
|
||||
* @param ntemplate string The filename of the template file from /nano/templates (e.g. "my_template.tmpl")
|
||||
* @param ntitle string The title of this ui
|
||||
* @param nwidth int the width of the ui window
|
||||
* @param nheight int the height of the ui window
|
||||
@@ -65,14 +66,14 @@ nanoui is used to open and update nano browser uis
|
||||
*
|
||||
* @return /nanoui new nanoui object
|
||||
*/
|
||||
/datum/nanoui/New(nuser, nsrc_object, nui_key, ntemplate, ntitle = 0, nwidth = 0, nheight = 0, var/atom/nref = null)
|
||||
/datum/nanoui/New(nuser, nsrc_object, nui_key, ntemplate_filename, ntitle = 0, nwidth = 0, nheight = 0, var/atom/nref = null)
|
||||
user = nuser
|
||||
src_object = nsrc_object
|
||||
ui_key = nui_key
|
||||
window_id = "[ui_key]\ref[src_object]"
|
||||
|
||||
// Add the passed template as the 'main' template, this is required
|
||||
add_template("main", ntemplate)
|
||||
// add the passed template filename as the "main" template, this is required
|
||||
add_template("main", ntemplate_filename)
|
||||
|
||||
if (ntitle)
|
||||
title = ntitle
|
||||
@@ -86,17 +87,21 @@ nanoui is used to open and update nano browser uis
|
||||
add_common_assets()
|
||||
|
||||
/**
|
||||
* Use this proc to add assets which are common to all nano uis
|
||||
* Use this proc to add assets which are common to (and required by) all nano uis
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
/datum/nanoui/proc/add_common_assets()
|
||||
add_script("libraries.min.js") // The jQuery library
|
||||
add_script("nano_config.js") // The NanoConfig JS, this is used to store configuration values.
|
||||
add_script("nano_update.js") // The NanoUpdate JS, this is used to receive updates and apply them.
|
||||
add_script("nano_base_helpers.js") // The NanoBaseHelpers JS, this is used to set up template helpers which are common to all templates
|
||||
add_script("libraries.min.js") // A JS file comprising of jQuery, doT.js and jQuery Timer libraries (compressed together)
|
||||
add_script("nano_utility.js") // The NanoUtility JS, this is used to store utility functions.
|
||||
add_script("nano_template.js") // The NanoTemplate JS, this is used to render templates.
|
||||
add_script("nano_state_manager.js") // The NanoStateManager JS, it handles updates from the server and passes data to the current state
|
||||
add_script("nano_state.js") // The NanoState JS, this is the base state which all states must inherit from
|
||||
add_script("nano_state_default.js") // The NanoStateDefault JS, this is the "default" state (used by all UIs by default), which inherits from NanoState
|
||||
add_script("nano_base_callbacks.js") // The NanoBaseCallbacks JS, this is used to set up (before and after update) callbacks which are common to all UIs
|
||||
add_script("nano_base_helpers.js") // The NanoBaseHelpers JS, this is used to set up template helpers which are common to all UIs
|
||||
add_stylesheet("shared.css") // this CSS sheet is common to all UIs
|
||||
add_stylesheet("icons.css") // this CSS sheet is common to all UIs
|
||||
add_stylesheet("icons.css") // this CSS sheet is common to all UIs
|
||||
|
||||
/**
|
||||
* Set the current status (also known as visibility) of this ui.
|
||||
@@ -107,12 +112,15 @@ nanoui is used to open and update nano browser uis
|
||||
* @return nothing
|
||||
*/
|
||||
/datum/nanoui/proc/set_status(state, push_update)
|
||||
if (state != status)
|
||||
status = state
|
||||
if (push_update || !status)
|
||||
push_data(list(), 1) // Update the UI, force the update in case the status is 0
|
||||
else
|
||||
status = state
|
||||
if (state != status) // Only update if it is different
|
||||
if (status == STATUS_DISABLED)
|
||||
status = state
|
||||
if (push_update)
|
||||
update()
|
||||
else
|
||||
status = state
|
||||
if (push_update || status == 0)
|
||||
push_data(null, 1) // Update the UI, force the update in case the status is 0, data is null so that previous data is used
|
||||
|
||||
/**
|
||||
* Update the status (visibility) of this ui based on the user's status
|
||||
@@ -121,7 +129,7 @@ nanoui is used to open and update nano browser uis
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
/datum/nanoui/proc/update_status(push_update = 0)
|
||||
/datum/nanoui/proc/update_status(var/push_update = 0)
|
||||
if (istype(user, /mob/living/silicon/ai))
|
||||
set_status(STATUS_INTERACTIVE, push_update) // interactive (green visibility)
|
||||
else if (istype(user, /mob/living/silicon/robot))
|
||||
@@ -169,21 +177,39 @@ nanoui is used to open and update nano browser uis
|
||||
* @return nothing
|
||||
*/
|
||||
/datum/nanoui/proc/set_initial_data(list/data)
|
||||
initial_data = add_default_data(data)
|
||||
initial_data = data
|
||||
|
||||
/**
|
||||
* Add default data to the data being sent to the ui.
|
||||
* Get config data to sent to the ui.
|
||||
*
|
||||
* @param data /list The list of data to be modified
|
||||
*
|
||||
* @return /list modified data
|
||||
* @return /list config data
|
||||
*/
|
||||
/datum/nanoui/proc/add_default_data(list/data)
|
||||
data["ui"] = list(
|
||||
/datum/nanoui/proc/get_config_data()
|
||||
var/list/config_data = list(
|
||||
"title" = title,
|
||||
"srcObject" = list("name" = src_object.name),
|
||||
"stateKey" = state_key,
|
||||
"status" = status,
|
||||
"user" = list("name" = user.name)
|
||||
)
|
||||
return data
|
||||
return config_data
|
||||
|
||||
/**
|
||||
* Get data to sent to the ui.
|
||||
*
|
||||
* @param data /list The list of general data for this ui (can be null to use previous data sent)
|
||||
*
|
||||
* @return /list data to send to the ui
|
||||
*/
|
||||
/datum/nanoui/proc/get_send_data(var/list/data)
|
||||
var/list/config_data = get_config_data()
|
||||
|
||||
var/list/send_data = list("config" = config_data)
|
||||
|
||||
if (!isnull(data))
|
||||
send_data["data"] = data
|
||||
|
||||
return send_data
|
||||
|
||||
/**
|
||||
* Set the browser window options for this ui
|
||||
@@ -197,6 +223,7 @@ nanoui is used to open and update nano browser uis
|
||||
|
||||
/**
|
||||
* Add a CSS stylesheet to this UI
|
||||
* These must be added before the UI has been opened, adding after that will have no effect
|
||||
*
|
||||
* @param file string The name of the CSS file from /nano/css (e.g. "my_style.css")
|
||||
*
|
||||
@@ -207,6 +234,7 @@ nanoui is used to open and update nano browser uis
|
||||
|
||||
/**
|
||||
* Add a JavsScript script to this UI
|
||||
* These must be added before the UI has been opened, adding after that will have no effect
|
||||
*
|
||||
* @param file string The name of the JavaScript file from /nano/js (e.g. "my_script.js")
|
||||
*
|
||||
@@ -216,30 +244,41 @@ nanoui is used to open and update nano browser uis
|
||||
scripts.Add(file)
|
||||
|
||||
/**
|
||||
* Add a template to this UI
|
||||
* Add a template for this UI
|
||||
* Templates are combined with the data sent to the UI to create the rendered view
|
||||
* Each template needs a div in ui.content to contain the rendered content.
|
||||
* The div format is '<div id='<templateKey>Template'></div>' where <templateKey> is replaced with the templater's key.
|
||||
* All UIs are set up by default to use a 'main' template, so only use this proc if you want to add advanced functionality.
|
||||
* These must be added before the UI has been opened, adding after that will have no effect
|
||||
*
|
||||
* @param key string The key name for this template, used to identify the div to render this template into ('<div id='<templateKey>Template'></div>')
|
||||
* @param file string The name of the template file from /nano/templates (e.g. "my_template.tmpl")
|
||||
* @param key string The key which is used to reference this template in the frontend
|
||||
* @param filename string The name of the template file from /nano/templates (e.g. "my_template.tmpl")
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
/datum/nanoui/proc/add_template(key, file)
|
||||
templates[key] = file
|
||||
|
||||
/datum/nanoui/proc/add_template(key, filename)
|
||||
templates[key] = filename
|
||||
|
||||
/**
|
||||
* Set the HTML content of the UI
|
||||
* This should only really be used to add more template divs (see the add_template() proc)
|
||||
* Set the layout key for use in the frontend Javascript
|
||||
* The layout key is the basic layout key for the page
|
||||
* Two files are loaded on the client based on the layout key varable:
|
||||
* -> a template in /nano/templates with the filename "layout_<layout_key>.tmpl
|
||||
* -> a CSS stylesheet in /nano/css with the filename "layout_<layout_key>.css
|
||||
*
|
||||
* @param ncontent string The new HTML content for this UI
|
||||
* @param nlayout string The layout key to use
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
/datum/nanoui/proc/set_content(ncontent)
|
||||
content = ncontent
|
||||
/datum/nanoui/proc/set_layout_key(nlayout_key)
|
||||
layout_key = lowertext(nlayout_key)
|
||||
|
||||
/**
|
||||
* Set the state key for use in the frontend Javascript
|
||||
*
|
||||
* @param nstate_key string The key of the state to use
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
/datum/nanoui/proc/set_state_key(nstate_key)
|
||||
state_key = nstate_key
|
||||
|
||||
/**
|
||||
* Set whether or not to use the "old" on close logic (mainly unset_machine())
|
||||
@@ -252,11 +291,16 @@ nanoui is used to open and update nano browser uis
|
||||
on_close_logic = state
|
||||
|
||||
/**
|
||||
* Return the HTML header content for this UI
|
||||
* Return the HTML for this UI
|
||||
*
|
||||
* @return string HTML header content
|
||||
* @return string HTML for the UI
|
||||
*/
|
||||
/datum/nanoui/proc/get_header()
|
||||
/datum/nanoui/proc/get_html()
|
||||
|
||||
// before the UI opens, add the layout files based on the layout key
|
||||
add_stylesheet("layout_[layout_key].css")
|
||||
add_template("layout", "layout_[layout_key].tmpl")
|
||||
|
||||
var/head_content = ""
|
||||
|
||||
for (var/filename in scripts)
|
||||
@@ -264,68 +308,46 @@ nanoui is used to open and update nano browser uis
|
||||
|
||||
for (var/filename in stylesheets)
|
||||
head_content += "<link rel='stylesheet' type='text/css' href='[filename]'> "
|
||||
|
||||
var/templatel_data[0]
|
||||
for (var/key in templates)
|
||||
templatel_data[key] = templates[key];
|
||||
|
||||
|
||||
var/template_data_json = "{}" // An empty JSON object
|
||||
if (templatel_data.len > 0)
|
||||
template_data_json = list2json(templatel_data)
|
||||
if (templates.len > 0)
|
||||
template_data_json = list2json(templates)
|
||||
|
||||
var/initial_data_json = "{}" // An empty JSON object
|
||||
if (initial_data.len > 0)
|
||||
initial_data_json = list2json(initial_data)
|
||||
var/list/send_data = get_send_data(initial_data)
|
||||
var/initial_data_json = list2json(send_data)
|
||||
|
||||
var/url_parameters_json = list2json(list("src" = "\ref[src]"))
|
||||
|
||||
return {"<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
return {"
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<head>
|
||||
<script type='text/javascript'>
|
||||
function receiveUpdateData(jsonString)
|
||||
{
|
||||
// We need both jQuery and NanoUpdate to be able to recieve data
|
||||
// We need both jQuery and NanoStateManager to be able to recieve data
|
||||
// At the moment any data received before those libraries are loaded will be lost
|
||||
if (typeof NanoUpdate != 'undefined' && typeof jQuery != 'undefined')
|
||||
if (typeof NanoStateManager != 'undefined' && typeof jQuery != 'undefined')
|
||||
{
|
||||
NanoUpdate.receiveUpdateData(jsonString);
|
||||
NanoStateManager.receiveUpdateData(jsonString);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
[head_content]
|
||||
</head>
|
||||
<body scroll=auto data-url-parameters='[url_parameters_json]' data-template-data='[template_data_json]' data-initial-data='[initial_data_json]'>
|
||||
<div id='uiWrapper'>
|
||||
[title ? "<div id='uiTitleWrapper'><div id='uiStatusIcon' class='icon24 uiStatusGood'></div><div id='uiTitle'>[title]</div><div id='uiTitleFluff'></div></div>" : ""]
|
||||
<div id='uiContent'>
|
||||
<div id='uiNoJavaScript'>Initiating...</div>
|
||||
"}
|
||||
|
||||
/**
|
||||
* Return the HTML footer content for this UI
|
||||
*
|
||||
* @return string HTML footer content
|
||||
*/
|
||||
/datum/nanoui/proc/get_footer()
|
||||
|
||||
return {"
|
||||
</div>
|
||||
<body scroll=auto data-template-data='[template_data_json]' data-url-parameters='[url_parameters_json]' data-initial-data='[initial_data_json]'>
|
||||
<div id='uiLayout'>
|
||||
</div>
|
||||
<noscript>
|
||||
<div id='uiNoScript'>
|
||||
<h2>JAVASCRIPT REQUIRED</h2>
|
||||
<p>Your Internet Explorer's Javascript is disabled (or broken).<br/>
|
||||
Enable Javascript and then open this UI again.</p>
|
||||
</div>
|
||||
</noscript>
|
||||
</body>
|
||||
</html>"}
|
||||
|
||||
/**
|
||||
* Return the HTML for this UI
|
||||
*
|
||||
* @return string HTML for the UI
|
||||
*/
|
||||
/datum/nanoui/proc/get_html()
|
||||
return {"
|
||||
[get_header()]
|
||||
[content]
|
||||
[get_footer()]
|
||||
</html>
|
||||
"}
|
||||
|
||||
/**
|
||||
@@ -333,7 +355,8 @@ nanoui is used to open and update nano browser uis
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
/datum/nanoui/proc/open()
|
||||
/datum/nanoui/proc/open()
|
||||
|
||||
var/window_size = ""
|
||||
if (width && height)
|
||||
window_size = "size=[width]x[height];"
|
||||
@@ -377,9 +400,10 @@ nanoui is used to open and update nano browser uis
|
||||
if (status == STATUS_DISABLED && !force_push)
|
||||
return // Cannot update UI, no visibility
|
||||
|
||||
data = add_default_data(data)
|
||||
var/list/send_data = get_send_data(data)
|
||||
|
||||
//user << list2json(data) // used for debugging
|
||||
user << output(list2params(list(list2json(data))),"[window_id].browser:receiveUpdateData")
|
||||
user << output(list2params(list(list2json(send_data))),"[window_id].browser:receiveUpdateData")
|
||||
|
||||
/**
|
||||
* This Topic() proc is called whenever a user clicks on a link within a Nano UI
|
||||
@@ -410,7 +434,15 @@ nanoui is used to open and update nano browser uis
|
||||
return
|
||||
|
||||
if (status && (update || is_auto_updating))
|
||||
src_object.ui_interact(user, ui_key, src) // Update the UI (update_status() is called whenever a UI is updated)
|
||||
update() // Update the UI (update_status() is called whenever a UI is updated)
|
||||
else
|
||||
update_status(1) // Not updating UI, so lets check here if status has changed
|
||||
|
||||
/**
|
||||
* Update the UI
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
/datum/nanoui/proc/update(var/force_open = 0)
|
||||
src_object.ui_interact(user, ui_key, src, force_open)
|
||||
|
||||
|
||||
+15
-15
@@ -673,7 +673,7 @@
|
||||
return
|
||||
|
||||
// do APC interaction
|
||||
user.set_machine(src)
|
||||
//user.set_machine(src)
|
||||
src.interact(user)
|
||||
|
||||
/obj/machinery/power/apc/attack_alien(mob/living/carbon/alien/humanoid/user)
|
||||
@@ -741,7 +741,7 @@
|
||||
else
|
||||
return 0 // 0 = User is not a Malf AI
|
||||
|
||||
/obj/machinery/power/apc/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
|
||||
/obj/machinery/power/apc/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
if(!user)
|
||||
return
|
||||
|
||||
@@ -752,7 +752,7 @@
|
||||
"powerCellStatus" = cell ? cell.percent() : null,
|
||||
"chargeMode" = chargemode,
|
||||
"chargingStatus" = charging,
|
||||
"totalLoad" = lastused_equip + lastused_light + lastused_environ,
|
||||
"totalLoad" = round(lastused_equip + lastused_light + lastused_environ),
|
||||
"coverLocked" = coverlocked,
|
||||
"siliconUser" = istype(user, /mob/living/silicon),
|
||||
"malfStatus" = get_malf_status(user),
|
||||
@@ -760,7 +760,7 @@
|
||||
"powerChannels" = list(
|
||||
list(
|
||||
"title" = "Equipment",
|
||||
"powerLoad" = lastused_equip,
|
||||
"powerLoad" = round(lastused_equip),
|
||||
"status" = equipment,
|
||||
"topicParams" = list(
|
||||
"auto" = list("eqp" = 3),
|
||||
@@ -770,7 +770,7 @@
|
||||
),
|
||||
list(
|
||||
"title" = "Lighting",
|
||||
"powerLoad" = lastused_light,
|
||||
"powerLoad" = round(lastused_light),
|
||||
"status" = lighting,
|
||||
"topicParams" = list(
|
||||
"auto" = list("lgt" = 3),
|
||||
@@ -780,7 +780,7 @@
|
||||
),
|
||||
list(
|
||||
"title" = "Environment",
|
||||
"powerLoad" = lastused_environ,
|
||||
"powerLoad" = round(lastused_environ),
|
||||
"status" = environ,
|
||||
"topicParams" = list(
|
||||
"auto" = list("env" = 3),
|
||||
@@ -792,7 +792,7 @@
|
||||
)
|
||||
|
||||
// update the ui if it exists, returns null if no ui is passed/found
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
// the ui does not exist, so we'll create a new() one
|
||||
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
|
||||
@@ -961,14 +961,14 @@
|
||||
/obj/machinery/power/apc/Topic(href, href_list, var/usingUI = 1)
|
||||
if(!(isrobot(usr) && (href_list["apcwires"] || href_list["pulse"])))
|
||||
if(!can_use(usr, 1))
|
||||
return
|
||||
return 0
|
||||
src.add_fingerprint(usr)
|
||||
|
||||
if (href_list["apcwires"])
|
||||
var/t1 = text2num(href_list["apcwires"])
|
||||
if (!( istype(usr.get_active_hand(), /obj/item/weapon/wirecutters) ))
|
||||
usr << "You need wirecutters!"
|
||||
return
|
||||
return 0
|
||||
if (src.isWireColorCut(t1))
|
||||
src.mend(t1)
|
||||
else
|
||||
@@ -977,10 +977,10 @@
|
||||
var/t1 = text2num(href_list["pulse"])
|
||||
if (!istype(usr.get_active_hand(), /obj/item/device/multitool))
|
||||
usr << "You need a multitool!"
|
||||
return
|
||||
return 0
|
||||
if (src.isWireColorCut(t1))
|
||||
usr << "You can't pulse a cut wire."
|
||||
return
|
||||
return 0
|
||||
else
|
||||
src.pulse(t1)
|
||||
else if (href_list["lock"])
|
||||
@@ -1027,11 +1027,11 @@
|
||||
else if( href_list["close"] )
|
||||
nanomanager.close_user_uis(usr, src)
|
||||
|
||||
return
|
||||
return 0
|
||||
else if (href_list["close2"])
|
||||
usr << browse(null, "window=apcwires")
|
||||
|
||||
return
|
||||
return 0
|
||||
|
||||
else if (href_list["overload"])
|
||||
if( istype(usr, /mob/living/silicon) && !src.aidisabled )
|
||||
@@ -1042,7 +1042,7 @@
|
||||
if( istype(malfai, /mob/living/silicon/ai) && !src.aidisabled )
|
||||
if (malfai.malfhacking)
|
||||
malfai << "You are already hacking an APC."
|
||||
return
|
||||
return 0
|
||||
malfai << "Beginning override of APC systems. This takes some time, and you cannot perform other actions during the process."
|
||||
malfai.malfhack = src
|
||||
malfai.malfhacking = 1
|
||||
@@ -1071,7 +1071,7 @@
|
||||
if(usingUI)
|
||||
src.updateDialog()
|
||||
|
||||
return
|
||||
return 1
|
||||
|
||||
/*/obj/machinery/power/apc/proc/malfoccupy(var/mob/living/silicon/ai/malf)
|
||||
if(!istype(malf))
|
||||
|
||||
@@ -27,12 +27,11 @@ var/global/list/rad_collectors = list()
|
||||
|
||||
/obj/machinery/power/rad_collector/process()
|
||||
if(P)
|
||||
if(P.air_contents.phoron <= 0)
|
||||
if(P.air_contents.gas["phoron"] == 0)
|
||||
investigate_log("<font color='red'>out of fuel</font>.","singulo")
|
||||
P.air_contents.phoron = 0
|
||||
eject()
|
||||
else
|
||||
P.air_contents.adjust(tx = -0.001*drainratio)
|
||||
P.air_contents.adjust_gas("phoron", -0.001*drainratio)
|
||||
return
|
||||
|
||||
|
||||
@@ -42,7 +41,7 @@ var/global/list/rad_collectors = list()
|
||||
toggle_power()
|
||||
user.visible_message("[user.name] turns the [src.name] [active? "on":"off"].", \
|
||||
"You turn the [src.name] [active? "on":"off"].")
|
||||
investigate_log("turned [active?"<font color='green'>on</font>":"<font color='red'>off</font>"] by [user.key]. [P?"Fuel: [round(P.air_contents.phoron/0.29)]%":"<font color='red'>It is empty</font>"].","singulo")
|
||||
investigate_log("turned [active?"<font color='green'>on</font>":"<font color='red'>off</font>"] by [user.key]. [P?"Fuel: [round(P.air_contents.gas["phoron"]/0.29)]%":"<font color='red'>It is empty</font>"].","singulo")
|
||||
return
|
||||
else
|
||||
user << "\red The controls are locked!"
|
||||
@@ -121,7 +120,7 @@ var/global/list/rad_collectors = list()
|
||||
/obj/machinery/power/rad_collector/proc/receive_pulse(var/pulse_strength)
|
||||
if(P && active)
|
||||
var/power_produced = 0
|
||||
power_produced = P.air_contents.phoron*pulse_strength*20
|
||||
power_produced = P.air_contents.gas["phoron"]*pulse_strength*20
|
||||
add_avail(power_produced)
|
||||
last_power = power_produced
|
||||
return
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
anchored = 0
|
||||
density = 1
|
||||
req_access = list(access_engine_equip)
|
||||
var/id = null
|
||||
|
||||
use_power = 0
|
||||
idle_power_usage = 10
|
||||
@@ -51,9 +52,11 @@
|
||||
else
|
||||
icon_state = "emitter"
|
||||
|
||||
|
||||
/obj/machinery/power/emitter/attack_hand(mob/user as mob)
|
||||
src.add_fingerprint(user)
|
||||
activate(user)
|
||||
|
||||
/obj/machinery/power/emitter/proc/activate(mob/user as mob)
|
||||
if(state == 2)
|
||||
if(!powernet)
|
||||
user << "The emitter isn't connected to a wire."
|
||||
|
||||
@@ -250,7 +250,7 @@
|
||||
building_terminal = 0
|
||||
|
||||
|
||||
/obj/machinery/power/smes/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
|
||||
/obj/machinery/power/smes/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
@@ -269,7 +269,7 @@
|
||||
data["outputLoad"] = round(loaddemand)
|
||||
|
||||
// update the ui if it exists, returns null if no ui is passed/found
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
// the ui does not exist, so we'll create a new() one
|
||||
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
return
|
||||
rpm = 0.9* rpm + 0.1 * rpmtarget
|
||||
var/datum/gas_mixture/environment = inturf.return_air()
|
||||
var/transfer_moles = environment.total_moles()/10
|
||||
var/transfer_moles = environment.total_moles / 10
|
||||
//var/transfer_moles = rpm/10000*capacity
|
||||
var/datum/gas_mixture/removed = inturf.remove_air(transfer_moles)
|
||||
gas_contained.merge(removed)
|
||||
@@ -129,14 +129,14 @@
|
||||
lastgen = ((compressor.rpm / TURBGENQ)**TURBGENG) *TURBGENQ
|
||||
|
||||
add_avail(lastgen)
|
||||
var/newrpm = ((compressor.gas_contained.temperature) * compressor.gas_contained.total_moles())/4
|
||||
var/newrpm = ((compressor.gas_contained.temperature) * compressor.gas_contained.total_moles)/4
|
||||
newrpm = max(0, newrpm)
|
||||
|
||||
if(!compressor.starter || newrpm > 1000)
|
||||
compressor.rpmtarget = newrpm
|
||||
|
||||
if(compressor.gas_contained.total_moles()>0)
|
||||
var/oamount = min(compressor.gas_contained.total_moles(), (compressor.rpm+100)/35000*compressor.capacity)
|
||||
if(compressor.gas_contained.total_moles>0)
|
||||
var/oamount = min(compressor.gas_contained.total_moles, (compressor.rpm+100)/35000*compressor.capacity)
|
||||
var/datum/gas_mixture/removed = compressor.gas_contained.remove(oamount)
|
||||
outturf.assume_air(removed)
|
||||
|
||||
|
||||
@@ -21,6 +21,10 @@
|
||||
|
||||
/obj/item/projectile/bullet/weakbullet/beanbag //because beanbags are not bullets
|
||||
name = "beanbag"
|
||||
damage = 20
|
||||
agony = 60
|
||||
embed = 0
|
||||
sharp = 0
|
||||
|
||||
/obj/item/projectile/bullet/weakbullet/rubber
|
||||
name = "rubber bullet"
|
||||
|
||||
@@ -49,8 +49,7 @@
|
||||
Robot.mmi = new /obj/item/device/mmi(new_mob)
|
||||
Robot.mmi.transfer_identity(M) //Does not transfer key/client.
|
||||
if("slime")
|
||||
if(prob(50)) new_mob = new /mob/living/carbon/slime/adult(M.loc)
|
||||
else new_mob = new /mob/living/carbon/slime(M.loc)
|
||||
new_mob = new /mob/living/carbon/slime(M.loc)
|
||||
new_mob.universal_speak = 1
|
||||
if("xeno")
|
||||
var/alien_caste = pick("Hunter","Sentinel","Drone","Larva")
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
/obj/machinery/chem_dispenser/ui_interact(mob/user, ui_key = "main",var/datum/nanoui/ui = null)
|
||||
/obj/machinery/chem_dispenser/ui_interact(mob/user, ui_key = "main",var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
if(broken_requirements.len)
|
||||
user << "<span class='warning'>[src] is broken. [broken_requirements[broken_requirements[1]]]</span>"
|
||||
return
|
||||
@@ -114,8 +114,8 @@
|
||||
// this is the data which will be sent to the ui
|
||||
var/data[0]
|
||||
data["amount"] = amount
|
||||
data["energy"] = energy
|
||||
data["maxEnergy"] = max_energy
|
||||
data["energy"] = round(energy)
|
||||
data["maxEnergy"] = round(max_energy)
|
||||
data["isBeakerLoaded"] = beaker ? 1 : 0
|
||||
data["glass"] = accept_glass
|
||||
var beakerContents[0]
|
||||
@@ -141,7 +141,7 @@
|
||||
data["chemicals"] = chemicals
|
||||
|
||||
// update the ui if it exists, returns null if no ui is passed/found
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
// the ui does not exist, so we'll create a new() one
|
||||
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
|
||||
|
||||
@@ -234,11 +234,11 @@ datum
|
||||
T.wet_overlay = null
|
||||
|
||||
for(var/mob/living/carbon/slime/M in T)
|
||||
M.adjustToxLoss(rand(15,20))
|
||||
M.apply_water()
|
||||
|
||||
var/hotspot = (locate(/obj/fire) in T)
|
||||
if(hotspot && !istype(T, /turf/space))
|
||||
var/datum/gas_mixture/lowertemp = T.remove_air( T:air:total_moles() )
|
||||
var/datum/gas_mixture/lowertemp = T.remove_air( T:air:total_moles )
|
||||
lowertemp.temperature = max( min(lowertemp.temperature-2000,lowertemp.temperature / 2) ,0)
|
||||
lowertemp.react()
|
||||
T.assume_air(lowertemp)
|
||||
@@ -249,7 +249,7 @@ datum
|
||||
var/turf/T = get_turf(O)
|
||||
var/hotspot = (locate(/obj/fire) in T)
|
||||
if(hotspot && !istype(T, /turf/space))
|
||||
var/datum/gas_mixture/lowertemp = T.remove_air( T:air:total_moles() )
|
||||
var/datum/gas_mixture/lowertemp = T.remove_air( T:air:total_moles )
|
||||
lowertemp.temperature = max( min(lowertemp.temperature-2000,lowertemp.temperature / 2) ,0)
|
||||
lowertemp.react()
|
||||
T.assume_air(lowertemp)
|
||||
@@ -842,18 +842,18 @@ datum
|
||||
description = "Sterilizes wounds in preparation for surgery."
|
||||
reagent_state = LIQUID
|
||||
color = "#C8A5DC" // rgb: 200, 165, 220
|
||||
|
||||
|
||||
//makes you squeaky clean
|
||||
reaction_mob(var/mob/living/M, var/method=TOUCH, var/volume)
|
||||
if (method == TOUCH)
|
||||
M.germ_level -= min(volume*20, M.germ_level)
|
||||
|
||||
|
||||
reaction_obj(var/obj/O, var/volume)
|
||||
O.germ_level -= min(volume*20, O.germ_level)
|
||||
|
||||
|
||||
reaction_turf(var/turf/T, var/volume)
|
||||
T.germ_level -= min(volume*20, T.germ_level)
|
||||
|
||||
|
||||
/* reaction_mob(var/mob/living/M, var/method=TOUCH, var/volume)
|
||||
src = null
|
||||
if (method==TOUCH)
|
||||
@@ -1612,18 +1612,10 @@ datum
|
||||
egg.Hatch()*/
|
||||
if((!O) || (!volume)) return 0
|
||||
var/turf/the_turf = get_turf(O)
|
||||
var/datum/gas_mixture/napalm = new
|
||||
var/datum/gas/volatile_fuel/fuel = new
|
||||
fuel.moles = volume
|
||||
napalm.trace_gases += fuel
|
||||
the_turf.assume_air(napalm)
|
||||
the_turf.assume_gas("volatile_fuel", volume, T20C)
|
||||
reaction_turf(var/turf/T, var/volume)
|
||||
src = null
|
||||
var/datum/gas_mixture/napalm = new
|
||||
var/datum/gas/volatile_fuel/fuel = new
|
||||
fuel.moles = volume
|
||||
napalm.trace_gases += fuel
|
||||
T.assume_air(napalm)
|
||||
T.assume_gas("volatile_fuel", volume, T20C)
|
||||
return
|
||||
|
||||
toxin/lexorin
|
||||
@@ -2339,7 +2331,7 @@ datum
|
||||
T.wet_overlay = null
|
||||
var/hotspot = (locate(/obj/fire) in T)
|
||||
if(hotspot)
|
||||
var/datum/gas_mixture/lowertemp = T.remove_air( T:air:total_moles() )
|
||||
var/datum/gas_mixture/lowertemp = T.remove_air( T:air:total_moles )
|
||||
lowertemp.temperature = max( min(lowertemp.temperature-2000,lowertemp.temperature / 2) ,0)
|
||||
lowertemp.react()
|
||||
T.assume_air(lowertemp)
|
||||
|
||||
@@ -406,16 +406,7 @@ datum
|
||||
on_reaction(var/datum/reagents/holder, var/created_volume)
|
||||
var/turf/location = get_turf(holder.my_atom.loc)
|
||||
for(var/turf/simulated/floor/target_tile in range(0,location))
|
||||
|
||||
var/datum/gas_mixture/napalm = new
|
||||
var/datum/gas/volatile_fuel/fuel = new
|
||||
fuel.moles = created_volume
|
||||
napalm.trace_gases += fuel
|
||||
|
||||
napalm.temperature = 400+T0C
|
||||
napalm.update_values()
|
||||
|
||||
target_tile.assume_air(napalm)
|
||||
target_tile.assume_gas("volatile_fuel", created_volume, 400+T0C)
|
||||
spawn (0) target_tile.hotspot_expose(700, 400)
|
||||
holder.del_reagent("napalm")
|
||||
return
|
||||
@@ -1183,13 +1174,7 @@ datum
|
||||
sleep(50)
|
||||
var/turf/location = get_turf(holder.my_atom.loc)
|
||||
for(var/turf/simulated/floor/target_tile in range(0,location))
|
||||
|
||||
var/datum/gas_mixture/napalm = new
|
||||
|
||||
napalm.phoron = 25
|
||||
napalm.temperature = 1400
|
||||
|
||||
target_tile.assume_air(napalm)
|
||||
target_tile.assume_gas("phoron", 25, 1400)
|
||||
spawn (0) target_tile.hotspot_expose(700, 400)
|
||||
|
||||
//Yellow
|
||||
@@ -1230,7 +1215,7 @@ datum
|
||||
O.show_message(text("\red The contents of the slime core harden and begin to emit a warm, bright light."), 1)
|
||||
var/obj/item/device/flashlight/slime/F = new /obj/item/device/flashlight/slime
|
||||
F.loc = get_turf(holder.my_atom)
|
||||
|
||||
|
||||
//Purple
|
||||
|
||||
slimepsteroid
|
||||
@@ -1292,7 +1277,6 @@ datum
|
||||
required_other = 1
|
||||
on_reaction(var/datum/reagents/holder)
|
||||
for(var/mob/living/carbon/slime/slime in viewers(get_turf(holder.my_atom), null))
|
||||
slime.tame = 0
|
||||
slime.rabid = 1
|
||||
for(var/mob/O in viewers(get_turf(holder.my_atom), null))
|
||||
O.show_message(text("\red The [slime] is driven into a frenzy!."), 1)
|
||||
|
||||
@@ -728,7 +728,7 @@
|
||||
del(src)
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/bluetomato/HasEntered(AM as mob|obj)
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/bluetomato/Crossed(AM as mob|obj)
|
||||
if (istype(AM, /mob/living/carbon))
|
||||
var/mob/M = AM
|
||||
if (istype(M, /mob/living/carbon/human) && (isobj(M:shoes) && M:shoes.flags&NOSLIP) || M.buckled)
|
||||
|
||||
@@ -424,6 +424,17 @@
|
||||
mode = SYRINGE_INJECT
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/drugs
|
||||
name = "Syringe (drugs)"
|
||||
desc = "Contains aggressive drugs meant for torture."
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("space_drugs", 5)
|
||||
reagents.add_reagent("mindbreaker", 5)
|
||||
reagents.add_reagent("cryptobiolin", 5)
|
||||
mode = SYRINGE_INJECT
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/ld50_syringe/choral
|
||||
New()
|
||||
..()
|
||||
|
||||
@@ -736,10 +736,10 @@
|
||||
// this will be revealed if a T-scanner is used
|
||||
// if visible, use regular icon_state
|
||||
proc/updateicon()
|
||||
if(invisibility)
|
||||
/* if(invisibility) //we hide things with alpha now, no need for transparent icons
|
||||
icon_state = "[base_icon_state]f"
|
||||
else
|
||||
icon_state = base_icon_state
|
||||
icon_state = base_icon_state*/
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -1358,6 +1358,7 @@ datum/design/nanopaste
|
||||
materials = list("$metal" = 7000, "$glass" = 7000)
|
||||
build_path = "/obj/item/stack/nanopaste"
|
||||
|
||||
/* // Removal of loyalty implants. Can't think of a way to add this to the config option.
|
||||
datum/design/implant_loyal
|
||||
name = "loyalty implant"
|
||||
desc = "Makes you loyal or such."
|
||||
@@ -1366,6 +1367,7 @@ datum/design/implant_loyal
|
||||
build_type = PROTOLATHE
|
||||
materials = list("$metal" = 7000, "$glass" = 7000)
|
||||
build_path = "/obj/item/weapon/implant/loyalty"
|
||||
*/
|
||||
|
||||
datum/design/implant_chem
|
||||
name = "chemical implant"
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
var/datum/gas_mixture/env = L.return_air()
|
||||
if(env.temperature < (heat_amt+T0C))
|
||||
|
||||
var/transfer_moles = 0.25 * env.total_moles()
|
||||
var/transfer_moles = 0.25 * env.total_moles
|
||||
|
||||
var/datum/gas_mixture/removed = env.remove(transfer_moles)
|
||||
|
||||
|
||||
@@ -143,13 +143,13 @@ var/list/valid_secondary_effect_types = list(\
|
||||
else if(env.temperature > 375)
|
||||
trigger_hot = 1
|
||||
|
||||
if(env.phoron >= 10)
|
||||
if(env.gas["phoron"] >= 10)
|
||||
trigger_phoron = 1
|
||||
if(env.oxygen >= 10)
|
||||
if(env.gas["oxygen"] >= 10)
|
||||
trigger_oxy = 1
|
||||
if(env.carbon_dioxide >= 10)
|
||||
if(env.gas["carbon_dioxide"] >= 10)
|
||||
trigger_co2 = 1
|
||||
if(env.nitrogen >= 10)
|
||||
if(env.gas["nitrogen"] >= 10)
|
||||
trigger_nitro = 1
|
||||
|
||||
//COLD ACTIVATION
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
|
||||
/datum/artifact_effect/gasco2
|
||||
effecttype = "gasco2"
|
||||
var/max_pressure
|
||||
var/target_percentage
|
||||
|
||||
/datum/artifact_effect/heat/New()
|
||||
..()
|
||||
effect_type = pick(6,7)
|
||||
|
||||
/datum/artifact_effect/gasco2/New()
|
||||
..()
|
||||
effect = pick(EFFECT_TOUCH, EFFECT_AURA)
|
||||
max_pressure = rand(115,1000)
|
||||
|
||||
/datum/artifact_effect/gasco2/DoEffectTouch(var/mob/user)
|
||||
if(holder)
|
||||
var/datum/gas_mixture/env = holder.loc.return_air()
|
||||
if(env)
|
||||
env.carbon_dioxide += rand(2,15)
|
||||
|
||||
/datum/artifact_effect/gasco2/DoEffectAura()
|
||||
if(holder)
|
||||
var/datum/gas_mixture/env = holder.loc.return_air()
|
||||
if(env && env.total_moles < max_pressure)
|
||||
env.carbon_dioxide += pick(0, 0, 0.1, rand())
|
||||
|
||||
/datum/artifact_effect/gasco2
|
||||
effecttype = "gasco2"
|
||||
var/max_pressure
|
||||
var/target_percentage
|
||||
|
||||
/datum/artifact_effect/heat/New()
|
||||
..()
|
||||
effect_type = pick(6,7)
|
||||
|
||||
/datum/artifact_effect/gasco2/New()
|
||||
..()
|
||||
effect = pick(EFFECT_TOUCH, EFFECT_AURA)
|
||||
max_pressure = rand(115,1000)
|
||||
|
||||
/datum/artifact_effect/gasco2/DoEffectTouch(var/mob/user)
|
||||
if(holder)
|
||||
var/turf/holder_loc = holder.loc
|
||||
if(istype(holder_loc))
|
||||
holder_loc.assume_gas("carbon_dioxide", rand(2, 15))
|
||||
|
||||
/datum/artifact_effect/gasco2/DoEffectAura()
|
||||
if(holder)
|
||||
var/turf/holder_loc = holder.loc
|
||||
if(istype(holder_loc))
|
||||
holder_loc.assume_gas("carbon_dioxide", pick(0, 0, 0.1, rand()))
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
|
||||
/datum/artifact_effect/gasnitro
|
||||
effecttype = "gasnitro"
|
||||
var/max_pressure
|
||||
var/target_percentage
|
||||
|
||||
/datum/artifact_effect/gasnitro/New()
|
||||
..()
|
||||
effect = pick(EFFECT_TOUCH, EFFECT_AURA)
|
||||
effect_type = pick(6,7)
|
||||
max_pressure = rand(115,1000)
|
||||
|
||||
/datum/artifact_effect/gasnitro/DoEffectTouch(var/mob/user)
|
||||
if(holder)
|
||||
var/datum/gas_mixture/env = holder.loc.return_air()
|
||||
if(env)
|
||||
env.nitrogen += rand(2,15)
|
||||
|
||||
/datum/artifact_effect/gasnitro/DoEffectAura()
|
||||
if(holder)
|
||||
var/datum/gas_mixture/env = holder.loc.return_air()
|
||||
if(env && env.total_moles < max_pressure)
|
||||
env.nitrogen += pick(0, 0, 0.1, rand())
|
||||
|
||||
/datum/artifact_effect/gasnitro
|
||||
effecttype = "gasnitro"
|
||||
var/max_pressure
|
||||
var/target_percentage
|
||||
|
||||
/datum/artifact_effect/gasnitro/New()
|
||||
..()
|
||||
effect = pick(EFFECT_TOUCH, EFFECT_AURA)
|
||||
effect_type = pick(6,7)
|
||||
max_pressure = rand(115,1000)
|
||||
|
||||
/datum/artifact_effect/gasnitro/DoEffectTouch(var/mob/user)
|
||||
if(holder)
|
||||
var/turf/holder_loc = holder.loc
|
||||
if(istype(holder_loc))
|
||||
holder_loc.assume_gas("nitrogen", rand(2, 15))
|
||||
|
||||
/datum/artifact_effect/gasnitro/DoEffectAura()
|
||||
if(holder)
|
||||
var/turf/holder_loc = holder.loc
|
||||
if(istype(holder_loc))
|
||||
holder_loc.assume_gas("nitrogen", pick(0, 0, 0.1, rand()))
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
|
||||
/datum/artifact_effect/gasoxy
|
||||
effecttype = "gasoxy"
|
||||
var/max_pressure
|
||||
|
||||
/datum/artifact_effect/gasoxy/New()
|
||||
..()
|
||||
effect = pick(EFFECT_TOUCH, EFFECT_AURA)
|
||||
max_pressure = rand(115,1000)
|
||||
effect_type = pick(6,7)
|
||||
|
||||
|
||||
/datum/artifact_effect/gasoxy/DoEffectTouch(var/mob/user)
|
||||
if(holder)
|
||||
var/datum/gas_mixture/env = holder.loc.return_air()
|
||||
if(env)
|
||||
env.oxygen += rand(2,15)
|
||||
|
||||
/datum/artifact_effect/gasoxy/DoEffectAura()
|
||||
if(holder)
|
||||
var/datum/gas_mixture/env = holder.loc.return_air()
|
||||
if(env && env.total_moles < max_pressure)
|
||||
env.oxygen += pick(0, 0, 0.1, rand())
|
||||
|
||||
/datum/artifact_effect/gasoxy
|
||||
effecttype = "gasoxy"
|
||||
var/max_pressure
|
||||
|
||||
/datum/artifact_effect/gasoxy/New()
|
||||
..()
|
||||
effect = pick(EFFECT_TOUCH, EFFECT_AURA)
|
||||
max_pressure = rand(115,1000)
|
||||
effect_type = pick(6,7)
|
||||
|
||||
|
||||
/datum/artifact_effect/gasoxy/DoEffectTouch(var/mob/user)
|
||||
if(holder)
|
||||
var/turf/holder_loc = holder.loc
|
||||
if(istype(holder_loc))
|
||||
holder_loc.assume_gas("oxygen", rand(2, 15))
|
||||
|
||||
/datum/artifact_effect/gasoxy/DoEffectAura()
|
||||
if(holder)
|
||||
var/turf/holder_loc = holder.loc
|
||||
if(istype(holder_loc))
|
||||
holder_loc.assume_gas("oxygen", pick(0, 0, 0.1, rand()))
|
||||
|
||||
@@ -12,12 +12,12 @@
|
||||
|
||||
/datum/artifact_effect/gasphoron/DoEffectTouch(var/mob/user)
|
||||
if(holder)
|
||||
var/datum/gas_mixture/env = holder.loc.return_air()
|
||||
if(env)
|
||||
env.phoron += rand(2,15)
|
||||
var/turf/holder_loc = holder.loc
|
||||
if(istype(holder_loc))
|
||||
holder_loc.assume_gas("oxygen", rand(2, 15))
|
||||
|
||||
/datum/artifact_effect/gasphoron/DoEffectAura()
|
||||
if(holder)
|
||||
var/datum/gas_mixture/env = holder.loc.return_air()
|
||||
if(env && env.total_moles < max_pressure)
|
||||
env.phoron += pick(0, 0, 0.1, rand())
|
||||
var/turf/holder_loc = holder.loc
|
||||
if(istype(holder_loc))
|
||||
holder_loc.assume_gas("phoron", pick(0, 0, 0.1, rand()))
|
||||
|
||||
+23
-31
@@ -1,31 +1,23 @@
|
||||
|
||||
/datum/artifact_effect/gassleeping
|
||||
effecttype = "gassleeping"
|
||||
var/max_pressure
|
||||
var/target_percentage
|
||||
|
||||
/datum/artifact_effect/gassleeping/New()
|
||||
..()
|
||||
effect = pick(EFFECT_TOUCH, EFFECT_AURA)
|
||||
max_pressure = rand(115,1000)
|
||||
effect_type = pick(6,7)
|
||||
|
||||
/datum/artifact_effect/gassleeping/DoEffectTouch(var/mob/user)
|
||||
if(holder)
|
||||
var/datum/gas_mixture/env = holder.loc.return_air()
|
||||
if(env)
|
||||
var/datum/gas/sleeping_agent/trace_gas = new
|
||||
env.trace_gases += trace_gas
|
||||
trace_gas.moles = rand(2,15)
|
||||
env.update_values()
|
||||
|
||||
|
||||
/datum/artifact_effect/gassleeping/DoEffectAura()
|
||||
if(holder)
|
||||
var/datum/gas_mixture/env = holder.loc.return_air()
|
||||
if(env && env.total_moles < max_pressure)
|
||||
var/datum/gas/sleeping_agent/trace_gas = new
|
||||
env.trace_gases += trace_gas
|
||||
trace_gas.moles = pick(0, 0, 0.1, rand())
|
||||
env.update_values()
|
||||
|
||||
|
||||
/datum/artifact_effect/gassleeping
|
||||
effecttype = "gassleeping"
|
||||
var/max_pressure
|
||||
var/target_percentage
|
||||
|
||||
/datum/artifact_effect/gassleeping/New()
|
||||
..()
|
||||
effect = pick(EFFECT_TOUCH, EFFECT_AURA)
|
||||
max_pressure = rand(115,1000)
|
||||
effect_type = pick(6,7)
|
||||
|
||||
/datum/artifact_effect/gassleeping/DoEffectTouch(var/mob/user)
|
||||
if(holder)
|
||||
var/turf/holder_loc = holder.loc
|
||||
if(istype(holder_loc))
|
||||
holder_loc.assume_gas("sleeping_agent", rand(2, 15))
|
||||
|
||||
/datum/artifact_effect/gassleeping/DoEffectAura()
|
||||
if(holder)
|
||||
var/turf/holder_loc = holder.loc
|
||||
if(istype(holder_loc))
|
||||
holder_loc.assume_gas("sleeping_agent", pick(0, 0, 0.1, rand()))
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
if(total_purity && fresh_coolant)
|
||||
coolant_purity = total_purity / fresh_coolant
|
||||
|
||||
/obj/machinery/radiocarbon_spectrometer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
|
||||
/obj/machinery/radiocarbon_spectrometer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
|
||||
if(user.stat)
|
||||
return
|
||||
@@ -146,7 +146,7 @@
|
||||
data["rad_shield_on"] = rad_shield
|
||||
|
||||
// update the ui if it exists, returns null if no ui is passed/found
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
// the ui does not exist, so we'll create a new() one
|
||||
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/computer/shuttle_control/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
|
||||
/obj/machinery/computer/shuttle_control/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
var/data[0]
|
||||
var/datum/shuttle/ferry/shuttle = shuttle_controller.shuttles[shuttle_tag]
|
||||
if (!istype(shuttle))
|
||||
@@ -57,7 +57,7 @@
|
||||
"can_force" = shuttle.can_force(),
|
||||
)
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "shuttle_control_console.tmpl", "[shuttle_tag] Shuttle Control", 470, 310)
|
||||
|
||||
@@ -153,7 +153,7 @@
|
||||
read_authorization(W)
|
||||
..()
|
||||
|
||||
/obj/machinery/computer/shuttle_control/emergency/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
|
||||
/obj/machinery/computer/shuttle_control/emergency/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
var/data[0]
|
||||
var/datum/shuttle/ferry/emergency/shuttle = shuttle_controller.shuttles[shuttle_tag]
|
||||
if (!istype(shuttle))
|
||||
@@ -211,7 +211,7 @@
|
||||
"user" = debug? user : null,
|
||||
)
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "escape_shuttle_control_console.tmpl", "Shuttle Control", 470, 420)
|
||||
|
||||
@@ -175,7 +175,7 @@
|
||||
damage = max( damage + min( ( (removed.temperature - 800) / 150 ), damage_inc_limit ) , 0 )
|
||||
//Ok, 100% oxygen atmosphere = best reaction
|
||||
//Maxes out at 100% oxygen pressure
|
||||
oxygen = max(min((removed.oxygen - (removed.nitrogen * NITROGEN_RETARDATION_FACTOR)) / MOLES_CELLSTANDARD, 1), 0)
|
||||
oxygen = max(min((removed.gas["oxygen"] - (removed.gas["nitrogen"] * NITROGEN_RETARDATION_FACTOR)) / MOLES_CELLSTANDARD, 1), 0)
|
||||
|
||||
var/temp_factor = 100
|
||||
|
||||
@@ -212,11 +212,8 @@
|
||||
removed.temperature = max(0, min(removed.temperature, 10000))
|
||||
|
||||
//Calculate how much gas to release
|
||||
removed.phoron += max(device_energy / PHORON_RELEASE_MODIFIER, 0)
|
||||
|
||||
removed.oxygen += max((device_energy + removed.temperature - T0C) / OXYGEN_RELEASE_MODIFIER, 0)
|
||||
|
||||
removed.update_values()
|
||||
removed.adjust_multi("phoron", max(device_energy / PHORON_RELEASE_MODIFIER, 0), \
|
||||
"oxygen", max((device_energy + removed.temperature - T0C) / OXYGEN_RELEASE_MODIFIER, 0))
|
||||
|
||||
env.merge(removed)
|
||||
|
||||
|
||||
@@ -271,8 +271,7 @@
|
||||
if(target.cores >= 0)
|
||||
new target.coretype(target.loc)
|
||||
if(target.cores <= 0)
|
||||
var/origstate = initial(target.icon_state)
|
||||
target.icon_state = "[origstate] dead-nocore"
|
||||
target.icon_state = "[target.colour] baby slime dead-nocore"
|
||||
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
if(..()) return
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/computer/centrifuge/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
|
||||
/obj/machinery/computer/centrifuge/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
user.set_machine(src)
|
||||
|
||||
var/data[0]
|
||||
@@ -70,7 +70,7 @@
|
||||
data["antibodies"] = A && A.data["antibodies"] ? antigens2string(A.data["antibodies"]) : null
|
||||
data["is_antibody_sample"] = 1
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "isolation_centrifuge.tmpl", src.name, 400, 500)
|
||||
ui.set_initial_data(data)
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
if(..()) return
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
|
||||
/obj/machinery/computer/diseasesplicer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
user.set_machine(src)
|
||||
|
||||
var/data[0]
|
||||
@@ -81,7 +81,7 @@
|
||||
else
|
||||
data["info"] = "No dish loaded."
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "disease_splicer.tmpl", src.name, 400, 600)
|
||||
ui.set_initial_data(data)
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
if(stat & (NOPOWER|BROKEN)) return
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/disease2/incubator/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
|
||||
/obj/machinery/disease2/incubator/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
user.set_machine(src)
|
||||
|
||||
var/data[0]
|
||||
@@ -82,7 +82,7 @@
|
||||
for (var/ID in virus)
|
||||
data["blood_already_infected"] = virus[ID]
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "dish_incubator.tmpl", src.name, 400, 600)
|
||||
ui.set_initial_data(data)
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
if(stat & (NOPOWER|BROKEN)) return
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/disease2/isolator/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
|
||||
/obj/machinery/disease2/isolator/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
user.set_machine(src)
|
||||
|
||||
var/data[0]
|
||||
@@ -100,7 +100,7 @@
|
||||
"name" = entry.fields["name"], \
|
||||
"description" = replacetext(desc, "\n", ""))
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "pathogenic_isolator.tmpl", src.name, 400, 500)
|
||||
ui.set_initial_data(data)
|
||||
|
||||
Reference in New Issue
Block a user