Conflicts:
	code/modules/mob/new_player/new_player.dm
This commit is contained in:
Chinsky
2013-10-15 10:56:50 +04:00
27 changed files with 264 additions and 226 deletions

View File

@@ -1007,6 +1007,18 @@ What are the archived variables for?
return 0 return 0
return 1 return 1
/datum/gas_mixture/proc/compare_unsim(turf/list/samples)
//Purpose: Compares a list of unsimulated tiles to self to see if within acceptable ranges that group processing may be enabled
//Called by: ZAS sleeping detection.
//Inputs: List of unsimulated turfs to compare to
//Outputs: 1 if within an acceptable range to sleep, 0 otherwise.
var/datum/gas_mixture/after_share = new
after_share.copy_from(src)
ShareSpace(after_share, samples)
return src.compare(after_share)
/datum/gas_mixture/proc/subtract(datum/gas_mixture/right_side) /datum/gas_mixture/proc/subtract(datum/gas_mixture/right_side)
//Purpose: Subtracts right_side from air_mixture. Used to help turfs mingle //Purpose: Subtracts right_side from air_mixture. Used to help turfs mingle
//Called by: Pipelines ending in a break (or something) //Called by: Pipelines ending in a break (or something)

View File

@@ -179,6 +179,8 @@
if((air_check_directions & direction && !(air_directions_archived & direction)) || \ if((air_check_directions & direction && !(air_directions_archived & direction)) || \
(unsim_check_directions & direction && !(unsim_directions_archived & direction))) (unsim_check_directions & direction && !(unsim_directions_archived & direction)))
ZConnect(src,T) ZConnect(src,T)
zone.ActivateIfNeeded()
if(T.zone) T.zone.ActivateIfNeeded()
//Something like a wall was built, changing the geometry. //Something like a wall was built, changing the geometry.
else if((!(air_check_directions & direction) && air_directions_archived & direction) || \ else if((!(air_check_directions & direction) && air_directions_archived & direction) || \

View File

@@ -21,6 +21,7 @@ var/list/CounterDoorDirections = list(SOUTH,EAST) //Which directions doors turfs
var/last_rebuilt = 0 var/last_rebuilt = 0
var/status = ZONE_ACTIVE var/status = ZONE_ACTIVE
var/interactions_with_neighbors = 0 var/interactions_with_neighbors = 0
var/interactions_with_unsim = 0
var/progress = "nothing" var/progress = "nothing"
@@ -185,10 +186,14 @@ var/list/CounterDoorDirections = list(SOUTH,EAST) //Which directions doors turfs
unsimulated_tiles -= T unsimulated_tiles -= T
if(unsimulated_tiles.len) if(unsimulated_tiles.len)
var/old_pressure = air.return_pressure()
var/moved_air = ShareSpace(air,unsimulated_tiles) var/moved_air = ShareSpace(air,unsimulated_tiles)
if(moved_air > vsc.airflow_lightest_pressure) if(moved_air > vsc.airflow_lightest_pressure)
AirflowSpace(src) AirflowSpace(src)
if(old_pressure && (moved_air / old_pressure) > MINIMUM_AIR_RATIO_TO_SUSPEND) //Check if we've moved enough air to be considered awake.
interactions_with_unsim++
else else
unsimulated_tiles = null unsimulated_tiles = null
@@ -305,10 +310,11 @@ var/list/CounterDoorDirections = list(SOUTH,EAST) //Which directions doors turfs
Z.interactions_with_neighbors++ Z.interactions_with_neighbors++
interactions_with_neighbors++ interactions_with_neighbors++
if(!interactions_with_neighbors && !unsimulated_tiles) if(!interactions_with_neighbors && !interactions_with_unsim)
SetStatus(ZONE_SLEEPING) SetStatus(ZONE_SLEEPING)
interactions_with_neighbors = 0 interactions_with_neighbors = 0
interactions_with_unsim = 0
progress = "all components completed successfully, the problem is not here" progress = "all components completed successfully, the problem is not here"
@@ -329,6 +335,28 @@ var/list/CounterDoorDirections = list(SOUTH,EAST) //Which directions doors turfs
/zone/proc/CheckStatus() /zone/proc/CheckStatus()
return status return status
/zone/proc/ActivateIfNeeded()
if(status == ZONE_ACTIVE) return
var/difference = 0
if(unsimulated_tiles && unsimulated_tiles.len)
if(air.compare_unsim(unsimulated_tiles))
difference = 1
if(!difference)
for(var/zone/Z in connected_zones) //Check adjacent zones for air difference.
if(air.compare(Z.air))
difference = 1
break
if(difference) //We have a difference, activate the zone.
SetStatus(ZONE_ACTIVE)
return
/zone/proc/assume_air(var/datum/gas_mixture/giver) /zone/proc/assume_air(var/datum/gas_mixture/giver)
if(status == ZONE_ACTIVE) if(status == ZONE_ACTIVE)
return air.merge(giver) return air.merge(giver)

View File

@@ -368,27 +368,26 @@
spawn(rand(800,2000)) spawn(rand(800,2000))
if(changeling_power(20,1,100,DEAD)) if(changeling_power(20,1,100,DEAD))
// charge the changeling chemical cost for stasis
changeling.chem_charges -= 20 changeling.chem_charges -= 20
if(C.stat == DEAD)
dead_mob_list -= C // restore us to health
living_mob_list += C C.rejuvenate()
C.stat = CONSCIOUS
C.tod = null // remove our fake death flag
C.setToxLoss(0) C.status_flags &= ~(FAKEDEATH)
C.setOxyLoss(0)
C.setCloneLoss(0) // let us move again
C.SetParalysis(0) C.update_canmove()
C.SetStunned(0)
C.SetWeakened(0) // re-add out changeling powers
C.radiation = 0 C.make_changeling()
C.heal_overall_damage(C.getBruteLoss(), C.getFireLoss())
C.reagents.clear_reagents() // sending display messages
C << "<span class='notice'>We have regenerated.</span>" C << "<span class='notice'>We have regenerated.</span>"
C.visible_message("<span class='warning'>[src] appears to wake from the dead, having healed all wounds.</span>") C.visible_message("<span class='warning'>[src] appears to wake from the dead, having healed all wounds.</span>")
C.status_flags &= ~(FAKEDEATH)
C.update_canmove()
C.make_changeling()
feedback_add_details("changeling_powers","FD") feedback_add_details("changeling_powers","FD")
return 1 return 1

View File

@@ -198,7 +198,7 @@
nextstate = CLOSED nextstate = CLOSED
latetoggle() proc/latetoggle()
if(operating || stat & NOPOWER || !nextstate) if(operating || stat & NOPOWER || !nextstate)
return return
switch(nextstate) switch(nextstate)
@@ -285,4 +285,4 @@
/obj/machinery/door/firedoor/multi_tile /obj/machinery/door/firedoor/multi_tile
icon = 'icons/obj/doors/DoorHazard2x1.dmi' icon = 'icons/obj/doors/DoorHazard2x1.dmi'
width = 2 width = 2

View File

@@ -22,7 +22,7 @@
weapons += new /datum/mecha_weapon/honker(src) weapons += new /datum/mecha_weapon/honker(src)
weapons += new /datum/mecha_weapon/missile_rack/banana_mortar(src) weapons += new /datum/mecha_weapon/missile_rack/banana_mortar(src)
weapons += new /datum/mecha_weapon/missile_rack/mousetrap_mortar(src) weapons += new /datum/mecha_weapon/missile_rack/banana_mortar/mousetrap_mortar(src)
selected_weapon = weapons[1] selected_weapon = weapons[1]
return return
*/ */

View File

@@ -47,7 +47,7 @@
..() ..()
var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/weapon/energy/pulse var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/weapon/energy/pulse
ME.attach(src) ME.attach(src)
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/explosive
ME.attach(src) ME.attach(src)
ME = new /obj/item/mecha_parts/mecha_equipment/tesla_energy_relay(src) ME = new /obj/item/mecha_parts/mecha_equipment/tesla_energy_relay(src)
ME.attach(src) ME.attach(src)
@@ -66,7 +66,7 @@
del(ME) del(ME)
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/scattershot(src) ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/scattershot(src)
ME.attach(src) ME.attach(src)
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack(src) ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/explosive(src)
ME.attach(src) ME.attach(src)
ME = new /obj/item/mecha_parts/mecha_equipment/teleporter(src) ME = new /obj/item/mecha_parts/mecha_equipment/teleporter(src)
ME.attach(src) ME.attach(src)

View File

@@ -2,41 +2,68 @@
name = "mecha weapon" name = "mecha weapon"
range = RANGED range = RANGED
origin_tech = "materials=3;combat=3" origin_tech = "materials=3;combat=3"
var/projectile var/projectile //Type of projectile fired.
var/fire_sound var/projectiles = 1 //Amount of projectiles loaded.
var/projectiles_per_shot = 1 //Amount of projectiles fired per single shot.
var/deviation = 0 //Inaccuracy of shots.
var/fire_cooldown = 0 //Duration of sleep between firing projectiles in single shot.
var/fire_sound //Sound played while firing.
var/fire_volume = 50 //How loud it is played.
var/auto_rearm = 0 //Does the weapon reload itself after each shot?
/obj/item/mecha_parts/mecha_equipment/weapon/can_attach(var/obj/mecha/combat/M as obj) /obj/item/mecha_parts/mecha_equipment/weapon/can_attach(var/obj/mecha/combat/M as obj)
if(..()) if(!istype(M))
if(istype(M)) return 0
return 1 return ..()
return 0
/obj/item/mecha_parts/mecha_equipment/weapon/action_checks(atom/target)
if(projectiles <= 0)
return 0
return ..()
/obj/item/mecha_parts/mecha_equipment/weapon/action(atom/target)
if(!action_checks(target))
return
var/turf/curloc = chassis.loc
var/turf/targloc = get_turf(target)
if(!curloc || !targloc)
return
chassis.use_power(energy_drain)
chassis.visible_message("<span class='warning'>[chassis] fires [src]!</span>")
occupant_message("<span class='warning'>You fire [src]!</span>")
log_message("Fired from [src], targeting [target].")
for(var/i = 1 to min(projectiles, projectiles_per_shot))
var/turf/aimloc = targloc
if(deviation)
aimloc = locate(targloc.x+GaussRandRound(deviation,1),targloc.y+GaussRandRound(deviation,1),targloc.z)
if(!aimloc || aimloc == curloc)
break
playsound(chassis, fire_sound, fire_volume, 1)
projectiles--
var/P = new projectile(curloc)
Fire(P, target, aimloc)
if(fire_cooldown)
sleep(fire_cooldown)
if(auto_rearm)
projectiles = projectiles_per_shot
set_ready_state(0)
do_after_cooldown()
return
/obj/item/mecha_parts/mecha_equipment/weapon/proc/Fire(atom/A, atom/target, turf/aimloc)
var/obj/item/projectile/P = A
P.shot_from = src
P.original = target
P.starting = P.loc
P.current = P.loc
P.firer = chassis.occupant
P.yo = aimloc.y - P.loc.y
P.xo = aimloc.x - P.loc.x
P.process()
/obj/item/mecha_parts/mecha_equipment/weapon/energy /obj/item/mecha_parts/mecha_equipment/weapon/energy
name = "General Energy Weapon" name = "General Energy Weapon"
auto_rearm = 1
action(target)
if(!action_checks(target)) return
var/turf/curloc = chassis.loc
var/atom/targloc = get_turf(target)
if (!targloc || !istype(targloc, /turf) || !curloc)
return
if (targloc == curloc)
return
set_ready_state(0)
playsound(chassis, fire_sound, 50, 1)
var/obj/item/projectile/A = new projectile(curloc)
A.original = target
A.current = curloc
A.yo = targloc.y - curloc.y
A.xo = targloc.x - curloc.x
chassis.use_power(energy_drain)
A.process()
chassis.log_message("Fired from [src.name], targeting [target].")
do_after_cooldown()
return
/obj/item/mecha_parts/mecha_equipment/weapon/energy/laser /obj/item/mecha_parts/mecha_equipment/weapon/energy/laser
equip_cooldown = 8 equip_cooldown = 8
@@ -104,10 +131,9 @@
construction_cost = list("metal"=20000,"bananium"=10000) construction_cost = list("metal"=20000,"bananium"=10000)
can_attach(obj/mecha/combat/honker/M as obj) can_attach(obj/mecha/combat/honker/M as obj)
if(..()) if(!istype(M))
if(istype(M)) return 0
return 1 return ..()
return 0
action(target) action(target)
if(!chassis) if(!chassis)
@@ -152,15 +178,8 @@
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic /obj/item/mecha_parts/mecha_equipment/weapon/ballistic
name = "General Ballisic Weapon" name = "General Ballisic Weapon"
var/projectiles
var/projectile_energy_cost var/projectile_energy_cost
action_checks(atom/target)
if(..())
if(projectiles > 0)
return 1
return 0
get_equip_info() get_equip_info()
return "[..()]\[[src.projectiles]\][(src.projectiles < initial(src.projectiles))?" - <a href='?src=\ref[src];rearm=1'>Rearm</a>":null]" return "[..()]\[[src.projectiles]\][(src.projectiles < initial(src.projectiles))?" - <a href='?src=\ref[src];rearm=1'>Rearm</a>":null]"
@@ -188,38 +207,11 @@
equip_cooldown = 20 equip_cooldown = 20
projectile = /obj/item/projectile/bullet/midbullet projectile = /obj/item/projectile/bullet/midbullet
fire_sound = 'sound/weapons/Gunshot.ogg' fire_sound = 'sound/weapons/Gunshot.ogg'
fire_volume = 80
projectiles = 40 projectiles = 40
projectiles_per_shot = 4
deviation = 0.7
projectile_energy_cost = 25 projectile_energy_cost = 25
var/projectiles_per_shot = 4
var/deviation = 0.7
action(atom/target)
if(!action_checks(target)) return
var/turf/curloc = get_turf(chassis)
var/turf/targloc = get_turf(target)
if(!curloc || !targloc) return
var/target_x = targloc.x
var/target_y = targloc.y
var/target_z = targloc.z
targloc = null
for(var/i=1 to min(projectiles, projectiles_per_shot))
targloc = locate(target_x+GaussRandRound(deviation,1),target_y+GaussRandRound(deviation,1),target_z)
if(!targloc || targloc == curloc)
break
playsound(chassis, fire_sound, 80, 1)
var/obj/item/projectile/A = new projectile(curloc)
src.projectiles--
A.original = target
A.current = curloc
A.yo = targloc.y - curloc.y
A.xo = targloc.x - curloc.x
set_ready_state(0)
A.process()
log_message("Fired from [src.name], targeting [target].")
do_after_cooldown()
return
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/lmg /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/lmg
name = "Ultra AC 2" name = "Ultra AC 2"
@@ -228,41 +220,19 @@
projectile = /obj/item/projectile/bullet/weakbullet projectile = /obj/item/projectile/bullet/weakbullet
fire_sound = 'sound/weapons/Gunshot.ogg' fire_sound = 'sound/weapons/Gunshot.ogg'
projectiles = 300 projectiles = 300
projectiles_per_shot = 3
deviation = 0.3
projectile_energy_cost = 20 projectile_energy_cost = 20
var/projectiles_per_shot = 3 fire_cooldown = 2
var/deviation = 0.3
action(atom/target)
if(!action_checks(target)) return
var/turf/targloc = get_turf(target)
var/target_x = targloc.x
var/target_y = targloc.y
var/target_z = targloc.z
targloc = null
spawn for(var/i=1 to min(projectiles, projectiles_per_shot))
if(!chassis) break
var/turf/curloc = get_turf(chassis)
targloc = locate(target_x+GaussRandRound(deviation,1),target_y+GaussRandRound(deviation,1),target_z)
if (!targloc || !curloc)
continue
if (targloc == curloc)
continue
playsound(chassis, fire_sound, 50, 1)
var/obj/item/projectile/A = new projectile(curloc)
src.projectiles--
A.original = target
A.current = curloc
A.yo = targloc.y - curloc.y
A.xo = targloc.x - curloc.x
A.process()
sleep(2)
set_ready_state(0)
log_message("Fired from [src.name], targeting [target].")
do_after_cooldown()
return
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack
var/missile_speed = 2
var/missile_range = 30
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/Fire(atom/movable/AM, atom/target, turf/aimloc)
AM.throw_at(target,missile_range, missile_speed)
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/explosive
name = "SRM-8 Missile Rack" name = "SRM-8 Missile Rack"
icon_state = "mecha_missilerack" icon_state = "mecha_missilerack"
projectile = /obj/item/missile projectile = /obj/item/missile
@@ -270,21 +240,11 @@
projectiles = 8 projectiles = 8
projectile_energy_cost = 1000 projectile_energy_cost = 1000
equip_cooldown = 60 equip_cooldown = 60
var/missile_speed = 2
var/missile_range = 30
action(target)
if(!action_checks(target)) return
set_ready_state(0)
var/obj/item/missile/M = new projectile(chassis.loc)
M.primed = 1
playsound(chassis, fire_sound, 50, 1)
M.throw_at(target, missile_range, missile_speed)
projectiles--
log_message("Fired from [src.name], targeting [target].")
do_after_cooldown()
return
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/explosive/Fire(atom/movable/AM, atom/target, turf/aimloc)
var/obj/item/missile/M = AM
M.primed = 1
..()
/obj/item/missile /obj/item/missile
icon = 'icons/obj/grenade.dmi' icon = 'icons/obj/grenade.dmi'
@@ -311,18 +271,11 @@
equip_cooldown = 60 equip_cooldown = 60
var/det_time = 20 var/det_time = 20
action(target) /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flashbang/Fire(atom/movable/AM, atom/target, turf/aimloc)
if(!action_checks(target)) return ..()
set_ready_state(0) var/obj/item/weapon/grenade/flashbang/F = AM
var/obj/item/weapon/grenade/flashbang/F = new projectile(chassis.loc) spawn(det_time)
playsound(chassis, fire_sound, 50, 1) F.prime()
F.throw_at(target, missile_range, missile_speed)
projectiles--
log_message("Fired from [src.name], targeting [target].")
spawn(det_time)
F.prime()
do_after_cooldown()
return
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flashbang/clusterbang//Because I am a heartless bastard -Sieve /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flashbang/clusterbang//Because I am a heartless bastard -Sieve
name = "SOP-6 Grenade Launcher" name = "SOP-6 Grenade Launcher"
@@ -348,49 +301,17 @@
construction_cost = list("metal"=20000,"bananium"=5000) construction_cost = list("metal"=20000,"bananium"=5000)
can_attach(obj/mecha/combat/honker/M as obj) can_attach(obj/mecha/combat/honker/M as obj)
if(..()) if(!istype(M))
if(istype(M)) return 0
return 1 return ..()
return 0
action(target) /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/banana_mortar/mousetrap_mortar
if(!action_checks(target)) return
set_ready_state(0)
var/obj/item/weapon/bananapeel/B = new projectile(chassis.loc)
playsound(chassis, fire_sound, 60, 1)
B.throw_at(target, missile_range, missile_speed)
projectiles--
log_message("Bananed from [src.name], targeting [target]. HONK!")
do_after_cooldown()
return
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/mousetrap_mortar
name = "Mousetrap Mortar" name = "Mousetrap Mortar"
icon_state = "mecha_mousetrapmrtr" icon_state = "mecha_mousetrapmrtr"
projectile = /obj/item/device/assembly/mousetrap projectile = /obj/item/device/assembly/mousetrap
fire_sound = 'sound/items/bikehorn.ogg'
projectiles = 15
missile_speed = 1.5
projectile_energy_cost = 100
equip_cooldown = 10 equip_cooldown = 10
construction_time = 300
construction_cost = list("metal"=20000,"bananium"=5000)
can_attach(obj/mecha/combat/honker/M as obj) /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/banana_mortar/mousetrap_mortar/Fire(atom/movable/AM, atom/target, turf/aimloc)
if(..()) var/obj/item/device/assembly/mousetrap/M = AM
if(istype(M)) M.secured = 1
return 1 ..()
return 0
action(target)
if(!action_checks(target)) return
set_ready_state(0)
var/obj/item/device/assembly/mousetrap/M = new projectile(chassis.loc)
M.secured = 1
playsound(chassis, fire_sound, 60, 1)
M.throw_at(target, missile_range, missile_speed)
projectiles--
log_message("Launched a mouse-trap from [src.name], targeting [target]. HONK!")
do_after_cooldown()
return

View File

@@ -112,7 +112,7 @@
///obj/item/mecha_parts/mecha_equipment/jetpack, //TODO MECHA JETPACK SPRITE MISSING ///obj/item/mecha_parts/mecha_equipment/jetpack, //TODO MECHA JETPACK SPRITE MISSING
/obj/item/mecha_parts/mecha_equipment/weapon/energy/taser, /obj/item/mecha_parts/mecha_equipment/weapon/energy/taser,
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/lmg, /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/lmg,
///obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/mousetrap_mortar, HONK-related mech part ///obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/banana_mortar/mousetrap_mortar, HONK-related mech part
///obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/banana_mortar, Also HONK-related ///obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/banana_mortar, Also HONK-related
///obj/item/mecha_parts/mecha_equipment/weapon/honker Thirdly HONK-related ///obj/item/mecha_parts/mecha_equipment/weapon/honker Thirdly HONK-related
), ),

View File

@@ -6,7 +6,7 @@
name = "mecha part" name = "mecha part"
icon = 'icons/mecha/mech_construct.dmi' icon = 'icons/mecha/mech_construct.dmi'
icon_state = "blank" icon_state = "blank"
w_class = 20 w_class = 5
flags = FPRINT | TABLEPASS | CONDUCT flags = FPRINT | TABLEPASS | CONDUCT
origin_tech = "programming=2;materials=2" origin_tech = "programming=2;materials=2"
var/construction_time = 100 var/construction_time = 100

View File

@@ -1,6 +1,8 @@
/obj/mecha/medical/New() /obj/mecha/medical/New()
..() ..()
new /obj/item/mecha_parts/mecha_tracking(src) var/turf/T = get_turf(src)
if(T.z != 2)
new /obj/item/mecha_parts/mecha_tracking(src)
return return

View File

@@ -3,7 +3,9 @@
/obj/mecha/working/New() /obj/mecha/working/New()
..() ..()
new /obj/item/mecha_parts/mecha_tracking(src) var/turf/T = get_turf(src)
if(T.z != 2)
new /obj/item/mecha_parts/mecha_tracking(src)
return return
/* /*

View File

@@ -27,6 +27,7 @@
/obj/item/weapon/storage/fancy/examine() /obj/item/weapon/storage/fancy/examine()
set src in oview(1) set src in oview(1)
..()
if(contents.len <= 0) if(contents.len <= 0)
usr << "There are no [src.icon_type]s left in the box." usr << "There are no [src.icon_type]s left in the box."
else if(contents.len == 1) else if(contents.len == 1)

View File

@@ -313,9 +313,6 @@ BLIND // can't see anything
if(usr.stat) return if(usr.stat) return
if(hastie) if(hastie)
usr.put_in_hands(hastie)
hastie = null
if (istype(hastie,/obj/item/clothing/tie/holster)) if (istype(hastie,/obj/item/clothing/tie/holster))
verbs -= /obj/item/clothing/under/proc/holster verbs -= /obj/item/clothing/under/proc/holster
@@ -323,7 +320,10 @@ BLIND // can't see anything
verbs -= /obj/item/clothing/under/proc/storage verbs -= /obj/item/clothing/under/proc/storage
var/obj/item/clothing/tie/storage/W = hastie var/obj/item/clothing/tie/storage/W = hastie
if (W.hold) if (W.hold)
W.hold.loc = hastie W.hold.close(usr)
usr.put_in_hands(hastie)
hastie = null
if(istype(loc, /mob/living/carbon/human)) if(istype(loc, /mob/living/carbon/human))
var/mob/living/carbon/human/H = loc var/mob/living/carbon/human/H = loc

View File

@@ -74,7 +74,7 @@ Works together with spawning an observer, noted above.
if(key) if(key)
var/mob/dead/observer/ghost = new(src) //Transfer safety to observer spawning proc. var/mob/dead/observer/ghost = new(src) //Transfer safety to observer spawning proc.
ghost.can_reenter_corpse = can_reenter_corpse ghost.can_reenter_corpse = can_reenter_corpse
ghost.timeofdeath = timeofdeath //BS12 EDIT ghost.timeofdeath = src.timeofdeath //BS12 EDIT
ghost.key = key ghost.key = key
return ghost return ghost
@@ -89,10 +89,11 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(stat == DEAD) if(stat == DEAD)
ghostize(1) ghostize(1)
else else
var/response = alert(src, "Are you -sure- you want to ghost?\n(You are alive. If you ghost whilst still alive you may not play again this round! You can't change your mind so choose wisely!!)","Are you sure you want to ghost?","Ghost","Stay in body") var/response = alert(src, "Are you -sure- you want to ghost?\n(You are alive. If you ghost, you won't be able to play this round for another 30 minutes! You can't change your mind so choose wisely!)","Are you sure you want to ghost?","Ghost","Stay in body")
if(response != "Ghost") return //didn't want to ghost after-all if(response != "Ghost") return //didn't want to ghost after-all
resting = 1 resting = 1
ghostize(0) //0 parameter is so we can never re-enter our body, "Charlie, you can never come baaaack~" :3 var/mob/dead/observer/ghost = ghostize(0) //0 parameter is so we can never re-enter our body, "Charlie, you can never come baaaack~" :3
ghost.timeofdeath = world.time // Because the living mob won't have a time of death and we want the respawn timer to work properly.
return return

View File

@@ -174,6 +174,21 @@
//////////////////////////////////////////// ////////////////////////////////////////////
/*
This function restores the subjects blood to max.
*/
/mob/living/carbon/human/proc/restore_blood()
var/blood_volume = vessel.get_reagent_amount("blood")
vessel.add_reagent("blood",560.0-blood_volume)
/*
This function restores all organs.
*/
/mob/living/carbon/human/restore_all_organs()
for(var/datum/organ/external/current_organ in organs)
current_organ.rejuvenate()
/mob/living/carbon/human/proc/HealDamage(zone, brute, burn) /mob/living/carbon/human/proc/HealDamage(zone, brute, burn)
var/datum/organ/external/E = get_organ(zone) var/datum/organ/external/E = get_organ(zone)
if(istype(E, /datum/organ/external)) if(istype(E, /datum/organ/external))

View File

@@ -93,7 +93,7 @@
set desc = "Take a blood sample from a suitable donor." set desc = "Take a blood sample from a suitable donor."
var/list/choices = list() var/list/choices = list()
for(var/mob/living/C in view(1,src)) for(var/mob/living/carbon/C in view(1,src))
if(C.real_name != real_name) if(C.real_name != real_name)
choices += C choices += C

View File

@@ -39,7 +39,7 @@
reagents = R reagents = R
R.my_atom = src R.my_atom = src
if(name == "monkey" || name == "farwa" || name == "stok" || name == "neara" || name == "diona nymph") //Hideous but necessary to stop Pun-Pun becoming generic. if(name == initial(name)) //To stop Pun-Pun becoming generic.
name = "[name] ([rand(1, 1000)])" name = "[name] ([rand(1, 1000)])"
real_name = name real_name = name

View File

@@ -39,6 +39,7 @@
/datum/species/human /datum/species/human
name = "Human" name = "Human"
language = "Sol Common"
primitive = /mob/living/carbon/monkey primitive = /mob/living/carbon/monkey
flags = HAS_SKIN_TONE | HAS_LIPS | HAS_UNDERWEAR flags = HAS_SKIN_TONE | HAS_LIPS | HAS_UNDERWEAR

View File

@@ -246,7 +246,21 @@
adjustFireLoss(burn) adjustFireLoss(burn)
src.updatehealth() src.updatehealth()
/mob/living/proc/restore_all_organs()
return
/mob/living/proc/revive() /mob/living/proc/revive()
rejuvenate()
buckled = initial(src.buckled)
if(iscarbon(src))
var/mob/living/carbon/C = src
C.handcuffed = initial(C.handcuffed)
/mob/living/proc/rejuvenate()
// shut down various types of badness
setToxLoss(0) setToxLoss(0)
setOxyLoss(0) setOxyLoss(0)
setCloneLoss(0) setCloneLoss(0)
@@ -254,30 +268,43 @@
SetParalysis(0) SetParalysis(0)
SetStunned(0) SetStunned(0)
SetWeakened(0) SetWeakened(0)
// shut down ongoing problems
radiation = 0 radiation = 0
nutrition = 400 nutrition = 400
bodytemperature = 310 bodytemperature = T20C
sdisabilities = 0 sdisabilities = 0
disabilities = 0 disabilities = 0
// fix blindness and deafness
blinded = 0 blinded = 0
eye_blind = 0 eye_blind = 0
eye_blurry = 0 eye_blurry = 0
eye_stat = 0 eye_stat = 0
ear_deaf = 0 ear_deaf = 0
ear_damage = 0 ear_damage = 0
heal_overall_damage(1000, 1000) heal_overall_damage(getBruteLoss(), getFireLoss())
buckled = initial(src.buckled)
if(iscarbon(src)) // restore all of a human's blood
var/mob/living/carbon/C = src if(ishuman(src))
C.handcuffed = initial(C.handcuffed) var/mob/living/carbon/human/human_mob = src
for(var/datum/disease/D in viruses) human_mob.restore_blood()
D.cure(0)
// fix all of our organs
restore_all_organs()
// remove the character from the list of the dead
if(stat == 2) if(stat == 2)
dead_mob_list -= src dead_mob_list -= src
living_mob_list += src living_mob_list += src
tod = null
// restore us to conciousness
stat = CONSCIOUS stat = CONSCIOUS
// make the icons look correct
regenerate_icons() regenerate_icons()
..()
return return
/mob/living/proc/UpdateDamageIcon() /mob/living/proc/UpdateDamageIcon()

View File

@@ -119,6 +119,7 @@
var/obj/O = locate("landmark*Observer-Start") var/obj/O = locate("landmark*Observer-Start")
src << "\blue Now teleporting." src << "\blue Now teleporting."
observer.loc = O.loc observer.loc = O.loc
observer.timeofdeath = world.time // Set the time of death so that the respawn timer works correctly.
client.prefs.update_preview_icon() client.prefs.update_preview_icon()
observer.icon = client.prefs.preview_icon observer.icon = client.prefs.preview_icon

View File

@@ -181,8 +181,31 @@
var/result = update_icon() var/result = update_icon()
return result return result
/*
This function completely restores a damaged organ to perfect condition.
*/
/datum/organ/external/proc/rejuvenate()
damage_state = "00"
status = 0
perma_injury = 0
brute_dam = 0
burn_dam = 0
// handle internal organs
for(var/datum/organ/internal/current_organ in internal_organs)
current_organ.rejuvenate()
// remove embedded objects and drop them on the floor
for(var/obj/implanted_object in implants)
if(!istype(implanted_object,/obj/item/weapon/implant)) // We don't want to remove REAL implants. Just shrapnel etc.
implanted_object.loc = owner.loc
implants -= implanted_object
owner.updatehealth()
update_icon()
/datum/organ/external/proc/createwound(var/type = CUT, var/damage) /datum/organ/external/proc/createwound(var/type = CUT, var/damage)
if(damage == 0) return if(damage == 0) return

View File

@@ -11,6 +11,9 @@
var/min_broken_damage = 30 var/min_broken_damage = 30
var/parent_organ = "chest" var/parent_organ = "chest"
/datum/organ/internal/proc/rejuvenate()
damage=0
/datum/organ/internal/proc/is_bruised() /datum/organ/internal/proc/is_bruised()
return damage >= min_bruised_damage return damage >= min_bruised_damage

View File

@@ -16,7 +16,7 @@
pressure_resistance = 1 pressure_resistance = 1
slot_flags = SLOT_HEAD slot_flags = SLOT_HEAD
body_parts_covered = HEAD body_parts_covered = HEAD
attack_verb = list("") attack_verb = list("bapped")
var/info //What's actually written on the paper. var/info //What's actually written on the paper.
var/info_links //A different version of the paper which includes html links at fields and EOF var/info_links //A different version of the paper which includes html links at fields and EOF

View File

@@ -71,13 +71,13 @@ var/list/beam_master = list()
..() ..()
proc/cleanup(reference) //Waits .3 seconds then removes the overlay. proc/cleanup(reference) //Waits .3 seconds then removes the overlay.
src = null src = null //we're getting deleted! this will keep the code running
sleep(3) spawn(3)
var/list/turf_master = beam_master[reference] var/list/turf_master = beam_master[reference]
for(var/laser_state in turf_master) for(var/laser_state in turf_master)
var/list/turfs = turf_master[laser_state] var/list/turfs = turf_master[laser_state]
for(var/turf/T in turfs) for(var/turf/T in turfs)
T.overlays -= beam_master[laser_state] T.overlays -= beam_master[laser_state]
return return
/obj/item/projectile/beam/practice /obj/item/projectile/beam/practice

View File

@@ -122,8 +122,8 @@
return ..() && target.brain_op_stage == 2 return ..() && target.brain_op_stage == 2
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] starts taking out bone chips and out of [target]'s brain with \the [tool].", \ user.visible_message("[user] starts taking out bone chips out of [target]'s brain with \the [tool].", \
"You start taking out bone chips and out of [target]'s brain with \the [tool].") "You start taking out bone chips out of [target]'s brain with \the [tool].")
..() ..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 24 KiB