Just some general cleanup

Moved the spacecraft folder into the unused section, moved syndiebeacon into machinery.
Research moved into Modules.
Virus2 moved into WIP - is anyone even working on this, it looks almost done?
Computer2,optics,pda2,experimental moved unto unused.
WIP Chemistry things moved into Chemical Module
Cameras.dm moved into weapons
GameKit.dm moved into unused
BrokenInHands.dm moved into unused
Removed Grillify.dm
Moved all of the files listed as unused in the mining module to unused
Removed several empty folders in modules
Moved cloning.dm into machinery
Moved NewBan.dm into admin
Changed humanoid aliens new_life.dm into life.dm
Moved beast mob into unused
Moved hivebot into unused
Moved carpedexplosion.dm into unused
Moved ai_lockdown.dm verb into unused and removed it from the AIs verb list as it didn't actually do anything.
Removed mastercontroler2.dm
Moved savefile.dm from human to new_player

Bugfix
People spawning on the starting screen on rev/cult should be fixed.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1964 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
mport2004@gmail.com
2011-07-31 21:31:00 +00:00
parent ce470a81ba
commit 2224916ab9
94 changed files with 608 additions and 1126 deletions
@@ -6,6 +6,7 @@
temperature_alert = 0
/mob/living/carbon/alien/humanoid/Life()
set invisibility = 0
set background = 1
@@ -13,245 +14,84 @@
if (src.monkeyizing)
return
var/datum/gas_mixture/environment = loc.return_air()
if (src.stat != 2) //still breathing
//First, resolve location and get a breath
if(air_master.current_cycle%4==2)
//Only try to take a breath every 4 seconds, unless suffocating
var/datum/air_group/breath
//No breath from internal atmosphere so get breath from location
if(!breath)
if(istype(loc, /obj/))
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
breath = loc.remove_air(breath_moles)
else //Still give containing object the chance to interact
if(istype(loc, /obj/))
var/obj/location_as_object = loc
location_as_object.handle_internal_lifeform(src, 0)
handle_breath(breath)
if(breath)
loc.assume_air(breath)
spawn(0) breathe()
else //Still give containing object the chance to interact
if(istype(loc, /obj/))
var/obj/location_as_object = loc
location_as_object.handle_internal_lifeform(src, 0)
//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
//Disease Check
handle_virus_updates()
handle_environment(environment)
//Handle temperature/pressure differences between body and environment also handles alien weeds!
//Update mind
update_mind()
//Handle temperature/pressure differences between body and environment
handle_environment()
//Mutations and radiation
handle_mutations_and_radiation()
//Chemicals in the body
handle_chemicals_in_body()
//stuff in the stomach
handle_stomach()
//Disabilities
handle_disabilities()
//Status updates, death etc.
handle_regular_status_updates()
// Update clothing
update_clothing()
if(client)
handle_regular_hud_updates()
//Being buckled to a chair or bed
check_if_buckled()
// Yup.
update_canmove()
clamp_values()
// Grabbing
for(var/obj/item/weapon/grab/G in src)
G.process()
/mob/living/carbon/alien/humanoid
proc
clamp_values()
handle_breath(datum/gas_mixture/breath)
//Aliens can breathe in any atmosphere
var/toxins_used = 0
stunned = max(min(stunned, 20),0)
paralysis = max(min(paralysis, 20), 0)
weakened = max(min(weakened, 20), 0)
sleeping = max(min(sleeping, 20), 0)
bruteloss = max(bruteloss, 0)
toxloss = max(toxloss, 0)
oxyloss = max(oxyloss, 0)
fireloss = max(fireloss, 0)
if(breath.toxins > ((ONE_ATMOSPHERE*BREATH_VOLUME*0.15)/(T20C*R_IDEAL_GAS_EQUATION)))
var/available_ratio = breath.toxins/((ONE_ATMOSPHERE*BREATH_VOLUME*0.15)/(T20C*R_IDEAL_GAS_EQUATION))
toxins_used = breath.toxins*available_ratio/6
toxloss += 7*(1-available_ratio)
else
toxloss = max(toxloss-5, 0)
toxins_used = breath.oxygen/6
breath.toxins -= toxins_used
breath.oxygen += toxins_used
handle_disabilities()
if(breath.temperature > (T0C+66))
fire_alert = max(fire_alert, 1)
return 1
handle_environment(datum/gas_mixture/environment)
if(!environment)
return
var/environment_heat_capacity = environment.heat_capacity()
if(istype(loc, /turf/space))
environment_heat_capacity = loc:heat_capacity
//If there are alien weeds on the ground then heal if needed or give some toxins
if(locate(/obj/alien/weeds) in loc)
if(health >= 100)
toxloss += 2
else
health += 5
if((environment.temperature > (T0C + 50)) || (environment.temperature < (T0C + 10)))
var/transfer_coefficient
transfer_coefficient = 1
if(head && (head.body_parts_covered & HEAD) && (environment.temperature < head.protective_temperature))
transfer_coefficient *= head.heat_transfer_coefficient
if(wear_mask && (wear_mask.body_parts_covered & HEAD) && (environment.temperature < wear_mask.protective_temperature))
transfer_coefficient *= wear_mask.heat_transfer_coefficient
if(wear_suit && (wear_suit.body_parts_covered & HEAD) && (environment.temperature < wear_suit.protective_temperature))
transfer_coefficient *= wear_suit.heat_transfer_coefficient
handle_temperature_damage(HEAD, environment.temperature, environment_heat_capacity*transfer_coefficient)
transfer_coefficient = 1
if(wear_suit && (wear_suit.body_parts_covered & UPPER_TORSO) && (environment.temperature < wear_suit.protective_temperature))
transfer_coefficient *= wear_suit.heat_transfer_coefficient
handle_temperature_damage(UPPER_TORSO, environment.temperature, environment_heat_capacity*transfer_coefficient)
transfer_coefficient = 1
if(wear_suit && (wear_suit.body_parts_covered & LOWER_TORSO) && (environment.temperature < wear_suit.protective_temperature))
transfer_coefficient *= wear_suit.heat_transfer_coefficient
handle_temperature_damage(LOWER_TORSO, environment.temperature, environment_heat_capacity*transfer_coefficient)
transfer_coefficient = 1
if(wear_suit && (wear_suit.body_parts_covered & LEGS) && (environment.temperature < wear_suit.protective_temperature))
transfer_coefficient *= wear_suit.heat_transfer_coefficient
handle_temperature_damage(LEGS, environment.temperature, environment_heat_capacity*transfer_coefficient)
transfer_coefficient = 1
if(wear_suit && (wear_suit.body_parts_covered & ARMS) && (environment.temperature < wear_suit.protective_temperature))
transfer_coefficient *= wear_suit.heat_transfer_coefficient
handle_temperature_damage(ARMS, environment.temperature, environment_heat_capacity*transfer_coefficient)
transfer_coefficient = 1
if(wear_suit && (wear_suit.body_parts_covered & HANDS) && (environment.temperature < wear_suit.protective_temperature))
transfer_coefficient *= wear_suit.heat_transfer_coefficient
handle_temperature_damage(HANDS, environment.temperature, environment_heat_capacity*transfer_coefficient)
transfer_coefficient = 1
if(wear_suit && (wear_suit.body_parts_covered & FEET) && (environment.temperature < wear_suit.protective_temperature))
transfer_coefficient *= wear_suit.heat_transfer_coefficient
handle_temperature_damage(FEET, environment.temperature, environment_heat_capacity*transfer_coefficient)
if(stat==2)
bodytemperature += 0.1*(environment.temperature - bodytemperature)*environment_heat_capacity/(environment_heat_capacity + 270000)
//Account for massive pressure differences
return //TODO: DEFERRED
handle_temperature_damage(body_part, exposed_temperature, exposed_intensity)
var/discomfort = abs(exposed_temperature - bodytemperature)*(exposed_intensity)/2000000
switch(body_part)
if(HEAD)
TakeDamage("head", 0, 2.5*discomfort)
if(UPPER_TORSO)
TakeDamage("chest", 0, 2.5*discomfort)
if(LOWER_TORSO)
TakeDamage("groin", 0, 2.0*discomfort)
if(LEGS)
TakeDamage("l_leg", 0, 0.6*discomfort)
TakeDamage("r_leg", 0, 0.6*discomfort)
if(ARMS)
TakeDamage("l_arm", 0, 0.4*discomfort)
TakeDamage("r_arm", 0, 0.4*discomfort)
if(FEET)
TakeDamage("l_foot", 0, 0.25*discomfort)
TakeDamage("r_foot", 0, 0.25*discomfort)
if(HANDS)
TakeDamage("l_hand", 0, 0.25*discomfort)
TakeDamage("r_hand", 0, 0.25*discomfort)
handle_chemicals_in_body()
return //TODO: DEFERRED
handle_regular_status_updates()
//No toxloss because aliens breathe in toxins
health = 100 - (oxyloss + fireloss + bruteloss)
if(oxyloss > 25)
paralysis = max(paralysis, 3)
if(health < -100)
death()
return 1
handle_regular_hud_updates()
//Aliens can't have internals
if(internal)
internals.icon_state = "internal1"
else
internals.icon_state = "internal0"
//Aliens can breathe any atmosphere
if(oxygen_alert > 0)
oxygen_alert -= 1
oxygen.icon_state = "oxy1"
else
oxygen.icon_state = "oxy0"
//Aliens like toxins :)
if(toxins_alert > 0)
toxins_alert -= 1
toxin.icon_state = "tox1"
else
toxin.icon_state = "tox0"
//This makes sense, aliens hate fire
if(fire_alert > 0)
fire_alert -= 1
fire.icon_state = "fire1"
else
fire.icon_state = "fire0"
return 1
//Should aliens have DNA?
//Figure it out and come back here.
//Nannek
//As a note, the toxloss for radiation should be changed as the alien uses toxloss as a fuel
handle_random_events()
return
/*
if (src.radiation > 100)
src.radiation = 100
if ((prob(1) && (src.radiation >= 75)))
randmutb(src)
src << "\red High levels of Radiation cause you to spontaneously mutate."
domutcheck(src,null)
if ((prob(7) && (src.radiation >= 75)))
if (src.paralysis < 3)
src.paralysis = 3
src << "\red You feel weak!"
emote("collapse")
src.updatehealth()
src.radiation -= 5
else if ((prob(7) && ((src.radiation > 50)&&(src.radiation < 75))))
src.updatehealth()
src.radiation -= 5
emote("gasp")
else
if (prob(7) && (src.radiation > 1))
if (src.radiation >= 10)
src.radiation -= 10
src.toxloss += 5
src.updatehealth()
else
src.radiation = 0
if (src.disabilities & 2)
if ((prob(1) && src.paralysis < 10 && src.r_epil < 1))
src << "\red You have a seizure!"
@@ -271,87 +111,465 @@
if (src.disabilities & 16)
if (prob(10))
src.stuttering = max(10, src.stuttering)
if (prob(1) && prob(2))
spawn(0)
emote("sneeze")
return
*/
//This is fine for the alien
update_mind()
if(!mind && client)
mind = new
mind.current = src
mind.assigned_role = "Hunter"
mind.key = key
handle_mutations_and_radiation()
if(src.fireloss)
if(src.mutations & COLD_RESISTANCE || prob(50))
switch(src.fireloss)
if(1 to 50)
src.fireloss--
if(51 to 100)
src.fireloss -= 5
if (src.mutations & HULK && src.health <= 25)
src.mutations &= ~HULK
src << "\red You suddenly feel very weak."
src.weakened = 3
emote("collapse")
if (src.radiation)
if (src.radiation > 100)
src.radiation = 100
src.weakened = 10
src << "\red You feel weak."
emote("collapse")
if (src.radiation < 0)
src.radiation = 0
switch(src.radiation)
if(1 to 49)
src.radiation--
if(prob(25))
src.toxloss++
src.updatehealth()
if(50 to 74)
src.radiation -= 2
src.toxloss++
if(prob(5))
src.radiation -= 5
src.weakened = 3
src << "\red You feel weak."
emote("collapse")
src.updatehealth()
if(75 to 100)
src.radiation -= 3
src.toxloss += 3
if(prob(1))
src << "\red You mutate!"
randmutb(src)
domutcheck(src,null)
emote("gasp")
src.updatehealth()
breathe()
if(src.reagents)
if(src.reagents.has_reagent("lexorin")) return
if(istype(loc, /obj/machinery/atmospherics/unary/cryo_cell)) return
var/datum/gas_mixture/environment = loc.return_air()
var/datum/air_group/breath
// HACK NEED CHANGING LATER
if(src.health < 0)
src.losebreath++
if(losebreath>0) //Suffocating so do not take a breath
src.losebreath--
if (prob(75)) //High chance of gasping for air
spawn emote("gasp")
if(istype(loc, /obj/))
var/obj/location_as_object = loc
location_as_object.handle_internal_lifeform(src, 0)
else
//First, check for air from internal atmosphere (using an air tank and mask generally)
breath = get_breath_from_internal(BREATH_VOLUME)
//No breath from internal atmosphere so get breath from location
if(!breath)
if(istype(loc, /obj/))
var/obj/location_as_object = loc
breath = location_as_object.handle_internal_lifeform(src, BREATH_VOLUME)
else if(istype(loc, /turf/))
var/breath_moles = 0
/*if(environment.return_pressure() > ONE_ATMOSPHERE)
// Loads of air around (pressure effects will be handled elsewhere), so lets just take a enough to fill our lungs at normal atmos pressure (using n = Pv/RT)
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 = loc.remove_air(breath_moles)
else //Still give containing object the chance to interact
if(istype(loc, /obj/))
var/obj/location_as_object = loc
location_as_object.handle_internal_lifeform(src, 0)
handle_breath(breath)
if(breath)
loc.assume_air(breath)
get_breath_from_internal(volume_needed)
if(internal)
if (!contents.Find(src.internal))
internal = null
if (!wear_mask || !(wear_mask.flags & MASKINTERNALS) )
internal = null
if(internal)
if (src.internals)
src.internals.icon_state = "internal1"
return internal.remove_air_volume(volume_needed)
else
if (src.internals)
src.internals.icon_state = "internal0"
return null
update_canmove()
if(paralysis || stunned || weakened || buckled) canmove = 0
else canmove = 1
handle_breath(datum/gas_mixture/breath)
if(src.nodamage)
return
if(!breath || (breath.total_moles() == 0))
//Aliens breathe in vaccuum
return 0
var/toxins_used = 0
var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
//Partial pressure of the toxins in our breath
var/Toxins_pp = (breath.toxins/breath.total_moles())*breath_pressure
if(Toxins_pp) // Detect toxins in air
toxloss += breath.toxins*250
toxins_alert = max(toxins_alert, 1)
toxins_used = breath.toxins
else
toxins_alert = 0
//Breathe in toxins and out oxygen
breath.toxins -= toxins_used
breath.oxygen += toxins_used
if(breath.temperature > (T0C+66) && !(src.mutations & COLD_RESISTANCE)) // Hot air hurts :(
if(prob(20))
src << "\red You feel a searing heat in your lungs!"
fire_alert = max(fire_alert, 1)
else
fire_alert = 0
//Temporary fixes to the alerts.
return 1
handle_environment()
//If there are alien weeds on the ground then heal if needed or give some toxins
if(locate(/obj/alien/weeds) in loc)
if(health >= 100)
toxloss += 15
if(toxloss > max_plasma)
toxloss = max_plasma
else
bruteloss -= 15
fireloss -= 15
adjust_body_temperature(current, loc_temp, boost)
var/temperature = current
var/difference = abs(current-loc_temp) //get difference
var/increments// = difference/10 //find how many increments apart they are
if(difference > 50)
increments = difference/5
else
increments = difference/10
var/change = increments*boost // Get the amount to change by (x per increment)
var/temp_change
if(current < loc_temp)
temperature = min(loc_temp, temperature+change)
else if(current > loc_temp)
temperature = max(loc_temp, temperature-change)
temp_change = (temperature - current)
return temp_change
get_thermal_protection()
var/thermal_protection = 1.0
//Handle normal clothing
if(head && (head.body_parts_covered & HEAD))
thermal_protection += 0.5
if(wear_suit && (wear_suit.body_parts_covered & UPPER_TORSO))
thermal_protection += 0.5
if(wear_suit && (wear_suit.body_parts_covered & LEGS))
thermal_protection += 0.2
if(wear_suit && (wear_suit.body_parts_covered & ARMS))
thermal_protection += 0.2
if(wear_suit && (wear_suit.body_parts_covered & HANDS))
thermal_protection += 0.2
if(wear_suit && (wear_suit.flags & SUITSPACE))
thermal_protection += 3
if(src.mutations & COLD_RESISTANCE)
thermal_protection += 5
return thermal_protection
add_fire_protection(var/temp)
var/fire_prot = 0
if(head)
if(head.protective_temperature > temp)
fire_prot += (head.protective_temperature/10)
if(wear_mask)
if(wear_mask.protective_temperature > temp)
fire_prot += (wear_mask.protective_temperature/10)
if(wear_suit)
if(wear_suit.protective_temperature > temp)
fire_prot += (wear_suit.protective_temperature/10)
return fire_prot
handle_chemicals_in_body()
if(reagents) reagents.metabolize(src)
if(src.nutrition > 500 && !(src.mutations & FAT))
if(prob(5 + round((src.nutrition - 200) / 2)))
src << "\red You suddenly feel blubbery!"
src.mutations |= FAT
// update_body()
if (src.nutrition < 100 && src.mutations & FAT)
if(prob(round((50 - src.nutrition) / 100)))
src << "\blue You feel fit again!"
src.mutations &= ~FAT
// update_body()
if (src.nutrition > 0)
src.nutrition -= HUNGER_FACTOR
if (src.drowsyness)
src.drowsyness--
src.eye_blurry = max(2, src.eye_blurry)
if (prob(5))
src.sleeping = 1
src.paralysis = 5
confused = max(0, confused - 1)
// decrement dizziness counter, clamped to 0
if(resting)
dizziness = max(0, dizziness - 5)
jitteriness = max(0, jitteriness - 5)
else
dizziness = max(0, dizziness - 1)
jitteriness = max(0, jitteriness - 1)
src.updatehealth()
return //TODO: DEFERRED
handle_regular_status_updates()
health = 100 - (oxyloss + fireloss + bruteloss + cloneloss)
if(oxyloss > 50) paralysis = max(paralysis, 3)
if(src.sleeping)
src.paralysis = max(src.paralysis, 3)
if (prob(10) && health) spawn(0) emote("snore")
src.sleeping--
if(src.resting)
src.weakened = max(src.weakened, 5)
if(health < -100 || src.brain_op_stage == 4.0)
death()
else if(src.health < 0)
if(src.health <= 20 && prob(1)) spawn(0) emote("gasp")
//if(!src.rejuv) src.oxyloss++
if(!src.reagents.has_reagent("inaprovaline")) src.oxyloss++
if(src.stat != 2) src.stat = 1
src.paralysis = max(src.paralysis, 5)
if (src.stat != 2) //Alive.
if (src.paralysis || src.stunned || src.weakened) //Stunned etc.
if (src.stunned > 0)
src.stunned--
src.stat = 0
if (src.weakened > 0)
src.weakened--
src.lying = 1
src.stat = 0
if (src.paralysis > 0)
src.paralysis--
src.blinded = 1
src.lying = 1
src.stat = 1
var/h = src.hand
src.hand = 0
drop_item()
src.hand = 1
drop_item()
src.hand = h
else //Not stunned.
src.lying = 0
src.stat = 0
else //Dead.
src.lying = 1
src.blinded = 1
src.stat = 2
if (src.stuttering) src.stuttering--
if (src.eye_blind)
src.eye_blind--
src.blinded = 1
if (src.ear_deaf > 0) src.ear_deaf--
if (src.ear_damage < 25)
src.ear_damage -= 0.05
src.ear_damage = max(src.ear_damage, 0)
src.density = !( src.lying )
if ((src.sdisabilities & 1))
src.blinded = 1
if ((src.sdisabilities & 4))
src.ear_deaf = 1
if (src.eye_blurry > 0)
src.eye_blurry--
src.eye_blurry = max(0, src.eye_blurry)
if (src.druggy > 0)
src.druggy--
src.druggy = max(0, src.druggy)
return 1
handle_regular_hud_updates()
if (src.stat == 2 || src.mutations & XRAY)
src.sight |= SEE_TURFS
src.sight |= SEE_MOBS
src.sight |= SEE_OBJS
src.see_in_dark = 8
src.see_invisible = 2
else if (src.stat != 2)
src.sight |= SEE_MOBS
src.sight &= ~SEE_TURFS
src.sight &= ~SEE_OBJS
src.see_in_dark = 4
src.see_invisible = 2
if (src.sleep) src.sleep.icon_state = text("sleep[]", src.sleeping)
if (src.rest) src.rest.icon_state = text("rest[]", src.resting)
if (src.healths)
if (src.stat != 2)
switch(health)
if(100 to INFINITY)
src.healths.icon_state = "health0"
if(75 to 100)
src.healths.icon_state = "health1"
if(50 to 75)
src.healths.icon_state = "health2"
if(25 to 50)
src.healths.icon_state = "health3"
if(0 to 25)
src.healths.icon_state = "health4"
else
src.healths.icon_state = "health5"
else
src.healths.icon_state = "health6"
if(src.pullin) src.pullin.icon_state = "pull[src.pulling ? 1 : 0]"
if (src.toxin) src.toxin.icon_state = "tox[src.toxins_alert ? 1 : 0]"
if (src.oxygen) src.oxygen.icon_state = "oxy[src.oxygen_alert ? 1 : 0]"
if (src.fire) src.fire.icon_state = "fire[src.fire_alert ? 1 : 0]"
//NOTE: the alerts dont reset when youre out of danger. dont blame me,
//blame the person who coded them. Temporary fix added.
src.client.screen -= src.hud_used.blurry
src.client.screen -= src.hud_used.druggy
src.client.screen -= src.hud_used.vimpaired
if ((src.blind && src.stat != 2))
if ((src.blinded))
src.blind.layer = 18
else
src.blind.layer = 0
if (src.disabilities & 1)
src.client.screen += src.hud_used.vimpaired
if (src.eye_blurry)
src.client.screen += src.hud_used.blurry
if (src.druggy)
src.client.screen += src.hud_used.druggy
if (src.stat != 2)
if (src.machine)
if (!( src.machine.check_eye(src) ))
src.reset_view(null)
else
if(!client.adminobs)
reset_view(null)
return 1
handle_virus_updates()
if(src.bodytemperature > 406)
src.virus.cure()
for(var/datum/disease/D in viruses)
D.cure()
return
if(!src.virus)
if(prob(40))
for(var/mob/living/carbon/M in range(4, src))
if(M.virus && M.virus.spread == "Airborne")
if(M.virus.affected_species.Find("Alien"))
if(M.virus.type in src.resistances)
continue
src.contract_disease(new M.virus.type)
for(var/obj/decal/cleanable/blood/B in range(4, src))
if(B.virus && B.virus.spread == "Airborne")
if(B.virus.affected_species.Find("Alien"))
if(B.virus.type in src.resistances)
continue
src.contract_disease(new B.virus.type)
for(var/obj/decal/cleanable/xenoblood/X in range(4, src))
if(X.virus && X.virus.spread == "Airborne")
if(X.virus.affected_species.Find("Alien"))
if(X.virus.type in src.resistances)
continue
src.contract_disease(new X.virus.type)
check_if_buckled()
if (src.buckled)
src.lying = (istype(src.buckled, /obj/stool/bed) ? 1 : 0)
if(src.lying)
src.drop_item()
src.density = 1
else
src.virus.stage_act()
/*
snippets
src.density = !src.lying
if (src.mach)
if (src.machine)
src.mach.icon_state = "mach1"
else
src.mach.icon_state = null
if (!src.m_flag)
src.moved_recently = 0
src.m_flag = null
if ((istype(src.loc, /turf/space) && !( locate(/obj/movable, src.loc) )))
var/layers = 20
// ******* Check
if (((istype(src.head, /obj/item/clothing/head) && src.head.flags & 4) || (istype(src.wear_mask, /obj/item/clothing/mask) && (!( src.wear_mask.flags & 4 ) && src.wear_mask.flags & 8))))
layers -= 5
if (istype(src.w_uniform, /obj/item/clothing/under))
layers -= 5
if ((istype(src.wear_suit, /obj/item/clothing/suit) && src.wear_suit.flags & 8))
layers -= 10
if (layers > oxcheck)
oxcheck = layers
if(src.bodytemperature < 282.591 && (!src.firemut))
if(src.bodytemperature < 250)
src.fireloss += 4
src.updatehealth()
if(src.paralysis <= 2) src.paralysis += 2
else if(prob(1) && !src.paralysis)
if(src.paralysis <= 5) src.paralysis += 5
emote("collapse")
src << "\red You collapse from the cold!"
if(src.bodytemperature > 327.444 && (!src.firemut))
if(src.bodytemperature > 345.444)
if(!src.eye_blurry) src << "\red The heat blurs your vision!"
src.eye_blurry = max(4, src.eye_blurry)
if(prob(3)) src.fireloss += rand(1,2)
else if(prob(3) && !src.paralysis)
src.paralysis += 2
emote("collapse")
src << "\red You collapse from heat exaustion!"
plcheck = src.t_plasma
oxcheck = src.t_oxygen
G.turf_add(T, G.total_moles())
*/
handle_stomach()
spawn(0)
for(var/mob/M in stomach_contents)
if(M.loc != src)
stomach_contents.Remove(M)
continue
if(istype(M, /mob/living/carbon) && src.stat != 2)
if(M.stat == 2)
M.death(1)
stomach_contents.Remove(M)
del(M)
continue
if(air_master.current_cycle%3==1)
if(!M.nodamage)
M.bruteloss += 5
src.nutrition += 10
@@ -1,575 +0,0 @@
/mob/living/carbon/alien/humanoid
var
oxygen_alert = 0
toxins_alert = 0
fire_alert = 0
temperature_alert = 0
/mob/living/carbon/alien/humanoid/Life()
set invisibility = 0
set background = 1
if (src.monkeyizing)
return
if (src.stat != 2) //still breathing
//First, resolve location and get a breath
if(air_master.current_cycle%4==2)
//Only try to take a breath every 4 seconds, unless suffocating
spawn(0) breathe()
else //Still give containing object the chance to interact
if(istype(loc, /obj/))
var/obj/location_as_object = loc
location_as_object.handle_internal_lifeform(src, 0)
//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
//Disease Check
handle_virus_updates()
//Update mind
update_mind()
//Handle temperature/pressure differences between body and environment
handle_environment()
//Mutations and radiation
handle_mutations_and_radiation()
//Chemicals in the body
handle_chemicals_in_body()
//stuff in the stomach
handle_stomach()
//Disabilities
handle_disabilities()
//Status updates, death etc.
handle_regular_status_updates()
// Update clothing
update_clothing()
if(client)
handle_regular_hud_updates()
//Being buckled to a chair or bed
check_if_buckled()
// Yup.
update_canmove()
clamp_values()
// Grabbing
for(var/obj/item/weapon/grab/G in src)
G.process()
/mob/living/carbon/alien/humanoid
proc
clamp_values()
stunned = max(min(stunned, 20),0)
paralysis = max(min(paralysis, 20), 0)
weakened = max(min(weakened, 20), 0)
sleeping = max(min(sleeping, 20), 0)
bruteloss = max(bruteloss, 0)
toxloss = max(toxloss, 0)
oxyloss = max(oxyloss, 0)
fireloss = max(fireloss, 0)
handle_disabilities()
if (src.disabilities & 2)
if ((prob(1) && src.paralysis < 10 && src.r_epil < 1))
src << "\red You have a seizure!"
src.paralysis = max(10, src.paralysis)
if (src.disabilities & 4)
if ((prob(5) && src.paralysis <= 1 && src.r_ch_cou < 1))
src.drop_item()
spawn( 0 )
emote("cough")
return
if (src.disabilities & 8)
if ((prob(10) && src.paralysis <= 1 && src.r_Tourette < 1))
src.stunned = max(10, src.stunned)
spawn( 0 )
emote("twitch")
return
if (src.disabilities & 16)
if (prob(10))
src.stuttering = max(10, src.stuttering)
update_mind()
if(!mind && client)
mind = new
mind.current = src
mind.assigned_role = "Hunter"
mind.key = key
handle_mutations_and_radiation()
if(src.fireloss)
if(src.mutations & COLD_RESISTANCE || prob(50))
switch(src.fireloss)
if(1 to 50)
src.fireloss--
if(51 to 100)
src.fireloss -= 5
if (src.mutations & HULK && src.health <= 25)
src.mutations &= ~HULK
src << "\red You suddenly feel very weak."
src.weakened = 3
emote("collapse")
if (src.radiation)
if (src.radiation > 100)
src.radiation = 100
src.weakened = 10
src << "\red You feel weak."
emote("collapse")
if (src.radiation < 0)
src.radiation = 0
switch(src.radiation)
if(1 to 49)
src.radiation--
if(prob(25))
src.toxloss++
src.updatehealth()
if(50 to 74)
src.radiation -= 2
src.toxloss++
if(prob(5))
src.radiation -= 5
src.weakened = 3
src << "\red You feel weak."
emote("collapse")
src.updatehealth()
if(75 to 100)
src.radiation -= 3
src.toxloss += 3
if(prob(1))
src << "\red You mutate!"
randmutb(src)
domutcheck(src,null)
emote("gasp")
src.updatehealth()
breathe()
if(src.reagents)
if(src.reagents.has_reagent("lexorin")) return
if(istype(loc, /obj/machinery/atmospherics/unary/cryo_cell)) return
var/datum/gas_mixture/environment = loc.return_air()
var/datum/air_group/breath
// HACK NEED CHANGING LATER
if(src.health < 0)
src.losebreath++
if(losebreath>0) //Suffocating so do not take a breath
src.losebreath--
if (prob(75)) //High chance of gasping for air
spawn emote("gasp")
if(istype(loc, /obj/))
var/obj/location_as_object = loc
location_as_object.handle_internal_lifeform(src, 0)
else
//First, check for air from internal atmosphere (using an air tank and mask generally)
breath = get_breath_from_internal(BREATH_VOLUME)
//No breath from internal atmosphere so get breath from location
if(!breath)
if(istype(loc, /obj/))
var/obj/location_as_object = loc
breath = location_as_object.handle_internal_lifeform(src, BREATH_VOLUME)
else if(istype(loc, /turf/))
var/breath_moles = 0
/*if(environment.return_pressure() > ONE_ATMOSPHERE)
// Loads of air around (pressure effects will be handled elsewhere), so lets just take a enough to fill our lungs at normal atmos pressure (using n = Pv/RT)
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 = loc.remove_air(breath_moles)
else //Still give containing object the chance to interact
if(istype(loc, /obj/))
var/obj/location_as_object = loc
location_as_object.handle_internal_lifeform(src, 0)
handle_breath(breath)
if(breath)
loc.assume_air(breath)
get_breath_from_internal(volume_needed)
if(internal)
if (!contents.Find(src.internal))
internal = null
if (!wear_mask || !(wear_mask.flags & MASKINTERNALS) )
internal = null
if(internal)
if (src.internals)
src.internals.icon_state = "internal1"
return internal.remove_air_volume(volume_needed)
else
if (src.internals)
src.internals.icon_state = "internal0"
return null
update_canmove()
if(paralysis || stunned || weakened || buckled) canmove = 0
else canmove = 1
handle_breath(datum/gas_mixture/breath)
if(src.nodamage)
return
if(!breath || (breath.total_moles() == 0))
//Aliens breathe in vaccuum
return 0
var/toxins_used = 0
var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
//Partial pressure of the toxins in our breath
var/Toxins_pp = (breath.toxins/breath.total_moles())*breath_pressure
if(Toxins_pp) // Detect toxins in air
toxloss += breath.toxins*250
toxins_alert = max(toxins_alert, 1)
toxins_used = breath.toxins
else
toxins_alert = 0
//Breathe in toxins and out oxygen
breath.toxins -= toxins_used
breath.oxygen += toxins_used
if(breath.temperature > (T0C+66) && !(src.mutations & COLD_RESISTANCE)) // Hot air hurts :(
if(prob(20))
src << "\red You feel a searing heat in your lungs!"
fire_alert = max(fire_alert, 1)
else
fire_alert = 0
//Temporary fixes to the alerts.
return 1
handle_environment()
//If there are alien weeds on the ground then heal if needed or give some toxins
if(locate(/obj/alien/weeds) in loc)
if(health >= 100)
toxloss += 15
if(toxloss > max_plasma)
toxloss = max_plasma
else
bruteloss -= 15
fireloss -= 15
adjust_body_temperature(current, loc_temp, boost)
var/temperature = current
var/difference = abs(current-loc_temp) //get difference
var/increments// = difference/10 //find how many increments apart they are
if(difference > 50)
increments = difference/5
else
increments = difference/10
var/change = increments*boost // Get the amount to change by (x per increment)
var/temp_change
if(current < loc_temp)
temperature = min(loc_temp, temperature+change)
else if(current > loc_temp)
temperature = max(loc_temp, temperature-change)
temp_change = (temperature - current)
return temp_change
get_thermal_protection()
var/thermal_protection = 1.0
//Handle normal clothing
if(head && (head.body_parts_covered & HEAD))
thermal_protection += 0.5
if(wear_suit && (wear_suit.body_parts_covered & UPPER_TORSO))
thermal_protection += 0.5
if(wear_suit && (wear_suit.body_parts_covered & LEGS))
thermal_protection += 0.2
if(wear_suit && (wear_suit.body_parts_covered & ARMS))
thermal_protection += 0.2
if(wear_suit && (wear_suit.body_parts_covered & HANDS))
thermal_protection += 0.2
if(wear_suit && (wear_suit.flags & SUITSPACE))
thermal_protection += 3
if(src.mutations & COLD_RESISTANCE)
thermal_protection += 5
return thermal_protection
add_fire_protection(var/temp)
var/fire_prot = 0
if(head)
if(head.protective_temperature > temp)
fire_prot += (head.protective_temperature/10)
if(wear_mask)
if(wear_mask.protective_temperature > temp)
fire_prot += (wear_mask.protective_temperature/10)
if(wear_suit)
if(wear_suit.protective_temperature > temp)
fire_prot += (wear_suit.protective_temperature/10)
return fire_prot
handle_chemicals_in_body()
if(reagents) reagents.metabolize(src)
if(src.nutrition > 500 && !(src.mutations & FAT))
if(prob(5 + round((src.nutrition - 200) / 2)))
src << "\red You suddenly feel blubbery!"
src.mutations |= FAT
// update_body()
if (src.nutrition < 100 && src.mutations & FAT)
if(prob(round((50 - src.nutrition) / 100)))
src << "\blue You feel fit again!"
src.mutations &= ~FAT
// update_body()
if (src.nutrition > 0)
src.nutrition -= HUNGER_FACTOR
if (src.drowsyness)
src.drowsyness--
src.eye_blurry = max(2, src.eye_blurry)
if (prob(5))
src.sleeping = 1
src.paralysis = 5
confused = max(0, confused - 1)
// decrement dizziness counter, clamped to 0
if(resting)
dizziness = max(0, dizziness - 5)
jitteriness = max(0, jitteriness - 5)
else
dizziness = max(0, dizziness - 1)
jitteriness = max(0, jitteriness - 1)
src.updatehealth()
return //TODO: DEFERRED
handle_regular_status_updates()
health = 100 - (oxyloss + fireloss + bruteloss + cloneloss)
if(oxyloss > 50) paralysis = max(paralysis, 3)
if(src.sleeping)
src.paralysis = max(src.paralysis, 3)
if (prob(10) && health) spawn(0) emote("snore")
src.sleeping--
if(src.resting)
src.weakened = max(src.weakened, 5)
if(health < -100 || src.brain_op_stage == 4.0)
death()
else if(src.health < 0)
if(src.health <= 20 && prob(1)) spawn(0) emote("gasp")
//if(!src.rejuv) src.oxyloss++
if(!src.reagents.has_reagent("inaprovaline")) src.oxyloss++
if(src.stat != 2) src.stat = 1
src.paralysis = max(src.paralysis, 5)
if (src.stat != 2) //Alive.
if (src.paralysis || src.stunned || src.weakened) //Stunned etc.
if (src.stunned > 0)
src.stunned--
src.stat = 0
if (src.weakened > 0)
src.weakened--
src.lying = 1
src.stat = 0
if (src.paralysis > 0)
src.paralysis--
src.blinded = 1
src.lying = 1
src.stat = 1
var/h = src.hand
src.hand = 0
drop_item()
src.hand = 1
drop_item()
src.hand = h
else //Not stunned.
src.lying = 0
src.stat = 0
else //Dead.
src.lying = 1
src.blinded = 1
src.stat = 2
if (src.stuttering) src.stuttering--
if (src.eye_blind)
src.eye_blind--
src.blinded = 1
if (src.ear_deaf > 0) src.ear_deaf--
if (src.ear_damage < 25)
src.ear_damage -= 0.05
src.ear_damage = max(src.ear_damage, 0)
src.density = !( src.lying )
if ((src.sdisabilities & 1))
src.blinded = 1
if ((src.sdisabilities & 4))
src.ear_deaf = 1
if (src.eye_blurry > 0)
src.eye_blurry--
src.eye_blurry = max(0, src.eye_blurry)
if (src.druggy > 0)
src.druggy--
src.druggy = max(0, src.druggy)
return 1
handle_regular_hud_updates()
if (src.stat == 2 || src.mutations & XRAY)
src.sight |= SEE_TURFS
src.sight |= SEE_MOBS
src.sight |= SEE_OBJS
src.see_in_dark = 8
src.see_invisible = 2
else if (src.stat != 2)
src.sight |= SEE_MOBS
src.sight &= ~SEE_TURFS
src.sight &= ~SEE_OBJS
src.see_in_dark = 4
src.see_invisible = 2
if (src.sleep) src.sleep.icon_state = text("sleep[]", src.sleeping)
if (src.rest) src.rest.icon_state = text("rest[]", src.resting)
if (src.healths)
if (src.stat != 2)
switch(health)
if(100 to INFINITY)
src.healths.icon_state = "health0"
if(75 to 100)
src.healths.icon_state = "health1"
if(50 to 75)
src.healths.icon_state = "health2"
if(25 to 50)
src.healths.icon_state = "health3"
if(0 to 25)
src.healths.icon_state = "health4"
else
src.healths.icon_state = "health5"
else
src.healths.icon_state = "health6"
if(src.pullin) src.pullin.icon_state = "pull[src.pulling ? 1 : 0]"
if (src.toxin) src.toxin.icon_state = "tox[src.toxins_alert ? 1 : 0]"
if (src.oxygen) src.oxygen.icon_state = "oxy[src.oxygen_alert ? 1 : 0]"
if (src.fire) src.fire.icon_state = "fire[src.fire_alert ? 1 : 0]"
//NOTE: the alerts dont reset when youre out of danger. dont blame me,
//blame the person who coded them. Temporary fix added.
src.client.screen -= src.hud_used.blurry
src.client.screen -= src.hud_used.druggy
src.client.screen -= src.hud_used.vimpaired
if ((src.blind && src.stat != 2))
if ((src.blinded))
src.blind.layer = 18
else
src.blind.layer = 0
if (src.disabilities & 1)
src.client.screen += src.hud_used.vimpaired
if (src.eye_blurry)
src.client.screen += src.hud_used.blurry
if (src.druggy)
src.client.screen += src.hud_used.druggy
if (src.stat != 2)
if (src.machine)
if (!( src.machine.check_eye(src) ))
src.reset_view(null)
else
if(!client.adminobs)
reset_view(null)
return 1
handle_virus_updates()
if(src.bodytemperature > 406)
for(var/datum/disease/D in viruses)
D.cure()
return
check_if_buckled()
if (src.buckled)
src.lying = (istype(src.buckled, /obj/stool/bed) ? 1 : 0)
if(src.lying)
src.drop_item()
src.density = 1
else
src.density = !src.lying
handle_stomach()
spawn(0)
for(var/mob/M in stomach_contents)
if(M.loc != src)
stomach_contents.Remove(M)
continue
if(istype(M, /mob/living/carbon) && src.stat != 2)
if(M.stat == 2)
M.death(1)
stomach_contents.Remove(M)
del(M)
continue
if(air_master.current_cycle%3==1)
if(!M.nodamage)
M.bruteloss += 5
src.nutrition += 10
@@ -1 +0,0 @@
mob/living/carbon/beast
@@ -1,15 +0,0 @@
datum/bodypart
var
name = "unidentified bodypart"
health = 50
datum/bodypart/body
health = 100
datum/bodypart/head
health = 30
datum/bodypart/limb
datum/bodypart/tail
health = 15
@@ -1,13 +0,0 @@
/*
var/mob/dead/phantasm/P = new (src.loc)
for(var/obj/O in src.contents) // Where src is a mob
if(istype(O, /obj/item)) // Only remember carried items (sanity checking, mostly)
src.u_equip(O) // Unequip the item if we're wearing it
if (src.client)
src.client.screen -= O // Clear out any overlays the item added, notably in the equip windows
O.loc = src.loc // Honestly not sure if these two steps are necessary
O.dropped(src) // but they seem to occur everywhere else in the code, so we're not taking any chances.
O.layer = initial(O.layer)
O.loc = P // Add the item to the phantasm's inventory
src.Death(0)
*/
+1 -5
View File
@@ -32,8 +32,6 @@
verbs += /mob/living/silicon/ai/proc/ai_camera_list
//Added ai_network_change by Mord_Sith
verbs += /mob/living/silicon/ai/proc/ai_network_change
verbs += /mob/living/silicon/ai/proc/lockdown
verbs += /mob/living/silicon/ai/proc/disablelockdown
verbs += /mob/living/silicon/ai/proc/ai_statuschange
//Hologram verb./N
verbs += /mob/living/silicon/ai/proc/ai_hologram_change
@@ -188,12 +186,10 @@
/mob/living/silicon/ai/emp_act(severity)
if (prob(30))
switch(pick(1,2,3)) //Add Random laws.
switch(pick(1,2))
if(1)
cancel_camera()
if(2)
lockdown()
if(3)
ai_call_shuttle()
..()
@@ -1,24 +0,0 @@
/mob/living/silicon/hivebot/death(gibbed)
if(src.mainframe)
src.mainframe.return_to(src)
src.stat = 2
src.canmove = 0
if(src.blind)
src.blind.layer = 0
src.sight |= SEE_TURFS
src.sight |= SEE_MOBS
src.sight |= SEE_OBJS
src.see_in_dark = 8
src.see_invisible = 2
src.updateicon()
var/tod = time2text(world.realtime,"hh:mm:ss") //weasellos time of death patch
store_memory("Time of death: [tod]", 0)
if (src.key)
spawn(50)
if(src.key && src.stat == 2)
src.verbs += /mob/proc/ghost
return ..(gibbed)
@@ -1,140 +0,0 @@
/mob/living/silicon/hivebot/emote(var/act)
var/param = null
if (findtext(act, "-", 1, null))
var/t1 = findtext(act, "-", 1, null)
param = copytext(act, t1 + 1, length(act) + 1)
act = copytext(act, 1, t1)
var/m_type = 1
var/message
switch(act)
if ("salute")
if (!src.buckled)
var/M = null
if (param)
for (var/mob/A in view(null, null))
if (param == A.name)
M = A
break
if (!M)
param = null
if (param)
message = "<B>[src]</B> salutes to [param]."
else
message = "<B>[src]</b> salutes."
m_type = 1
if ("bow")
if (!src.buckled)
var/M = null
if (param)
for (var/mob/A in view(null, null))
if (param == A.name)
M = A
break
if (!M)
param = null
if (param)
message = "<B>[src]</B> bows to [param]."
else
message = "<B>[src]</B> bows."
m_type = 1
if ("clap")
if (!src.restrained())
message = "<B>[src]</B> claps."
m_type = 2
if ("flap")
if (!src.restrained())
message = "<B>[src]</B> flaps his wings."
m_type = 2
if ("aflap")
if (!src.restrained())
message = "<B>[src]</B> flaps his wings ANGRILY!"
m_type = 2
if ("custom")
var/input = input("Choose an emote to display.") as text|null
if (!input)
return
input = sanitize(input)
var/input2 = input("Is this a visible or hearable emote?") in list("Visible","Hearable")
if (input2 == "Visible")
m_type = 1
else if (input2 == "Hearable")
m_type = 2
else
alert("Unable to use this emote, must be either hearable or visible.")
return
message = "<B>[src]</B> [input]"
if ("twitch")
message = "<B>[src]</B> twitches violently."
m_type = 1
if ("twitch_s")
message = "<B>[src]</B> twitches."
m_type = 1
if ("nod")
message = "<B>[src]</B> nods."
m_type = 1
if ("glare")
var/M = null
if (param)
for (var/mob/A in view(null, null))
if (param == A.name)
M = A
break
if (!M)
param = null
if (param)
message = "<B>[src]</B> glares at [param]."
else
message = "<B>[src]</B> glares."
if ("stare")
var/M = null
if (param)
for (var/mob/A in view(null, null))
if (param == A.name)
M = A
break
if (!M)
param = null
if (param)
message = "<B>[src]</B> stares at [param]."
else
message = "<B>[src]</B> stares."
if ("look")
var/M = null
if (param)
for (var/mob/A in view(null, null))
if (param == A.name)
M = A
break
if (!M)
param = null
if (param)
message = "<B>[src]</B> looks at [param]."
else
message = "<B>[src]</B> looks."
m_type = 1
else
src << text("Invalid Emote: []", act)
if ((message && src.stat == 0))
if (m_type & 1)
for(var/mob/O in viewers(src, null))
O.show_message(message, m_type)
else
for(var/mob/O in hearers(src, null))
O.show_message(message, m_type)
return
@@ -1,20 +0,0 @@
/mob/living/silicon/hivebot/examine()
set src in oview()
usr << "\blue *---------*"
usr << text("\blue This is \icon[src] <B>[src.name]</B>!")
if (src.stat == 2)
usr << text("\red [src.name] is powered-down.")
if (src.bruteloss)
if (src.bruteloss < 75)
usr << text("\red [src.name] looks slightly dented")
else
usr << text("\red <B>[src.name] looks severely dented!</B>")
if (src.fireloss)
if (src.fireloss < 75)
usr << text("\red [src.name] looks slightly burnt!")
else
usr << text("\red <B>[src.name] looks severely burnt!</B>")
if (src.stat == 1)
usr << text("\red [src.name] doesn't seem to be responding.")
return
@@ -1,57 +0,0 @@
/obj/item/weapon/hive_module
name = "hive robot module"
icon = 'module.dmi'
icon_state = "std_module"
w_class = 2.0
item_state = "electronic"
flags = FPRINT|TABLEPASS | CONDUCT
var/list/modules = list()
/obj/item/weapon/hive_module/standard
name = "give standard robot module"
/obj/item/weapon/hive_module/engineering
name = "HiveBot engineering robot module"
/obj/item/weapon/hive_module/New()//Shit all the mods have
src.modules += new /obj/item/device/flash(src)
/obj/item/weapon/hive_module/standard/New()
..()
src.modules += new /obj/item/weapon/melee/baton(src)
src.modules += new /obj/item/weapon/extinguisher(src)
//var/obj/item/weapon/gun/mp5/M = new /obj/item/weapon/gun/mp5(src)
//M.weapon_lock = 0
//src.modules += M
/obj/item/weapon/hive_module/engineering/New()
src.modules += new /obj/item/weapon/extinguisher(src)
src.modules += new /obj/item/weapon/screwdriver(src)
src.modules += new /obj/item/weapon/weldingtool(src)
src.modules += new /obj/item/weapon/wrench(src)
src.modules += new /obj/item/device/analyzer(src)
src.modules += new /obj/item/device/flashlight(src)
var/obj/item/weapon/rcd/R = new /obj/item/weapon/rcd(src)
R.matter = 30
src.modules += R
src.modules += new /obj/item/device/t_scanner(src)
src.modules += new /obj/item/weapon/crowbar(src)
src.modules += new /obj/item/weapon/wirecutters(src)
src.modules += new /obj/item/device/multitool(src)
var/obj/item/stack/sheet/metal/M = new /obj/item/stack/sheet/metal(src)
M.amount = 50
src.modules += M
var/obj/item/stack/sheet/rglass/G = new /obj/item/stack/sheet/rglass(src)
G.amount = 50
src.modules += G
var/obj/item/weapon/cable_coil/W = new /obj/item/weapon/cable_coil(src)
W.amount = 50
src.modules += W
@@ -1,506 +0,0 @@
/mob/living/silicon/hivebot/New(loc,mainframe)
src << "\blue Your icons have been generated!"
updateicon()
if(mainframe)
dependent = 1
src.real_name = mainframe:name
src.name = src.real_name
else
src.real_name = "Robot [pick(rand(1, 999))]"
src.name = src.real_name
src.radio = new /obj/item/device/radio(src)
..()
/mob/living/silicon/hivebot/proc/pick_module()
if(src.module)
return
var/mod = input("Please, select a module!", "Robot", null, null) in list("Combat", "Engineering")
if(src.module)
return
switch(mod)
if("Combat")
src.module = new /obj/item/weapon/hive_module/standard(src)
if("Engineering")
src.module = new /obj/item/weapon/hive_module/engineering(src)
src.hands.icon_state = "malf"
updateicon()
/mob/living/silicon/hivebot/blob_act()
if (src.stat != 2)
src.bruteloss += 60
src.updatehealth()
return 1
return 0
/mob/living/silicon/hivebot/Stat()
..()
statpanel("Status")
if (src.client.statpanel == "Status")
if(emergency_shuttle.online && emergency_shuttle.location < 2)
var/timeleft = emergency_shuttle.timeleft()
if (timeleft)
stat(null, "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]")
/*
if(ticker.mode.name == "AI malfunction")
stat(null, "Points left until the AI takes over: [AI_points]/[AI_points_win]")
*/
stat(null, text("Charge Left: [src.energy]/[src.energy_max]"))
/mob/living/silicon/hivebot/restrained()
return 0
/mob/living/silicon/hivebot/ex_act(severity)
flick("flash", src.flash)
if (src.stat == 2 && src.client)
src.gib(1)
return
else if (src.stat == 2 && !src.client)
del(src)
return
var/b_loss = src.bruteloss
var/f_loss = src.fireloss
switch(severity)
if(1.0)
if (src.stat != 2)
b_loss += 100
f_loss += 100
src.gib(1)
return
if(2.0)
if (src.stat != 2)
b_loss += 60
f_loss += 60
if(3.0)
if (src.stat != 2)
b_loss += 30
src.bruteloss = b_loss
src.fireloss = f_loss
src.updatehealth()
/mob/living/silicon/hivebot/meteorhit(obj/O as obj)
for(var/mob/M in viewers(src, null))
M.show_message(text("\red [src] has been hit by [O]"), 1)
//Foreach goto(19)
if (src.health > 0)
src.bruteloss += 30
if ((O.icon_state == "flaming"))
src.fireloss += 40
src.updatehealth()
return
/mob/living/silicon/hivebot/bullet_act(flag)
/*
if (flag == PROJECTILE_BULLET)
if (src.stat != 2)
src.bruteloss += 60
src.updatehealth()
else if (flag == PROJECTILE_MEDBULLET)
if (src.stat != 2)
src.bruteloss += 30
src.updatehealth()
else if (flag == PROJECTILE_WEAKBULLET)
if (src.stat != 2)
src.bruteloss += 15
src.updatehealth()
else if (flag == PROJECTILE_MPBULLET)
if (src.stat != 2)
src.bruteloss += 20
src.updatehealth()
else if (flag == PROJECTILE_SLUG)
if (src.stat != 2)
src.bruteloss += 40
src.updatehealth()
else if (flag == PROJECTILE_BAG)
if (src.stat != 2)
src.bruteloss += 2
src.updatehealth()
else if (flag == PROJECTILE_TASER)
return
else if (flag == PROJECTILE_WAVE)
if (src.stat != 2)
src.bruteloss += 25
src.updatehealth()
return
else if(flag == PROJECTILE_LASER)
if (src.stat != 2)
src.bruteloss += 20
src.updatehealth()
else if(flag == PROJECTILE_PULSE)
if (src.stat != 2)
src.bruteloss += 40
src.updatehealth()
*/
return
/mob/living/silicon/hivebot/Bump(atom/movable/AM as mob|obj, yes)
spawn( 0 )
if ((!( yes ) || src.now_pushing))
return
src.now_pushing = 1
if(ismob(AM))
var/mob/tmob = AM
if(istype(tmob, /mob/living/carbon/human) && tmob.mutations & FAT)
if(prob(20))
for(var/mob/M in viewers(src, null))
if(M.client)
M << M << "\red <B>[src] fails to push [tmob]'s fat ass out of the way.</B>"
src.now_pushing = 0
//src.unlock_medal("That's No Moon, That's A Gourmand!", 1)
return
src.now_pushing = 0
..()
if (!istype(AM, /atom/movable))
return
if (!src.now_pushing)
src.now_pushing = 1
if (!AM.anchored)
var/t = get_dir(src, AM)
step(AM, t)
src.now_pushing = null
return
return
/mob/living/silicon/hivebot/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/weldingtool) && W:welding)
if (W:remove_fuel(0))
src.bruteloss -= 30
if(src.bruteloss < 0) src.bruteloss = 0
src.updatehealth()
src.add_fingerprint(user)
for(var/mob/O in viewers(user, null))
O.show_message(text("\red [user] has fixed some of the dents on [src]!"), 1)
else
user << "Need more welding fuel!"
return
/mob/living/silicon/hivebot/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
if (M.a_intent == "grab")
if (M == src)
return
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M )
G.assailant = M
if (M.hand)
M.l_hand = G
else
M.r_hand = G
G.layer = 20
G.affecting = src
src.grabbed_by += G
G.synch()
playsound(src.loc, 'thudswoosh.ogg', 50, 1, -1)
for(var/mob/O in viewers(src, null))
O.show_message(text("\red [] has grabbed [] passively!", M, src), 1)
else if (M.a_intent == "hurt")
var/damage = rand(5, 10)
if (prob(90))
/*
if (M.class == "combat")
damage += 15
if(prob(20))
src.weakened = max(src.weakened,4)
src.stunned = max(src.stunned,4)
*/
playsound(src.loc, 'slash.ogg', 25, 1, -1)
for(var/mob/O in viewers(src, null))
O.show_message(text("\red <B>[] has slashed at []!</B>", M, src), 1)
if(prob(8))
flick("noise", src.flash)
src.bruteloss += damage
src.updatehealth()
else
playsound(src.loc, 'slashmiss.ogg', 25, 1, -1)
for(var/mob/O in viewers(src, null))
O.show_message(text("\red <B>[] took a swipe at []!</B>", M, src), 1)
return
else if (M.a_intent == "disarm")
if(!(src.lying))
var/randn = rand(1, 100)
if (randn <= 40)
src.stunned = 5
step(src,get_dir(M,src))
spawn(5) step(src,get_dir(M,src))
playsound(src.loc, 'slash.ogg', 50, 1, -1)
for(var/mob/O in viewers(src, null))
O.show_message(text("\red <B>[] has pushed back []!</B>", M, src), 1)
else
playsound(src.loc, 'slashmiss.ogg', 25, 1, -1)
for(var/mob/O in viewers(src, null))
O.show_message(text("\red <B>[] attempted to push back []!</B>", M, src), 1)
return
/mob/living/silicon/hivebot/attack_hand(mob/user)
..()
return
/mob/living/silicon/hivebot/proc/allowed(mob/M)
//check if it doesn't require any access at all
if(src.check_access(null))
return 1
return 0
/mob/living/silicon/hivebot/proc/check_access(obj/item/weapon/card/id/I)
if(!istype(src.req_access, /list)) //something's very wrong
return 1
var/list/L = src.req_access
if(!L.len) //no requirements
return 1
if(!I || !istype(I, /obj/item/weapon/card/id) || !I.access) //not ID or no access
return 0
for(var/req in src.req_access)
if(!(req in I.access)) //doesn't have this access
return 0
return 1
/mob/living/silicon/hivebot/proc/updateicon()
src.overlays = null
if(src.stat == 0)
src.overlays += "eyes"
else
src.overlays -= "eyes"
/mob/living/silicon/hivebot/proc/installed_modules()
if(!src.module)
src.pick_module()
return
var/dat = "<HEAD><TITLE>Modules</TITLE><META HTTP-EQUIV='Refresh' CONTENT='10'></HEAD><BODY>\n"
dat += {"<A HREF='?src=\ref[src];mach_close=robotmod'>Close</A>
<BR>
<BR>
<B>Activated Modules</B>
<BR>
Module 1: [module_state_1 ? "<A HREF=?src=\ref[src];mod=\ref[module_state_1]>[module_state_1]<A>" : "No Module"]<BR>
Module 2: [module_state_2 ? "<A HREF=?src=\ref[src];mod=\ref[module_state_2]>[module_state_2]<A>" : "No Module"]<BR>
Module 3: [module_state_3 ? "<A HREF=?src=\ref[src];mod=\ref[module_state_3]>[module_state_3]<A>" : "No Module"]<BR>
<BR>
<B>Installed Modules</B><BR><BR>"}
for (var/obj in src.module.modules)
if(src.activated(obj))
dat += text("[obj]: <B>Activated</B><BR>")
else
dat += text("[obj]: <A HREF=?src=\ref[src];act=\ref[obj]>Activate</A><BR>")
/*
if(src.activated(obj))
dat += text("[obj]: \[<B>Activated</B> | <A HREF=?src=\ref[src];deact=\ref[obj]>Deactivate</A>\]<BR>")
else
dat += text("[obj]: \[<A HREF=?src=\ref[src];act=\ref[obj]>Activate</A> | <B>Deactivated</B>\]<BR>")
*/
src << browse(dat, "window=robotmod&can_close=0")
/mob/living/silicon/hivebot/Topic(href, href_list)
..()
if (href_list["mach_close"])
var/t1 = text("window=[href_list["mach_close"]]")
src.machine = null
src << browse(null, t1)
return
if (href_list["mod"])
var/obj/item/O = locate(href_list["mod"])
O.attack_self(src)
if (href_list["act"])
var/obj/item/O = locate(href_list["act"])
if(activated(O))
src << "Already activated"
return
if(!src.module_state_1)
src.module_state_1 = O
O.layer = 20
src.contents += O
else if(!src.module_state_2)
src.module_state_2 = O
O.layer = 20
src.contents += O
else if(!src.module_state_3)
src.module_state_3 = O
O.layer = 20
src.contents += O
else
src << "You need to disable a module first!"
src.installed_modules()
if (href_list["deact"])
var/obj/item/O = locate(href_list["deact"])
if(activated(O))
if(src.module_state_1 == O)
src.module_state_1 = null
src.contents -= O
else if(src.module_state_2 == O)
src.module_state_2 = null
src.contents -= O
else if(src.module_state_3 == O)
src.module_state_3 = null
src.contents -= O
else
src << "Module isn't activated."
else
src << "Module isn't activated"
src.installed_modules()
return
/mob/living/silicon/hivebot/proc/uneq_active()
if(isnull(src.module_active))
return
if(src.module_state_1 == src.module_active)
if (src.client)
src.client.screen -= module_state_1
src.contents -= module_state_1
src.module_active = null
src.module_state_1 = null
src.inv1.icon_state = "inv1"
else if(src.module_state_2 == src.module_active)
if (src.client)
src.client.screen -= module_state_2
src.contents -= module_state_2
src.module_active = null
src.module_state_2 = null
src.inv2.icon_state = "inv2"
else if(src.module_state_3 == src.module_active)
if (src.client)
src.client.screen -= module_state_3
src.contents -= module_state_3
src.module_active = null
src.module_state_3 = null
src.inv3.icon_state = "inv3"
/mob/living/silicon/hivebot/proc/activated(obj/item/O)
if(src.module_state_1 == O)
return 1
else if(src.module_state_2 == O)
return 1
else if(src.module_state_3 == O)
return 1
else
return 0
/mob/living/silicon/hivebot/proc/radio_menu()
var/dat = {"
<TT>
Microphone: [src.radio.broadcasting ? "<A href='byond://?src=\ref[src.radio];talk=0'>Engaged</A>" : "<A href='byond://?src=\ref[src.radio];talk=1'>Disengaged</A>"]<BR>
Speaker: [src.radio.listening ? "<A href='byond://?src=\ref[src.radio];listen=0'>Engaged</A>" : "<A href='byond://?src=\ref[src.radio];listen=1'>Disengaged</A>"]<BR>
Frequency:
<A href='byond://?src=\ref[src.radio];freq=-10'>-</A>
<A href='byond://?src=\ref[src.radio];freq=-2'>-</A>
[format_frequency(src.radio.frequency)]
<A href='byond://?src=\ref[src.radio];freq=2'>+</A>
<A href='byond://?src=\ref[src.radio];freq=10'>+</A><BR>
-------
</TT>"}
src << browse(dat, "window=radio")
onclose(src, "radio")
return
/mob/living/silicon/hivebot/Move(a, b, flag)
if (src.buckled)
return
if (src.restrained())
src.pulling = null
var/t7 = 1
if (src.restrained())
for(var/mob/M in range(src, 1))
if ((M.pulling == src && M.stat == 0 && !( M.restrained() )))
t7 = null
if ((t7 && (src.pulling && ((get_dist(src, src.pulling) <= 1 || src.pulling.loc == src.loc) && (src.client && src.client.moving)))))
var/turf/T = src.loc
. = ..()
if (src.pulling && src.pulling.loc)
if(!( isturf(src.pulling.loc) ))
src.pulling = null
return
else
if(Debug)
diary <<"src.pulling disappeared? at [__LINE__] in mob.dm - src.pulling = [src.pulling]"
diary <<"REPORT THIS"
/////
if(src.pulling && src.pulling.anchored)
src.pulling = null
return
if (!src.restrained())
var/diag = get_dir(src, src.pulling)
if ((diag - 1) & diag)
else
diag = null
if ((get_dist(src, src.pulling) > 1 || diag))
if (ismob(src.pulling))
var/mob/M = src.pulling
var/ok = 1
if (locate(/obj/item/weapon/grab, M.grabbed_by))
if (prob(75))
var/obj/item/weapon/grab/G = pick(M.grabbed_by)
if (istype(G, /obj/item/weapon/grab))
for(var/mob/O in viewers(M, null))
O.show_message(text("\red [G.affecting] has been pulled from [G.assailant]'s grip by [src]"), 1)
del(G)
else
ok = 0
if (locate(/obj/item/weapon/grab, M.grabbed_by.len))
ok = 0
if (ok)
var/t = M.pulling
M.pulling = null
step(src.pulling, get_dir(src.pulling.loc, T))
M.pulling = t
else
if (src.pulling)
step(src.pulling, get_dir(src.pulling.loc, T))
else
src.pulling = null
. = ..()
if ((src.s_active && !( s_active in src.contents ) ))
src.s_active.close(src)
return
/mob/living/silicon/hivebot/verb/cmd_return_mainframe()
set category = "Robot Commands"
set name = "Recall to Mainframe."
return_mainframe()
/mob/living/silicon/hivebot/proc/return_mainframe()
if(mainframe)
mainframe.return_to(src)
else
src << "\red You lack a dedicated mainframe!"
return
@@ -1,250 +0,0 @@
/obj/hud/proc/hivebot_hud()
src.adding = list( )
src.other = list( )
src.intents = list( )
src.mon_blo = list( )
src.m_ints = list( )
src.mov_int = list( )
src.vimpaired = list( )
src.darkMask = list( )
src.g_dither = new src.h_type( src )
src.g_dither.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.g_dither.name = "Mask"
src.g_dither.icon_state = "dither12g"
src.g_dither.layer = 18
src.g_dither.mouse_opacity = 0
src.alien_view = new src.h_type(src)
src.alien_view.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.alien_view.name = "Alien"
src.alien_view.icon_state = "alien"
src.alien_view.layer = 18
src.alien_view.mouse_opacity = 0
src.blurry = new src.h_type( src )
src.blurry.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.blurry.name = "Blurry"
src.blurry.icon_state = "blurry"
src.blurry.layer = 17
src.blurry.mouse_opacity = 0
src.druggy = new src.h_type( src )
src.druggy.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.druggy.name = "Druggy"
src.druggy.icon_state = "druggy"
src.druggy.layer = 17
src.druggy.mouse_opacity = 0
// station explosion cinematic
src.station_explosion = new src.h_type( src )
src.station_explosion.icon = 'station_explosion.dmi'
src.station_explosion.icon_state = "start"
src.station_explosion.layer = 20
src.station_explosion.mouse_opacity = 0
src.station_explosion.screen_loc = "1,3"
var/obj/screen/using
//Radio
using = new src.h_type( src )
using.name = "radio"
using.dir = SOUTHWEST
using.icon = 'screen1_robot.dmi'
using.icon_state = "radio"
using.screen_loc = ui_movi
using.layer = 20
src.adding += using
//Generic overlays
using = new src.h_type(src) //Right hud bar
using.dir = SOUTH
using.icon = 'screen1_robot.dmi'
using.screen_loc = "EAST+1,SOUTH to EAST+1,NORTH"
using.layer = 19
src.adding += using
using = new src.h_type(src) //Lower hud bar
using.dir = EAST
using.icon = 'screen1_robot.dmi'
using.screen_loc = "WEST,SOUTH-1 to EAST,SOUTH-1"
using.layer = 19
src.adding += using
using = new src.h_type(src) //Corner Button
using.dir = NORTHWEST
using.icon = 'screen1_robot.dmi'
using.screen_loc = "EAST+1,SOUTH-1"
using.layer = 19
src.adding += using
//Module select
using = new src.h_type( src )
using.name = "module1"
using.dir = SOUTHWEST
using.icon = 'screen1_robot.dmi'
using.icon_state = "inv1"
using.screen_loc = ui_inv1
using.layer = 20
src.adding += using
mymob:inv1 = using
using = new src.h_type( src )
using.name = "module2"
using.dir = SOUTHWEST
using.icon = 'screen1_robot.dmi'
using.icon_state = "inv2"
using.screen_loc = ui_inv2
using.layer = 20
src.adding += using
mymob:inv2 = using
using = new src.h_type( src )
using.name = "module3"
using.dir = SOUTHWEST
using.icon = 'screen1_robot.dmi'
using.icon_state = "inv3"
using.screen_loc = ui_inv3
using.layer = 20
src.adding += using
mymob:inv3 = using
//End of module select
//Intent
using = new src.h_type( src )
using.name = "act_intent"
using.dir = SOUTHWEST
using.icon = 'screen1_robot.dmi'
using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
using.screen_loc = ui_acti
using.layer = 20
src.adding += using
action_intent = using
using = new src.h_type( src )
using.name = "arrowleft"
using.icon = 'screen1_robot.dmi'
using.icon_state = "s_arrow"
using.dir = WEST
using.screen_loc = ui_iarrowleft
using.layer = 19
src.adding += using
using = new src.h_type( src )
using.name = "arrowright"
using.icon = 'screen1_robot.dmi'
using.icon_state = "s_arrow"
using.dir = EAST
using.screen_loc = ui_iarrowright
using.layer = 19
src.adding += using
//End of Intent
//Cell
mymob:cells = new /obj/screen( null )
mymob:cells.icon = 'screen1_robot.dmi'
mymob:cells.icon_state = "charge-empty"
mymob:cells.name = "cell"
mymob:cells.screen_loc = ui_toxin
//Health
mymob.healths = new /obj/screen( null )
mymob.healths.icon = 'screen1_robot.dmi'
mymob.healths.icon_state = "health0"
mymob.healths.name = "health"
mymob.healths.screen_loc = ui_health
//Installed Module
mymob.hands = new /obj/screen( null )
mymob.hands.icon = 'screen1_robot.dmi'
mymob.hands.icon_state = "nomod"
mymob.hands.name = "module"
mymob.hands.screen_loc = ui_dropbutton
//Module Panel
using = new src.h_type( src )
using.name = "panel"
using.icon = 'screen1_robot.dmi'
using.icon_state = "panel"
using.screen_loc = ui_throw
using.layer = 19
src.adding += using
//Store
mymob.throw_icon = new /obj/screen(null)
mymob.throw_icon.icon = 'screen1_robot.dmi'
mymob.throw_icon.icon_state = "store"
mymob.throw_icon.name = "store"
mymob.throw_icon.screen_loc = ui_hand
//Temp
mymob.bodytemp = new /obj/screen( null )
mymob.bodytemp.icon_state = "temp0"
mymob.bodytemp.name = "body temperature"
mymob.bodytemp.screen_loc = ui_temp
//does nothing (fire and oxy)
mymob.oxygen = new /obj/screen( null )
mymob.oxygen.icon = 'screen1_robot.dmi'
mymob.oxygen.icon_state = "oxy0"
mymob.oxygen.name = "oxygen"
mymob.oxygen.screen_loc = ui_oxygen
mymob.fire = new /obj/screen( null )
mymob.fire.icon = 'screen1_robot.dmi'
mymob.fire.icon_state = "fire0"
mymob.fire.name = "fire"
mymob.fire.screen_loc = ui_fire
mymob.pullin = new /obj/screen( null )
mymob.pullin.icon = 'screen1_robot.dmi'
mymob.pullin.icon_state = "pull0"
mymob.pullin.name = "pull"
mymob.pullin.screen_loc = ui_pull
mymob.blind = new /obj/screen( null )
mymob.blind.icon = 'screen1_robot.dmi'
mymob.blind.icon_state = "black"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1 to 15,15"
mymob.blind.layer = 0
mymob.flash = new /obj/screen( null )
mymob.flash.icon = 'screen1_robot.dmi'
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
mymob.flash.screen_loc = "1,1 to 15,15"
mymob.flash.layer = 17
mymob.sleep = new /obj/screen( null )
mymob.sleep.icon = 'screen1_robot.dmi'
mymob.sleep.icon_state = "sleep0"
mymob.sleep.name = "sleep"
mymob.sleep.screen_loc = ui_sleep
mymob.rest = new /obj/screen( null )
mymob.rest.icon = 'screen1_robot.dmi'
mymob.rest.icon_state = "rest0"
mymob.rest.name = "rest"
mymob.rest.screen_loc = ui_rest
mymob.zone_sel = new /obj/screen/zone_sel( null )
mymob.zone_sel.overlays = null
mymob.zone_sel.overlays += image("icon" = 'zone_sel.dmi', "icon_state" = text("[]", mymob.zone_sel.selecting))
mymob.client.screen = null
mymob.client.screen += list(mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.fire, mymob.hands, mymob.healths, mymob:cells, mymob.pullin, mymob.blind, mymob.flash, mymob.rest, mymob.sleep) //, mymob.mach )
mymob.client.screen += src.adding + src.other
return
@@ -1,229 +0,0 @@
/mob/living/silicon/hivebot/Life()
set invisibility = 0
set background = 1
if (src.monkeyizing)
return
if (src.stat != 2)
use_power()
src.blinded = null
clamp_values()
handle_regular_status_updates()
if(client)
src.shell = 0
handle_regular_hud_updates()
update_items()
if(dependent)
mainframe_check()
update_canmove()
/mob/living/silicon/hivebot
proc
clamp_values()
stunned = max(min(stunned, 10),0)
paralysis = max(min(paralysis, 1), 0)
weakened = max(min(weakened, 15), 0)
sleeping = max(min(sleeping, 1), 0)
bruteloss = max(bruteloss, 0)
toxloss = 0
oxyloss = 0
fireloss = max(fireloss, 0)
use_power()
if (src.energy)
if(src.energy <= 0)
death()
else if (src.energy <= 10)
src.module_active = null
src.module_state_1 = null
src.module_state_2 = null
src.module_state_3 = null
src.energy -=1
else
if(src.module_state_1)
src.energy -=1
if(src.module_state_2)
src.energy -=1
if(src.module_state_3)
src.energy -=1
src.energy -=1
src.blinded = 0
src.stat = 0
else
src.blinded = 1
src.stat = 1
update_canmove()
if(paralysis || stunned || weakened || buckled) canmove = 0
else canmove = 1
handle_regular_status_updates()
health = src.health_max - (fireloss + bruteloss)
if(health <= 0)
death()
if (src.stat != 2) //Alive.
if (src.paralysis || src.stunned || src.weakened) //Stunned etc.
if (src.stunned > 0)
src.stunned--
src.stat = 0
if (src.weakened > 0)
src.weakened--
src.lying = 0
src.stat = 0
if (src.paralysis > 0)
src.paralysis--
src.blinded = 0
src.lying = 0
src.stat = 1
else //Not stunned.
src.lying = 0
src.stat = 0
else //Dead.
src.blinded = 1
src.stat = 2
src.density = !( src.lying )
if ((src.sdisabilities & 1))
src.blinded = 1
if ((src.sdisabilities & 4))
src.ear_deaf = 1
if (src.eye_blurry > 0)
src.eye_blurry--
src.eye_blurry = max(0, src.eye_blurry)
if (src.druggy > 0)
src.druggy--
src.druggy = max(0, src.druggy)
return 1
handle_regular_hud_updates()
if (src.stat == 2 || src.mutations & XRAY)
src.sight |= SEE_TURFS
src.sight |= SEE_MOBS
src.sight |= SEE_OBJS
src.see_in_dark = 8
src.see_invisible = 2
else if (src.stat != 2)
src.sight &= ~SEE_MOBS
src.sight &= ~SEE_TURFS
src.sight &= ~SEE_OBJS
src.see_in_dark = 8
src.see_invisible = 2
if (src.healths)
if (src.stat != 2)
switch(health)
if(health_max to INFINITY)
src.healths.icon_state = "health0"
if(src.health_max*0.80 to src.health_max)
src.healths.icon_state = "health1"
if(src.health_max*0.60 to src.health_max*0.80)
src.healths.icon_state = "health2"
if(src.health_max*0.40 to src.health_max*0.60)
src.healths.icon_state = "health3"
if(src.health_max*0.20 to src.health_max*0.40)
src.healths.icon_state = "health4"
if(0 to health_max*0.20)
src.healths.icon_state = "health5"
else
src.healths.icon_state = "health6"
else
src.healths.icon_state = "health7"
if (src.cells)
switch(src.energy)
if(src.energy_max*0.75 to INFINITY)
src.cells.icon_state = "charge4"
if(0.5*src.energy_max to 0.75*src.energy_max)
src.cells.icon_state = "charge3"
if(0.25*src.energy_max to 0.5*src.energy_max)
src.cells.icon_state = "charge2"
if(0 to 0.25*src.energy_max)
src.cells.icon_state = "charge1"
else
src.cells.icon_state = "charge0"
switch(src.bodytemperature) //310.055 optimal body temp
if(335 to INFINITY)
src.bodytemp.icon_state = "temp2"
if(320 to 335)
src.bodytemp.icon_state = "temp1"
if(300 to 320)
src.bodytemp.icon_state = "temp0"
if(260 to 300)
src.bodytemp.icon_state = "temp-1"
else
src.bodytemp.icon_state = "temp-2"
if(src.pullin) src.pullin.icon_state = "pull[src.pulling ? 1 : 0]"
src.client.screen -= src.hud_used.blurry
src.client.screen -= src.hud_used.druggy
src.client.screen -= src.hud_used.vimpaired
if ((src.blind && src.stat != 2))
if ((src.blinded))
src.blind.layer = 18
else
src.blind.layer = 0
if (src.disabilities & 1)
src.client.screen += src.hud_used.vimpaired
if (src.eye_blurry)
src.client.screen += src.hud_used.blurry
if (src.druggy)
src.client.screen += src.hud_used.druggy
if (src.stat != 2)
if (src.machine)
if (!( src.machine.check_eye(src) ))
src.reset_view(null)
else
if(!client.adminobs)
reset_view(null)
return 1
update_items()
if (src.client)
src.client.screen -= src.contents
src.client.screen += src.contents
if(src.module_state_1)
src.module_state_1:screen_loc = ui_inv1
if(src.module_state_2)
src.module_state_2:screen_loc = ui_inv2
if(src.module_state_3)
src.module_state_3:screen_loc = ui_inv3
mainframe_check()
if(mainframe)
if(mainframe.stat == 2)
mainframe.return_to(src)
else
death()
@@ -1,15 +0,0 @@
/mob/living/silicon/hivebot/Login()
..()
update_clothing()
if (!isturf(src.loc))
src.client.eye = src.loc
src.client.perspective = EYE_PERSPECTIVE
if (src.stat == 2)
src.verbs += /mob/proc/ghost
if(src.real_name == "Hiveborg")
src.real_name += " "
src.real_name += "-[rand(1, 999)]"
src.name = src.real_name
return
@@ -1,178 +0,0 @@
/mob/living/silicon/hive_mainframe/New()
Namepick()
/mob/living/silicon/hive_mainframe/Life()
if (src.stat == 2)
return
else
src.updatehealth()
if (src.health <= 0)
death()
return
if(src.force_mind)
if(!src.mind)
if(src.client)
src.mind = new
src.mind.key = src.key
src.mind.current = src
src.force_mind = 0
/mob/living/silicon/hive_mainframe/Stat()
..()
statpanel("Status")
if (src.client.statpanel == "Status")
if(emergency_shuttle.online && emergency_shuttle.location < 2)
var/timeleft = emergency_shuttle.timeleft()
if (timeleft)
stat(null, "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]")
/*
if(ticker.mode.name == "AI malfunction")
stat(null, "Points left until the AI takes over: [AI_points]/[AI_points_win]")
*/
/mob/living/silicon/hive_mainframe/updatehealth()
if (src.nodamage == 0)
src.health = 100 - src.fireloss - src.bruteloss
else
src.health = 100
src.stat = 0
/mob/living/silicon/hive_mainframe/death(gibbed)
src.stat = 2
src.canmove = 0
if(src.blind)
src.blind.layer = 0
src.sight |= SEE_TURFS
src.sight |= SEE_MOBS
src.sight |= SEE_OBJS
src.see_in_dark = 8
src.see_invisible = 2
src.lying = 1
src.icon_state = "hive_main-crash"
var/tod = time2text(world.realtime,"hh:mm:ss") //weasellos time of death patch
mind.store_memory("Time of death: [tod]", 0)
if (src.key)
spawn(50)
if(src.key && src.stat == 2)
src.verbs += /mob/proc/ghost
return ..(gibbed)
/mob/living/silicon/hive_mainframe/say_understands(var/other)
if (istype(other, /mob/living/carbon/human))
return 1
if (istype(other, /mob/living/silicon/robot))
return 1
if (istype(other, /mob/living/silicon/hivebot))
return 1
if (istype(other, /mob/living/silicon/ai))
return 1
return ..()
/mob/living/silicon/hive_mainframe/say_quote(var/text)
var/ending = copytext(text, length(text))
if (ending == "?")
return "queries, \"[text]\"";
else if (ending == "!")
return "declares, \"[copytext(text, 1, length(text))]\"";
return "states, \"[text]\"";
/mob/living/silicon/hive_mainframe/proc/return_to(var/mob/user)
if(user.mind)
user.mind.transfer_to(src)
spawn(20)
user:shell = 1
user:real_name = "Robot [pick(rand(1, 999))]"
user:name = user:real_name
return
/mob/living/silicon/hive_mainframe/verb/cmd_deploy_to()
set category = "Mainframe Commands"
set name = "Deploy to shell."
deploy_to()
/mob/living/silicon/hive_mainframe/verb/deploy_to()
if(usr.stat == 2)
usr << "You can't deploy because you are dead!"
return
var/list/bodies = new/list()
for(var/mob/living/silicon/hivebot/H in world)
if(H.z == src.z)
if(H.shell)
if(!H.stat)
bodies += H
var/target_shell = input(usr, "Which body to control?") as null|anything in bodies
if (!target_shell)
return
else if(src.mind)
spawn(30)
target_shell:mainframe = src
target_shell:dependent = 1
target_shell:real_name = src.name
target_shell:name = target_shell:real_name
src.mind.transfer_to(target_shell)
return
/client/proc/MainframeMove(n,direct,var/mob/living/silicon/hive_mainframe/user)
return
/obj/hud/proc/hive_mainframe_hud()
return
/mob/living/silicon/hive_mainframe/Login()
..()
update_clothing()
for(var/S in src.client.screen)
del(S)
src.flash = new /obj/screen( null )
src.flash.icon_state = "blank"
src.flash.name = "flash"
src.flash.screen_loc = "1,1 to 15,15"
src.flash.layer = 17
src.blind = new /obj/screen( null )
src.blind.icon_state = "black"
src.blind.name = " "
src.blind.screen_loc = "1,1 to 15,15"
src.blind.layer = 0
src.client.screen += list( src.blind, src.flash )
if(!isturf(src.loc))
src.client.eye = src.loc
src.client.perspective = EYE_PERSPECTIVE
if (src.stat == 2)
src.verbs += /mob/proc/ghost
return
/mob/living/silicon/hive_mainframe/proc/Namepick()
var/randomname = pick(ai_names)
var/newname = input(src,"You are the a Mainframe Unit. Would you like to change your name to something else?", "Name change",randomname)
if (length(newname) == 0)
newname = randomname
if (newname)
if (length(newname) >= 26)
newname = copytext(newname, 1, 26)
newname = dd_replacetext(newname, ">", "'")
src.real_name = newname
src.name = newname
@@ -1,18 +0,0 @@
/mob/living/silicon/hivebot/say_understands(var/other)
if (istype(other, /mob/living/silicon/ai))
return 1
if (istype(other, /mob/living/carbon/human))
return 1
if (istype(other, /mob/living/silicon/robot))
return 1
return ..()
/mob/living/silicon/hivebot/say_quote(var/text)
var/ending = copytext(text, length(text))
if (ending == "?")
return "queries, \"[text]\"";
else if (ending == "!")
return "declares, \"[copytext(text, 1, length(text))]\"";
return "states, \"[text]\"";
+2 -2
View File
@@ -5,8 +5,8 @@
return 1
if (istype(other, /mob/living/carbon/human))
return 1
if (istype(other, /mob/living/silicon/hivebot))
return 1
// if (istype(other, /mob/living/silicon/hivebot))
// return 1
return ..()
/mob/living/silicon/robot/say_quote(var/text)
+11 -11
View File
@@ -57,15 +57,15 @@
return 1
return 0
/proc/ishivebot(A)
/*proc/ishivebot(A)
if(A && istype(A, /mob/living/silicon/hivebot))
return 1
return 0
return 0*/
/proc/ishivemainframe(A)
/*proc/ishivemainframe(A)
if(A && istype(A, /mob/living/silicon/hive_mainframe))
return 1
return 0
return 0*/
/proc/isAI(A)
if(istype(A, /mob/living/silicon/ai))
@@ -974,20 +974,20 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
usr << "\blue You successfully unbuckle yourself."
usr:buckled.manual_unbuckle_all(usr)
if("module")
if(istype(usr, /mob/living/silicon/robot)||istype(usr, /mob/living/silicon/hivebot))
if(istype(usr, /mob/living/silicon/robot))
if(usr:module)
return
usr:pick_module()
if("radio")
if(istype(usr, /mob/living/silicon/robot)||istype(usr, /mob/living/silicon/hivebot))
if(istype(usr, /mob/living/silicon/robot))
usr:radio_menu()
if("panel")
if(istype(usr, /mob/living/silicon/robot)||istype(usr, /mob/living/silicon/hivebot))
if(istype(usr, /mob/living/silicon/robot))
usr:installed_modules()
if("store")
if(istype(usr, /mob/living/silicon/robot)||istype(usr, /mob/living/silicon/hivebot))
if(istype(usr, /mob/living/silicon/robot))
usr:uneq_active()
if("module1")
@@ -1254,7 +1254,7 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
/mob/proc/equipped()
if(issilicon(src))
if(ishivebot(src)||isrobot(src))
if(isrobot(src))
if(src:module_active)
return src:module_active
else
@@ -1751,8 +1751,8 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
if(isAI(mob))
return AIMove(n,direct,mob)
if(ishivemainframe(mob))
return MainframeMove(n,direct,mob)
// if(ishivemainframe(mob))
// return MainframeMove(n,direct,mob)
if(mob.anchored)/*If mob is not AI and is anchored. This means most anchored mobs will not be able to move.
This is a fix for ninja energy_net to where mobs can not move but can still act to destroy it.
-2
View File
@@ -126,8 +126,6 @@
O.verbs += /mob/living/silicon/ai/proc/ai_camera_track
O.verbs += /mob/living/silicon/ai/proc/ai_alerts
O.verbs += /mob/living/silicon/ai/proc/ai_camera_list
O.verbs += /mob/living/silicon/ai/proc/lockdown
O.verbs += /mob/living/silicon/ai/proc/disablelockdown
O.verbs += /mob/living/silicon/ai/proc/ai_statuschange
O.verbs += /mob/living/silicon/ai/proc/ai_roster