Merge remote-tracking branch 'Aurorastation/development' into new-engine

# Conflicts:
#	code/__HELPERS/unsorted.dm
This commit is contained in:
skull132
2016-01-24 23:25:08 +02:00
322 changed files with 4499 additions and 2403 deletions
+4 -2
View File
@@ -1,6 +1,7 @@
/obj
var/can_buckle = 0
var/buckle_movable = 0
var/buckle_dir = 0
var/buckle_lying = -1 //bed-like behavior, forces mob.lying = buckle_lying if != -1
var/buckle_require_restraints = 0 //require people to be handcuffed before being able to buckle. eg: pipes
var/mob/living/buckled_mob = null
@@ -31,7 +32,7 @@
M.buckled = src
M.facing_dir = null
M.set_dir(dir)
M.set_dir(buckle_dir ? buckle_dir : dir)
M.update_canmove()
buckled_mob = M
post_buckle_mob(M)
@@ -55,7 +56,8 @@
user << "<span class='warning'>You can't buckle anyone in before the game starts.</span>"
if(!user.Adjacent(M) || user.restrained() || user.lying || user.stat || istype(user, /mob/living/silicon/pai))
return
if(M == buckled_mob)
return
if(istype(M, /mob/living/carbon/slime))
user << "<span class='warning'>The [M] is too squishy to buckle in.</span>"
return
+82 -29
View File
@@ -4,14 +4,76 @@
/obj/effect/effect/smoke/chem
icon = 'icons/effects/chemsmoke.dmi'
opacity = 0
layer = 6
time_to_live = 300
pass_flags = PASSTABLE | PASSGRILLE | PASSGLASS //PASSGLASS is fine here, it's just so the visual effect can "flow" around glass
var/splash_amount = 10 //atoms moving through a smoke cloud get splashed with up to 10 units of reagent
var/turf/destination
/obj/effect/effect/smoke/chem/New()
/obj/effect/effect/smoke/chem/New(var/newloc, smoke_duration, turf/dest_turf = null, icon/cached_icon = null)
time_to_live = smoke_duration
..()
create_reagents(500)
return
if(cached_icon)
icon = cached_icon
set_dir(pick(cardinal))
pixel_x = -32 + rand(-8, 8)
pixel_y = -32 + rand(-8, 8)
//switching opacity on after the smoke has spawned, and then turning it off before it is deleted results in cleaner
//lighting and view range updates (Is this still true with the new lighting system?)
opacity = 1
//float over to our destination, if we have one
destination = dest_turf
if(destination)
walk_to(src, destination)
/obj/effect/effect/smoke/chem/Destroy()
opacity = 0
fadeOut()
..()
/obj/effect/effect/smoke/chem/Move()
var/list/oldlocs = view(1, src)
. = ..()
if(.)
for(var/turf/T in view(1, src) - oldlocs)
for(var/atom/movable/AM in T)
if(!istype(AM, /obj/effect/effect/smoke/chem))
reagents.splash(AM, splash_amount, copy = 1)
if(loc == destination)
bound_width = 96
bound_height = 96
/obj/effect/effect/smoke/chem/Crossed(atom/movable/AM)
..()
if(!istype(AM, /obj/effect/effect/smoke/chem))
reagents.splash(AM, splash_amount, copy = 1)
/obj/effect/effect/smoke/chem/proc/initial_splash()
for(var/turf/T in view(1, src))
for(var/atom/movable/AM in T)
if(!istype(AM, /obj/effect/effect/smoke/chem))
reagents.splash(AM, splash_amount, copy = 1)
// Fades out the smoke smoothly using it's alpha variable.
/obj/effect/effect/smoke/chem/proc/fadeOut(var/frames = 16)
if(!alpha) return //already transparent
frames = max(frames, 1) //We will just assume that by 0 frames, the coder meant "during one frame".
var/alpha_step = round(alpha / frames)
while(alpha > 0)
alpha = max(0, alpha - alpha_step)
sleep(world.tick_lag)
/////////////////////////////////////////////
// Chem Smoke Effect System
/////////////////////////////////////////////
/datum/effect/effect/system/smoke_spread/chem
smoke_type = /obj/effect/effect/smoke/chem
var/obj/chemholder
@@ -115,13 +177,21 @@
else
I = icon('icons/effects/96x96.dmi', "smoke")
//Calculate smoke duration
var/smoke_duration = 150
var/pressure = 0
var/datum/gas_mixture/environment = location.return_air()
if(environment) pressure = environment.return_pressure()
smoke_duration = between(5, smoke_duration*pressure/(ONE_ATMOSPHERE/3), smoke_duration)
var/const/arcLength = 2.3559 //distance between each smoke cloud
for(var/i = 0, i < range, i++) //calculate positions for smoke coverage - then spawn smoke
var/radius = i * 1.5
if(!radius)
spawn(0)
spawnSmoke(location, I, 1)
spawnSmoke(location, I, 1, 1)
continue
var/offset = 0
@@ -146,43 +216,26 @@
// Randomizes and spawns the smoke effect.
// Also handles deleting the smoke once the effect is finished.
//------------------------------------------
/datum/effect/effect/system/smoke_spread/chem/proc/spawnSmoke(var/turf/T, var/icon/I, var/dist = 1, var/obj/effect/effect/smoke/chem/passed_smoke)
/datum/effect/effect/system/smoke_spread/chem/proc/spawnSmoke(var/turf/T, var/icon/I, var/smoke_duration, var/dist = 1, var/splash_initial=0, var/obj/effect/effect/smoke/chem/passed_smoke)
var/obj/effect/effect/smoke/chem/smoke
if(passed_smoke)
smoke = passed_smoke
else
smoke = PoolOrNew(/obj/effect/effect/smoke/chem, location)
smoke = PoolOrNew(/obj/effect/effect/smoke/chem, list(location, smoke_duration + rand(0, 20), T, I))
if(chemholder.reagents.reagent_list.len)
chemholder.reagents.trans_to_obj(smoke, chemholder.reagents.total_volume / dist, copy = 1) //copy reagents to the smoke so mob/breathe() can handle inhaling the reagents
smoke.icon = I
smoke.layer = 6
smoke.set_dir(pick(cardinal))
smoke.pixel_x = -32 + rand(-8, 8)
smoke.pixel_y = -32 + rand(-8, 8)
walk_to(smoke, T)
smoke.opacity = 1 //switching opacity on after the smoke has spawned, and then
sleep(150+rand(0,20)) // turning it off before it is deleted results in cleaner
smoke.opacity = 0 // lighting and view range updates
fadeOut(smoke)
qdel(src)
/datum/effect/effect/system/smoke_spread/chem/spores/spawnSmoke(var/turf/T, var/icon/I, var/dist = 1)
//Kinda ugly, but needed unless the system is reworked
if(splash_initial)
smoke.initial_splash()
/datum/effect/effect/system/smoke_spread/chem/spores/spawnSmoke(var/turf/T, var/smoke_duration, var/icon/I, var/dist = 1)
var/obj/effect/effect/smoke/chem/spores = PoolOrNew(/obj/effect/effect/smoke/chem, location)
spores.name = "cloud of [seed.seed_name] [seed.seed_noun]"
..(T, I, dist, spores)
/datum/effect/effect/system/smoke_spread/chem/proc/fadeOut(var/atom/A, var/frames = 16) // Fades out the smoke smoothly using it's alpha variable.
if(A.alpha == 0) //Handle already transparent case
return
if(frames == 0)
frames = 1 //We will just assume that by 0 frames, the coder meant "during one frame".
var/step = A.alpha / frames
for(var/i = 0, i < frames, i++)
A.alpha -= step
sleep(world.tick_lag)
return
..(T, I, smoke_duration, dist, spores)
/datum/effect/effect/system/smoke_spread/chem/proc/smokeFlow() // Smoke pathfinder. Uses a flood fill method based on zones to quickly check what turfs the smoke (airflow) can actually reach.
@@ -60,7 +60,7 @@ var/global/list/image/splatter_cache=list()
var/obj/item/organ/external/l_foot = perp.get_organ("l_foot")
var/obj/item/organ/external/r_foot = perp.get_organ("r_foot")
var/hasfeet = 1
if((!l_foot || l_foot.status & ORGAN_DESTROYED) && (!r_foot || r_foot.status & ORGAN_DESTROYED))
if((!l_foot || l_foot.is_stump()) && (!r_foot || r_foot.is_stump()))
hasfeet = 0
if(perp.shoes && !perp.buckled)//Adding blood to shoes
var/obj/item/clothing/shoes/S = perp.shoes
@@ -105,27 +105,61 @@
qdel(src)
*/
/client/proc/spawn_tanktransferbomb()
set category = "Debug"
set desc = "Spawn a tank transfer valve bomb"
set name = "Instant TTV"
if(!check_rights(R_SPAWN)) return
var/obj/effect/spawner/newbomb/proto = /obj/effect/spawner/newbomb/radio/custom
var/p = input("Enter phoron amount (mol):","Phoron", initial(proto.phoron_amt)) as num|null
if(p == null) return
var/o = input("Enter oxygen amount (mol):","Oxygen", initial(proto.oxygen_amt)) as num|null
if(o == null) return
var/c = input("Enter carbon dioxide amount (mol):","Carbon Dioxide", initial(proto.carbon_amt)) as num|null
if(c == null) return
new /obj/effect/spawner/newbomb/radio/custom(get_turf(mob), p, o, c)
/obj/effect/spawner/newbomb
name = "bomb"
name = "TTV bomb"
icon = 'icons/mob/screen1.dmi'
icon_state = "x"
var/btype = 0 // 0=radio, 1=prox, 2=time
var/assembly_type = /obj/item/device/assembly/signaler
//Note that the maximum amount of gas you can put in a 70L air tank at 1013.25 kPa and 519K is 16.44 mol.
var/phoron_amt = 10.96
var/oxygen_amt = 16.44
var/carbon_amt = 0.0
timer
btype = 2
/obj/effect/spawner/newbomb/timer
name = "TTV bomb - timer"
assembly_type = /obj/item/device/assembly/timer
syndicate
/obj/effect/spawner/newbomb/timer/syndicate
name = "TTV bomb - merc"
//High yield bombs. Yes, it is possible to make these with toxins
phoron_amt = 15.66
oxygen_amt = 24.66
proximity
btype = 1
/obj/effect/spawner/newbomb/proximity
name = "TTV bomb - proximity"
assembly_type = /obj/item/device/assembly/prox_sensor
radio
btype = 0
/obj/effect/spawner/newbomb/New()
/obj/effect/spawner/newbomb/radio/custom/New(var/newloc, ph, ox, co)
if(ph != null) phoron_amt = ph
if(ox != null) oxygen_amt = ox
if(co != null) carbon_amt = co
..()
/obj/effect/spawner/newbomb/New(newloc)
..(newloc)
var/obj/item/device/transfer_valve/V = new(src.loc)
var/obj/item/weapon/tank/phoron/PT = new(V)
var/obj/item/weapon/tank/oxygen/OT = new(V)
@@ -137,28 +171,15 @@
OT.master = V
PT.air_contents.temperature = PHORON_FLASHPOINT
PT.air_contents.adjust_multi("phoron", 12, "carbon_dioxide", 8)
PT.air_contents.gas["phoron"] = phoron_amt
PT.air_contents.gas["carbon_dioxide"] = carbon_amt
PT.air_contents.update_values()
OT.air_contents.temperature = PHORON_FLASHPOINT
OT.air_contents.adjust_gas("oxygen", 20)
OT.air_contents.gas["oxygen"] = oxygen_amt
OT.air_contents.update_values()
var/obj/item/device/assembly/S
switch (src.btype)
// radio
if (0)
S = new/obj/item/device/assembly/signaler(V)
// proximity
if (1)
S = new/obj/item/device/assembly/prox_sensor(V)
// timer
if (2)
S = new/obj/item/device/assembly/timer(V)
var/obj/item/device/assembly/S = new assembly_type(V)
V.attached_device = S
+6
View File
@@ -151,6 +151,9 @@
if(temp && !temp.is_usable())
user << "<span class='notice'>You try to move your [temp.name], but cannot!"
return
if(!temp)
user << "<span class='notice'>You try to use your hand, but realize it is no longer attached!"
return
src.pickup(user)
if (istype(src.loc, /obj/item/weapon/storage))
var/obj/item/weapon/storage/S = src.loc
@@ -242,6 +245,9 @@
// for items that can be placed in multiple slots
// note this isn't called during the initial dressing of a player
/obj/item/proc/equipped(var/mob/user, var/slot)
layer = 20
if(user.client) user.client.screen |= src
if(user.pulling == src) user.stop_pulling()
return
//Defines which slots correspond to which slot flags
+4 -3
View File
@@ -721,7 +721,8 @@ var/global/list/obj/item/device/pda/PDAs = list()
if("Message")
var/obj/item/device/pda/P = locate(href_list["target"])
src.create_message(U, P, !href_list["notap"])
var/tap = istype(U, /mob/living/carbon)
src.create_message(U, P, tap)
if(mode == 2)
if(href_list["target"] in conversations) // Need to make sure the message went through, if not welp.
active_conversation = href_list["target"]
@@ -1040,7 +1041,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
new_message(sending_device, sending_device.owner, sending_device.ownjob, message)
/obj/item/device/pda/proc/new_message(var/sending_unit, var/sender, var/sender_job, var/message)
var/reception_message = "\icon[src] <b>Message from [sender] ([sender_job]), </b>\"[message]\" (<a href='byond://?src=\ref[src];choice=Message;notap=[istype(loc, /mob/living/silicon)];skiprefresh=1;target=\ref[sending_unit]'>Reply</a>)"
var/reception_message = "\icon[src] <b>Message from [sender] ([sender_job]), </b>\"[message]\" (<a href='byond://?src=\ref[src];choice=Message;skiprefresh=1;target=\ref[sending_unit]'>Reply</a>)"
new_info(message_silent, ttone, reception_message)
log_pda("[usr] (PDA: [sending_unit]) sent \"[message]\" to [name]")
@@ -1052,7 +1053,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
if(ismob(sending_unit.loc) && isAI(loc))
track = "(<a href='byond://?src=\ref[loc];track=\ref[sending_unit.loc];trackname=[html_encode(sender)]'>Follow</a>)"
var/reception_message = "\icon[src] <b>Message from [sender] ([sender_job]), </b>\"[message]\" (<a href='byond://?src=\ref[src];choice=Message;notap=1;skiprefresh=1;target=\ref[sending_unit]'>Reply</a>) [track]"
var/reception_message = "\icon[src] <b>Message from [sender] ([sender_job]), </b>\"[message]\" (<a href='byond://?src=\ref[src];choice=Message;skiprefresh=1;target=\ref[sending_unit]'>Reply</a>) [track]"
new_info(message_silent, newstone, reception_message)
log_pda("[usr] (PDA: [sending_unit]) sent \"[message]\" to [name]")
@@ -18,9 +18,11 @@
/obj/item/device/chameleon/dropped()
disrupt()
..()
/obj/item/device/chameleon/equipped()
disrupt()
..()
/obj/item/device/chameleon/attack_self()
toggle()
+18
View File
@@ -68,6 +68,24 @@
if(safety <= 0)
M.Weaken(10)
flick("e_flash", M.flash)
//Vaurca damage 15/01/16
var/mob/living/carbon/human/H = M
if(H.species.flags & IS_BUG)
var/obj/item/organ/eyes/E = H.internal_organs_by_name["eyes"]
if(!E)
return
usr << "\red Your eyes burn with the intense light of the flash!."
E.damage += rand(10, 11)
if(E.damage > 12)
M.eye_blurry += rand(3,6)
if (E.damage >= E.min_broken_damage)
M.sdisabilities |= BLIND
else if (E.damage >= E.min_bruised_damage)
M.eye_blind = 5
M.eye_blurry = 5
M.disabilities |= NEARSIGHTED
spawn(100)
M.disabilities &= ~NEARSIGHTED
if(ishuman(M) && ishuman(user) && M.stat!=DEAD)
if(user.mind && user.mind in revs.current_antagonists)
@@ -0,0 +1,323 @@
#define STATUS_INACTIVE 0
#define STATUS_ACTIVE 1
#define STATUS_BROKEN 2
#define LAYER_ATTACHED 3.2
#define LAYER_NORMAL 3
/obj/item/device/magnetic_lock
name = "magnetic door lock"
desc = "A large, ID locked device used for completely locking down airlocks."
icon = 'icons/obj/magnetic_locks/centcom.dmi'
icon_state = "inactive"
w_class = 3
req_access = list(103)
health = 90
var/department = "CENTCOM"
var/status = 0
var/constructionstate = 0
var/drainamount = 20
var/obj/machinery/door/airlock/target = null
var/obj/item/weapon/cell/powercell
/obj/item/device/magnetic_lock/security
icon = 'icons/obj/magnetic_locks/security.dmi'
department = "Security"
req_access = list(1)
/obj/item/device/magnetic_lock/engineering
icon = 'icons/obj/magnetic_locks/engineering.dmi'
department = "Engineering"
req_access = null
req_one_access = list(11, 24)
/obj/item/device/magnetic_lock/New()
..()
powercell = new /obj/item/weapon/cell/high()
/obj/item/device/magnetic_lock/examine()
..()
if (status == STATUS_BROKEN)
usr << "<span class='danger'>It looks broken!</span>"
else
if (powercell)
var/power = round(powercell.charge / powercell.maxcharge * 100)
usr << "\blue The powercell is at [power]% charge."
else
usr << "\red It has no powercell to power it!"
/obj/item/device/magnetic_lock/attack_hand(var/mob/user)
if (status == STATUS_ACTIVE)
ui_interact(user)
else
..()
/obj/item/device/magnetic_lock/bullet_act(var/obj/item/projectile/Proj)
takedamage(Proj.damage)
..()
/obj/item/device/magnetic_lock/attackby(var/obj/item/I, var/mob/user)
if (status == STATUS_BROKEN)
user << "<span class='danger'>[src] is broken beyond repair!</span>"
return
if (istype(I, /obj/item/weapon) && user.a_intent == "hurt")
if (I.force >= 8)
user.visible_message("<span class='danger'>[user] bashes [src] with [I]!</span>", "<span class='danger'>You strike [src] with [I], damaging it!</span>")
takedamage(I.force)
return
else
user.visible_message("<span class='notice'>[user] hits [src] with [I] to no visible effect.</span>", "<span class='notice'>You hit [src] with [I], but it appears to have no effect.</span>")
return
switch (constructionstate)
if (0)
if (istype(I, /obj/item/weapon/card/emag))
var/obj/item/weapon/card/emag/emagcard = I
emagcard.uses--
visible_message("<span class='danger'>[src] sparks and falls off the door!</span>", "<span class='danger'>You emag [src], frying its circuitry[status == STATUS_ACTIVE ? " and making it drop onto the floor" : ""]!</span>")
setstatus(STATUS_BROKEN)
return
if (status == STATUS_ACTIVE && istype(I, /obj/item/weapon/card/id))
if (check_access(I) && !constructionstate)
user << "<span class='notice'>You swipe your [I] through [src], making it drop onto the floor with a thud.</span>"
setstatus(STATUS_INACTIVE)
return
else if (constructionstate)
user << "<span class='danger'>You cannot swipe your [I] through [src] with it partially dismantled!</span>"
return
else
user << "<span class='danger'>A red light flashes on [src] as you swipe your [I] through it.</span>"
flick("deny",src)
return
if (istype(I, /obj/item/weapon/screwdriver))
user << "<span class='notice'>You unfasten and remove the plastic cover from [src], revealing a thick metal shell.</span>"
playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1)
setconstructionstate(1)
return
if (1)
if (istype(I, /obj/item/weapon/screwdriver))
user << "<span class='notice'>You put the metal cover of back onto [src], and screw it tight.</span>"
playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1)
setconstructionstate(0)
return
if (istype(I, /obj/item/weapon/cell))
user.drop_item()
I.loc = src
powercell = I
return
if (istype(I, /obj/item/weapon/crowbar))
user << "<span class='notice'>You remove \the [powercell] from \the [src].</span>"
powercell.loc = loc
powercell = null
return
if (istype(I, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = I
if (WT.remove_fuel(1, user))
user.visible_message("<span class='notice'>[user] starts welding through the metal shell of [src].</span>", "<span class='notice'>You start welding through the metal covering of [src]</span>")
playsound(loc, 'sound/items/Welder.ogg', 50, 1)
if (do_after(user, 25))
user << "<span class='notice'>You are able to weld through the metal shell of [src].</span>"
setconstructionstate(2)
return
if (2)
if (istype(I, /obj/item/weapon/crowbar))
user << "<span class='notice'>You pry off the metal covering from [src].</span>"
playsound(loc, 'sound/items/Crowbar.ogg', 50, 1)
setconstructionstate(3)
return
if (3)
if (istype(I, /obj/item/weapon/wirecutters))
user << "<span class='notice'>You cut the wires connecting the [src]'s magnets to their powersupply, [target ? "making the device fall off [target] and rendering it unusable." : "rendering the device unusable."]</span>"
playsound(loc, 'sound/items/Wirecutter.ogg', 50, 1)
setconstructionstate(4)
return
/obj/item/device/magnetic_lock/process()
if (powercell && powercell.charge > drainamount)
powercell.charge -= drainamount
else
if (powercell)
powercell.charge = 0
visible_message("<span class='danger'>[src] beeps loudly and falls off \the [target]; its powercell having run out of power.</span>")
setstatus(STATUS_INACTIVE)
/obj/item/device/magnetic_lock/proc/attachto(var/obj/machinery/door/airlock/newtarget, var/mob/user as mob)
if (status == STATUS_BROKEN)
user << "<span class='danger'>[src] is damaged beyond repair! It cannot be used!</span>"
return
if (!newtarget.density || newtarget.operating)
user << "<span class='danger'>[newtarget] must be closed before you can attach [src] to it!</span>"
return
if (newtarget.p_open)
user << "<span class='danger'>You must close [newtarget]'s maintenance panel before attaching [src] to it!</span>"
return
user.visible_message("<span class='notice'>[user] starts mounting [src] onto [newtarget].</span>", "<span class='notice'>You begin mounting [src] onto [newtarget].</span>")
if (do_after(user, 35, 1))
if (status == STATUS_BROKEN)
user << "<span class='danger'>[src] is damaged beyond repair! It cannot be used!</span>"
return
if (!newtarget.density)
user << "<span class='danger'>[newtarget] must be closed before you can attach [src] to it!</span>"
return
if (newtarget.p_open)
user << "<span class='danger'>You must close [newtarget]'s maintenance panel before attaching [src] to it!</span>"
return
user.visible_message("<span class='notice'>[user] attached [src] onto [newtarget] and flicks it on. The magnetic lock now seals [newtarget].</span>", "<span class='notice'>You attached [src] onto [newtarget] and switched on the magnetic lock.</span>")
user.drop_item()
setstatus(STATUS_ACTIVE, newtarget)
return
/obj/item/device/magnetic_lock/proc/setstatus(var/newstatus, var/obj/machinery/door/airlock/newtarget as obj)
switch (newstatus)
if (STATUS_INACTIVE)
if (status != STATUS_ACTIVE)
return
if (!target)
return
detach()
icon_state = "inactive"
status = newstatus
if (STATUS_ACTIVE)
if (status != STATUS_INACTIVE)
return
if (!newtarget)
return
attach(newtarget)
icon_state = "active"
status = newstatus
if (STATUS_BROKEN)
spark()
if (target)
var/playflick = 1
if (constructionstate)
playflick = 0
detach(playflick)
icon_state = "broken"
status = newstatus
/obj/item/device/magnetic_lock/proc/setconstructionstate(var/newstate)
constructionstate = newstate
if (newstate == 0)
if (status == STATUS_ACTIVE)
icon_state = "active"
else
icon_state = "inactive"
else if (newstate == 2)
flick("deconstruct_2_anim", src)
else if (newstate == 4)
setstatus(STATUS_BROKEN)
else
icon_state = "deconstruct_[constructionstate]"
/obj/item/device/magnetic_lock/proc/detach(var/playflick = 1)
if (target)
if (playflick)
spawn(-15) flick("release", src)
adjustsprite(null)
layer = LAYER_NORMAL
target.bracer = null
processing_objects.Remove(src)
anchored = 0
/obj/item/device/magnetic_lock/proc/attach(var/obj/machinery/door/airlock/newtarget as obj)
adjustsprite(newtarget)
layer = LAYER_ATTACHED
flick("deploy", src)
newtarget.bracer = src
target = newtarget
processing_objects.Add(src)
anchored = 1
/obj/item/device/magnetic_lock/proc/adjustsprite(var/obj/target as obj)
if (target)
switch (get_dir(src, target))
if (NORTH)
pixel_x = 0
pixel_y = 32
if (NORTHEAST)
pixel_x = 32
pixel_y = 32
if (EAST)
pixel_x = 32
pixel_y = 0
if (SOUTHEAST)
pixel_x = 32
pixel_y = -32
if (SOUTH)
pixel_x = 0
pixel_y = -32
if (SOUTHWEST)
pixel_x = -32
pixel_y = -32
if (WEST)
pixel_x = -32
pixel_y = 0
if (NORTHWEST)
pixel_x = -32
pixel_y = 32
else
pixel_x = 0
pixel_y = 0
/obj/item/device/magnetic_lock/proc/takedamage(var/damage)
health -= damage
if (damage >= 40 && prob(50))
health = 0
if (health <= 0)
visible_message("<span class='danger'>[src] sparks[target ? " and falls off of \the [target]!" : "!"] It is now completely unusable!</span>")
setstatus(STATUS_BROKEN)
return
if (prob(50))
spark()
/obj/item/device/magnetic_lock/proc/spark()
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
if (target)
s.set_up(5, 1, target)
else
s.set_up(5, 1, src)
s.start()
spawn(5)
del(s)
#undef STATUS_INACTIVE
#undef STATUS_ACTIVE
#undef STATUS_BROKEN
#undef LAYER_ATTACHED
#undef LAYER_NORMAL
+1 -1
View File
@@ -320,7 +320,7 @@
qdel(src)
/obj/item/device/paicard/see_emote(mob/living/M, text)
if(pai && pai.client)
if(pai && pai.client && !pai.canmove)
var/rendered = "<span class='message'>[text]</span>"
pai.show_message(rendered, 2)
..()
@@ -99,17 +99,9 @@
if (src.loc != usr)
return 0
if(tank_one && href_list["tankone"])
split_gases()
valve_open = 0
tank_one.loc = get_turf(src)
tank_one = null
update_icon()
remove_tank(tank_one)
else if(tank_two && href_list["tanktwo"])
split_gases()
valve_open = 0
tank_two.loc = get_turf(src)
tank_two = null
update_icon()
remove_tank(tank_two)
else if(href_list["open"])
toggle_valve()
else if(attached_device)
@@ -148,20 +140,43 @@
if(attached_device)
overlays += "device"
/obj/item/device/transfer_valve/proc/remove_tank(obj/item/weapon/tank/T)
if(tank_one == T)
split_gases()
tank_one = null
else if(tank_two == T)
split_gases()
tank_two = null
else
return
T.loc = get_turf(src)
update_icon()
/obj/item/device/transfer_valve/proc/merge_gases()
if(valve_open)
return
tank_two.air_contents.volume += tank_one.air_contents.volume
var/datum/gas_mixture/temp
temp = tank_one.air_contents.remove_ratio(1)
tank_two.air_contents.merge(temp)
valve_open = 1
/obj/item/device/transfer_valve/proc/split_gases()
if (!valve_open || !tank_one || !tank_two)
if(!valve_open)
return
valve_open = 0
if(deleted(tank_one) || deleted(tank_two))
return
var/ratio1 = tank_one.air_contents.volume/tank_two.air_contents.volume
var/datum/gas_mixture/temp
temp = tank_two.air_contents.remove_ratio(ratio1)
tank_one.air_contents.merge(temp)
tank_two.air_contents.volume -= tank_one.air_contents.volume
/*
Exadv1: I know this isn't how it's going to work, but this was just to check
@@ -169,8 +184,7 @@
*/
/obj/item/device/transfer_valve/proc/toggle_valve()
if(valve_open==0 && (tank_one && tank_two))
valve_open = 1
if(!valve_open && (tank_one && tank_two))
var/turf/bombturf = get_turf(src)
var/area/A = get_area(bombturf)
@@ -196,16 +210,11 @@
message_admins(log_str, 0, 1)
log_game(log_str)
merge_gases()
spawn(20) // In case one tank bursts
for (var/i=0,i<5,i++)
src.update_icon()
sleep(10)
src.update_icon()
else if(valve_open==1 && (tank_one && tank_two))
split_gases()
valve_open = 0
src.update_icon()
src.update_icon()
// this doesn't do anything but the timer etc. expects it to be here
// eventually maybe have it update icon to show state (timer, prox etc.) like old bombs
@@ -71,6 +71,10 @@
icon_state = "meson"
icon = 'icons/obj/clothing/glasses.dmi'
/obj/item/borg/sight/material
name = "\proper material scanner vision"
sight_mode = BORGMATERIAL
/obj/item/borg/sight/hud
name = "hud"
var/obj/item/clothing/glasses/hud/hud = null
+17
View File
@@ -0,0 +1,17 @@
/obj/item/shoe_cover
name = "strange fabric"
desc = "A fabirc that allows for silent walking."
icon = 'icons/obj/items.dmi'
icon_state = "sheet-cloth"
/obj/item/shoe_cover/afterattack(var/obj/A as obj, mob/user as mob, proximity)
if(!proximity)
return
if (istype(A, /obj/item/clothing/shoes) && get_dist(src,A) <= 1)
var/obj/item/clothing/shoes/S = A
user << "You attahed the [src] to [S] making movement silent"
S.silent = 1
S.desc += " They appear to have some type of fabric soles"
user.drop_from_inventory(src)
del(src)
+7 -6
View File
@@ -137,6 +137,7 @@
if (istype(O, /obj/item/stack))
var/obj/item/stack/S = O
S.amount = produced
S.add_to_stacks(user)
if (istype(O, /obj/item/weapon/storage)) //BubbleWrap - so newly formed boxes are empty
for (var/obj/item/I in O)
@@ -191,7 +192,7 @@
else
if(get_amount() < used)
return 0
for(var/i = 1 to uses_charge)
for(var/i = 1 to charge_costs.len)
var/datum/matter_synth/S = synths[i]
S.use_charge(charge_costs[i] * used) // Doesn't need to be deleted
return 1
@@ -264,8 +265,8 @@
return 0
var/datum/matter_synth/S = synths[1]
. = round(S.get_charge() / charge_costs[1])
if(uses_charge > 1)
for(var/i = 2 to uses_charge)
if(charge_costs.len > 1)
for(var/i = 2 to charge_costs.len)
S = synths[i]
. = min(., round(S.get_charge() / charge_costs[i]))
return
@@ -284,13 +285,13 @@
return
return max_amount
/obj/item/stack/proc/add_to_stacks(mob/usr as mob)
for (var/obj/item/stack/item in usr.loc)
/obj/item/stack/proc/add_to_stacks(mob/user as mob)
for (var/obj/item/stack/item in user.loc)
if (item==src)
continue
var/transfer = src.transfer_to(item)
if (transfer)
usr << "You add a new [item.singular_name] to the stack. It now contains [item.amount] [item.singular_name]\s."
user << "<span class='notice'>You add a new [item.singular_name] to the stack. It now contains [item.amount] [item.singular_name]\s.</span>"
if(!amount)
break
@@ -1,27 +1,135 @@
#ifndef T_BOARD
#error T_BOARD macro is not defined but we need it!
#error T_BOARD macro is not defined but we need it!
#endif
/obj/item/weapon/circuitboard/air_management
name = T_BOARD("atmosphere monitoring console")
build_path = /obj/machinery/computer/general_air_control
var/console_name
var/frequency = 1439
var/list/sensors = list()
var/list/sensor_information = list()
/obj/item/weapon/circuitboard/air_management/tank_control
name = T_BOARD("tank control")
build_path = /obj/machinery/computer/general_air_control/large_tank_control
frequency = 1441
var/input_tag
var/output_tag
var/list/input_info = list()
var/list/output_info = list()
var/input_flow_setting = 200
var/pressure_setting = ONE_ATMOSPHERE * 45
/obj/item/weapon/circuitboard/air_management/supermatter_core
name = T_BOARD("core control")
build_path = /obj/machinery/computer/general_air_control/supermatter_core
frequency = 1438
var/input_tag
var/output_tag
var/list/input_info = list()
var/list/output_info = list()
var/input_flow_setting = 700
var/pressure_setting = 100
/obj/item/weapon/circuitboard/air_management/injector_control
name = T_BOARD("injector control")
build_path = /obj/machinery/computer/general_air_control/fuel_injection
var/device_tag
var/list/device_info
var/automation = 0
var/cutoff_temperature = 2000
var/on_temperature = 1200
/************
* Construct *
************/
/obj/item/weapon/circuitboard/air_management/construct(var/obj/machinery/computer/general_air_control/C)
if (..(C))
C.frequency = frequency
if(console_name)
C.name = console_name
C.set_frequency(frequency)
C.sensors = sensors.Copy()
C.sensor_information = sensor_information.Copy()
return 1
/obj/item/weapon/circuitboard/air_management/tank_control/construct(var/obj/machinery/computer/general_air_control/large_tank_control/LTC)
if(..(LTC))
LTC.input_tag = input_tag
LTC.output_tag = output_tag
LTC.input_info = input_info.Copy()
LTC.output_info = output_info.Copy()
LTC.input_flow_setting = input_flow_setting
LTC.pressure_setting = pressure_setting
return 1
/obj/item/weapon/circuitboard/air_management/supermatter_core/construct(var/obj/machinery/computer/general_air_control/supermatter_core/SC)
if(..(SC))
SC.input_tag = input_tag
SC.output_tag = output_tag
SC.input_info = input_info.Copy()
SC.output_info = output_info.Copy()
SC.input_flow_setting = input_flow_setting
SC.pressure_setting = input_flow_setting
return 1
/obj/item/weapon/circuitboard/air_management/injector_control/construct(var/obj/machinery/computer/general_air_control/fuel_injection/FI)
if(..(FI))
FI.device_tag = device_tag
FI.device_info = device_info.Copy()
FI.automation = automation
FI.cutoff_temperature = cutoff_temperature
FI.on_temperature = on_temperature
return 1
/**************
* Deconstruct *
**************/
/obj/item/weapon/circuitboard/air_management/deconstruct(var/obj/machinery/computer/general_air_control/C)
if (..(C))
console_name = C.name
frequency = C.frequency
sensors = C.sensors.Copy()
sensor_information = C.sensor_information.Copy()
return 1
/obj/item/weapon/circuitboard/air_management/tank_control/deconstruct(var/obj/machinery/computer/general_air_control/large_tank_control/LTC)
if(..(LTC))
input_tag = LTC.input_tag
output_tag = LTC.output_tag
input_info = LTC.input_info.Copy()
output_info = LTC.output_info.Copy()
input_flow_setting = LTC.input_flow_setting
pressure_setting = LTC.pressure_setting
return 1
/obj/item/weapon/circuitboard/air_management/supermatter_core/deconstruct(var/obj/machinery/computer/general_air_control/supermatter_core/SC)
if(..(SC))
input_tag = SC.input_tag
output_tag = SC.output_tag
input_info = SC.input_info.Copy()
output_info = SC.output_info.Copy()
input_flow_setting = SC.input_flow_setting
pressure_setting = SC.input_flow_setting
return 1
/obj/item/weapon/circuitboard/air_management/injector_control/deconstruct(var/obj/machinery/computer/general_air_control/fuel_injection/FI)
if(..(FI))
device_tag = FI.device_tag
device_info = FI.device_info.Copy()
automation = FI.automation
cutoff_temperature = FI.cutoff_temperature
on_temperature = FI.on_temperature
return 1
@@ -1,5 +1,5 @@
#ifndef T_BOARD
#error T_BOARD macro is not defined but we need it!
#error T_BOARD macro is not defined but we need it!
#endif
/obj/item/weapon/circuitboard/message_monitor
@@ -60,11 +60,11 @@
/obj/item/weapon/circuitboard/stationalert_engineering
name = T_BOARD("station alert console (engineering)")
build_path = /obj/machinery/computer/station_alert
/obj/item/weapon/circuitboard/stationalert_security
name = T_BOARD("station alert console (security)")
build_path = /obj/machinery/computer/station_alert
/obj/item/weapon/circuitboard/stationalert_all
name = T_BOARD("station alert console (all)")
build_path = /obj/machinery/computer/station_alert/all
@@ -196,3 +196,8 @@
name = T_BOARD("RCON remote control console")
build_path = /obj/machinery/computer/rcon
origin_tech = "programming=4;engineering=3;powerstorage=5"
/obj/item/weapon/circuitboard/telesci_console
name = T_BOARD("Telescience Console")
build_path = /obj/machinery/computer/telescience
origin_tech = "programming=3;bluespace=2"
@@ -0,0 +1,31 @@
#ifndef T_BOARD
#error T_BOARD macro is not defined but we need it!
#endif
/obj/item/weapon/circuitboard/holodeckcontrol
name = T_BOARD("holodeck control console")
build_path = /obj/machinery/computer/HolodeckControl
origin_tech = "programming=2;bluespace=2"
var/last_to_emag
var/linkedholodeck_area
var/list/supported_programs
var/list/restricted_programs
/obj/item/weapon/circuitboard/holodeckcontrol/construct(var/obj/machinery/computer/HolodeckControl/HC)
if (..(HC))
HC.supported_programs = supported_programs.Copy()
HC.restricted_programs = restricted_programs.Copy()
if(linkedholodeck_area)
HC.linkedholodeck = locate(linkedholodeck_area)
if(last_to_emag)
HC.last_to_emag = last_to_emag
HC.emagged = 1
HC.safety_disabled = 1
/obj/item/weapon/circuitboard/holodeckcontrol/deconstruct(var/obj/machinery/computer/HolodeckControl/HC)
if (..(HC))
linkedholodeck_area = HC.linkedholodeck_area
supported_programs = HC.supported_programs.Copy()
restricted_programs = HC.restricted_programs.Copy()
last_to_emag = HC.last_to_emag
HC.emergencyShutdown()
@@ -1,5 +1,5 @@
#ifndef T_BOARD
#error T_BOARD macro is not defined but we need it!
#error T_BOARD macro is not defined but we need it!
#endif
obj/item/weapon/circuitboard/rdserver
@@ -62,3 +62,14 @@ obj/item/weapon/circuitboard/rdserver
"/obj/item/weapon/stock_parts/manipulator" = 1,
"/obj/item/weapon/stock_parts/micro_laser" = 1,
"/obj/item/weapon/stock_parts/console_screen" = 1)
/obj/item/weapon/circuitboard/telesci_pad
name = T_BOARD("telepad")
build_path = "/obj/machinery/telepad"
board_type = "machine"
origin_tech = "programming=4;engineering=3;materials=3;bluespace=4"
req_components = list(
"/obj/item/bluespace_crystal" = 2,
"/obj/item/weapon/stock_parts/capacitor" = 1,
"/obj/item/stack/cable_coil" = 1,
"/obj/item/weapon/stock_parts/console_screen" = 1)
+13 -2
View File
@@ -15,7 +15,15 @@
/*
* Soap
*/
/obj/item/weapon/soap/Crossed(AM as mob|obj) //EXACTLY the same as bananapeel for now, so it makes sense to put it in the same dm -- Urist
/obj/item/weapon/soap/New()
..()
create_reagents(5)
wet()
/obj/item/weapon/soap/proc/wet()
reagents.add_reagent("cleaner", 5)
/obj/item/weapon/soap/Crossed(AM as mob|obj)
if (istype(AM, /mob/living))
var/mob/living/M = AM
M.slip("the [src.name]",3)
@@ -32,7 +40,10 @@
else if(istype(target,/turf))
user << "<span class='notice'>You scrub \the [target.name] clean.</span>"
var/turf/T = target
T.clean(src)
T.clean(src, user)
else if(istype(target,/obj/structure/sink))
user << "<span class='notice'>You wet \the [src] in the sink.</span>"
wet()
else
user << "<span class='notice'>You clean \the [target.name].</span>"
target.clean_blood()
@@ -6,6 +6,7 @@
w_class = 2.0
force = 2.0
det_time = null
unacidable = 1
var/stage = 0
var/state = 0
var/path = 0
@@ -163,7 +164,7 @@
playsound(src.loc, 'sound/effects/bamf.ogg', 50, 1)
for(var/obj/item/weapon/reagent_containers/glass/G in beakers)
G.reagents.trans_to(src, G.reagents.total_volume)
G.reagents.trans_to_obj(src, G.reagents.total_volume)
if(src.reagents.total_volume) //The possible reactions didnt use up all reagents.
var/datum/effect/effect/system/steam_spread/steam = new /datum/effect/effect/system/steam_spread()
@@ -53,6 +53,24 @@
flick("e_flash", M.flash)
M.Stun(2)
M.Weaken(10)
//Vaurca damage 15/01/16
var/mob/living/carbon/human/H = M
if(H.species.flags & IS_BUG)
var/obj/item/organ/eyes/E = H.internal_organs_by_name["eyes"]
if(!E)
return
usr << "\red Your eyes burn with the intense light of the flash!."
E.damage += rand(10, 11)
if(E.damage > 12)
M.eye_blurry += rand(3,6)
if (E.damage >= E.min_broken_damage)
M.sdisabilities |= BLIND
else if (E.damage >= E.min_bruised_damage)
M.eye_blind = 5
M.eye_blurry = 5
M.disabilities |= NEARSIGHTED
spawn(100)
M.disabilities &= ~NEARSIGHTED
@@ -6,6 +6,7 @@
name = "implant"
icon = 'icons/obj/device.dmi'
icon_state = "implant"
w_class = 1
var/implanted = null
var/mob/imp_in = null
var/obj/item/organ/external/part = null
@@ -44,7 +44,8 @@
overlays.Cut()
return
else
..()
user << "<span class='warning'>You don't have anything on \the [src].</span>" //if we have help intent and no food scooped up DON'T STAB OURSELVES WITH THE FORK GODDAMNIT
return
/obj/item/weapon/material/kitchen/utensil/fork
name = "fork"
@@ -77,14 +78,14 @@
/obj/item/weapon/material/kitchen/utensil/knife/attack(target as mob, mob/living/user as mob)
if ((CLUMSY in user.mutations) && prob(50))
user << "\red You accidentally cut yourself with the [src]."
user << "<span class='warning'>You accidentally cut yourself with \the [src].</span>"
user.take_organ_damage(20)
return
return ..()
/obj/item/weapon/material/kitchen/utensil/knife/attack(target as mob, mob/living/user as mob)
if ((CLUMSY in user.mutations) && prob(50))
user << "\red You somehow managed to cut yourself with the [src]."
user << "<span class='warning'>You somehow managed to cut yourself with \the [src].</span>"
user.take_organ_damage(20)
return
return ..()
@@ -107,7 +108,7 @@
/obj/item/weapon/material/kitchen/rollingpin/attack(mob/living/M as mob, mob/living/user as mob)
if ((CLUMSY in user.mutations) && prob(50))
user << "\red The [src] slips out of your hand and hits your head."
user << "<span class='warning'>\The [src] slips out of your hand and hits your head.</span>"
user.take_organ_damage(10)
user.Paralyse(2)
return
+2 -14
View File
@@ -14,19 +14,7 @@
/obj/item/weapon/mop/New()
create_reagents(5)
//expects an atom containing the reagents used to clean the turf
/turf/proc/clean(atom/source)
if(source.reagents.has_reagent("water", 1))
clean_blood()
if(istype(src, /turf/simulated))
var/turf/simulated/T = src
T.dirt = 0
for(var/obj/effect/O in src)
if(istype(O,/obj/effect/rune) || istype(O,/obj/effect/decal/cleanable) || istype(O,/obj/effect/overlay))
qdel(O)
source.reagents.trans_to_turf(src, 1, 10) //10 is the multiplier for the reaction effect. probably needed to wet the floor properly.
create_reagents(30)
/obj/item/weapon/mop/afterattack(atom/A, mob/user, proximity)
if(!proximity) return
@@ -40,7 +28,7 @@
if(do_after(user, 40))
var/turf/T = get_turf(A)
if(T)
T.clean(src)
T.clean(src, user)
user << "<span class='notice'>You have finished mopping!</span>"
@@ -598,32 +598,33 @@
icon_state = "light"
desc = "This box is shaped on the inside so that only light tubes and bulbs fit."
item_state = "syringe_kit"
storage_slots=21
can_hold = list(/obj/item/weapon/light/tube, /obj/item/weapon/light/bulb)
max_storage_space = 42 //holds 21 items of w_class 2
use_to_pickup = 1 // for picking up broken bulbs, not that most people will try
/obj/item/weapon/storage/box/lights/New()
..()
make_exact_fit()
/obj/item/weapon/storage/box/lights/bulbs/New()
..()
for(var/i = 0; i < 21; i++)
new /obj/item/weapon/light/bulb(src)
..()
/obj/item/weapon/storage/box/lights/tubes
name = "box of replacement tubes"
icon_state = "lighttube"
/obj/item/weapon/storage/box/lights/tubes/New()
..()
for(var/i = 0; i < 21; i++)
new /obj/item/weapon/light/tube(src)
..()
/obj/item/weapon/storage/box/lights/mixed
name = "box of replacement lights"
icon_state = "lightmixed"
/obj/item/weapon/storage/box/lights/mixed/New()
..()
for(var/i = 0; i < 14; i++)
new /obj/item/weapon/light/tube(src)
for(var/i = 0; i < 7; i++)
new /obj/item/weapon/light/bulb(src)
..()
@@ -130,8 +130,7 @@
/obj/item/weapon/storage/firstaid/surgery
name = "surgery kit"
desc = "Contains tools for surgery."
storage_slots = 10
desc = "Contains tools for surgery. Has precise foam fitting for safe transport."
/obj/item/weapon/storage/firstaid/surgery/New()
..()
@@ -146,7 +145,8 @@
new /obj/item/weapon/bonegel(src)
new /obj/item/weapon/FixOVein(src)
new /obj/item/stack/medical/advanced/bruise_pack(src)
return
make_exact_fit()
/*
* Pill Bottles
@@ -86,3 +86,12 @@
New()
..()
new /obj/item/weapon/grenade/flashbang/clusterbang(src)
/obj/item/weapon/storage/lockbox/lawgiver
name = "Weapons lockbox"
desc = "A high security weapons lockbox"
req_access = list(access_armory)
New()
..()
new /obj/item/weapon/gun/energy/lawgiver(src)
@@ -51,10 +51,10 @@
//there's got to be a better way of doing this.
if (!(src.loc == usr) || (src.loc && src.loc.loc == usr))
return
if (( usr.restrained() ) || ( usr.stat ))
return
if ((src.loc == usr) && !usr.unEquip(src))
return
@@ -232,12 +232,16 @@
usr << "<span class='notice'>[src] is full, make some space.</span>"
return 0 //Storage item is full
if(can_hold.len && !is_type_in_list(W, can_hold))
if(!stop_messages)
if (istype(W, /obj/item/weapon/hand_labeler))
return 0
usr << "<span class='notice'>[src] cannot hold [W].</span>"
return 0
if(can_hold.len)
if(!is_type_in_list(W, can_hold))
if(!stop_messages && ! istype(W, /obj/item/weapon/hand_labeler))
usr << "<span class='notice'>[src] cannot hold \the [W].</span>"
return 0
var/max_instances = can_hold[W.type]
if(max_instances && instances_of_type_in_list(W, contents) >= max_instances)
if(!stop_messages && !istype(W, /obj/item/weapon/hand_labeler))
usr << "<span class='notice'>[src] has no more space specifically for \the [W].</span>"
return 0
if(cant_hold.len && is_type_in_list(W, cant_hold))
if(!stop_messages)
@@ -449,6 +453,17 @@
var/obj/O = A
O.hear_talk(M, text, verb, speaking)
/obj/item/weapon/storage/proc/make_exact_fit()
storage_slots = contents.len
can_hold.Cut()
max_w_class = 0
max_storage_space = 0
for(var/obj/item/I in src)
can_hold[I.type]++
max_w_class = max(I.w_class, max_w_class)
max_storage_space += I.get_storage_cost()
//Returns the storage depth of an atom. This is the number of storage items the atom is contained in before reaching toplevel (the area).
//Returns -1 if the atom was not found on container.
/atom/proc/storage_depth(atom/container)
@@ -1,71 +0,0 @@
/obj/item/robot_parts/attack(mob/living/carbon/human/M as mob, mob/living/carbon/user as mob)
var/limbloc = null
if(!istype(M))
return ..()
if(!((locate(/obj/machinery/optable, M.loc) && M.resting) || (locate(/obj/structure/bed/roller, M.loc) && (M.buckled || M.lying || M.weakened || M.stunned || M.paralysis || M.sleeping || M.stat)) && prob(75) || (locate(/obj/structure/table/, M.loc) && (M.lying || M.weakened || M.stunned || M.paralysis || M.sleeping || M.stat) && prob(66))))
return ..()
if(!istype(M, /mob/living/carbon/human))
return ..()
if((user.zone_sel.selecting == "l_arm") && (istype(src, /obj/item/robot_parts/l_arm)))
limbloc = "l_hand"
else if((user.zone_sel.selecting == "r_arm") && (istype(src, /obj/item/robot_parts/r_arm)))
limbloc = "r_hand"
else if((user.zone_sel.selecting == "r_leg") && (istype(src, /obj/item/robot_parts/r_leg)))
limbloc = "r_foot"
else if((user.zone_sel.selecting == "l_leg") && (istype(src, /obj/item/robot_parts/l_leg)))
limbloc = "l_foot"
else
user << "\red That doesn't fit there!"
return ..()
var/mob/living/carbon/human/H = M
var/datum/organ/external/S = H.organs[user.zone_sel.selecting]
if(S.status & ORGAN_DESTROYED)
if(!(S.status & ORGAN_ATTACHABLE))
user << "\red The wound is not ready for a replacement!"
return 0
if(M != user)
M.visible_message( \
"\red [user] is beginning to attach \the [src] where [H]'s [S.display_name] used to be.", \
"\red [user] begins to attach \the [src] where your [S.display_name] used to be.")
else
M.visible_message( \
"\red [user] begins to attach a robotic limb where \his [S.display_name] used to be with [src].", \
"\red You begin to attach \the [src] where your [S.display_name] used to be.")
if(do_mob(user, H, 100))
if(M != user)
M.visible_message( \
"\red [user] finishes attaching [H]'s new [S.display_name].", \
"\red [user] finishes attaching your new [S.display_name].")
else
M.visible_message( \
"\red [user] finishes attaching \his new [S.display_name].", \
"\red You finish attaching your new [S.display_name].")
if(H == user && prob(25))
user << "\red You mess up!"
S.take_damage(15)
S.status &= ~ORGAN_BROKEN
S.status &= ~ORGAN_SPLINTED
S.status &= ~ORGAN_ATTACHABLE
S.status &= ~ORGAN_DESTROYED
S.status |= ORGAN_ROBOT
var/datum/organ/external/T = H.organs["[limbloc]"]
T.status &= ~ORGAN_BROKEN
T.status &= ~ORGAN_SPLINTED
T.status &= ~ORGAN_ATTACHABLE
T.status &= ~ORGAN_DESTROYED
T.status |= ORGAN_ROBOT
H.update_body()
M.updatehealth()
M.UpdateDamageIcon()
qdel(src)
return 1
return 0
+12 -2
View File
@@ -36,6 +36,10 @@
qdel(air_contents)
processing_objects.Remove(src)
if(istype(loc, /obj/item/device/transfer_valve))
var/obj/item/device/transfer_valve/TTV = loc
TTV.remove_tank(src)
..()
@@ -272,7 +276,10 @@
qdel(src)
else if(pressure > TANK_RUPTURE_PRESSURE)
//world << "\blue[x],[y] tank is rupturing: [pressure] kPa, integrity [integrity]"
#ifdef FIREDBG
log_debug("\blue[x],[y] tank is rupturing: [pressure] kPa, integrity [integrity]")
#endif
if(integrity <= 0)
var/turf/simulated/T = get_turf(src)
if(!T)
@@ -284,7 +291,10 @@
integrity--
else if(pressure > TANK_LEAK_PRESSURE)
//world << "\blue[x],[y] tank is leaking: [pressure] kPa, integrity [integrity]"
#ifdef FIREDBG
log_debug("\blue[x],[y] tank is leaking: [pressure] kPa, integrity [integrity]")
#endif
if(integrity <= 0)
var/turf/simulated/T = get_turf(src)
if(!T)
+21 -4
View File
@@ -237,11 +237,28 @@
playsound(src.loc, 'sound/effects/refill.ogg', 50, 1, -6)
return
else if (istype(O, /obj/structure/reagent_dispensers/fueltank) && get_dist(src,O) <= 1 && src.welding)
message_admins("[key_name_admin(user)] triggered a fueltank explosion with a welding tool.")
log_game("[key_name(user)] triggered a fueltank explosion with a welding tool.")
user << "\red You begin welding on the fueltank and with a moment of lucidity you realize, this might not have been the smartest thing you've ever done."
var/obj/structure/reagent_dispensers/fueltank/tank = O
tank.explode()
if(tank.armed)
user << "You are already heating the [O]"
return
tank.armed = 1
user.visible_message("[user] begins heating the [O].", "You start to heat the [O].")
message_admins("[key_name_admin(user)] is attempting a welder bomb at ([loc.x],[loc.y],[loc.z]) - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[O.x];Y=[O.y];Z=[O.z]'>JMP</a>")
if(do_after(user,100))
if(tank.defuse)
user.visible_message("[user] melts some of the framework on the [O].", "You melt some of the framework.")
tank.defuse = 0
tank.armed = 0
return
message_admins("[key_name_admin(user)] triggered a fueltank explosion.")
log_game("[key_name(user)] triggered a fueltank explosion with a welding tool.")
user << "\red That was stupid of you."
tank.explode()
return
else
tank.armed = 0
user << "You thought better of yourself."
return
return
if (src.welding)
remove_fuel(1)
+18 -6
View File
@@ -47,12 +47,24 @@
user.Paralyse(20)
return
if (M.stat !=2)
if(cult && (M.mind in cult.current_antagonists) && prob(33))
M << "<span class='danger'>The power of [src] clears your mind of the cult's influence!</span>"
user << "<span class='danger'>You wave [src] over [M]'s head and see their eyes become clear, their mind returning to normal.</span>"
cult.remove_antagonist(M.mind)
M.visible_message("<span class='danger'>\The [user] waves \the [src] over \the [M]'s head.</span>")
if (M.stat !=2 && ishuman(M))
var/mob/living/K = M
if(cult && (K.mind in cult.current_antagonists) && prob(33))
if(do_after(user, 15))
K.visible_message("<span class='danger'>\The [user] waves \the [src] over \the [K]'s head, [K] looks captivated by it.</span>", "\red [user] wave's the [src] over your head. <b>You see a foreign light, asking you to follow it. Its presence burns and blinds.</b>")
var/choice = alert(K,"Do you want to give up your goal?","Become cleansed","Resist","Give in")
switch(choice)
if("Resist")
K.visible_message("\red The gaze in [K]'s eyes remains determined.", "\blue You turn away from the light, remaining true to your dark lord. The light burns you due to rejection!")
K.say("*scream")
K.take_overall_damage(5, 15)
if("Give in")
K.visible_message("\blue [K]'s eyes become clearer, the evil gone, but not without leaving scars.")
K.take_overall_damage(15, 30)
cult.remove_antagonist(K.mind)
else
user.visible_message("\red [user]'s concentration is broken!", "\red Your concentration is broken! You and your target need to stay uninterrupted for longer!")
return
else if(prob(10))
user << "<span class='danger'>The rod slips in your hand.</span>"
..()
+1 -1
View File
@@ -79,7 +79,7 @@
return ..()
/obj/structure/proc/can_climb(var/mob/living/user, post_climb_check=0)
if (!can_touch(user) || !climbable || (!post_climb_check && (user in climbers)))
if (!climbable || !can_touch(user) || (!post_climb_check && (user in climbers)))
return 0
if (!user.Adjacent(src))
@@ -172,19 +172,18 @@
if(1)
for(var/atom/movable/A as mob|obj in src)//pulls everything out of the locker and hits it with an explosion
A.forceMove(src.loc)
A.ex_act(severity++)
A.ex_act(severity + 1)
qdel(src)
if(2)
if(prob(50))
for (var/atom/movable/A as mob|obj in src)
A.forceMove(src.loc)
A.ex_act(severity++)
A.ex_act(severity + 1)
qdel(src)
if(3)
if(prob(5))
for(var/atom/movable/A as mob|obj in src)
A.forceMove(src.loc)
A.ex_act(severity++)
qdel(src)
/obj/structure/closet/proc/damage(var/damage)
@@ -66,11 +66,12 @@
src.MouseDrop_T(W:affecting, user) //act like they were dragged onto the closet
user.drop_item()
if (W) W.forceMove(src.loc)
else if(istype(W, /obj/item/weapon/card/id))
else if(W.GetID())
var/obj/item/weapon/card/id/I = W.GetID()
if(src.broken)
user << "<span class='warning'>It appears to be broken.</span>"
return
var/obj/item/weapon/card/id/I = W
if(!I || !I.registered_name) return
if(src.allowed(user) || !src.registered_name || (istype(I) && (src.registered_name == I.registered_name)))
//they can open all lockers, or nobody owns this, or they own this locker
@@ -15,6 +15,7 @@
pressure_resistance = 15
anchored = 1
can_buckle = 1
buckle_dir = SOUTH
buckle_lying = 1
var/material/material
var/material/padding_material
@@ -131,14 +132,18 @@
remove_padding()
else if(istype(W, /obj/item/weapon/grab))
user.visible_message("<span class='notice'>[user] attempts to buckle [W:affecting] into \the [src]!</span>")
var/obj/item/weapon/grab/G = W
var/mob/living/affecting = G.affecting
user.visible_message("<span class='notice'>[user] attempts to buckle [affecting] into \the [src]!</span>")
if(do_after(user, 20))
W:affecting.loc = loc
if(buckle_mob(W:affecting))
W:affecting.visible_message(\
"<span class='danger'>[W:affecting.name] is buckled to [src] by [user.name]!</span>",\
"<span class='danger'>You are buckled to [src] by [user.name]!</span>",\
"<span class='notice'>You hear metal clanking.</span>")
affecting.loc = loc
spawn(0)
if(buckle_mob(affecting))
affecting.visible_message(\
"<span class='danger'>[affecting.name] is buckled to [src] by [user.name]!</span>",\
"<span class='danger'>You are buckled to [src] by [user.name]!</span>",\
"<span class='notice'>You hear metal clanking.</span>")
qdel(W)
else
..()
@@ -4,6 +4,7 @@
icon_state = "chair_preview"
color = "#666666"
base_icon = "chair"
buckle_dir = 0
buckle_lying = 0 //force people to sit up in chairs when buckled
var/propelled = 0 // Check for fire-extinguisher-driven chairs
+1 -1
View File
@@ -140,7 +140,7 @@
return 1
if(is_full_window())
return 0 //full tile window, you can't move into it!
if(get_dir(loc, target) == dir)
if(get_dir(loc, target) & dir)
return !density
else
return 1