Skip to content

Commit

Permalink
Merge pull request #609 from Zuhayr/machines
Browse files Browse the repository at this point in the history
[DNM] Full prosthetic bodies.
  • Loading branch information
Neerti committed Dec 24, 2015
2 parents c886810 + f93ea6a commit 35e2468
Show file tree
Hide file tree
Showing 194 changed files with 2,092 additions and 1,827 deletions.
2 changes: 1 addition & 1 deletion code/ATMOSPHERICS/he_pipes.dm
Expand Up @@ -81,7 +81,7 @@ obj/machinery/atmospherics/pipe/simple/heat_exchanging
heat_limit = H.species.heat_level_3

if(pipe_air.temperature > heat_limit + 1)
buckled_mob.apply_damage(4 * log(pipe_air.temperature - heat_limit), BURN, "chest", used_weapon = "Excessive Heat")
buckled_mob.apply_damage(4 * log(pipe_air.temperature - heat_limit), BURN, BP_TORSO, used_weapon = "Excessive Heat")

//fancy radiation glowing
if(pipe_air.temperature && (icon_temperature > 500 || pipe_air.temperature > 500)) //start glowing at 500K
Expand Down
12 changes: 6 additions & 6 deletions code/ZAS/Airflow.dm
Expand Up @@ -227,14 +227,14 @@ mob/living/carbon/human/airflow_hit(atom/A)
bloody_body(src)
var/b_loss = airflow_speed * vsc.airflow_damage

var/blocked = run_armor_check("head","melee")
apply_damage(b_loss/3, BRUTE, "head", blocked, 0, "Airflow")
var/blocked = run_armor_check(BP_HEAD,"melee")
apply_damage(b_loss/3, BRUTE, BP_HEAD, blocked, 0, "Airflow")

blocked = run_armor_check("chest","melee")
apply_damage(b_loss/3, BRUTE, "chest", blocked, 0, "Airflow")
blocked = run_armor_check(BP_TORSO,"melee")
apply_damage(b_loss/3, BRUTE, BP_TORSO, blocked, 0, "Airflow")

blocked = run_armor_check("groin","melee")
apply_damage(b_loss/3, BRUTE, "groin", blocked, 0, "Airflow")
blocked = run_armor_check(BP_GROIN,"melee")
apply_damage(b_loss/3, BRUTE, BP_GROIN, blocked, 0, "Airflow")

if(airflow_speed > 10)
Paralyse(round(airflow_speed * vsc.airflow_stun))
Expand Down
44 changes: 22 additions & 22 deletions code/ZAS/Fire.dm
Expand Up @@ -65,12 +65,12 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0)
/zone/proc/remove_liquidfuel(var/used_liquid_fuel, var/remove_fire=0)
if(!fuel_objs.len)
return
//As a simplification, we remove fuel equally from all fuel sources. It might be that some fuel sources have more fuel,

//As a simplification, we remove fuel equally from all fuel sources. It might be that some fuel sources have more fuel,
//some have less, but whatever. It will mean that sometimes we will remove a tiny bit less fuel then we intended to.

var/fuel_to_remove = used_liquid_fuel/(fuel_objs.len*LIQUIDFUEL_AMOUNT_TO_MOL) //convert back to liquid volume units

for(var/O in fuel_objs)
var/obj/effect/decal/cleanable/liquid_fuel/fuel = O
if(!istype(fuel))
Expand Down Expand Up @@ -188,7 +188,7 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0)
return

set_dir(pick(cardinal))

var/datum/gas_mixture/air_contents = loc.return_air()
color = fire_color(air_contents.temperature)
set_light(3, 1, color)
Expand All @@ -209,7 +209,7 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0)
var/turf/T = loc
if (istype(T))
set_light(0)

T.fire = null
loc = null
air_master.active_hotspots.Remove(src)
Expand All @@ -224,12 +224,12 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0)
/datum/gas_mixture/proc/zburn(zone/zone, force_burn, no_check = 0)
. = 0
if((temperature > PHORON_MINIMUM_BURN_TEMPERATURE || force_burn) && (no_check ||check_recombustability(zone? zone.fuel_objs : null)))

#ifdef FIREDBG
log_debug("***************** FIREDBG *****************")
log_debug("Burning [zone? zone.name : "zoneless gas_mixture"]!")
#endif

var/gas_fuel = 0
var/liquid_fuel = 0
var/total_fuel = 0
Expand Down Expand Up @@ -278,7 +278,7 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0)
var/total_reaction_progress = gas_reaction_progress + liquid_reaction_progress
var/used_fuel = min(total_reaction_progress, reaction_limit)
var/used_oxidizers = used_fuel*(FIRE_REACTION_OXIDIZER_AMOUNT/FIRE_REACTION_FUEL_AMOUNT)

#ifdef FIREDBG
log_debug("gas_fuel = [gas_fuel], liquid_fuel = [liquid_fuel], total_oxidizers = [total_oxidizers]")
log_debug("fuel_area = [fuel_area], total_fuel = [total_fuel], reaction_limit = [reaction_limit]")
Expand Down Expand Up @@ -312,12 +312,12 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0)
//calculate the energy produced by the reaction and then set the new temperature of the mix
temperature = (starting_energy + vsc.fire_fuel_energy_release * (used_gas_fuel + used_liquid_fuel)) / heat_capacity()
update_values()

#ifdef FIREDBG
log_debug("used_gas_fuel = [used_gas_fuel]; used_liquid_fuel = [used_liquid_fuel]; total = [used_fuel]")
log_debug("new temperature = [temperature]; new pressure = [return_pressure()]")
#endif

return firelevel

datum/gas_mixture/proc/check_recombustability(list/fuel_objs)
Expand Down Expand Up @@ -369,19 +369,19 @@ datum/gas_mixture/proc/check_recombustability(list/fuel_objs)
if(total_combustables > 0)
//slows down the burning when the concentration of the reactants is low
var/damping_multiplier = min(1, active_combustables / (total_moles/group_multiplier))

//weight the damping mult so that it only really brings down the firelevel when the ratio is closer to 0
damping_multiplier = 2*damping_multiplier - (damping_multiplier*damping_multiplier)

//calculates how close the mixture of the reactants is to the optimum
//fires burn better when there is more oxidizer -- too much fuel will choke the fire out a bit, reducing firelevel.
var/mix_multiplier = 1 / (1 + (5 * ((total_fuel / total_combustables) ** 2)))

#ifdef FIREDBG
ASSERT(damping_multiplier <= 1)
ASSERT(mix_multiplier <= 1)
#endif

//toss everything together -- should produce a value between 0 and fire_firelevel_multiplier
firelevel = vsc.fire_firelevel_multiplier * mix_multiplier * damping_multiplier

Expand Down Expand Up @@ -425,10 +425,10 @@ datum/gas_mixture/proc/check_recombustability(list/fuel_objs)

//Always check these damage procs first if fire damage isn't working. They're probably what's wrong.

apply_damage(2.5*mx*head_exposure, BURN, "head", 0, 0, "Fire")
apply_damage(2.5*mx*chest_exposure, BURN, "chest", 0, 0, "Fire")
apply_damage(2.0*mx*groin_exposure, BURN, "groin", 0, 0, "Fire")
apply_damage(0.6*mx*legs_exposure, BURN, "l_leg", 0, 0, "Fire")
apply_damage(0.6*mx*legs_exposure, BURN, "r_leg", 0, 0, "Fire")
apply_damage(0.4*mx*arms_exposure, BURN, "l_arm", 0, 0, "Fire")
apply_damage(0.4*mx*arms_exposure, BURN, "r_arm", 0, 0, "Fire")
apply_damage(2.5*mx*head_exposure, BURN, BP_HEAD, 0, 0, "Fire")
apply_damage(2.5*mx*chest_exposure, BURN, BP_TORSO, 0, 0, "Fire")
apply_damage(2.0*mx*groin_exposure, BURN, BP_GROIN, 0, 0, "Fire")
apply_damage(0.6*mx*legs_exposure, BURN, BP_L_LEG, 0, 0, "Fire")
apply_damage(0.6*mx*legs_exposure, BURN, BP_R_LEG, 0, 0, "Fire")
apply_damage(0.4*mx*arms_exposure, BURN, BP_L_ARM, 0, 0, "Fire")
apply_damage(0.4*mx*arms_exposure, BURN, BP_R_ARM, 0, 0, "Fire")
12 changes: 4 additions & 8 deletions code/ZAS/Phoron.dm
Expand Up @@ -116,11 +116,7 @@ obj/var/contaminated = 0


/mob/living/carbon/human/proc/burn_eyes()
//The proc that handles eye burning.
if(!species.has_organ["eyes"])
return

var/obj/item/organ/eyes/E = internal_organs_by_name["eyes"]
var/obj/item/organ/internal/eyes/E = internal_organs_by_name[O_EYES]
if(E)
if(prob(20)) src << "<span class='danger'>Your eyes burn!</span>"
E.damage += 2.5
Expand All @@ -143,15 +139,15 @@ obj/var/contaminated = 0
//Checks if the suit is adequately sealed.
var/coverage = 0
for(var/obj/item/protection in list(wear_suit, gloves, shoes))
if(!protection)
if(!protection)
continue
if(vsc.plc.PHORONGUARD_ONLY && !(protection.flags & PHORONGUARD))
return 0
coverage |= protection.body_parts_covered

if(vsc.plc.PHORONGUARD_ONLY)
return 1

return BIT_TEST_ALL(coverage, UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS)

/mob/living/carbon/human/proc/suit_contamination()
Expand Down
1 change: 0 additions & 1 deletion code/__defines/chemistry.dm
Expand Up @@ -23,7 +23,6 @@
#define IS_UNATHI 4
#define IS_TAJARA 5
#define IS_XENOS 6
#define IS_MACHINE 7

#define CE_STABLE "stable" // Inaprovaline
#define CE_ANTIBIOTIC "antibiotic" // Spaceacilin
Expand Down
18 changes: 9 additions & 9 deletions code/__defines/damage_organs.dm
Expand Up @@ -30,15 +30,15 @@
#define AIR_DAMAGE_MODIFIER 2.025 // More means less damage from hot air scalding lungs, less = more damage. (default 2.025)

// Organ defines.
#define ORGAN_CUT_AWAY 1<<0
#define ORGAN_BLEEDING 1<<1
#define ORGAN_BROKEN 1<<2
#define ORGAN_DESTROYED 1<<3
#define ORGAN_ROBOT 1<<4
#define ORGAN_SPLINTED 1<<5
#define ORGAN_DEAD 1<<6
#define ORGAN_MUTATED 1<<7
#define ORGAN_ASSISTED 1<<8
#define ORGAN_CUT_AWAY (1<<0)
#define ORGAN_BLEEDING (1<<1)
#define ORGAN_BROKEN (1<<2)
#define ORGAN_DESTROYED (1<<3)
#define ORGAN_ROBOT (1<<4)
#define ORGAN_SPLINTED (1<<5)
#define ORGAN_DEAD (1<<6)
#define ORGAN_MUTATED (1<<7)
#define ORGAN_ASSISTED (1<<8)

#define DROPLIMB_EDGE 0
#define DROPLIMB_BLUNT 1
Expand Down
36 changes: 36 additions & 0 deletions code/__defines/mobs.dm
Expand Up @@ -136,3 +136,39 @@

#define INCAPACITATION_DEFAULT (INCAPACITATION_RESTRAINED|INCAPACITATION_BUCKLED_FULLY)
#define INCAPACITATION_ALL (INCAPACITATION_RESTRAINED|INCAPACITATION_BUCKLED_PARTIALLY|INCAPACITATION_BUCKLED_FULLY)

// Bodyparts and organs.
#define O_MOUTH "mouth"
#define O_EYES "eyes"
#define O_HEART "heart"
#define O_LUNGS "lungs"
#define O_BRAIN "brain"
#define O_LIVER "liver"
#define O_KIDNEYS "kidneys"
#define O_PLASMA "plasma vessel"
#define O_HIVE "hive node"
#define O_NUTRIENT "nutrient vessel"
#define O_STRATA "neural strata"
#define O_RESPONSE "response node"
#define O_GBLADDER "gas bladder"
#define O_POLYP "polyp segment"
#define O_ANCHOR "anchoring ligament"
#define O_ACID "acid gland"
#define O_EGG "egg sac"
#define O_RESIN "resin spinner"

#define BP_L_FOOT "l_foot"
#define BP_R_FOOT "r_foot"
#define BP_L_LEG "l_leg"
#define BP_R_LEG "r_leg"
#define BP_L_HAND "l_hand"
#define BP_R_HAND "r_hand"
#define BP_L_ARM "l_arm"
#define BP_R_ARM "r_arm"
#define BP_HEAD "head"
#define BP_TORSO "torso"
#define BP_GROIN "groin"
#define BP_ALL list(BP_GROIN, BP_TORSO, BP_HEAD, BP_L_ARM, BP_R_ARM, BP_L_HAND, BP_R_HAND, BP_L_FOOT, BP_R_FOOT, BP_L_LEG, BP_R_LEG)

#define SYNTH_BLOOD_COLOUR "#030303"
#define SYNTH_FLESH_COLOUR "#575757"
6 changes: 2 additions & 4 deletions code/__defines/species_languages.dm
@@ -1,12 +1,10 @@
// Species flags.
#define NO_BLOOD 0x1 // Vessel var is not filled with blood, cannot bleed out.
#define NO_BREATHE 0x2 // Cannot suffocate or take oxygen loss.
#define NO_MINOR_CUT 0x1 // Can step on broken glass with no ill-effects. Either thick skin (diona/vox), cut resistant (slimes) or incorporeal (shadows)
#define IS_PLANT 0x2 // Is a treeperson.
#define NO_SCAN 0x4 // Cannot be scanned in a DNA machine/genome-stolen.
#define NO_PAIN 0x8 // Cannot suffer halloss/recieves deceptive health indicator.
#define NO_SLIP 0x10 // Cannot fall over.
#define NO_POISON 0x20 // Cannot not suffer toxloss.
#define IS_PLANT 0x40 // Is a treeperson.
#define NO_MINOR_CUT 0x80 // Can step on broken glass with no ill-effects. Either thick skin (diona/vox), cut resistant (slimes) or incorporeal (shadows)
// unused: 0x8000 - higher than this will overflow

// Species spawn flags
Expand Down
26 changes: 16 additions & 10 deletions code/_helpers/mobs.dm
Expand Up @@ -29,10 +29,13 @@ proc/random_hair_style(gender, species = "Human")
var/list/valid_hairstyles = list()
for(var/hairstyle in hair_styles_list)
var/datum/sprite_accessory/S = hair_styles_list[hairstyle]
if(gender == MALE && S.gender == FEMALE)
continue
if(gender == FEMALE && S.gender == MALE)
continue

if(gender != NEUTER && gender != PLURAL)
if(gender == MALE && S.gender == FEMALE)
continue
if(gender == FEMALE && S.gender == MALE)
continue

if( !(species in S.species_allowed))
continue
valid_hairstyles[hairstyle] = hair_styles_list[hairstyle]
Expand All @@ -48,10 +51,13 @@ proc/random_facial_hair_style(gender, species = "Human")
var/list/valid_facialhairstyles = list()
for(var/facialhairstyle in facial_hair_styles_list)
var/datum/sprite_accessory/S = facial_hair_styles_list[facialhairstyle]
if(gender == MALE && S.gender == FEMALE)
continue
if(gender == FEMALE && S.gender == MALE)
continue

if(gender != NEUTER && gender != PLURAL)
if(gender == MALE && S.gender == FEMALE)
continue
if(gender == FEMALE && S.gender == MALE)
continue

if( !(species in S.species_allowed))
continue

Expand All @@ -61,12 +67,12 @@ proc/random_facial_hair_style(gender, species = "Human")
f_style = pick(valid_facialhairstyles)

return f_style

proc/sanitize_name(name, species = "Human")
var/datum/species/current_species
if(species)
current_species = all_species[species]

return current_species ? current_species.sanitize_name(name) : sanitizeName(name)

proc/random_name(gender, species = "Human")
Expand Down
30 changes: 15 additions & 15 deletions code/_onclick/hud/screen_objects.dm
Expand Up @@ -98,7 +98,7 @@
name = "damage zone"
icon_state = "zone_sel"
screen_loc = ui_zonesel
var/selecting = "chest"
var/selecting = BP_TORSO

/obj/screen/zone_sel/Click(location, control,params)
var/list/PL = params2list(params)
Expand All @@ -110,52 +110,52 @@
if(1 to 3) //Feet
switch(icon_x)
if(10 to 15)
selecting = "r_foot"
selecting = BP_R_FOOT
if(17 to 22)
selecting = "l_foot"
selecting = BP_L_FOOT
else
return 1
if(4 to 9) //Legs
switch(icon_x)
if(10 to 15)
selecting = "r_leg"
selecting = BP_R_LEG
if(17 to 22)
selecting = "l_leg"
selecting = BP_L_LEG
else
return 1
if(10 to 13) //Hands and groin
switch(icon_x)
if(8 to 11)
selecting = "r_hand"
selecting = BP_R_HAND
if(12 to 20)
selecting = "groin"
selecting = BP_GROIN
if(21 to 24)
selecting = "l_hand"
selecting = BP_L_HAND
else
return 1
if(14 to 22) //Chest and arms to shoulders
switch(icon_x)
if(8 to 11)
selecting = "r_arm"
selecting = BP_R_ARM
if(12 to 20)
selecting = "chest"
selecting = BP_TORSO
if(21 to 24)
selecting = "l_arm"
selecting = BP_L_ARM
else
return 1
if(23 to 30) //Head, but we need to check for eye or mouth
if(icon_x in 12 to 20)
selecting = "head"
selecting = BP_HEAD
switch(icon_y)
if(23 to 24)
if(icon_x in 15 to 17)
selecting = "mouth"
selecting = O_MOUTH
if(26) //Eyeline, eyes are on 15 and 17
if(icon_x in 14 to 18)
selecting = "eyes"
selecting = O_EYES
if(25 to 27)
if(icon_x in 15 to 17)
selecting = "eyes"
selecting = O_EYES

if(old_selecting != selecting)
update_icon()
Expand Down

0 comments on commit 35e2468

Please sign in to comment.