Second commits.

This contains the changes to item_attack.dm
Obj/attackby() now follows a similar structure as mob/living/attackby. It calls attack_obj() (like attack() but for obj) which calls attacked_by (just like attack() does)
The use of the NOBLUDGEON flag changes a bit, it is now used to signify the item cannot be used as a melee weapon at all. No attack animation, no attack message. I've given this bitflag to many items that have an afterattack() so as to not both attack and do the special action (among those items: the rcd)

There's also the code changes to attacking machines: attacking any machine now give a proper message and a sound. And with this, I made more machines breakable (using a health var and the very little used BROKEN stat). Most notably, tables can now be attacked when on harm intent and be destroyed.

The newly destroyable machines have a take_damage() proc used by all sorts of attack (weapon, xeno, animal, hulk, mech melee, gun projectile, thrown items).

There's some more stuff in there, see the PR's description and comments.
This commit is contained in:
phil235
2016-04-24 20:37:00 +02:00
parent 0caa59b21a
commit b146131a34
54 changed files with 1480 additions and 1410 deletions
+75 -60
View File
@@ -7,10 +7,8 @@
/atom/proc/attackby(obj/item/W, mob/user, params)
return
/atom/movable/attackby(obj/item/W, mob/living/user, params)
user.do_attack_animation(src)
if(W && !(W.flags & NOBLUDGEON))
visible_message("<span class='danger'>[user] has hit [src] with [W]!</span>")
/obj/attackby(obj/item/I, mob/living/user, params)
return I.attack_obj(src, user) //phil235
/mob/living/attackby(obj/item/I, mob/user, params)
user.changeNext_move(CLICK_CD_MELEE)
@@ -21,42 +19,54 @@
playsound(loc, 'sound/weapons/slice.ogg', 50, 1, -1)
if(do_mob(user, src, 80/sharpness))
harvest(user)
return
I.attack(src, user)
return 1
return I.attack(src, user) //phil235 should we return 1 if successful special attack() so we don't call afterattack?
//see the attack() procs if it'd be useful.
/mob/living/proc/attacked_by(obj/item/I, mob/living/user, def_zone)
apply_damage(I.force, I.damtype, def_zone)
if(I.damtype == "brute")
if(prob(33) && I.force)
var/turf/location = get_turf(src)
location.add_blood_floor(src)
var/message_verb = ""
if(I.attack_verb && I.attack_verb.len)
message_verb = "[pick(I.attack_verb)]"
else if(I.force)
message_verb = "attacked"
/obj/item/proc/attack(mob/living/M, mob/living/user, def_zone)
if(flags & (NOBLUDGEON|ABSTRACT)) //phil235 check that no abstract item uses attack or attack_obj
return
if(!force)
playsound(loc, 'sound/weapons/tap.ogg', get_clamped_volume(), 1, -1)
else if(hitsound)
playsound(loc, hitsound, get_clamped_volume(), 1, -1)
var/attack_message = "[src] has been [message_verb] with [I]."
if(user)
user.lastattacked = M
M.lastattacker = user
M.attacked_by(src, user, def_zone)
add_logs(user, M, "attacked", src.name, "(INTENT: [uppertext(user.a_intent)]) (DAMTYPE: [uppertext(damtype)])")
add_fingerprint(user)
//the equivalent of the standard version of attack() but for object targets.
/obj/item/proc/attack_obj(obj/O, mob/living/user)
if(flags & (NOBLUDGEON|ABSTRACT)) //phil235
return
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(O)
O.attacked_by(src, user)
/atom/movable/proc/attacked_by()
return
/obj/attacked_by(obj/item/I, mob/living/user)
if(I.force)
user.visible_message("<span class='danger'>[user] has hit [src] with [I]!</span>", "<span class='danger'>You hit [src] with [I]!</span>")
/mob/living/attacked_by(obj/item/I, mob/living/user, def_zone)
if(user != src)
user.do_attack_animation(src)
if(user in viewers(src, null))
attack_message = "[user] has [message_verb] [src] with [I]!"
if(message_verb)
visible_message("<span class='danger'>[attack_message]</span>",
"<span class='userdanger'>[attack_message]</span>")
/mob/living/simple_animal/attacked_by(var/obj/item/I, var/mob/living/user)
if(!I.force)
user.visible_message("<span class='warning'>[user] gently taps [src] with [I].</span>",\
"<span class='warning'>This weapon is ineffective, it does no damage!</span>")
else if(I.force >= force_threshold && I.damtype != STAMINA)
..()
else
visible_message("<span class='warning'>[I] bounces harmlessly off of [src].</span>",\
"<span class='warning'>[I] bounces harmlessly off of [src]!</span>")
if(send_item_attack_message(I, user, def_zone))
if(apply_damage(I.force, I.damtype, def_zone))
if(I.damtype == BRUTE)
if(prob(33))
var/turf/location = get_turf(src)
location.add_blood_floor(src)
// Proximity_flag is 1 if this afterattack was called on something adjacent, in your square, or on your person.
// Click parameters is the params string from byond Click() code, see that documentation.
@@ -65,30 +75,35 @@
/obj/item/proc/get_clamped_volume()
if(src.force && src.w_class)
return Clamp((src.force + src.w_class) * 4, 30, 100)// Add the item's force to its weight class and multiply by 4, then clamp the value between 30 and 100
else if(!src.force && src.w_class)
return Clamp(src.w_class * 6, 10, 100) // Multiply the item's weight class by 6, then clamp the value between 10 and 100
if(w_class)
if(force)
return Clamp((force + w_class) * 4, 30, 100)// Add the item's force to its weight class and multiply by 4, then clamp the value between 30 and 100
else
return Clamp(w_class * 6, 10, 100) // Multiply the item's weight class by 6, then clamp the value between 10 and 100
/obj/item/proc/attack(mob/living/M, mob/living/user, def_zone)
if (!istype(M)) // not sure if this is the right thing...
return
if (hitsound && force > 0) //If an item's hitsound is defined and the item's force is greater than zero...
playsound(loc, hitsound, get_clamped_volume(), 1, -1) //...play the item's hitsound at get_clamped_volume() with varying frequency and -1 extra range.
else if (force == 0)//Otherwise, if the item's force is zero...
playsound(loc, 'sound/weapons/tap.ogg', get_clamped_volume(), 1, -1)//...play tap.ogg at get_clamped_volume()
/////////////////////////
user.lastattacked = M
M.lastattacker = user
//spawn(1800) // this wont work right
// M.lastattacker = null
/////////////////////////
M.attacked_by(src, user, def_zone)
add_logs(user, M, "attacked", src.name, "(INTENT: [uppertext(user.a_intent)]) (DAMTYPE: [uppertext(damtype)])")
add_fingerprint(user)
/mob/living/proc/send_item_attack_message(obj/item/I, mob/living/user, hit_area)
var/message_verb = "attacked"
if(I.attack_verb.len)
message_verb = "[pick(I.attack_verb)]"
else if(!I.force)
return 0
var/message_hit_area = ""
if(hit_area)
message_hit_area = " in the [hit_area]"
var/attack_message = "[src] has been [message_verb][message_hit_area] with [I]."
if(user in viewers(src, null))
attack_message = "[user] has [message_verb] [src][message_hit_area] with [I]!"
visible_message("<span class='danger'>[attack_message]</span>",
"<span class='userdanger'>[attack_message]</span>")
return 1
/mob/living/simple_animal/send_item_attack_message(obj/item/I, mob/living/user, hit_area)
if(!I.force)
user.visible_message("<span class='warning'>[user] gently taps [src] with [I].</span>",\
"<span class='warning'>This weapon is ineffective, it does no damage!</span>")
else if(I.force < force_threshold || I.damtype == STAMINA)
visible_message("<span class='warning'>[I] bounces harmlessly off of [src].</span>",\
"<span class='warning'>[I] bounces harmlessly off of [src]!</span>")
else
return ..()
+48 -78
View File
@@ -9,8 +9,9 @@
var/maxhealth = 200
var/health = 200
var/datum/gang/gang
var/operating = 0 //-1=broken, 0=standby, 1=takeover
var/operating = 0 //0=standby or broken, 1=takeover
var/warned = 0 //if this device has set off the warning at <3 minutes yet
var/datum/effect_system/spark_spread/spark_system
/obj/machinery/dominator/tesla_act()
qdel(src)
@@ -19,10 +20,12 @@
..()
SetLuminosity(2)
poi_list |= src
spark_system = new
spark_system.set_up(5, 1, src)
/obj/machinery/dominator/examine(mob/user)
..()
if(operating == -1)
if(stat & BROKEN)
user << "<span class='danger'>It looks completely busted.</span>"
return
@@ -52,30 +55,31 @@
else
SSmachine.processing -= src
/obj/machinery/dominator/proc/healthcheck(damage)
var/iconname = "dominator"
if(gang)
iconname += "-[gang.color]"
SetLuminosity(3)
var/datum/effect_system/spark_spread/sparks = new /datum/effect_system/spark_spread
/obj/machinery/dominator/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
switch(damage_type)
if(BURN)
if(sound_effect)
playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
if(BRUTE)
if(sound_effect)
if(damage)
playsound(src, 'sound/effects/bang.ogg', 50, 1)
else
playsound(loc, 'sound/weapons/tap.ogg', 50, 1)
else
return
health -= damage
if(health > (maxhealth/2))
if(prob(damage*2))
sparks.set_up(5, 1, src)
sparks.start()
else if(operating >= 0)
sparks.set_up(5, 1, src)
sparks.start()
spark_system.start()
else if(!(stat & BROKEN))
spark_system.start()
overlays += "damage"
if(operating != -1)
if(!(stat & BROKEN))
if(health <= 0)
set_broken()
else
icon_state = iconname
if(health <= -100)
new /obj/item/stack/sheet/plasteel(src.loc)
@@ -107,17 +111,19 @@
SetLuminosity(0)
icon_state = "dominator-broken"
overlays.Cut()
operating = -1
operating = 0
stat |= BROKEN
SSmachine.processing -= src
/obj/machinery/dominator/Destroy()
if(operating != -1)
if(!(stat & BROKEN))
set_broken()
poi_list.Remove(src)
qdel(spark_system)
return ..()
/obj/machinery/dominator/emp_act(severity)
healthcheck(100)
take_damage(100, BURN, 0)
..()
/obj/machinery/dominator/ex_act(severity, target)
@@ -128,31 +134,26 @@
if(1)
qdel(src)
if(2)
healthcheck(120)
take_damage(120, BRUTE, 0)
if(3)
healthcheck(30)
take_damage(30, BRUTE, 0)
return
/obj/machinery/dominator/bullet_act(obj/item/projectile/Proj)
if(Proj.damage)
if((Proj.damage_type == BRUTE || Proj.damage_type == BURN))
var/damage = Proj.damage
if(Proj.forcedodge)
damage *= 0.5
playsound(src, 'sound/effects/bang.ogg', 50, 1)
visible_message("<span class='danger'>[src] was hit by [Proj].</span>")
healthcheck(damage)
..()
/obj/machinery/dominator/bullet_act(obj/item/projectile/P)
. = ..()
if(P.damage)
var/damage_amount = P.damage
if(P.forcedodge)
damage_amount *= 0.5
visible_message("<span class='danger'>[src] was hit by [P].</span>")
take_damage(damage_amount, P.damage_type, 0)
/obj/machinery/dominator/blob_act()
healthcheck(110)
/obj/machinery/dominator/attackby(obj/I, mob/user, params)
return
take_damage(110, BRUTE, 0)
/obj/machinery/dominator/attack_hand(mob/user)
if(operating)
if(operating || (stat & BROKEN))
examine(user)
return
@@ -185,8 +186,9 @@
priority_announce("Network breach detected in [locname]. The [gang.name] Gang is attempting to seize control of the station!","Network Alert")
gang.domination()
src.name = "[gang.name] Gang [src.name]"
healthcheck(0)
operating = 1
icon_state = "dominator-[gang.color]"
SetLuminosity(3)
SSmachine.processing += src
gang.message_gangtools("Hostile takeover in progress: Estimated [time] minutes until victory.[gang.dom_attempts ? "" : " This is your final attempt."]")
@@ -194,46 +196,14 @@
if(G != gang)
G.message_gangtools("Enemy takeover attempt detected in [locname]: Estimated [time] minutes until our defeat.",1,1)
/obj/machinery/dominator/attack_alien(mob/living/user)
user.do_attack_animation(src)
playsound(src, 'sound/effects/bang.ogg', 50, 1)
user.visible_message("<span class='danger'>[user] smashes against [src] with its claws.</span>",\
"<span class='danger'>You smash against [src] with your claws.</span>",\
"<span class='italics'>You hear metal scraping.</span>")
healthcheck(15)
/obj/machinery/dominator/attack_animal(mob/living/user)
if(!isanimal(user))
return
var/mob/living/simple_animal/M = user
M.do_attack_animation(src)
if(M.melee_damage_upper <= 0)
return
healthcheck(M.melee_damage_upper)
/obj/machinery/dominator/mech_melee_attack(obj/mecha/M)
if(M.damtype == "brute")
playsound(src, 'sound/effects/bang.ogg', 50, 1)
visible_message("<span class='danger'>[M.name] has hit [src].</span>")
healthcheck(M.force)
return
/obj/machinery/dominator/attack_hulk(mob/user)
playsound(src, 'sound/effects/bang.ogg', 50, 1)
user.visible_message("<span class='danger'>[user] smashes [src].</span>",\
"<span class='danger'>You punch [src].</span>",\
"<span class='italics'>You hear metal being slammed.</span>")
healthcheck(5)
take_damage(5)
/obj/machinery/dominator/attacked_by(obj/item/I, mob/living/user)
add_fingerprint(user)
..()
/obj/machinery/dominator/attackby(obj/item/weapon/I, mob/living/user, params)
if(istype(I, /obj/item/weapon))
add_fingerprint(user)
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src)
if( (I.flags&NOBLUDGEON) || !I.force )
return
playsound(src, 'sound/weapons/smash.ogg', 50, 1)
visible_message("<span class='danger'>[user] has hit \the [src] with [I].</span>")
if(I.damtype == BURN || I.damtype == BRUTE)
healthcheck(I.force)
return
+57 -18
View File
@@ -7,6 +7,7 @@
anchored = 1
var/obj/item/device/pda/storedpda = null
var/list/colorlist = list()
var/health = 100
/obj/machinery/pdapainter/update_icon()
@@ -45,7 +46,7 @@
power_change()
return
if(istype(O, /obj/item/device/pda))
else if(istype(O, /obj/item/device/pda))
if(storedpda)
user << "<span class='warning'>There is already a PDA inside!</span>"
return
@@ -59,27 +60,65 @@
P.add_fingerprint(user)
update_icon()
else if(istype(O, /obj/item/weapon/weldingtool) && user.a_intent != "harm")
var/obj/item/weapon/weldingtool/WT = O
if(stat & BROKEN)
if(WT.remove_fuel(0,user))
user.visible_message("[user] is repairing [src].", \
"<span class='notice'>You begin repairing [src]...</span>", \
"<span class='italics'>You hear welding.</span>")
playsound(loc, 'sound/items/Welder.ogg', 40, 1)
if(do_after(user,40/WT.toolspeed, 1, target = src))
if(!WT.isOn() || !(stat & BROKEN))
return
user << "<span class='notice'>You repair [src].</span>"
playsound(loc, 'sound/items/Welder2.ogg', 50, 1)
stat &= ~BROKEN
health = initial(health)
update_icon()
else
user << "<span class='notice'>[src] does not need repairs.</span>"
else
return ..()
/obj/machinery/pdapainter/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
switch(damage_type)
if(BRUTE)
if(sound_effect)
if(damage)
playsound(loc, 'sound/weapons/smash.ogg', 50, 1)
else
playsound(loc, 'sound/weapons/tap.ogg', 50, 1)
if(BURN)
if(sound_effect)
playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
else
return
if(!(stat & BROKEN))
health -= damage
if(health <= 0)
stat |= BROKEN
update_icon()
/obj/machinery/pdapainter/attack_hand(mob/user)
..()
if(..())
add_fingerprint(user)
src.add_fingerprint(user)
if(storedpda)
var/obj/item/device/pda/P
P = input(user, "Select your color!", "PDA Painting") as null|anything in colorlist
if(!P)
return
if(!in_range(src, user))
return
if(!storedpda)//is the pda still there?
return
storedpda.icon_state = P.icon_state
storedpda.desc = P.desc
ejectpda()
if(storedpda)
var/obj/item/device/pda/P
P = input(user, "Select your color!", "PDA Painting") as null|anything in colorlist
if(!P)
return
if(!in_range(src, user))
return
if(!storedpda)//is the pda still there?
return
storedpda.icon_state = P.icon_state
storedpda.desc = P.desc
ejectpda()
else
user << "<span class='notice'>The [src] is empty.</span>"
else
user << "<span class='notice'>The [src] is empty.</span>"
/obj/machinery/pdapainter/verb/ejectpda()
+10 -17
View File
@@ -73,26 +73,19 @@ var/list/announcement_systems = list()
/obj/machinery/announcement_system/attackby(obj/item/P, mob/user, params)
if(istype(P, /obj/item/weapon/screwdriver))
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
panel_open = !panel_open
if(!panel_open)
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
user << "<span class='notice'>You open the maintenance hatch of [src].</span>"
panel_open = 1
else
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
user << "<span class='notice'>You close the maintenance hatch of [src].</span>"
panel_open = 0
user << "<span class='notice'>You [panel_open ? "open" : "close"] the maintenance hatch of [src].</span>"
update_icon()
else if(default_deconstruction_crowbar(P))
return
if(panel_open)
default_deconstruction_crowbar(P)
if(istype(P, /obj/item/device/multitool) && broken)
user << "<span class='notice'>You reset [src]'s firmware.</span>"
broken = 0
update_icon()
return
return ..()
else if(istype(P, /obj/item/device/multitool) && panel_open && broken)
user << "<span class='notice'>You reset [src]'s firmware.</span>"
broken = 0
update_icon()
else
return ..()
/obj/machinery/announcement_system/proc/CompileText(str, user, rank) //replaces user-given variables with actual thingies.
str = replacetext(str, "%PERSON", "[user]")
+50 -38
View File
@@ -63,7 +63,7 @@
if(assembly)
qdel(assembly)
assembly = null
if(istype(bug))
if(bug)
bug.bugged_cameras -= src.c_tag
if(bug.current == src)
bug.current = null
@@ -110,9 +110,13 @@
/obj/machinery/camera/ex_act(severity, target)
if(src.invuln)
return
else
..()
return
switch(severity)
if(1)
qdel(src)
if(2)
take_damage(50, BRUTE, 0)
else
take_damage(rand(30,60), BRUTE, 0)
/obj/machinery/camera/proc/setViewRange(num = 7)
src.view_range = num
@@ -123,17 +127,6 @@
return
user.electrocute_act(10, src)
/obj/machinery/camera/attack_paw(mob/living/carbon/alien/humanoid/user)
if(!istype(user))
return
user.do_attack_animation(src)
add_hiddenprint(user)
visible_message("<span class='warning'>\The [user] slashes at [src]!</span>")
playsound(src.loc, 'sound/weapons/slash.ogg', 100, 1)
health = max(0, health - 30)
if(!health && status)
toggle_cam(user, 0)
/obj/machinery/camera/attackby(obj/W, mob/living/user, params)
var/msg = "<span class='notice'>You attach [W] into the assembly's inner circuits.</span>"
var/msg2 = "<span class='notice'>[src] already has that upgrade!</span>"
@@ -173,6 +166,7 @@
user << "[msg]"
else
user << "[msg2]"
return
else if(istype(W, /obj/item/stack/sheet/mineral/plasma))
if(!isEmpProof())
@@ -181,6 +175,8 @@
qdel(W)
else
user << "[msg2]"
return
else if(istype(W, /obj/item/device/assembly/prox_sensor))
if(!isMotion())
upgradeMotion()
@@ -188,6 +184,7 @@
qdel(W)
else
user << "[msg2]"
return
// OTHER
if((istype(W, /obj/item/weapon/paper) || istype(W, /obj/item/device/pda)) && isliving(user))
@@ -220,34 +217,52 @@
else if (O.client && O.client.eye == src)
O << "[U] holds \a [itemname] up to one of the cameras ..."
O << browse(text("<HTML><HEAD><TITLE>[]</TITLE></HEAD><BODY><TT>[]</TT></BODY></HTML>", itemname, info), text("window=[]", itemname))
return
else if (istype(W, /obj/item/device/camera_bug))
if (!src.can_use())
else if(istype(W, /obj/item/device/camera_bug))
if(!can_use())
user << "<span class='notice'>Camera non-functional.</span>"
return
if(istype(src.bug))
if(bug)
user << "<span class='notice'>Camera bug removed.</span>"
src.bug.bugged_cameras -= src.c_tag
src.bug = null
bug.bugged_cameras -= src.c_tag
bug = null
else
user << "<span class='notice'>Camera bugged.</span>"
src.bug = W
src.bug.bugged_cameras[src.c_tag] = src
bug = W
bug.bugged_cameras[src.c_tag] = src
return
else if(istype(W, /obj/item/weapon/pai_cable))
var/obj/item/weapon/pai_cable/cable = W
cable.plugin(src, user)
return
else if(istype(W, /obj/item/device/laser_pointer))
var/obj/item/device/laser_pointer/L = W
L.laser_act(src, user)
return
return ..()
else
if(W.force >= 10) //fairly simplistic, but will do for now.
user.changeNext_move(CLICK_CD_MELEE)
visible_message("<span class='warning'>[user] hits [src] with [W]!</span>", "<span class='warning'>You hit [src] with [W]!</span>")
health = max(0, health - W.force)
user.do_attack_animation(src)
if(!health && status)
triggerCameraAlarm()
toggle_cam(user, 1)
return
/obj/machinery/camera/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
switch(damage_type)
if(BRUTE)
if(sound_effect)
if(damage)
playsound(src, 'sound/weapons/smash.ogg', 50, 1)
else
playsound(src, 'sound/weapons/tap.ogg', 50, 1)
if(BURN)
if(sound_effect)
playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
else
return
if(damage < 10) //camera has a damage resistance threshold
return
health = max(0, health - damage)
if(!health && status)
triggerCameraAlarm()
toggle_cam(null, 0)
/obj/machinery/camera/proc/toggle_cam(mob/user, displaymessage = 1)
status = !status
@@ -373,12 +388,9 @@
else
src.SetLuminosity(0)
/obj/machinery/camera/bullet_act(obj/item/projectile/proj)
if(proj.damage_type == BRUTE)
health = max(0, health - proj.damage)
if(!health && status)
triggerCameraAlarm()
toggle_cam(null, 1)
/obj/machinery/camera/bullet_act(obj/item/projectile/P)
. = ..()
take_damage(P.damage, P.damage_type, 0)
/obj/machinery/camera/portable //Cameras which are placed inside of things, such as helmets.
var/turf/prev_turf
+34 -48
View File
@@ -12,6 +12,7 @@
var/brightness_on = 2
var/icon_keyboard = "generic_key"
var/icon_screen = "generic"
var/computer_health = 25
/obj/machinery/computer/New(location, obj/item/weapon/circuitboard/C)
..(location)
@@ -32,7 +33,10 @@
return 1
/obj/machinery/computer/emp_act(severity)
if(prob(20/severity)) set_broken()
if(severity == 1)
take_damage(rand(15,30), BRUTE, 0)
else
take_damage(rand(15,25), BRUTE, 0)
..()
/obj/machinery/computer/ex_act(severity, target)
@@ -42,25 +46,17 @@
switch(severity)
if(1)
qdel(src)
return
if(2)
if (prob(25))
if(prob(25))
qdel(src)
return
if (prob(50))
verbs.Cut()
set_broken()
else
take_damage(rand(20,30), BRUTE, 0)
if(3)
if (prob(25))
verbs.Cut()
set_broken()
else
return
take_damage(rand(10,30), BRUTE, 0)
/obj/machinery/computer/bullet_act(obj/item/projectile/Proj)
if(prob(Proj.damage))
if((Proj.damage_type == BRUTE || Proj.damage_type == BURN))
set_broken()
/obj/machinery/computer/bullet_act(obj/item/projectile/P)
take_damage(P.damage, P.damage_type, 0)
..()
/obj/machinery/computer/update_icon()
@@ -83,24 +79,19 @@
update_icon()
return
/obj/machinery/computer/proc/set_broken()
if(circuit) //no circuit, no breaking
stat |= BROKEN
update_icon()
return
/obj/machinery/computer/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/weapon/screwdriver) && circuit && !(flags&NODECONSTRUCT))
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
user << "<span class='notice'> You start to disconnect the monitor...</span>"
if(do_after(user, 20/I.toolspeed, target = src))
deconstruction()
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
A.circuit = circuit
A.anchored = 1
circuit = null
for (var/obj/C in src)
C.loc = src.loc
if (src.stat & BROKEN)
if (stat & BROKEN)
user << "<span class='notice'>The broken glass falls out.</span>"
new /obj/item/weapon/shard( src.loc )
A.state = 3
@@ -110,30 +101,25 @@
A.state = 4
A.icon_state = "4"
qdel(src)
return
else
return ..()
/obj/machinery/computer/attack_paw(mob/living/user)
user.do_attack_animation(src)
if(circuit)
if(prob(10))
user.visible_message("<span class='danger'>[user.name] smashes the [src.name] with its paws.</span>",\
"<span class='danger'>You smash the [src.name] with your paws.</span>",\
"<span class='italics'>You hear a smashing sound.</span>")
set_broken()
/obj/machinery/computer/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
switch(damage_type)
if(BRUTE)
if(sound_effect)
if(stat & BROKEN)
playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)
else
playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1)
if(BURN)
if(sound_effect)
playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
else
return
user.visible_message("<span class='danger'>[user.name] smashes against the [src.name] with its paws.</span>",\
"<span class='danger'>You smash against the [src.name] with your paws.</span>",\
"<span class='italics'>You hear hear a clicking sound.</span>")
/obj/machinery/computer/attack_alien(mob/living/user)
user.do_attack_animation(src)
if(circuit)
if(prob(80))
user.visible_message("<span class='danger'>[user.name] smashes the [src.name] with its claws.</span>",\
"<span class='danger'>You smash the [src.name] with your claws.</span>",\
"<span class='italics'>You hear a smashing sound.</span>")
set_broken()
return
user.visible_message("<span class='danger'>[user.name] smashes against the [src.name] with its claws.</span>",\
"<span class='danger'>You smash against the [src.name] with your claws.</span>",\
"<span class='italics'>You hear a clicking sound.</span>")
computer_health = max(computer_health - damage, 0)
if(circuit) //no circuit, no breaking
if(!computer_health && !(stat & BROKEN))
playsound(loc, 'sound/effects/Glassbr3.ogg', 100, 1)
stat |= BROKEN
update_icon()
+47 -33
View File
@@ -172,7 +172,7 @@
visible_message("<span class='notice'>[src] [end_create_message]</span>")
icon_state = icon_recharging
sleep(cooldownTime)
if(stat != BROKEN)
if(!(stat & BROKEN))
icon_state = icon_on
else
icon_state = icon_off
@@ -210,36 +210,50 @@
user << "<span class='notice'>You insert [stack] sheet[stack > 1 ? "s" : ""] to [src].</span>"
if((O && O.loc == src) || !stack)
qdel(O)
return
if(istype(O, /obj/item/weapon/weldingtool) && (stat & BROKEN))
var/obj/item/weapon/weldingtool/WT = O
if(!WT.isOn())
else if(istype(O, /obj/item/weapon/weldingtool))
if(stat & BROKEN)
var/obj/item/weapon/weldingtool/WT = O
if(!WT.isOn())
return
if(WT.get_fuel() < 1)
user << "<span class='warning'>You need more fuel to complete this task!</span>"
return
playsound(src, 'sound/items/Welder.ogg', 50, 1)
user.visible_message("<span class='notice'>[user] begins patching up [src] with [WT].</span>", \
"<span class='notice'>You begin restoring the damage to [src]...</span>")
if(!do_after(user, 40/O.toolspeed, target = src))
return
if(!src || !WT.remove_fuel(1, user)) return
user.visible_message("<span class='notice'>[user] fixes [src]!</span>", \
"<span class='notice'>You restore [src] to operation.</span>")
stat &= ~BROKEN
health = max_health
if(!stat)
icon_state = icon_on
else
user << "<span class='warning'>[src] doesn't need repairs.</span>"
else
return ..()
/obj/machinery/droneDispenser/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
switch(damage_type)
if(BURN)
if(sound_effect)
playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
if(BRUTE)
if(sound_effect)
if(damage)
playsound(loc, 'sound/weapons/smash.ogg', 50, 1)
else
playsound(loc, 'sound/weapons/tap.ogg', 50, 1)
else
return
if(WT.get_fuel() < 1)
user << "<span class='warning'>You need more fuel to complete this task!</span>"
return
playsound(src, 'sound/items/Welder.ogg', 50, 1)
user.visible_message("<span class='notice'>[user] begins patching up [src] with [WT].</span>", \
"<span class='notice'>You begin restoring the damage to [src]...</span>")
if(!do_after(user, 40/O.toolspeed, target = src))
return
if(!src || !WT.remove_fuel(1, user)) return
user.visible_message("<span class='notice'>[user] fixes [src]!</span>", \
"<span class='notice'>You restore [src] to operation.</span>")
stat -= BROKEN
icon_state = icon_on
return
if(O.force && stat != BROKEN)
user.visible_message("<span class='danger'>[user] hits [src] with [O]!</span>", \
"<span class='warning'>You hit [src] with [O]!</span>")
playsound(src, O.hitsound, 50, 1)
health = Clamp(health - O.force, 0, max_health)
if(health <= 0)
if(break_message)
audible_message("<span class='warning'>[src] [break_message]</span>")
if(break_sound)
playsound(src, break_sound, 50, 1)
stat = BROKEN
icon_state = icon_off
return
..()
health = max(health - damage, 0)
if(!health && !(stat & BROKEN))
if(break_message)
audible_message("<span class='warning'>[src] [break_message]</span>")
if(break_sound)
playsound(src, break_sound, 50, 1)
stat |= BROKEN
icon_state = icon_off
+28 -6
View File
@@ -21,6 +21,7 @@
power_channel = ENVIRON
var/detecting = 1
var/buildstage = 2 // 2 = complete, 1 = no wires, 0 = circuit gone
var/health = 50
/obj/machinery/firealarm/New(loc, dir, building)
..()
@@ -61,9 +62,9 @@
else
overlays += "overlay_fire"
/obj/machinery/firealarm/bullet_act(BLAH)
if(prob(50))
alarm()
/obj/machinery/firealarm/bullet_act(obj/item/projectile/P)
. = ..()
take_damage(P.damage, P.damage_type, 0)
/obj/machinery/firealarm/emp_act(severity)
if(prob(50 / severity))
@@ -74,11 +75,11 @@
emagged = 1
if(user)
user.visible_message("<span class='warning'>Sparks fly out of the [src]!</span>",
"<span class='notice'>You emag the [src], disabling its thermal sensors.</span>")
"<span class='notice'>You emag [src], disabling its thermal sensors.</span>")
playsound(src.loc, 'sound/effects/sparks4.ogg', 50, 1)
/obj/machinery/firealarm/temperature_expose(datum/gas_mixture/air, temperature, volume)
if(!emagged && detecting && temperature > T0C + 200)
if(!emagged && detecting && !stat && temperature > T0C + 200)
alarm()
/obj/machinery/firealarm/proc/alarm()
@@ -200,4 +201,25 @@
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
qdel(src)
return
return ..()
return ..()
/obj/machinery/firealarm/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
switch(damage_type)
if(BRUTE)
if(sound_effect)
if(damage)
playsound(loc, 'sound/weapons/smash.ogg', 50, 1)
else
playsound(loc, 'sound/weapons/tap.ogg', 50, 1)
if(BURN)
if(sound_effect)
playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
else
return
if(!(stat & BROKEN))
health -= damage
if(health <= 0)
stat |= BROKEN
update_icon()
else if(prob(33))
alarm()
+55 -6
View File
@@ -137,10 +137,6 @@ Class Procs:
dropContents()
return ..()
/obj/machinery/attackby(obj/item/weapon/W, mob/user, params)
user.changeNext_move(CLICK_CD_MELEE)
..()
/obj/machinery/proc/locate_machinery()
return
@@ -243,6 +239,61 @@ Class Procs:
////////////////////////////////////////////////////////////////////////////////////////////
/obj/machinery/mech_melee_attack(obj/mecha/M)
if(M.damtype == BRUTE || M.damtype == BURN)
visible_message("<span class='danger'>[M.name] has hit [src].</span>")
take_damage(M.force*2, M.damtype) // multiplied by 2 so we can hit machines hard but not be overpowered against mobs.
return 1
return 0
/obj/machinery/attacked_by(obj/item/I, mob/living/user)
..()
take_damage(I.force, I.damtype, 1)
/obj/machinery/proc/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
switch(damage_type)
if(BRUTE)
if(sound_effect)
if(damage)
playsound(loc, 'sound/weapons/smash.ogg', 50, 1)
else
playsound(loc, 'sound/weapons/tap.ogg', 50, 1)
if(BURN)
if(sound_effect)
playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
//phil235
/obj/machinery/attack_alien(mob/living/carbon/alien/humanoid/user)
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src)
add_hiddenprint(user)
visible_message("<span class='warning'>\The [user] slashes at [src]!</span>")
playsound(src.loc, 'sound/weapons/slash.ogg', 100, 1)
take_damage(20, BRUTE, 0)
/obj/machinery/attack_animal(mob/living/simple_animal/M)
M.changeNext_move(CLICK_CD_MELEE)
M.do_attack_animation(src)
if(M.melee_damage_upper > 0) // phil235 use M.attack_text verb?
M.visible_message("<span class='danger'>[M.name] smashes against \the [src.name].</span>",\
"<span class='danger'>You smash against the [src.name].</span>")
take_damage(M.melee_damage_upper, M.melee_damage_type, 1)
/obj/machinery/attack_paw(mob/living/user)
if(user.a_intent != "harm")
return attack_hand(user)
else
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src)
user.visible_message("<span class='danger'>[user.name] smashes against \the [src.name] with its paws.</span>",\
"<span class='danger'>You smash against the [src.name] with your paws.</span>")
take_damage(4, BRUTE, 1)
/obj/machinery/attack_ai(mob/user)
if(isrobot(user))// For some reason attack_robot doesn't work
var/mob/living/silicon/robot/R = user
@@ -251,8 +302,6 @@ Class Procs:
else
return attack_hand(user)
/obj/machinery/attack_paw(mob/user)
return attack_hand(user)
//set_machine must be 0 if clicking the machinery doesn't bring up a dialog
/obj/machinery/attack_hand(mob/user, check_power = 1, set_machine = 1)
+94 -66
View File
@@ -175,8 +175,6 @@ var/list/obj/machinery/newscaster/allCasters = list()
verb_say = "beeps"
verb_ask = "beeps"
verb_exclaim = "beeps"
var/isbroken = 0
var/ispowered = 1
var/screen = 0
var/paper_remaining = 15
var/securityCaster = 0
@@ -188,11 +186,12 @@ var/list/obj/machinery/newscaster/allCasters = list()
var/obj/item/weapon/photo/photo = null
var/channel_name = ""
var/c_locked=0
var/hitstaken = 0
var/health = 60
var/datum/newscaster/feed_channel/viewing_channel = null
var/allow_comments = 1
luminosity = 0
anchored = 1
var/hitstaken = 0 //phil235 to be removed, it's used in a map var edit.
/obj/machinery/newscaster/security_unit
name = "security newscaster"
@@ -217,32 +216,35 @@ var/list/obj/machinery/newscaster/allCasters = list()
return ..()
/obj/machinery/newscaster/update_icon()
if(!ispowered || isbroken)
icon_state = "newscaster_off"
if(isbroken)
overlays.Cut()
overlays += image(icon, "crack3")
return
overlays.Cut()
if(news_network.wanted_issue.active)
icon_state = "newscaster_wanted"
return
if(alert)
overlays += "newscaster_alert"
if(hitstaken > 0)
overlays += image(icon, "crack[hitstaken]")
icon_state = "newscaster_normal"
if(stat & (NOPOWER|BROKEN))
icon_state = "newscaster_off"
else
if(news_network.wanted_issue.active)
icon_state = "newscaster_wanted"
else
icon_state = "newscaster_normal"
if(alert)
overlays += "newscaster_alert"
switch(health)
if(45 to 60)
return
if(30 to 45)
overlays += "crack1"
if(15 to 30)
overlays += "crack2"
else
overlays += "crack3"
/obj/machinery/newscaster/power_change()
if(isbroken)
if(stat & BROKEN)
return
if(powered())
ispowered = 1
stat &= ~NOPOWER
update_icon()
else
spawn(rand(0, 15))
ispowered = 0
stat |= NOPOWER
update_icon()
@@ -251,21 +253,18 @@ var/list/obj/machinery/newscaster/allCasters = list()
if(1)
qdel(src)
if(2)
isbroken=1
if(prob(50))
qdel(src)
else
update_icon()
take_damage(rand(40,80), BRUTE, 0)
else
if(prob(50))
isbroken=1
update_icon()
take_damage(rand(20,40), BRUTE, 0)
/obj/machinery/newscaster/attack_ai(mob/user)
return attack_hand(user)
/obj/machinery/newscaster/attack_hand(mob/user)
if(!ispowered || isbroken)
if(stat & (NOPOWER|BROKEN))
return
if(istype(user, /mob/living/carbon/human) || istype(user,/mob/living/silicon) )
var/mob/living/human_or_robot_user = user
@@ -327,11 +326,11 @@ var/list/obj/machinery/newscaster/allCasters = list()
if(6)
dat+="<B><FONT COLOR='maroon'>ERROR: Could not submit Feed story to Network.</B></FONT><HR><BR>"
if(channel_name=="")
dat+="<FONT COLOR='maroon'>Invalid receiving channel name.</FONT><BR>"
dat+="<FONT COLOR='maroon'>?Invalid receiving channel name.</FONT><BR>"
if(scanned_user=="Unknown")
dat+="<FONT COLOR='maroon'>Channel author unverified.</FONT><BR>"
dat+="<FONT COLOR='maroon'>?Channel author unverified.</FONT><BR>"
if(msg == "" || msg == "\[REDACTED\]")
dat+="<FONT COLOR='maroon'>Invalid message body.</FONT><BR>"
dat+="<FONT COLOR='maroon'>?Invalid message body.</FONT><BR>"
dat+="<BR><A href='?src=\ref[src];setScreen=[3]'>Return</A><BR>"
if(7)
dat+="<B><FONT COLOR='maroon'>ERROR: Could not submit Feed Channel to Network.</B></FONT><HR><BR>"
@@ -342,18 +341,18 @@ var/list/obj/machinery/newscaster/allCasters = list()
else
existing_authors += FC.author
if(scanned_user in existing_authors)
dat+="<FONT COLOR='maroon'>There already exists a Feed channel under your name.</FONT><BR>"
dat+="<FONT COLOR='maroon'>?There already exists a Feed channel under your name.</FONT><BR>"
if(channel_name=="" || channel_name == "\[REDACTED\]")
dat+="<FONT COLOR='maroon'>Invalid channel name.</FONT><BR>"
dat+="<FONT COLOR='maroon'>?Invalid channel name.</FONT><BR>"
var/check = 0
for(var/datum/newscaster/feed_channel/FC in news_network.network_channels)
if(FC.channel_name == channel_name)
check = 1
break
if(check)
dat+="<FONT COLOR='maroon'>Channel name already in use.</FONT><BR>"
dat+="<FONT COLOR='maroon'>?Channel name already in use.</FONT><BR>"
if(scanned_user=="Unknown")
dat+="<FONT COLOR='maroon'>Channel author unverified.</FONT><BR>"
dat+="<FONT COLOR='maroon'>?Channel author unverified.</FONT><BR>"
dat+="<BR><A href='?src=\ref[src];setScreen=[2]'>Return</A><BR>"
if(8)
var/total_num=length(news_network.network_channels)
@@ -472,11 +471,11 @@ var/list/obj/machinery/newscaster/allCasters = list()
if(16)
dat+="<B><FONT COLOR='maroon'>ERROR: Wanted Issue rejected by Network.</B></FONT><HR><BR>"
if(channel_name=="" || channel_name == "\[REDACTED\]")
dat+="<FONT COLOR='maroon'>Invalid name for person wanted.</FONT><BR>"
dat+="<FONT COLOR='maroon'>?Invalid name for person wanted.</FONT><BR>"
if(scanned_user=="Unknown")
dat+="<FONT COLOR='maroon'>Issue author unverified.</FONT><BR>"
dat+="<FONT COLOR='maroon'>?Issue author unverified.</FONT><BR>"
if(msg == "" || msg == "\[REDACTED\]")
dat+="<FONT COLOR='maroon'>Invalid description.</FONT><BR>"
dat+="<FONT COLOR='maroon'>?Invalid description.</FONT><BR>"
dat+="<BR><A href='?src=\ref[src];setScreen=[0]'>Return</A><BR>"
if(17)
dat+="<B>Wanted Issue successfully deleted from Circulation</B><BR>"
@@ -724,39 +723,66 @@ var/list/obj/machinery/newscaster/allCasters = list()
user << "<span class='notice'>You start [anchored ? "un" : ""]securing [name]...</span>"
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
if(do_after(user, 60/I.toolspeed, target = src))
user << "<span class='notice'>You [anchored ? "un" : ""]secure [name].</span>"
new /obj/item/wallframe/newscaster(loc)
playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1)
qdel(src)
return
if(isbroken)
playsound(loc, 'sound/effects/hit_on_shattered_glass.ogg', 100, 1)
audible_message("<span class='danger'>[user.name] further abuses the shattered [name].</span>", null, 5 )
else
if(istype(I, /obj/item/weapon))
user.do_attack_animation(src)
var/obj/item/weapon/W = I
if(W.damtype == STAMINA)
return
if(W.force <15)
audible_message("<span class='danger'>[user.name] hits the [name] with the [W.name] with no visible effect.</span>", null , 5 )
playsound(loc, 'sound/effects/Glasshit.ogg', 100, 1)
if(stat & BROKEN)
user << "<span class='warning'>The broken remains of [src] fall on the ground.</span>"
new /obj/item/stack/sheet/metal(loc, 5)
new /obj/item/weapon/shard(loc)
new /obj/item/weapon/shard(loc)
else
hitstaken++
if(hitstaken==3)
audible_message("<span class='danger'>[user.name] smashes the [name]!</span>", null, 5 )
isbroken=1
playsound(loc, 'sound/effects/Glassbr3.ogg', 100, 1)
else
audible_message("<span class='danger'>[user.name] forcefully slams the [name] with the [I.name]!</span>", null, 5 )
playsound(loc, 'sound/effects/Glasshit.ogg', 100, 1)
user << "<span class='notice'>You [anchored ? "un" : ""]secure [name].</span>"
new /obj/item/wallframe/newscaster(loc)
qdel(src)
else if(istype(I, /obj/item/weapon/weldingtool) && user.a_intent != "harm")
var/obj/item/weapon/weldingtool/WT = I
if(stat & BROKEN)
if(WT.remove_fuel(0,user))
user.visible_message("[user] is repairing [src].", \
"<span class='notice'>You begin repairing [src]...</span>", \
"<span class='italics'>You hear welding.</span>")
playsound(loc, 'sound/items/Welder.ogg', 40, 1)
if(do_after(user,40/WT.toolspeed, 1, target = src))
if(!WT.isOn() || !(stat & BROKEN))
return
user << "<span class='notice'>You repair [src].</span>"
playsound(loc, 'sound/items/Welder2.ogg', 50, 1)
stat &= ~BROKEN
update_icon()
else
user << "<span class='warning'>This does nothing!</span>"
update_icon()
user << "<span class='notice'>[src] does not need repairs.</span>"
else
return ..()
/obj/machinery/newscaster/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
switch(damage_type)
if(BRUTE)
if(sound_effect)
if(stat & BROKEN)
playsound(loc, 'sound/effects/hit_on_shattered_glass.ogg', 100, 1)
else
playsound(loc, 'sound/effects/Glasshit.ogg', 90, 1)
if(BURN)
if(sound_effect)
playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
else
return
if(damage < 15) //so it can't be broken with a small weapon.
return
if(!(stat & BROKEN))
health -= damage
if(health <= 0)
stat |= BROKEN
playsound(loc, 'sound/effects/Glassbr3.ogg', 100, 1)
update_icon()
/obj/machinery/newscaster/attack_paw(mob/user)
user << "<span class='warning'>The newscaster controls are far too complicated for your tiny brain!</span>"
return
if(user.a_intent != "harm")
user << "<span class='warning'>The newscaster controls are far too complicated for your tiny brain!</span>"
else
take_damage(5)
//phil235 missing attack_alien, attack_animal, bullet_act, etc...
/obj/machinery/newscaster/proc/AttachPhoto(mob/user)
if(photo)
@@ -895,7 +921,7 @@ var/list/obj/machinery/newscaster/allCasters = list()
switch(screen)
if(0) //Cover
dat+="<DIV ALIGN='center'><B><FONT SIZE=6>The Griffon</FONT></B></div>"
dat+="<DIV ALIGN='center'><FONT SIZE=2>Nanotrasen-standard newspaper, for use on Nanotrasen© Space Facilities</FONT></div><HR>"
dat+="<DIV ALIGN='center'><FONT SIZE=2>Nanotrasen-standard newspaper, for use on Nanotrasen? Space Facilities</FONT></div><HR>"
if(isemptylist(news_content))
if(wantedAuthor)
dat+="Contents:<BR><ul><B><FONT COLOR='red'>**</FONT>Important Security Announcement<FONT COLOR='red'>**</FONT></B> <FONT SIZE=2>\[page [pages+2]\]</FONT><BR></ul>"
@@ -1022,4 +1048,6 @@ var/list/obj/machinery/newscaster/allCasters = list()
return
scribble_page = curr_page
scribble = s
attack_self(user)
attack_self(user)
else
return ..()
+18 -21
View File
@@ -64,7 +64,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
/obj/machinery/requests_console/update_icon()
if(open)
if(hackState == 0)
if(!hackState)
icon_state="req_comp_open"
else
icon_state="req_comp_rewired"
@@ -135,7 +135,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
dat += "<tr>"
dat += "<td width='55%'>[dpt]</td>"
dat += "<td width='45%'><A href='?src=\ref[src];write=[ckey(dpt)]'>Normal</A> <A href='?src=\ref[src];write=[ckey(dpt)];priority=2'>High</A>"
if (hackState == 1)
if(hackState)
dat += "<A href='?src=\ref[src];write=[ckey(dpt)];priority=3'>EXTREME</A>"
dat += "</td>"
dat += "</tr>"
@@ -150,7 +150,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
dat += "<tr>"
dat += "<td width='55%'>[dpt]</td>"
dat += "<td width='45%'><A href='?src=\ref[src];write=[ckey(dpt)]'>Normal</A> <A href='?src=\ref[src];write=[ckey(dpt)];priority=2'>High</A>"
if (hackState == 1)
if(hackState)
dat += "<A href='?src=\ref[src];write=[ckey(dpt)];priority=3'>EXTREME</A>"
dat += "</td>"
dat += "</tr>"
@@ -165,7 +165,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
dat += "<tr>"
dat += "<td width='55%'>[dpt]</td>"
dat += "<td width='45%'><A href='?src=\ref[src];write=[ckey(dpt)]'>Normal</A> <A href='?src=\ref[src];write=[ckey(dpt)];priority=2'>High</A>"
if (hackState == 1)
if(hackState)
dat += "<A href='?src=\ref[src];write=[ckey(dpt)];priority=3'>EXTREME</A>"
dat += "</td>"
dat += "</tr>"
@@ -479,34 +479,29 @@ var/list/obj/machinery/requests_console/allConsoles = list()
SetLuminosity(2)
/obj/machinery/requests_console/attackby(obj/item/weapon/O, mob/user, params)
if (istype(O, /obj/item/weapon/crowbar))
if(istype(O, /obj/item/weapon/crowbar))
if(open)
user << "<span class='notice'>You close the maintenance panel.</span>"
open = 0
icon_state="req_comp0"
else
user << "<span class='notice'>You open the maintenance panel.</span>"
open = 1
if(hackState == 0)
icon_state="req_comp_open"
else if(hackState == 1)
icon_state="req_comp_rewired"
if (istype(O, /obj/item/weapon/screwdriver))
update_icon()
return
if(istype(O, /obj/item/weapon/screwdriver))
if(open)
if(hackState == 0)
hackState = !hackState
if(hackState)
user << "<span class='notice'>You modify the wiring.</span>"
hackState = 1
icon_state="req_comp_rewired"
else if(hackState == 1)
else
user << "<span class='notice'>You reset the wiring.</span>"
hackState = 0
icon_state="req_comp_open"
update_icon()
else
user << "<span class='warning'>You can't do much with that!</span>"
update_icon()
user << "<span class='warning'>You must open the maintenance panel first!</span>"
return
var/obj/item/weapon/card/id/ID = O.GetID()
if (ID)
if(ID)
if(screen == 9)
msgVerified = "<font color='green'><b>Verified by [ID.registered_name] ([ID.assignment])</b></font>"
updateUsrDialog()
@@ -517,9 +512,11 @@ var/list/obj/machinery/requests_console/allConsoles = list()
announceAuth = 0
user << "<span class='warning'>You are not authorized to send announcements!</span>"
updateUsrDialog()
return
if (istype(O, /obj/item/weapon/stamp))
if(screen == 9)
var/obj/item/weapon/stamp/T = O
msgStamped = "<span class='boldnotice'>Stamped with the [T.name]</span>"
updateUsrDialog()
return
return
return ..()
+105 -111
View File
@@ -33,35 +33,25 @@
/obj/machinery/shield/CanAtmosPass(turf/T)
return !density
/obj/machinery/shield/attackby(obj/item/weapon/W, mob/user, params)
..()
if(W.damtype == BRUTE || W.damtype == BURN)
take_damage(W.force)
/obj/machinery/shield/bullet_act(obj/item/projectile/Proj)
..()
take_damage(Proj.damage)
/obj/machinery/shield/bullet_act(obj/item/projectile/P)
. = ..()
take_damage(P.damage, P.damage_type)
/obj/machinery/shield/ex_act(severity, target)
switch(severity)
if(1)
if (prob(75))
qdel(src)
take_damage(rand(180,260), BRUTE, 0)
if(2)
if (prob(50))
qdel(src)
take_damage(rand(150,230), BRUTE, 0)
if(3)
if (prob(25))
qdel(src)
return
take_damage(rand(80,150), BRUTE, 0)
/obj/machinery/shield/emp_act(severity)
switch(severity)
if(1)
qdel(src)
if(2)
if(prob(50))
qdel(src)
take_damage(50, BRUTE, 0)
/obj/machinery/shield/blob_act()
qdel(src)
@@ -77,14 +67,21 @@
..()
take_damage(tforce)
/obj/machinery/shield/proc/take_damage(damage)
playsound(loc, 'sound/effects/EMPulse.ogg', 75, 1)
/obj/machinery/shield/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
switch(damage_type)
if(BURN)
if(sound_effect)
playsound(loc, 'sound/effects/EMPulse.ogg', 75, 1)
if(BRUTE)
if(sound_effect)
playsound(loc, 'sound/effects/EMPulse.ogg', 75, 1)
else
return
opacity = 1
spawn(20)
opacity = 0
health -= damage
if(health <= 0)
visible_message("<span class='notice'>[src] dissipates.</span>")
qdel(src)
/obj/machinery/shieldgen
@@ -100,9 +97,7 @@
var/const/max_health = 100
var/health = max_health
var/active = 0
var/malfunction = 0 //Malfunction causes parts of the shield to slowly dissapate
var/list/deployed_shields = list()
var/is_open = 0 //Whether or not the wires are exposed
var/locked = 0
var/shield_range = 4
@@ -114,20 +109,22 @@
/obj/machinery/shieldgen/proc/shields_up()
if(active) return 0 //If it's already turned on, how did this get called?
if(active)
return 0 //If it's already turned on, how did this get called?
src.active = 1
active = 1
update_icon()
for(var/turf/target_tile in range(shield_range, src))
if (istype(target_tile,/turf/open/space) && !(locate(/obj/machinery/shield) in target_tile))
if (malfunction && prob(33) || !malfunction)
if(!(stat & BROKEN) || prob(33))
deployed_shields += new /obj/machinery/shield(target_tile)
/obj/machinery/shieldgen/proc/shields_down()
if(!active) return 0 //If it's already off, how did this get called?
if(!active)
return 0 //If it's already off, how did this get called?
src.active = 0
active = 0
update_icon()
for(var/obj/machinery/shield/shield_tile in deployed_shields)
@@ -135,66 +132,70 @@
deployed_shields.Cut()
/obj/machinery/shieldgen/process()
if(malfunction && active)
if((stat & BROKEN) && active)
if(deployed_shields.len && prob(5))
qdel(pick(deployed_shields))
return
/obj/machinery/shieldgen/proc/checkhp()
if(health <= 30)
src.malfunction = 1
if(health <= 0)
qdel(src)
update_icon()
return
/obj/machinery/shieldgen/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
switch(damage_type)
if(BRUTE)
if(sound_effect)
if(damage)
playsound(loc, 'sound/weapons/smash.ogg', 50, 1)
else
playsound(loc, 'sound/weapons/tap.ogg', 50, 1)
if(BURN)
if(sound_effect)
playsound(loc, 'sound/items/Welder.ogg', 40, 1)
else
return
health = max(health - damage, 0)
if(health <= 0 && !(stat && BROKEN))
stat |= BROKEN
update_icon()
/obj/machinery/shieldgen/ex_act(severity, target)
switch(severity)
if(1)
src.health -= 75
src.checkhp()
qdel(src)
if(2)
src.health -= 30
if (prob(15))
src.malfunction = 1
src.checkhp()
if(prob(33))
qdel(src)
else
take_damage(rand(80,120), BRUTE, 0)
if(3)
src.health -= 10
src.checkhp()
return
take_damage(rand(40,80), BRUTE, 0)
/obj/machinery/shieldgen/emp_act(severity)
switch(severity)
if(1)
src.health /= 2 //cut health in half
malfunction = 1
health = 0
stat |= BROKEN
locked = pick(0,1)
update_icon()
if(2)
if(prob(50))
src.health *= 0.3 //chop off a third of the health
malfunction = 1
checkhp()
take_damage(rand(80,120), BRUTE, 0)
/obj/machinery/shieldgen/attack_hand(mob/user)
if(locked)
user << "<span class='warning'>The machine is locked, you are unable to use it!</span>"
return
if(is_open)
if(panel_open)
user << "<span class='warning'>The panel must be closed before operating this machine!</span>"
return
if (src.active)
if (active)
user.visible_message("[user] deactivated \the [src].", \
"<span class='notice'>You deactivate \the [src].</span>", \
"<span class='italics'>You hear heavy droning fade out.</span>")
src.shields_down()
shields_down()
else
if(anchored)
user.visible_message("[user] activated \the [src].", \
"<span class='notice'>You activate \the [src].</span>", \
"<span class='italics'>You hear heavy droning.</span>")
src.shields_up()
shields_up()
else
user << "<span class='warning'>The device must first be secured to the floor!</span>"
return
@@ -202,14 +203,12 @@
/obj/machinery/shieldgen/attackby(obj/item/weapon/W, mob/user, params)
if(istype(W, /obj/item/weapon/screwdriver))
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
if(is_open)
user << "<span class='notice'>You close the panel.</span>"
is_open = 0
else
panel_open = !panel_open
if(panel_open)
user << "<span class='notice'>You open the panel and expose the wiring.</span>"
is_open = 1
else if(istype(W, /obj/item/stack/cable_coil) && malfunction && is_open)
else
user << "<span class='notice'>You close the panel.</span>"
else if(istype(W, /obj/item/stack/cable_coil) && (stat & BROKEN) && panel_open)
var/obj/item/stack/cable_coil/coil = W
if (coil.get_amount() < 1)
user << "<span class='warning'>You need one length of cable to repair [src]!</span>"
@@ -220,7 +219,7 @@
return
coil.use(1)
health = max_health
malfunction = 0
stat &= ~BROKEN
user << "<span class='notice'>You repair \the [src].</span>"
update_icon()
@@ -237,31 +236,30 @@
user << "<span class='notice'>You unsecure \the [src] from the floor!</span>"
if(active)
user << "<span class='notice'>\The [src] shuts off!</span>"
src.shields_down()
shields_down()
anchored = 0
else if(istype(W, /obj/item/weapon/card/id) || istype(W, /obj/item/device/pda))
if(src.allowed(user))
src.locked = !src.locked
user << "<span class='notice'>You [src.locked ? "lock" : "unlock"] the controls.</span>"
else if(W.GetID())
if(allowed(user))
locked = !locked
user << "<span class='notice'>You [locked ? "lock" : "unlock"] the controls.</span>"
else
user << "<span class='danger'>Access denied.</span>"
else
..()
return ..()
/obj/machinery/shieldgen/emag_act()
if(!malfunction)
malfunction = 1
if(!(stat & BROKEN))
stat |= BROKEN
health = 0
update_icon()
/obj/machinery/shieldgen/update_icon()
if(active)
src.icon_state = malfunction ? "shieldonbr":"shieldon"
icon_state = (stat & BROKEN) ? "shieldonbr":"shieldon"
else
src.icon_state = malfunction ? "shieldoffbr":"shieldoff"
return
icon_state = (stat & BROKEN) ? "shieldoffbr":"shieldoff"
////FIELD GEN START //shameless copypasta from fieldgen, powersink, and grille
#define maxstoredpower 500
@@ -273,6 +271,8 @@
anchored = 0
density = 1
req_access = list(access_teleporter)
flags = CONDUCT
use_power = 0
var/active = 0
var/power = 0
var/steps = 0
@@ -280,8 +280,6 @@
var/check_delay = 10
var/recalc = 0
var/locked = 1
var/destroyed = 0
// var/maxshieldload = 200
var/obj/structure/cable/attached // the attached cable
var/storedpower = 0
flags = CONDUCT
@@ -312,8 +310,6 @@
if(PN) //runtime errors fixer. They were caused by PN.newload trying to access missing network in case of working on stored power.
storedpower += shieldload
PN.load += shieldload //uses powernet power.
// message_admins("[PN.load]")
// use_power(250) //uses APC power
/obj/machinery/shieldwallgen/attack_hand(mob/user)
if(!anchored)
@@ -326,21 +322,21 @@
user << "<span class='warning'>\The [src] needs to be powered by wire underneath!</span>"
return 1
if(src.active >= 1)
src.active = 0
if(active >= 1)
active = 0
icon_state = "Shield_Gen"
user.visible_message("[user] turned \the [src] off.", \
"<span class='notice'>You turn off \the [src].</span>", \
"<span class='italics'>You hear heavy droning fade out.</span>")
src.cleanup()
cleanup()
else
src.active = 1
active = 1
icon_state = "Shield_Gen +a"
user.visible_message("[user] turned \the [src] on.", \
"<span class='notice'>You turn on \the [src].</span>", \
"<span class='italics'>You hear heavy droning.</span>")
src.add_fingerprint(user)
add_fingerprint(user)
/obj/machinery/shieldwallgen/process()
power()
@@ -350,28 +346,26 @@
storedpower = maxstoredpower
if(storedpower <= 0)
storedpower = 0
// if(shieldload >= maxshieldload) //there was a loop caused by specifics of process(), so this was needed.
// shieldload = maxshieldload
if(src.active == 1)
if(active == 1)
if(!anchored)
src.active = 0
active = 0
return
setup_field(1)
setup_field(2)
setup_field(4)
setup_field(8)
src.active = 2
if(src.active >= 1)
if(src.power == 0)
src.visible_message("<span class='danger'>The [src.name] shuts down due to lack of power!</span>", \
if(active >= 1)
if(power == 0)
visible_message("<span class='danger'>The [src.name] shuts down due to lack of power!</span>", \
"<span class='italics'>You hear heavy droning fade out.</span>")
icon_state = "Shield_Gen"
src.active = 0
src.cleanup(1)
src.cleanup(2)
src.cleanup(4)
src.cleanup(8)
active = 0
cleanup(1)
cleanup(2)
cleanup(4)
cleanup(8)
/obj/machinery/shieldwallgen/proc/setup_field(NSEW = 0)
var/turf/T = src.loc
@@ -436,16 +430,16 @@
anchored = 0
return
if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
if (src.allowed(user))
src.locked = !src.locked
if(W.GetID())
if (allowed(user))
locked = !locked
user << "<span class='notice'>You [src.locked ? "lock" : "unlock"] the controls.</span>"
else
user << "<span class='danger'>Access denied.</span>"
else
add_fingerprint(user)
..()
return ..()
/obj/machinery/shieldwallgen/proc/cleanup(NSEW)
var/obj/machinery/shieldwall/F
@@ -466,15 +460,16 @@
break
/obj/machinery/shieldwallgen/Destroy()
src.cleanup(1)
src.cleanup(2)
src.cleanup(4)
src.cleanup(8)
cleanup(1)
cleanup(2)
cleanup(4)
cleanup(8)
return ..()
/obj/machinery/shieldwallgen/bullet_act(obj/item/projectile/Proj)
storedpower -= Proj.damage
..()
/obj/machinery/shieldwallgen/bullet_act(obj/item/projectile/P)
. = ..()
storedpower -= P.damage
//////////////Containment Field START
@@ -525,16 +520,15 @@
gen_secondary.storedpower -=10
/obj/machinery/shieldwall/bullet_act(obj/item/projectile/Proj)
/obj/machinery/shieldwall/bullet_act(obj/item/projectile/P)
. = ..()
if(needs_power)
var/obj/machinery/shieldwallgen/G
if(prob(50))
G = gen_primary
else
G = gen_secondary
G.storedpower -= Proj.damage
..()
return
G.storedpower -= P.damage
/obj/machinery/shieldwall/ex_act(severity, target)
+25 -23
View File
@@ -47,8 +47,7 @@
locked = L
user << "<span class='caution'>You insert the GPS device into the [name]'s slot.</span>"
else
..()
return
return ..()
/obj/machinery/computer/teleporter/attack_ai(mob/user)
src.attack_hand(user)
@@ -299,11 +298,11 @@
/obj/machinery/teleport/hub/attackby(obj/item/W, mob/user, params)
if(default_deconstruction_screwdriver(user, "tele-o", "tele0", W))
return
if(exchange_parts(user, W))
return
default_deconstruction_crowbar(W)
if(default_deconstruction_crowbar(W))
return
return ..()
/obj/machinery/teleport/hub/proc/teleport(atom/movable/M as mob|obj, turf/T)
var/obj/machinery/computer/teleporter/com = power_station.teleporter_console
@@ -405,34 +404,37 @@
return ..()
/obj/machinery/teleport/station/attackby(obj/item/weapon/W, mob/user, params)
if(istype(W, /obj/item/device/multitool) && !panel_open)
if(istype(W, /obj/item/device/multitool))
var/obj/item/device/multitool/M = W
if(M.buffer && istype(M.buffer, /obj/machinery/teleport/station) && M.buffer != src)
if(linked_stations.len < efficiency)
linked_stations.Add(M.buffer)
M.buffer = null
user << "<span class='caution'>You upload the data from the [W.name]'s buffer.</span>"
else
user << "<span class='alert'>This station can't hold more information, try to use better parts.</span>"
if(default_deconstruction_screwdriver(user, "controller-o", "controller", W))
if(panel_open)
M.buffer = src
user << "<span class='caution'>You download the data to the [W.name]'s buffer.</span>"
else
if(M.buffer && istype(M.buffer, /obj/machinery/teleport/station) && M.buffer != src)
if(linked_stations.len < efficiency)
linked_stations.Add(M.buffer)
M.buffer = null
user << "<span class='caution'>You upload the data from the [W.name]'s buffer.</span>"
else
user << "<span class='alert'>This station can't hold more information, try to use better parts.</span>"
return
else if(default_deconstruction_screwdriver(user, "controller-o", "controller", W))
update_icon()
return
if(exchange_parts(user, W))
else if(exchange_parts(user, W))
return
default_deconstruction_crowbar(W)
else if(default_deconstruction_crowbar(W))
return
if(panel_open)
if(istype(W, /obj/item/device/multitool))
var/obj/item/device/multitool/M = W
M.buffer = src
user << "<span class='caution'>You download the data to the [W.name]'s buffer.</span>"
return
if(istype(W, /obj/item/weapon/wirecutters))
else if(istype(W, /obj/item/weapon/wirecutters))
if(panel_open)
link_console_and_hub()
user << "<span class='caution'>You reconnect the station to nearby machinery.</span>"
return
else
return ..()
/obj/machinery/teleport/station/attack_paw()
src.attack_hand()
+19 -15
View File
@@ -179,9 +179,8 @@
user << "<span class='notice'>You insert [W] into [src]'s chef compartment.</span>"
else
user << "<span class='notice'>[src]'s chef compartment does not accept junk food.</span>"
return
if(istype(W, /obj/item/weapon/storage/bag/tray))
else if(istype(W, /obj/item/weapon/storage/bag/tray))
if(!compartment_access_check(user))
return
var/obj/item/weapon/storage/T = W
@@ -203,7 +202,8 @@
updateUsrDialog()
return
..()
else
return ..()
/obj/machinery/vending/snack/proc/compartment_access_check(user)
req_access_txt = chef_compartment_access
@@ -237,16 +237,20 @@
if(default_unfasten_wrench(user, W, time = 60))
return
if(component_parts && istype(W, /obj/item/weapon/crowbar))
default_deconstruction_crowbar(W)
if(component_parts)
if(default_deconstruction_crowbar(W))
return
if(istype(W, /obj/item/weapon/screwdriver) && anchored)
panel_open = !panel_open
user << "<span class='notice'>You [panel_open ? "open" : "close"] the maintenance panel.</span>"
overlays.Cut()
if(panel_open)
overlays += image(icon, "[initial(icon_state)]-panel")
updateUsrDialog()
if(istype(W, /obj/item/weapon/screwdriver))
if(anchored)
panel_open = !panel_open
user << "<span class='notice'>You [panel_open ? "open" : "close"] the maintenance panel.</span>"
overlays.Cut()
if(panel_open)
overlays += image(icon, "[initial(icon_state)]-panel")
updateUsrDialog()
else
user << "<span class='warning'>You must first secure [src].</span>"
return
else if(istype(W, /obj/item/device/multitool)||istype(W, /obj/item/weapon/wirecutters))
if(panel_open)
@@ -273,14 +277,14 @@
user << "<span class='notice'>You loaded [transfered] items in \the [name].</span>"
else
user << "<span class='notice'>The [name] is fully stocked.</span>"
return;
return
else
user << "<span class='notice'>You should probably unscrew the service panel first.</span>"
else
..()
return ..()
/obj/machinery/vending/default_deconstruction_crowbar(obj/item/O)
/obj/machinery/vending/deconstruction()
var/product_list = list(product_records, hidden_records, coin_records)
for(var/i=1, i<=3, i++)
for(var/datum/data/vending_product/machine_content in product_list[i])
@@ -122,40 +122,43 @@ Pipelines + Other Objects -> Pipe network
return
/obj/machinery/atmospherics/attackby(obj/item/weapon/W, mob/user, params)
if(can_unwrench && istype(W, /obj/item/weapon/wrench))
var/turf/T = get_turf(src)
if (level==1 && isturf(T) && T.intact)
user << "<span class='warning'>You must remove the plating first!</span>"
return 1
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
add_fingerprint(user)
if(istype(W, /obj/item/weapon/wrench))
if(can_unwrench(user))
var/turf/T = get_turf(src)
if (level==1 && isturf(T) && T.intact)
user << "<span class='warning'>You must remove the plating first!</span>"
return 1
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
add_fingerprint(user)
var/unsafe_wrenching = FALSE
var/internal_pressure = int_air.return_pressure()-env_air.return_pressure()
var/unsafe_wrenching = FALSE
var/internal_pressure = int_air.return_pressure()-env_air.return_pressure()
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user << "<span class='notice'>You begin to unfasten \the [src]...</span>"
if (internal_pressure > 2*ONE_ATMOSPHERE)
user << "<span class='warning'>As you begin unwrenching \the [src] a gush of air blows in your face... maybe you should reconsider?</span>"
unsafe_wrenching = TRUE //Oh dear oh dear
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user << "<span class='notice'>You begin to unfasten \the [src]...</span>"
if (internal_pressure > 2*ONE_ATMOSPHERE)
user << "<span class='warning'>As you begin unwrenching \the [src] a gush of air blows in your face... maybe you should reconsider?</span>"
unsafe_wrenching = TRUE //Oh dear oh dear
if (do_after(user, 20/W.toolspeed, target = src) && !qdeleted(src))
user.visible_message( \
"[user] unfastens \the [src].", \
"<span class='notice'>You unfasten \the [src].</span>", \
"<span class='italics'>You hear ratchet.</span>")
investigate_log("was <span class='warning'>REMOVED</span> by [key_name(usr)]", "atmos")
//You unwrenched a pipe full of pressure? Let's splat you into the wall, silly.
if(unsafe_wrenching)
unsafe_pressure_release(user, internal_pressure)
Deconstruct()
if (do_after(user, 20/W.toolspeed, target = src) && !qdeleted(src))
user.visible_message( \
"[user] unfastens \the [src].", \
"<span class='notice'>You unfasten \the [src].</span>", \
"<span class='italics'>You hear ratchet.</span>")
investigate_log("was <span class='warning'>REMOVED</span> by [key_name(usr)]", "atmos")
//You unwrenched a pipe full of pressure? Let's splat you into the wall, silly.
if(unsafe_wrenching)
unsafe_pressure_release(user, internal_pressure)
Deconstruct()
else
return ..()
/obj/machinery/atmospherics/proc/can_unwrench(mob/user)
return can_unwrench
// Throws the user when they unwrench a pipe with a major difference between the internal and environmental pressure.
/obj/machinery/atmospherics/proc/unsafe_pressure_release(mob/user, pressures = null)
if(!user)
@@ -166,10 +166,10 @@ Passive gate is similar to the regular pump except:
..()
update_icon()
/obj/machinery/atmospherics/components/binary/passive_gate/attackby(obj/item/weapon/W, mob/user, params)
if(!istype(W, /obj/item/weapon/wrench))
return ..()
if(on)
user << "<span class='warning'>You cannot unwrench this [src], turn it off first!</span>"
return 1
return ..()
/obj/machinery/atmospherics/components/binary/passive_gate/can_unwrench(mob/user)
if(..())
if(on)
user << "<span class='warning'>You cannot unwrench this [src], turn it off first!</span>"
else
return 1
@@ -173,11 +173,10 @@ Thus, the two variables affect pump operation are set in New():
..()
update_icon()
/obj/machinery/atmospherics/components/binary/pump/attackby(obj/item/weapon/W, mob/user, params)
if (!istype(W, /obj/item/weapon/wrench))
return ..()
if (!(stat & NOPOWER) && on)
user << "<span class='warning'>You cannot unwrench this [src], turn it off first!</span>"
return 1
return ..()
/obj/machinery/atmospherics/components/binary/pump/can_unwrench(mob/user)
if(..())
if(!(stat & NOPOWER) && on)
user << "<span class='warning'>You cannot unwrench this [src], turn it off first!</span>"
else
return 1
@@ -169,10 +169,10 @@ Thus, the two variables affect pump operation are set in New():
..()
update_icon()
/obj/machinery/atmospherics/components/binary/volume_pump/attackby(obj/item/weapon/W, mob/user, params)
if (!istype(W, /obj/item/weapon/wrench))
return ..()
if (!(stat & NOPOWER) && on)
user << "<span class='warning'>You cannot unwrench this [src], turn it off first!</span>"
return 1
return ..()
/obj/machinery/atmospherics/components/binary/volume_pump/can_unwrench(mob/user)
if(..())
if(!(stat & NOPOWER) && on)
user << "<span class='warning'>You cannot unwrench this [src], turn it off first!</span>"
else
return 1
@@ -164,17 +164,17 @@
/obj/machinery/atmospherics/components/unary/cryo_cell/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/weapon/reagent_containers/glass))
if(isrobot(user))
. = 1 //no afterattack
if(!user.drop_item())
return
if(beaker)
user << "<span class='warning'>A beaker is already loaded into [src]!</span>"
return
if(!user.drop_item())
return
beaker = I
I.loc = src
user.visible_message("[user] places [I] in [src].", \
"<span class='notice'>You place [I] in [src].</span>")
return
if(!on && !occupant && !state_open)
if(default_deconstruction_screwdriver(user, "cell-o", "cell-off", I))
return
@@ -186,6 +186,7 @@
return
if(default_deconstruction_crowbar(I))
return
return ..()
/obj/machinery/atmospherics/components/unary/cryo_cell/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
datum/tgui/master_ui = null, datum/ui_state/state = notcontained_state)
@@ -27,12 +27,12 @@
connected_device.disconnect()
return ..()
/obj/machinery/atmospherics/components/unary/portables_connector/attackby(obj/item/weapon/W, mob/user, params)
if(istype(W, /obj/item/weapon/wrench))
/obj/machinery/atmospherics/components/unary/portables_connector/can_unwrench(mob/user)
if(..())
if(connected_device)
user << "<span class='warning'>You cannot unwrench this [src], dettach [connected_device] first!</span>"
user << "<span class='warning'>You cannot unwrench this [src], detach [connected_device] first!</span>"
else
return 1
return ..()
/obj/machinery/atmospherics/components/unary/portables_connector/portableConnectorReturnAir()
return connected_device.portableConnectorReturnAir()
@@ -85,6 +85,7 @@
return
if(default_deconstruction_crowbar(I))
return
return ..()
/obj/machinery/atmospherics/components/unary/thermomachine/default_change_direction_wrench(mob/user, obj/item/weapon/wrench/W)
if(!..())
@@ -244,9 +244,6 @@
return
/obj/machinery/atmospherics/components/unary/vent_pump/attackby(obj/item/W, mob/user, params)
if (istype(W, /obj/item/weapon/wrench)&& !(stat & NOPOWER) && on)
user << "<span class='warning'>You cannot unwrench this [src], turn it off first!</span>"
return 1
if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if (WT.remove_fuel(0,user))
@@ -267,6 +264,13 @@
else
return ..()
/obj/machinery/atmospherics/components/unary/vent_pump/can_unwrench(mob/user)
if(..())
if(!(stat & NOPOWER) && on)
user << "<span class='warning'>You cannot unwrench this [src], turn it off first!</span>"
else
return 1
/obj/machinery/atmospherics/components/unary/vent_pump/examine(mob/user)
..()
if(welded)
@@ -310,12 +310,15 @@
update_icon()
pipe_vision_img = image(src, loc, layer = 20, dir = dir)
return 0
if (!istype(W, /obj/item/weapon/wrench))
else
return ..()
if (!(stat & NOPOWER) && on)
user << "<span class='warning'>You cannot unwrench this [src], turn it off first!</span>"
return 1
return ..()
/obj/machinery/atmospherics/components/unary/vent_scrubber/can_unwrench(mob/user)
if(..())
if (!(stat & NOPOWER) && on)
user << "<span class='warning'>You cannot unwrench this [src], turn it off first!</span>"
else
return 1
/obj/machinery/atmospherics/components/unary/vent_scrubber/can_crawl_through()
return !welded
@@ -149,14 +149,25 @@
/obj/machinery/portable_atmospherics/canister/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature > temperature_resistance)
health -= 5
healthcheck()
take_damage(5, BRUTE, 0)
/obj/machinery/portable_atmospherics/canister/proc/healthcheck()
/obj/machinery/portable_atmospherics/canister/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
switch(damage_type)
if(BRUTE)
if(sound_effect)
if(damage)
playsound(loc, 'sound/weapons/smash.ogg', 50, 1)
else
playsound(loc, 'sound/weapons/tap.ogg', 50, 1)
if(BURN)
if(sound_effect)
playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
else
return
if(stat & BROKEN)
return
if(health <= 10)
health = max( health - damage, 0)
if(!health)
disconnect()
var/datum/gas_mixture/expelled_gas = air_contents.remove(air_contents.total_moles())
var/turf/T = get_turf(src)
@@ -193,42 +204,33 @@
update_icon()
/obj/machinery/portable_atmospherics/canister/blob_act()
health = 0
healthcheck()
take_damage(100, BRUTE, 0)
/obj/machinery/portable_atmospherics/canister/bullet_act(obj/item/projectile/P)
if((P.damage_type == BRUTE || P.damage_type == BURN))
if(P.damage)
health -= round(P.damage / 2)
healthcheck()
..()
. = ..()
take_damage(P.damage / 2, P.damage_type, 0)
/obj/machinery/portable_atmospherics/canister/ex_act(severity, target)
switch(severity)
if(1)
if((stat & BROKEN) || prob(30))
qdel(src)
return
else
health = 0
take_damage(100, BRUTE, 0)
if(2)
if(stat & BROKEN)
qdel(src)
return
else
health -= rand(40, 100)
take_damage(rand(40, 110), BRUTE, 0)
if(3)
health -= rand(15, 40)
healthcheck()
take_damage(rand(15, 40), BRUTE, 0)
/obj/machinery/portable_atmospherics/canister/attackby(obj/item/weapon/W, mob/user, params)
if(!istype(W, /obj/item/weapon/wrench) && !istype(W, /obj/item/weapon/tank) && !istype(W, /obj/item/device/analyzer) && !istype(W, /obj/item/device/pda))
investigate_log("was smacked with \a [W] by [key_name(user)].", "atmos")
health -= W.force
add_fingerprint(user)
healthcheck()
playsound(loc, 'sound/weapons/smash.ogg', 60, 1)
..()
/obj/machinery/portable_atmospherics/canister/attacked_by(obj/item/I, mob/user)
if(I.force)
user.visible_message("<span class='danger'>[user] has hit [src] with [I]!</span>", "<span class='danger'>You hit [src] with [I]!</span>")
investigate_log("was smacked with \a [I] by [key_name(user)].", "atmos")
add_fingerprint(user)
take_damage(I.force, I.damtype, 1)
/obj/machinery/portable_atmospherics/canister/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
datum/tgui/master_ui = null, datum/ui_state/state = physical_state)
@@ -69,38 +69,40 @@
return air_contents
/obj/machinery/portable_atmospherics/attackby(obj/item/weapon/W, mob/user, params)
if(istype(W, /obj/item/weapon/tank) && !(stat & BROKEN))
var/obj/item/weapon/tank/T = W
if(holding || !user.drop_item())
return
T.loc = src
holding = T
update_icon()
else if(istype(W, /obj/item/weapon/wrench) && !(stat & BROKEN))
if(connected_port)
disconnect()
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user.visible_message( \
"[user] disconnects [src].", \
"<span class='notice'>You unfasten [src] from the port.</span>", \
"<span class='italics'>You hear a ratchet.</span>")
update_icon()
return
else
var/obj/machinery/atmospherics/components/unary/portables_connector/possible_port = locate(/obj/machinery/atmospherics/components/unary/portables_connector) in loc
if(!possible_port)
user << "<span class='notice'>Nothing happens.</span>"
if(istype(W, /obj/item/weapon/tank))
if(!(stat & BROKEN))
var/obj/item/weapon/tank/T = W
if(holding || !user.drop_item())
return
if(!connect(possible_port))
user << "<span class='notice'>[name] failed to connect to the port.</span>"
return
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user.visible_message( \
"[user] connects [src].", \
"<span class='notice'>You fasten [src] to the port.</span>", \
"<span class='italics'>You hear a ratchet.</span>")
T.loc = src
holding = T
update_icon()
else if((istype(W, /obj/item/device/analyzer)) && Adjacent(user))
else if(istype(W, /obj/item/weapon/wrench))
if(!(stat & BROKEN))
if(connected_port)
disconnect()
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user.visible_message( \
"[user] disconnects [src].", \
"<span class='notice'>You unfasten [src] from the port.</span>", \
"<span class='italics'>You hear a ratchet.</span>")
update_icon()
return
else
var/obj/machinery/atmospherics/components/unary/portables_connector/possible_port = locate(/obj/machinery/atmospherics/components/unary/portables_connector) in loc
if(!possible_port)
user << "<span class='notice'>Nothing happens.</span>"
return
if(!connect(possible_port))
user << "<span class='notice'>[name] failed to connect to the port.</span>"
return
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user.visible_message( \
"[user] connects [src].", \
"<span class='notice'>You fasten [src] to the port.</span>", \
"<span class='italics'>You hear a ratchet.</span>")
update_icon()
else if(istype(W, /obj/item/device/analyzer) && Adjacent(user))
atmosanalyzer_scan(air_contents, user)
else
..()
return ..()
@@ -170,7 +170,8 @@
if(default_unfasten_wrench(user, O))
return
default_deconstruction_crowbar(O)
if(default_deconstruction_crowbar(O))
return
var/atom/movable/what = O
if(istype(O, /obj/item/weapon/grab))
@@ -183,15 +184,17 @@
what = G.affecting
var/datum/food_processor_process/P = select_recipe(what)
if (!P)
user << "<span class='warning'>That probably won't blend!</span>"
return 1
user.visible_message("[user] put [what] into [src].", \
"You put the [what] into [src].")
user.drop_item()
what.loc = src
return
if(P)
user.visible_message("[user] put [what] into [src].", \
"You put the [what] into [src].")
user.drop_item()
what.loc = src
else
if(user.a_intent != "harm")
user << "<span class='warning'>That probably won't blend!</span>"
return 1
else
return ..()
/obj/machinery/processor/attack_hand(mob/user)
if (src.stat != 0) //NOPOWER etc
@@ -66,7 +66,9 @@
power_change()
return
default_deconstruction_crowbar(O)
if(default_deconstruction_crowbar(O))
updateUsrDialog()
return
if(stat)
return 0
@@ -81,38 +83,36 @@
updateUsrDialog()
return 1
var/loaded = 0
if(istype(O, /obj/item/weapon/storage/bag))
var/obj/item/weapon/storage/P = O
var/loaded = 0
for(var/obj/G in P.contents)
if(contents.len >= max_n_of_items)
break
if(accept_check(G))
load(G)
loaded++
else
updateUsrDialog()
if(loaded)
if(contents.len >= max_n_of_items)
user.visible_message("[user] loads \the [src] with \the [O].", \
"<span class='notice'>You fill \the [src] with \the [O].</span>")
else
user.visible_message("[user] loads \the [src] with \the [O].", \
"<span class='notice'>You load \the [src] with \the [O].</span>")
if(O.contents.len > 0)
user << "<span class='warning'>Some items are refused.</span>"
else
user << "<span class='warning'>There is nothing in [O] to put in [src]!</span>"
return 0
else if(user.a_intent != "harm")
user << "<span class='warning'>\The [src] smartly refuses [O].</span>"
updateUsrDialog()
return 0
// this is a little backwards but it avoids duplication.
// this code follows storage items and trays only.
if(loaded)
if(contents.len >= max_n_of_items)
user.visible_message("[user] loads \the [src] with \the [O].", \
"<span class='notice'>You fill \the [src] with \the [O].</span>")
else
user.visible_message("[user] loads \the [src] with \the [O].", \
"<span class='notice'>You load \the [src] with \the [O].</span>")
if(O.contents.len > 0)
user << "<span class='warning'>Some items are refused.</span>"
else
user << "<span class='warning'>There is nothing in [O] to put in [src]!</span>"
return 0
updateUsrDialog()
return 1
return ..()
+41 -31
View File
@@ -54,40 +54,59 @@
return
/obj/machinery/biogenerator/attackby(obj/item/O, mob/user, params)
if(istype(O, /obj/item/weapon/reagent_containers/glass) && !panel_open)
if(beaker)
user << "<span class='warning'>A container is already loaded into the machine.</span>"
else
user.unEquip(O)
O.loc = src
beaker = O
user << "<span class='notice'>You add the container to the machine.</span>"
updateUsrDialog()
else if(processing)
if(processing)
user << "<span class='warning'>The biogenerator is currently processing.</span>"
return
if(default_deconstruction_screwdriver(user, "biogen-empty-o", "biogen-empty", O))
if(beaker)
var/obj/item/weapon/reagent_containers/glass/B = beaker
B.loc = loc
beaker = null
update_icon()
return
if(exchange_parts(user, O))
return
if(default_deconstruction_crowbar(O))
return
if(istype(O, /obj/item/weapon/reagent_containers/glass))
if(!panel_open)
if(beaker)
user << "<span class='warning'>A container is already loaded into the machine.</span>"
else
user.unEquip(O)
O.loc = src
beaker = O
user << "<span class='notice'>You add the container to the machine.</span>"
update_icon()
updateUsrDialog()
return 1 //no afterattack
else if(istype(O, /obj/item/weapon/storage/bag/plants))
var/obj/item/weapon/storage/bag/plants/PB = O
var/i = 0
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/G in contents)
i++
if(i >= max_items)
user << "<span class='warning'>The biogenerator is already full! Activate it.</span>"
else
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/G in O.contents)
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/G in PB.contents)
if(i >= max_items)
break
G.loc = src
PB.remove_from_storage(G, src)
i++
if(i<max_items)
user << "<span class='info'>You empty the plant bag into the biogenerator.</span>"
else if(O.contents.len == 0)
else if(PB.contents.len == 0)
user << "<span class='info'>You empty the plant bag into the biogenerator, filling it to its capacity.</span>"
else
user << "<span class='info'>You fill the biogenerator to its capacity.</span>"
return 1 //no afterattack
else if(!istype(O, /obj/item/weapon/reagent_containers/food/snacks/grown))
user << "<span class='warning'>You cannot put this in [src.name]!</span>"
else
else if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/grown))
var/i = 0
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/G in contents)
i++
@@ -97,21 +116,12 @@
user.unEquip(O)
O.loc = src
user << "<span class='info'>You put [O.name] in [src.name]</span>"
return 1 //no afterattack
if(!processing)
if(default_deconstruction_screwdriver(user, "biogen-empty-o", "biogen-empty", O))
if(beaker)
var/obj/item/weapon/reagent_containers/glass/B = beaker
B.loc = loc
beaker = null
if(exchange_parts(user, O))
return
default_deconstruction_crowbar(O)
update_icon()
return
else if(user.a_intent != "harm")
user << "<span class='warning'>You cannot put this in [src.name]!</span>"
else
return ..()
/obj/machinery/biogenerator/interact(mob/user)
if(stat & BROKEN || panel_open)
+15 -21
View File
@@ -6,12 +6,16 @@
else
t_max = rand(1,4)
var/seedloc = O.loc
if(extractor)
seedloc = extractor.loc
if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/grown/))
var/obj/item/weapon/reagent_containers/food/snacks/grown/F = O
if(F.seed)
while(t_amount < t_max)
var/obj/item/seeds/t_prod = F.seed.Copy()
t_prod.loc = O.loc
t_prod.loc = seedloc
t_amount++
qdel(O)
return 1
@@ -21,19 +25,12 @@
if(F.seed)
while(t_amount < t_max)
var/obj/item/seeds/t_prod = F.seed.Copy()
t_prod.loc = O.loc
t_prod.loc = seedloc
t_amount++
qdel(O)
return 1
/*else if(istype(O, /obj/item/stack/tile/grass))
var/obj/item/stack/tile/grass/S = O
new /obj/item/seeds/grassseed(O.loc)
S.use(1)
return 1*/
else
return 0
return 0
/obj/machinery/seed_extractor
@@ -75,9 +72,7 @@
if(default_unfasten_wrench(user, O))
return
default_deconstruction_crowbar(O)
if(isrobot(user))
if(default_deconstruction_crowbar(O))
return
if (istype(O,/obj/item/weapon/storage/bag/plants))
@@ -87,7 +82,7 @@
if(contents.len >= max_seeds)
break
++loaded
add(G)
add_seed(G)
if (loaded)
user << "<span class='notice'>You put the seeds from \the [O.name] into [src].</span>"
else
@@ -98,19 +93,18 @@
user << "<span class='warning'>\The [O] is stuck to your hand, you cannot put it in the seed extractor!</span>"
return
if(O && O.loc)
O.loc = src.loc
if(seedify(O,-1))
else if(seedify(O,-1, src))
user << "<span class='notice'>You extract some seeds.</span>"
return
else if (istype(O,/obj/item/seeds))
add(O)
add_seed(O)
user << "<span class='notice'>You add [O] to [src.name].</span>"
updateUsrDialog()
return
else
else if(user.a_intent != "harm")
user << "<span class='warning'>You can't extract any seeds from \the [O.name]!</span>"
else
return ..()
/datum/seed_pile
var/name = ""
@@ -187,7 +181,7 @@
src.updateUsrDialog()
return
/obj/machinery/seed_extractor/proc/add(obj/item/seeds/O)
/obj/machinery/seed_extractor/proc/add_seed(obj/item/seeds/O)
if(contents.len >= 999)
usr << "<span class='notice'>\The [src] is full.</span>"
return 0
+13 -14
View File
@@ -93,7 +93,7 @@
if (!powered())
return
if(istype(W,/obj/item/weapon/card/id))
var/obj/item/weapon/card/id/I = usr.get_active_hand()
var/obj/item/weapon/card/id/I = user.get_active_hand()
if(istype(I) && !istype(inserted_id))
if(!user.drop_item())
return
@@ -112,12 +112,13 @@
if(default_deconstruction_screwdriver(user, "ore_redemption-open", "ore_redemption", W))
updateUsrDialog()
return
if(panel_open)
if(istype(W, /obj/item/weapon/crowbar))
empty_content()
default_deconstruction_crowbar(W)
return 1
..()
if(default_deconstruction_crowbar(W))
return
return ..()
/obj/machinery/mineral/ore_redemption/deconstruction()
empty_content()
/obj/machinery/mineral/ore_redemption/proc/SmeltMineral(obj/item/weapon/ore/O)
if(O.refined_type)
@@ -407,11 +408,9 @@
if(default_deconstruction_screwdriver(user, "mining-open", "mining", I))
updateUsrDialog()
return
if(panel_open)
if(istype(I, /obj/item/weapon/crowbar))
default_deconstruction_crowbar(I)
return 1
..()
if(default_deconstruction_crowbar(I))
return
return ..()
/obj/machinery/mineral/equipment_vendor/proc/RedeemVoucher(obj/item/weapon/mining_voucher/voucher, mob/redeemer)
var/selection = input(redeemer, "Pick your equipment", "Mining Voucher Redemption") as null|anything in list("Two Survival Capsules", "Resonator", "Mining Drone", "Advanced Scanner")
@@ -767,8 +766,8 @@
icon_state = "door_electronics"
icon = 'icons/obj/module.dmi'
/obj/item/device/mine_bot_ugprade/afterattack(mob/living/simple_animal/hostile/mining_drone/M, mob/user)
if(!istype(M))
/obj/item/device/mine_bot_ugprade/afterattack(mob/living/simple_animal/hostile/mining_drone/M, mob/user, proximity)
if(!istype(M) || !proximity)
return
upgrade_bot(M, user)
@@ -20,20 +20,29 @@ It is possible to destroy the net by the occupant or someone else.
/obj/effect/energy_net/proc/healthcheck()
/obj/effect/energy_net/proc/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
switch(damage_type)
if(BRUTE)
if(sound_effect)
playsound(src.loc, 'sound/weapons/slash.ogg', 80, 1)
if(BURN)
if(sound_effect)
playsound(src.loc, 'sound/weapons/slash.ogg', 80, 1)
else
return
health -= damage
if(health <=0)
density = 0
if(affecting)
var/mob/living/carbon/M = affecting
M.anchored = 0
for(var/mob/O in viewers(src, 3))
O.show_message("[M.name] was recovered from the energy net!", 1, "<span class='italics'>You hear a grunt.</span>", 2)
if(!isnull(master))//As long as they still exist.
master << "<span class='userdanger'>ERROR</span>: unable to initiate transport protocol. Procedure terminated."
qdel(src)
return
/obj/effect/energy_net/Destroy()
if(affecting)
var/mob/living/carbon/M = affecting
M.anchored = 0
for(var/mob/O in viewers(src, 3))
O.show_message("[M.name] was recovered from the energy net!", 1, "<span class='italics'>You hear a grunt.</span>", 2)
if(master)//As long as they still exist.
master << "<span class='userdanger'>ERROR</span>: unable to initiate transport protocol. Procedure terminated."
return ..()
/obj/effect/energy_net/process(mob/living/carbon/M)
var/check = 30//30 seconds before teleportation. Could be extended I guess.
@@ -98,53 +107,39 @@ It is possible to destroy the net by the occupant or someone else.
/obj/effect/energy_net/bullet_act(obj/item/projectile/Proj)
health -= Proj.damage
healthcheck()
..()
. = ..()
take_damage(Proj.damage, Proj.damage_type)
/obj/effect/energy_net/ex_act(severity, target)
switch(severity)
if(1)
health-=50
qdel(src)
if(2)
health-=50
qdel(src)
if(3)
health-=prob(50)?50:25
healthcheck()
return
take_damage(rand(10,25), BRUTE, 0)
/obj/effect/energy_net/blob_act()
health-=50
healthcheck()
return
qdel(src)
/obj/effect/energy_net/hitby(AM as mob|obj)
/obj/effect/energy_net/hitby(atom/movable/AM)
..()
var/tforce = 0
if(ismob(AM))
tforce = 10
else
tforce = AM:throwforce
playsound(src.loc, 'sound/weapons/slash.ogg', 80, 1)
health = max(0, health - tforce)
healthcheck()
..()
return
else if(isobj(AM))
var/obj/O = AM
tforce = O.throwforce
take_damage(tforce)
/obj/effect/energy_net/attack_hulk(mob/living/carbon/human/user)
..(user, 1)
user.visible_message("<span class='danger'>[user] rips the energy net apart!</span>", \
"<span class='notice'>You easily destroy the energy net.</span>")
health-=50
healthcheck()
qdel(src)
@@ -155,25 +150,17 @@ It is possible to destroy the net by the occupant or someone else.
/obj/effect/energy_net/attack_alien(mob/living/user)
user.do_attack_animation(src)
if (islarva(user))
return
user.changeNext_move(CLICK_CD_MELEE)
playsound(src.loc, 'sound/weapons/slash.ogg', 80, 1)
health -= rand(10, 20)
if(health > 0)
user.visible_message("<span class='danger'>[user] claws at the energy net!</span>", \
"\green You claw at the net.")
else
user.visible_message("<span class='danger'>[user] slices the energy net apart!</span>", \
user.visible_message("<span class='danger'>[user] slices the energy net apart!</span>", \
"\green You slice the energy net to pieces.")
healthcheck()
return
qdel(src)
/obj/effect/energy_net/attackby(obj/item/weapon/W, mob/user, params)
var/aforce = W.force
health = max(0, health - aforce)
healthcheck()
/obj/effect/energy_net/attacked_by(obj/item/weapon/W, mob/user)
..()
return
take_damage(W.force, W.damtype)
+11 -11
View File
@@ -78,19 +78,19 @@
add_fingerprint(user)
/obj/item/weapon/paper_bin/attackby(obj/item/weapon/paper/i, mob/user, params)
if(!istype(i))
/obj/item/weapon/paper_bin/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/weapon/paper))
var/obj/item/weapon/paper/P = I
if(!user.unEquip(P))
return
P.loc = src
user << "<span class='notice'>You put [P] in [src].</span>"
papers.Add(P)
amount++
update_icon()
else
return ..()
if(!user.unEquip(i))
return
i.loc = src
user << "<span class='notice'>You put [i] in [src].</span>"
papers.Add(i)
amount++
update_icon()
/obj/item/weapon/paper_bin/examine(mob/user)
..()
if(amount)
+21 -12
View File
@@ -127,9 +127,10 @@
/obj/machinery/power/am_control_unit/bullet_act(obj/item/projectile/Proj)
. = ..()
if(Proj.flag != "bullet")
stability -= Proj.force
return 0
check_stability()
/obj/machinery/power/am_control_unit/power_change()
@@ -158,15 +159,14 @@
else if(!linked_shielding.len > 0)
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
user.visible_message("[user.name] unsecures the [src.name].", \
"Y<span class='notice'>You remove the anchor bolts.</span>", \
"<span class='notice'>You remove the anchor bolts.</span>", \
"<span class='italics'>You hear a ratchet.</span>")
src.anchored = 0
disconnect_from_network()
else
user << "<span class='warning'>Once bolted and linked to a shielding unit it the [src.name] is unable to be moved!</span>"
return
if(istype(W, /obj/item/weapon/am_containment))
else if(istype(W, /obj/item/weapon/am_containment))
if(fueljar)
user << "<span class='warning'>There is already a [fueljar] inside!</span>"
return
@@ -179,20 +179,29 @@
user.visible_message("[user.name] loads an [W.name] into the [src.name].", \
"<span class='notice'>You load an [W.name].</span>", \
"<span class='italics'>You hear a thunk.</span>")
return
else
return ..()
if(W.force >= 20)
stability -= W.force/2
/obj/machinery/power/am_control_unit/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
switch(damage_type)
if(BRUTE)
if(sound_effect)
if(damage)
playsound(loc, 'sound/weapons/smash.ogg', 50, 1)
else
playsound(loc, 'sound/weapons/tap.ogg', 50, 1)
if(BURN)
if(sound_effect)
playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
else
return
if(damage >= 20)
stability -= damage/2
check_stability()
..()
/obj/machinery/power/am_control_unit/attack_hand(mob/user)
if(anchored)
interact(user)
return
/obj/machinery/power/am_control_unit/proc/add_shielding(obj/machinery/am_shielding/AMS, AMS_linking = 0)
if(!istype(AMS))
+19 -8
View File
@@ -112,9 +112,10 @@
/obj/machinery/am_shielding/bullet_act(obj/item/projectile/Proj)
. = ..()
if(Proj.flag != "bullet")
stability -= Proj.force/2
return 0
check_stability()
/obj/machinery/am_shielding/update_icon()
@@ -132,11 +133,22 @@
shutdown_core()
/obj/machinery/am_shielding/attackby(obj/item/W, mob/user, params)
if(W.force > 10)
stability -= W.force/2
/obj/machinery/am_shielding/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
switch(damage_type)
if(BRUTE)
if(sound_effect)
if(damage)
playsound(loc, 'sound/weapons/smash.ogg', 50, 1)
else
playsound(loc, 'sound/weapons/tap.ogg', 50, 1)
if(BURN)
if(sound_effect)
playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
else
return
if(damage >= 10)
stability -= damage/2
check_stability()
..()
//Call this to link a detected shilding unit to the controller
@@ -219,6 +231,5 @@
if(istype(I, /obj/item/device/multitool) && istype(src.loc,/turf))
new/obj/machinery/am_shielding(src.loc)
qdel(src)
return
..()
return
else
return ..()
+61 -70
View File
@@ -114,7 +114,7 @@
transfer_fingerprints_to(newlight)
qdel(src)
return
..()
return ..()
/obj/machinery/light_construct/small
@@ -148,6 +148,7 @@
// this is used to calc the probability the light burns out
var/rigged = 0 // true if rigged to explode
var/health = 20
// the smaller bulb light fixture
@@ -158,6 +159,7 @@
brightness = 4
desc = "A small lighting fixture."
light_type = /obj/item/weapon/light/bulb
health = 15
/obj/machinery/light/Move()
@@ -276,16 +278,12 @@
//Light replacer code
if(istype(W, /obj/item/device/lightreplacer))
var/obj/item/device/lightreplacer/LR = W
if(isliving(user))
var/mob/living/U = user
LR.ReplaceLight(src, U)
return
LR.ReplaceLight(src, user)
// attempt to insert light
if(istype(W, /obj/item/weapon/light))
else if(istype(W, /obj/item/weapon/light))
if(status != LIGHT_EMPTY)
user << "<span class='warning'>There is a [fitting] already inserted!</span>"
return
else
src.add_fingerprint(user)
var/obj/item/weapon/light/L = W
@@ -306,28 +304,6 @@
explode()
else
user << "<span class='warning'>This type of light requires a [fitting]!</span>"
return
// attempt to break the light
//If xenos decide they want to smash a light bulb with a toolbox, who am I to stop them? /N
else if(status != LIGHT_BROKEN && status != LIGHT_EMPTY)
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src)
if(W.damtype == STAMINA)
return
if(prob(1+W.force * 5))
user.visible_message("<span class='danger'>[user.name] smashed the light!</span>", \
"<span class='danger'>You hit the light, and it smashes!</span>", \
"<span class='italics'>You hear a tinkle of breaking glass.</span>")
if(on && (W.flags & CONDUCT))
if (prob(12))
electrocute_mob(user, get_area(src), src, 0.3)
broken()
else
user.visible_message("<span class='danger'>[user.name] hits the light!</span>")
// attempt to stick weapon into light socket
else if(status == LIGHT_EMPTY)
@@ -348,15 +324,43 @@
newlight.stage = 2
transfer_fingerprints_to(newlight)
qdel(src)
return
else
user << "<span class='userdanger'>You stick \the [W] into the light socket!</span>"
if(has_power() && (W.flags & CONDUCT))
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(3, 1, src)
s.start()
if (prob(75))
electrocute_mob(user, get_area(src), src, rand(0.7,1.0))
else
return ..()
user << "<span class='userdanger'>You stick \the [W] into the light socket!</span>"
if(has_power() && (W.flags & CONDUCT))
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(3, 1, src)
s.start()
if (prob(75))
electrocute_mob(user, get_area(src), src, rand(0.7,1.0))
/obj/machinery/light/attacked_by(obj/item/I, mob/living/user)
..()
if(status == LIGHT_BROKEN || status == LIGHT_EMPTY)
if(on && (I.flags & CONDUCT))
if(prob(12))
electrocute_mob(user, get_area(src), src, 0.3)
/obj/machinery/light/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
switch(damage_type)
if(BRUTE)
if(sound_effect)
switch(status)
if(LIGHT_EMPTY)
playsound(loc, 'sound/weapons/smash.ogg', 50, 1)
if(LIGHT_BROKEN)
playsound(loc, 'sound/effects/hit_on_shattered_glass.ogg', 90, 1)
else
playsound(loc, 'sound/effects/Glasshit.ogg', 90, 1)
if(BURN)
if(sound_effect)
playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
else
return
health -= damage
if(health <= 0)
broken()
// returns whether this light has power
@@ -385,28 +389,20 @@
src.flicker(1)
return
// Aliens smash the bulb but do not get electrocuted./N
/obj/machinery/light/attack_alien(mob/living/carbon/alien/humanoid/user)//So larva don't go breaking light bulbs.
if(status == LIGHT_EMPTY||status == LIGHT_BROKEN)
user << "\green That object is useless to you."
return
else if (status == LIGHT_OK||status == LIGHT_BURNED)
user.do_attack_animation(src)
visible_message("<span class='danger'>[user.name] smashed the light!</span>", "<span class='italics'>You hear a tinkle of breaking glass.</span>")
broken()
return
/obj/machinery/light/bullet_act(obj/item/projectile/P)
. = ..()
take_damage(P.damage, P.damage_type, 0)
/obj/machinery/light/hitby(AM as mob|obj)
..()
var/tforce = 0
if(ismob(AM))
tforce = 40
else if(isobj(AM))
var/obj/item/I = AM
tforce = I.throwforce
take_damage(tforce)
/obj/machinery/light/attack_animal(mob/living/simple_animal/M)
if(M.melee_damage_upper == 0)
return
if(status == LIGHT_EMPTY||status == LIGHT_BROKEN)
M << "<span class='danger'>That object is useless to you.</span>"
return
else if (status == LIGHT_OK||status == LIGHT_BURNED)
M.do_attack_animation(src)
visible_message("<span class='danger'>[M.name] smashed the light!</span>", "<span class='italics'>You hear a tinkle of breaking glass.</span>")
broken()
return
// attack with hand - remove tube/bulb
// if hands aren't protected and the light is on, burn the player
@@ -584,8 +580,8 @@
brightness = 4
/obj/item/weapon/light/throw_impact(atom/hit_atom)
..()
shatter()
if(!..()) //not caught by a mob
shatter()
// update the icon state and description of the light
@@ -625,17 +621,12 @@
..()
return
// called after an attack with a light item
// shatter light, unless it was an attempt to put it in a light socket
// now only shatter if the intent was harm
/obj/item/weapon/light/afterattack(atom/target, mob/user,proximity)
if(!proximity) return
if(istype(target, /obj/machinery/light))
return
if(user.a_intent != "harm")
return
/obj/item/weapon/light/attack(mob/living/M, mob/living/user, def_zone)
..()
shatter()
/obj/item/weapon/light/attack_obj(obj/O, mob/living/user)
..()
shatter()
/obj/item/weapon/light/proc/shatter()
+23 -25
View File
@@ -10,7 +10,7 @@ var/global/list/rad_collectors = list()
density = 1
req_access = list(access_engine_equip)
// use_power = 0
var/obj/item/weapon/tank/internals/plasma/P = null
var/obj/item/weapon/tank/internals/plasma/loaded_tank = null
var/last_power = 0
var/active = 0
var/locked = 0
@@ -25,13 +25,13 @@ var/global/list/rad_collectors = list()
return ..()
/obj/machinery/power/rad_collector/process()
if(P)
if(!P.air_contents.gases["plasma"])
if(loaded_tank)
if(!loaded_tank.air_contents.gases["plasma"])
investigate_log("<font color='red'>out of fuel</font>.","singulo")
eject()
else
P.air_contents.gases["plasma"][MOLES] -= 0.001*drainratio
P.air_contents.garbage_collect()
loaded_tank.air_contents.gases["plasma"][MOLES] -= 0.001*drainratio
loaded_tank.air_contents.garbage_collect()
return
@@ -43,7 +43,7 @@ var/global/list/rad_collectors = list()
toggle_power()
user.visible_message("[user.name] turns the [src.name] [active? "on":"off"].", \
"<span class='notice'>You turn the [src.name] [active? "on":"off"].</span>")
investigate_log("turned [active?"<font color='green'>on</font>":"<font color='red'>off</font>"] by [user.key]. [P?"Fuel: [round(P.air_contents.gases["plasma"][MOLES]/0.29)]%":"<font color='red'>It is empty</font>"].","singulo")
investigate_log("turned [active?"<font color='green'>on</font>":"<font color='red'>off</font>"] by [user.key]. [loaded_tank?"Fuel: [round(loaded_tank.air_contents.gases["plasma"][MOLES]/0.29)]%":"<font color='red'>It is empty</font>"].","singulo")
return
else
user << "<span class='warning'>The controls are locked!</span>"
@@ -55,26 +55,26 @@ var/global/list/rad_collectors = list()
if(istype(W, /obj/item/device/multitool))
user << "<span class='notice'>The [W.name] detects that [last_power]W were recently produced.</span>"
return 1
else if(istype(W, /obj/item/device/analyzer) && P)
atmosanalyzer_scan(P.air_contents, user)
else if(istype(W, /obj/item/device/analyzer) && loaded_tank)
atmosanalyzer_scan(loaded_tank.air_contents, user)
else if(istype(W, /obj/item/weapon/tank/internals/plasma))
if(!src.anchored)
if(!anchored)
user << "<span class='warning'>The [src] needs to be secured to the floor first!</span>"
return 1
if(src.P)
if(loaded_tank)
user << "<span class='warning'>There's already a plasma tank loaded!</span>"
return 1
if(!user.drop_item())
return 1
src.P = W
loaded_tank = W
W.loc = src
update_icons()
else if(istype(W, /obj/item/weapon/crowbar))
if(P && !src.locked)
if(loaded_tank && !src.locked)
eject()
return 1
else if(istype(W, /obj/item/weapon/wrench))
if(P)
if(loaded_tank)
user << "<span class='warning'>Remove the plasma tank first!</span>"
return 1
if(!anchored && !isinspace())
@@ -91,20 +91,18 @@ var/global/list/rad_collectors = list()
"<span class='notice'>You unsecure the external bolts.</span>", \
"<span class='italics'>You hear a ratchet.</span>")
disconnect_from_network()
else if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
if (src.allowed(user))
else if(W.GetID())
if(allowed(user))
if(active)
src.locked = !src.locked
user << "<span class='notice'>You [src.locked ? "lock" : "unlock"] the controls.</span>"
locked = !locked
user << "<span class='notice'>You [locked ? "lock" : "unlock"] the controls.</span>"
else
src.locked = 0 //just in case it somehow gets locked
user << "<span class='warning'>The controls can only be locked when \the [src] is active!</span>"
else
user << "<span class='danger'>Access denied.</span>"
return 1
else
..()
return 1
return ..()
/obj/machinery/power/rad_collector/ex_act(severity, target)
@@ -116,20 +114,20 @@ var/global/list/rad_collectors = list()
/obj/machinery/power/rad_collector/proc/eject()
locked = 0
var/obj/item/weapon/tank/internals/plasma/Z = src.P
var/obj/item/weapon/tank/internals/plasma/Z = src.loaded_tank
if (!Z)
return
Z.loc = get_turf(src)
Z.layer = initial(Z.layer)
src.P = null
src.loaded_tank = null
if(active)
toggle_power()
else
update_icons()
/obj/machinery/power/rad_collector/proc/receive_pulse(pulse_strength)
if(P && active)
var/power_produced = P.air_contents.gases["plasma"] ? P.air_contents.gases["plasma"][MOLES] : 0
if(loaded_tank && active)
var/power_produced = loaded_tank.air_contents.gases["plasma"] ? loaded_tank.air_contents.gases["plasma"][MOLES] : 0
power_produced *= pulse_strength*20
add_avail(power_produced)
last_power = power_produced
@@ -139,7 +137,7 @@ var/global/list/rad_collectors = list()
/obj/machinery/power/rad_collector/proc/update_icons()
overlays.Cut()
if(P)
if(loaded_tank)
overlays += image('icons/obj/singularity.dmi', "ptank")
if(stat & (NOPOWER|BROKEN))
return
+69 -27
View File
@@ -12,7 +12,7 @@
idle_power_usage = 0
active_power_usage = 0
var/id = 0
var/health = 10
var/health = 20
var/obscured = 0
var/sunfrac = 0
var/adir = SOUTH // actual dir
@@ -66,24 +66,46 @@
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
user.visible_message("[user] takes the glass off the solar panel.", "<span class='notice'>You take the glass off the solar panel.</span>")
qdel(src)
return
else if (W)
src.add_fingerprint(user)
src.health -= W.force
src.healthcheck()
else
return ..()
/obj/machinery/power/solar/bullet_act(obj/item/projectile/P)
. = ..()
take_damage(P.damage, P.damage_type)
/obj/machinery/power/solar/hitby(AM as mob|obj)
..()
var/tforce = 0
if(ismob(AM))
tforce = 20
else if(isobj(AM))
var/obj/item/I = AM
tforce = I.throwforce
take_damage(tforce)
/obj/machinery/power/solar/proc/healthcheck()
if (src.health <= 0)
if(!(stat & BROKEN))
set_broken()
/obj/machinery/power/solar/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
switch(damage_type)
if(BRUTE)
if(sound_effect)
if(stat & BROKEN)
playsound(loc, 'sound/effects/hit_on_shattered_glass.ogg', 60, 1)
else
playsound(loc, 'sound/effects/Glasshit.ogg', 90, 1)
if(BURN)
if(sound_effect)
playsound(loc, 'sound/items/Welder.ogg', 100, 1)
else
new /obj/item/weapon/shard(src.loc)
new /obj/item/weapon/shard(src.loc)
qdel(src)
return
return
health -= damage
if(health <= 0)
playsound(src, "shatter", 70, 1)
new /obj/item/weapon/shard(src.loc)
new /obj/item/weapon/shard(src.loc)
qdel(src)
else if(health <= 10)
if(!(stat & BROKEN))
playsound(loc, 'sound/effects/Glassbr3.ogg', 100, 1)
set_broken()
/obj/machinery/power/solar/update_icon()
..()
@@ -132,7 +154,6 @@
stat |= BROKEN
unset_control()
update_icon()
return
/obj/machinery/power/solar/ex_act(severity, target)
@@ -140,11 +161,9 @@
if(!qdeleted(src))
switch(severity)
if(2)
if(prob(50))
set_broken()
take_damage(rand(10,20), BRUTE, 0)
if(3)
if(prob(25))
set_broken()
take_damage(rand(5,15), BRUTE, 0)
/obj/machinery/power/solar/fake/New(var/turf/loc, var/obj/item/solar_assembly/S)
..(loc, S, 0)
@@ -255,7 +274,7 @@
tracker = 0
user.visible_message("[user] takes out the electronics from the solar assembly.", "<span class='notice'>You take out the electronics from the solar assembly.</span>")
return 1
..()
return ..()
//
// Solar Control Computer
@@ -270,6 +289,7 @@
density = 1
use_power = 1
idle_power_usage = 250
var/health = 25
var/icon_screen = "solar"
var/icon_keyboard = "power_key"
var/id = 0
@@ -443,9 +463,33 @@
A.icon_state = "4"
A.anchored = 1
qdel(src)
else
else if(user.a_intent != "harm" && !(I.flags & NOBLUDGEON))
src.attack_hand(user)
return
else
return ..()
/obj/machinery/power/solar_control/bullet_act(obj/item/projectile/P)
. = ..()
take_damage(P.damage, P.damage_type)
/obj/machinery/power/solar_control/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
switch(damage_type)
if(BRUTE)
if(sound_effect)
if(stat & BROKEN)
playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)
else
playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1)
if(BURN)
if(sound_effect)
playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
else
return
health -= damage
if(health <= 0 && !(stat & BROKEN))
playsound(loc, 'sound/effects/Glassbr3.ogg', 100, 1)
stat |= BROKEN
update_icon()
/obj/machinery/power/solar_control/process()
lastgen = gen
@@ -489,11 +533,9 @@
if(!qdeleted(src))
switch(severity)
if(2)
if(prob(50))
set_broken()
take_damage(rand(20,30), BRUTE, 0)
if(3)
if(prob(25))
set_broken()
take_damage(rand(10,20), BRUTE, 0)
/obj/machinery/power/solar_control/blob_act()
if (prob(75))
@@ -147,28 +147,28 @@
if(default_unfasten_wrench(user, I))
return
if(isrobot(user))
return
if(istype(I, /obj/item/weapon/reagent_containers) && (I.flags & OPENCONTAINER))
var/obj/item/weapon/reagent_containers/B = I
. = 1 //no afterattack
if(beaker)
user << "<span class='warning'>A container is already loaded into the machine!</span>"
return
var/obj/item/weapon/reagent_containers/B = I // Get a beaker from it?
if(!istype(B))
return // Not a beaker?
if(!user.drop_item()) // Can't let go?
return
if(beaker)
user << "<span class='warning'>A beaker is already loaded into the machine!</span>"
return
beaker = B
beaker.loc = src
user << "<span class='notice'>You add \the [B] to the machine.</span>"
if(!user.drop_item()) // Can't let go?
return
beaker = B
beaker.loc = src
user << "<span class='notice'>You add the beaker to the machine.</span>"
if(!icon_beaker)
icon_beaker = image('icons/obj/chemical.dmi', src, "disp_beaker") //randomize beaker overlay position.
icon_beaker.pixel_x = rand(-10,5)
overlays += icon_beaker
if(!icon_beaker)
icon_beaker = image('icons/obj/chemical.dmi', src, "disp_beaker") //randomize beaker overlay position.
icon_beaker.pixel_x = rand(-10,5)
overlays += icon_beaker
else if(user.a_intent != "harm")
user << "<span class='warning'>You can't load \the [I] into the machine!</span>"
else
return ..()
/obj/machinery/chem_dispenser/constructable
name = "portable chem dispenser"
@@ -252,7 +252,7 @@
dispensable_reagents |= dispensable_reagent_tiers[i]
dispensable_reagents = sortList(dispensable_reagents)
/obj/machinery/chem_dispenser/constructable/attackby(var/obj/item/I, var/mob/user, params)
/obj/machinery/chem_dispenser/constructable/attackby(obj/item/I, mob/user, params)
..()
if(default_deconstruction_screwdriver(user, "minidispenser-o", "minidispenser", I))
return
@@ -260,13 +260,14 @@
if(exchange_parts(user, I))
return
if(panel_open)
if(istype(I, /obj/item/weapon/crowbar))
if(beaker)
beaker.loc = loc
beaker = null
default_deconstruction_crowbar(I)
return 1
if(default_deconstruction_crowbar(I))
return
return ..()
/obj/machinery/chem_dispenser/constructable/deconstruction()
if(beaker)
beaker.loc = loc
beaker = null
/obj/machinery/chem_dispenser/drinks
name = "soda dispenser"
@@ -296,20 +297,6 @@
"lemonjuice"
)
/obj/machinery/chem_dispenser/drinks/attackby(obj/item/I, mob/user)
if(default_unfasten_wrench(user, I))
return
if(istype(I, /obj/item/weapon/reagent_containers) && (I.flags & OPENCONTAINER))
if (beaker)
return 1
else
if(!user.drop_item())
return 1
src.beaker = I
beaker.loc = src
update_icon()
return
/obj/machinery/chem_dispenser/drinks/beer
name = "booze dispenser"
@@ -39,10 +39,17 @@
beaker.reagents.handle_reactions()
/obj/machinery/chem_heater/attackby(obj/item/I, mob/user, params)
if(isrobot(user))
if(default_deconstruction_screwdriver(user, "mixer0b", "mixer0b", I))
return
if(exchange_parts(user, I))
return
if(default_deconstruction_crowbar(I))
return
if(istype(I, /obj/item/weapon/reagent_containers) && (I.flags & OPENCONTAINER))
. = 1 //no afterattack
if(beaker)
user << "<span class='warning'>A beaker is already loaded into the machine!</span>"
return
@@ -53,18 +60,11 @@
I.loc = src
user << "<span class='notice'>You add the beaker to the machine.</span>"
icon_state = "mixer1b"
if(default_deconstruction_screwdriver(user, "mixer0b", "mixer0b", I))
return
return ..()
if(exchange_parts(user, I))
return
if(panel_open)
if(istype(I, /obj/item/weapon/crowbar))
eject_beaker()
default_deconstruction_crowbar(I)
return 1
/obj/machinery/chem_heater/deconstruction()
eject_beaker()
/obj/machinery/chem_heater/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
datum/tgui/master_ui = null, datum/ui_state/state = default_state)
@@ -37,10 +37,12 @@
return
if(istype(I, /obj/item/weapon/reagent_containers) && (I.flags & OPENCONTAINER))
if(isrobot(user))
. = 1 // no afterattack
if(panel_open)
user << "<span class='warning'>You can't use the [src.name] while its panel is opened!</span>"
return
if(beaker)
user << "<span class='warning'>A beaker is already loaded into the machine!</span>"
user << "<span class='warning'>A container is already loaded in the machine!</span>"
return
if(!user.drop_item())
return
@@ -62,8 +64,8 @@
bottle.loc = src
user << "<span class='notice'>You add the pill bottle into the dispenser slot.</span>"
src.updateUsrDialog()
return
else
return ..()
/obj/machinery/chem_master/Topic(href, href_list)
if(..())
@@ -341,7 +343,6 @@
component_parts += new /obj/item/weapon/reagent_containers/glass/beaker(null)
/obj/machinery/chem_master/constructable/attackby(obj/item/B, mob/user, params)
if(default_deconstruction_screwdriver(user, "mixer0_nopower", "mixer0", B))
if(beaker)
beaker.loc = src.loc
@@ -352,40 +353,9 @@
bottle = null
return
if(exchange_parts(user, B))
else if(exchange_parts(user, B))
return
if(panel_open)
if(istype(B, /obj/item/weapon/crowbar))
default_deconstruction_crowbar(B)
return 1
else
user << "<span class='warning'>You can't use the [src.name] while it's panel is opened!</span>"
return 1
if(istype(B, /obj/item/weapon/reagent_containers) && (B.flags & OPENCONTAINER))
if(beaker)
user << "<span class='warning'>A beaker is already loaded into the machine!</span>"
return
if(!user.drop_item())
return
beaker = B
beaker.loc = src
user << "<span class='notice'>You add the beaker to the machine.</span>"
src.updateUsrDialog()
icon_state = "mixer1"
else if(!condi && istype(B, /obj/item/weapon/storage/pill_bottle))
if(bottle)
user << "<span class='warning'>A pill bottle is already loaded into the machine!</span>"
return
if(!user.drop_item())
return
src.bottle = B
B.loc = src
user << "<span class='notice'>You add the pill bottle into the dispenser slot.</span>"
src.updateUsrDialog()
return
else if(default_deconstruction_crowbar(B))
return
else
return ..()
+8 -11
View File
@@ -122,22 +122,19 @@
transfer_fingerprints_to(C)
user << "<span class='notice'>You remove the conveyor belt.</span>"
qdel(src)
return
if(istype(I, /obj/item/weapon/wrench))
else if(istype(I, /obj/item/weapon/wrench))
if(!(stat & BROKEN))
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
dir = turn(dir,-45)
update_move_direction()
user << "<span class='notice'>You rotate [src].</span>"
return
if(isrobot(user))
return //Carn: fix for borgs dropping their modules on conveyor belts
if(!user.drop_item())
user << "<span class='warning'>\The [I] is stuck to your hand, you cannot place it on the conveyor!</span>"
return
if(I && I.loc)
I.loc = src.loc
return
else if(user.a_intent != "harm")
if(user.drop_item())
I.loc = src.loc
else
return ..()
// attack with hand, move pulled object onto conveyor
/obj/machinery/conveyor/attack_hand(mob/user)
@@ -27,7 +27,7 @@
dir = direction
// update iconstate and dpdir due to dir and type
/obj/structure/disposalconstruct/proc/update()
/obj/structure/disposalconstruct/update_icon()
var/flip = turn(dir, 180)
var/left = turn(dir, 90)
var/right = turn(dir, -90)
@@ -87,7 +87,7 @@
// change visibility status and force update of icon
/obj/structure/disposalconstruct/hide(var/intact)
invisibility = (intact && level==1) ? 101: 0 // hide if floor is intact
update()
update_icon()
// flip and rotate verbs
@@ -104,7 +104,7 @@
return
dir = turn(dir, -90)
update()
update_icon()
/obj/structure/disposalconstruct/AltClick(mob/user)
..()
@@ -138,7 +138,7 @@
if(DISP_SORTJUNCTION_FLIP)
ptype = DISP_SORTJUNCTION
update()
update_icon()
// returns the type path of disposalpipe corresponding to this item dtype
/obj/structure/disposalconstruct/proc/dpipetype()
@@ -210,7 +210,7 @@
return
else
if(CP)
update()
update_icon()
var/pdir = CP.dpdir
if(istype(CP, /obj/structure/disposalpipe/broken))
pdir = CP.dir
@@ -223,7 +223,7 @@
density = 0
user << "<span class='notice'>You attach the [nicetype] to the underfloor.</span>"
playsound(loc, 'sound/items/Ratchet.ogg', 100, 1)
update()
update_icon()
else if(istype(I, /obj/item/weapon/weldingtool))
if(anchored)
@@ -235,7 +235,7 @@
if(!loc || !W.isOn())
return
user << "<span class='notice'>The [nicetype] has been welded in place.</span>"
update() // TODO: Make this neat
update_icon() // TODO: Make this neat
if(ispipe)
var/pipetype = dpipetype()
+28 -66
View File
@@ -358,24 +358,27 @@
//weldingtool: unfasten and convert to obj/disposalconstruct
/obj/structure/disposalpipe/attackby(obj/item/I, mob/user, params)
var/turf/T = src.loc
if(T.intact)
return // prevent interaction with T-scanner revealed pipes
src.add_fingerprint(user)
add_fingerprint(user)
if(istype(I, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/W = I
if(can_be_deconstructed(user))
if(W.remove_fuel(0,user))
playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1)
user << "<span class='notice'>You start slicing the disposal pipe...</span>"
// check if anything changed over 2 seconds
if(do_after(user,30, target = src))
if(!src || !W.isOn()) return
Deconstruct()
user << "<span class='notice'>You slice the disposal pipe.</span>"
else
return ..()
if(W.remove_fuel(0,user))
playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1)
user << "<span class='notice'>You start slicing the disposal pipe...</span>"
// check if anything changed over 2 seconds
if(do_after(user,30, target = src))
if(!src || !W.isOn()) return
Deconstruct()
user << "<span class='notice'>You slice the disposal pipe.</span>"
else
return
//checks if something is blocking the deconstruction (e.g. trunk with a bin still linked to it)
/obj/structure/disposalpipe/proc/can_be_deconstructed()
. = 1
// called when pipe is cut with welder
/obj/structure/disposalpipe/Deconstruct()
@@ -386,7 +389,7 @@
stored.dir = dir
stored.density = 0
stored.anchored = 1
stored.update()
stored.update_icon()
..()
/obj/structure/disposalpipe/singularity_pull(S, current_size)
@@ -514,9 +517,6 @@
return
/obj/structure/disposalpipe/sortjunction/attackby(obj/item/I, mob/user, params)
if(..())
return
if(istype(I, /obj/item/device/destTagger))
var/obj/item/device/destTagger/O = I
@@ -528,6 +528,8 @@
sortTypes |= O.currTag
user << "<span class='notice'>Added \"[TAGGERLOCATIONS[O.currTag]]\" filter.</span>"
playsound(src.loc, 'sound/machines/twobeep.ogg', 100, 1)
else
return ..()
// next direction to move
@@ -635,47 +637,11 @@
update()
return
// Override attackby so we disallow trunkremoval when somethings ontop
/obj/structure/disposalpipe/trunk/attackby(obj/item/I, mob/user, params)
//Disposal bins or chutes
/*
These shouldn't be required
var/obj/machinery/disposal/D = locate() in src.loc
if(D && D.anchored)
return
//Disposal outlet
var/obj/structure/disposaloutlet/O = locate() in src.loc
if(O && O.anchored)
return
*/
//Disposal constructors
var/obj/structure/disposalconstruct/C = locate() in src.loc
if(C && C.anchored)
return
var/turf/T = src.loc
if(T.intact)
return // prevent interaction with T-scanner revealed pipes
src.add_fingerprint(user)
if(istype(I, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/W = I
if(linked)
user << "<span class='warning'>You need to deconstruct disposal machinery above this pipe!</span>"
return
if(W.remove_fuel(0,user))
playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1)
user << "<span class='notice'>You start slicing the disposal pipe...</span>"
if(do_after(user,30/I.toolspeed, target = src))
if(!src || !W.isOn()) return
Deconstruct()
user << "<span class='notice'>You slice the disposal pipe.</span>"
else
return
/obj/structure/disposalpipe/trunk/can_be_deconstructed(mob/user)
if(linked)
user << "<span class='warning'>You need to deconstruct disposal machinery above this pipe!</span>"
else
. = 1
// would transfer to next pipe segment, but we are in a trunk
// if not entering from disposal bin,
@@ -781,20 +747,17 @@
return
/obj/structure/disposaloutlet/attackby(obj/item/I, mob/user, params)
if(!I || !user)
return
src.add_fingerprint(user)
add_fingerprint(user)
if(istype(I, /obj/item/weapon/screwdriver))
if(mode==0)
mode=1
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
user << "<span class='notice'>You remove the screws around the power connection.</span>"
return
else if(mode==1)
mode=0
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
user << "<span class='notice'>You attach the screws around the power connection.</span>"
return
else if(istype(I,/obj/item/weapon/weldingtool) && mode==1)
var/obj/item/weapon/weldingtool/W = I
if(W.remove_fuel(0,user))
@@ -805,13 +768,12 @@
user << "<span class='notice'>You slice the floorweld off \the [src].</span>"
stored.loc = loc
src.transfer_fingerprints_to(stored)
stored.update()
stored.update_icon()
stored.anchored = 0
stored.density = 1
qdel(src)
return
else
return
else
return ..()
+43 -38
View File
@@ -34,7 +34,7 @@
air_contents = new/datum/gas_mixture()
//gas.volume = 1.05 * CELLSTANDARD
update()
update_icon()
/obj/machinery/disposal/proc/trunk_check()
trunk = locate() in src.loc
@@ -66,11 +66,8 @@
trunk_check()
/obj/machinery/disposal/attackby(obj/item/I, mob/user, params)
if(stat & BROKEN || !I || !user)
return
add_fingerprint(user)
if(mode<=0) // It's off
if(mode<=0)
if(istype(I, /obj/item/weapon/screwdriver))
if(contents.len > 0)
user << "<span class='notice'>Eject the items first!</span>"
@@ -96,7 +93,21 @@
user << "<span class='notice'>You slice the floorweld off \the [src].</span>"
Deconstruct()
return
return 1
if(user.a_intent != "harm")
if(!user.drop_item() || (I.flags & ABSTRACT))
return
place_item_in_disposal(I, user)
update_icon()
return 1 //no afterattack
else
return ..()
/obj/machinery/disposal/proc/place_item_in_disposal(obj/item/I, mob/user)
I.loc = src
user.visible_message("[user.name] places \the [I] into \the [src].", \
"<span class='notice'>You place \the [I] into \the [src].</span>")
// mouse drop another mob or self
@@ -133,7 +144,7 @@
"<span class='userdanger'>[user] has placed [target] in [src].</span>")
add_logs(user, target, "stuffed", addition="into [src]")
target.LAssailant = user
update()
update_icon()
// can breath normally in the disposal
/obj/machinery/disposal/alter_health()
@@ -157,7 +168,7 @@
user.loc = src.loc
user.reset_perspective(null)
update()
update_icon()
return
@@ -166,7 +177,7 @@
if(stat & BROKEN)
return
flush = !flush
update()
update_icon()
// ai as human but can't flush
/obj/machinery/disposal/attack_ai(mob/user)
@@ -198,10 +209,10 @@
for(var/atom/movable/AM in src)
AM.forceMove(T)
AM.pipe_eject(0)
update()
update_icon()
// update the icon & overlays to reflect mode & status
/obj/machinery/disposal/proc/update()
/obj/machinery/disposal/update_icon()
return
/obj/machinery/disposal/proc/flush()
@@ -222,12 +233,6 @@
flushing = 0
flush = 0
/obj/machinery/disposal/bin/flush()
..()
if(mode == 2)
mode = 1
update()
/obj/machinery/disposal/proc/newHolderDestination(obj/structure/disposalholder/H)
for(var/obj/item/smallDelivery/O in src)
H.tomail = 1
@@ -239,7 +244,7 @@
// called when area power changes
/obj/machinery/disposal/power_change()
..() // do default setting/reset of stat NOPOWER bit
update() // update icon
update_icon() // update icon
return
@@ -267,7 +272,7 @@
src.transfer_fingerprints_to(stored)
stored.anchored = 0
stored.density = 1
stored.update()
stored.update_icon()
..()
//How disposal handles getting a storage dump from a storage object
@@ -294,26 +299,15 @@
// attack by item places it in to disposal
/obj/machinery/disposal/bin/attackby(obj/item/I, mob/user, params)
if(!..())
return
if(istype(I, /obj/item/weapon/storage/bag/trash))
var/obj/item/weapon/storage/bag/trash/T = I
user << "<span class='warning'>You empty the bag.</span>"
for(var/obj/item/O in T.contents)
T.remove_from_storage(O,src)
T.update_icon()
update()
return
if(!user.drop_item() || I.flags & ABSTRACT) // Dunno why this wasn't here before?
return
I.loc = src
user.visible_message("[user.name] places \the [I] into \the [src].", \
"<span class='notice'>You place \the [I] into \the [src].</span>")
update()
update_icon()
else
return ..()
// user interaction
/obj/machinery/disposal/bin/interact(mob/user, ai=0)
@@ -373,11 +367,11 @@
mode = 1
else
mode = 0
update()
update_icon()
if(href_list["handle"])
flush = text2num(href_list["handle"])
update()
update_icon()
if(href_list["eject"])
eject()
@@ -391,14 +385,20 @@
if(prob(75))
I.loc = src
visible_message("<span class='notice'>\the [I] lands in \the [src].</span>")
update()
update_icon()
else
visible_message("<span class='notice'>\the [I] bounces off of \the [src]'s rim!</span>")
return 0
else
return ..(mover, target, height)
/obj/machinery/disposal/bin/update()
/obj/machinery/disposal/bin/flush()
..()
if(mode == 2)
mode = 1
update_icon()
/obj/machinery/disposal/bin/update_icon()
overlays.Cut()
if(stat & BROKEN)
mode = 0
@@ -473,7 +473,7 @@
// if full enough, switch to ready mode
if(air_contents.return_pressure() >= SEND_PRESSURE)
mode = 2
update()
update_icon()
return
/obj/machinery/disposal/bin/get_remote_view_fullscreens(mob/user)
@@ -498,6 +498,11 @@
if(trunk)
trunk.linked = src // link the pipe trunk to self
/obj/machinery/disposal/deliveryChute/place_item_in_disposal(obj/item/I, mob/user)
if(I.disposalEnterTry())
..()
flush()
/obj/machinery/disposal/deliveryChute/Bumped(atom/movable/AM) //Go straight into the chute
if(!AM.disposalEnterTry())
return
@@ -44,6 +44,8 @@
icon_state = "gift[icon_state]"
else
user << "<span class='warning'>You need more paper!</span>"
else
return ..()
/obj/structure/bigDelivery/relay_container_resist(mob/living/user, obj/O)
if(istype(loc, /atom/movable))
+48 -64
View File
@@ -74,71 +74,55 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis).
/obj/machinery/r_n_d/circuit_imprinter/proc/TotalMaterials()
return g_amount + gold_amount + diamond_amount
/obj/machinery/r_n_d/circuit_imprinter/attackby(obj/item/O, mob/user, params)
if (shocked)
shock(user,50)
if (default_deconstruction_screwdriver(user, "circuit_imprinter_t", "circuit_imprinter", O))
if(linked_console)
linked_console.linked_imprinter = null
linked_console = null
return
//we drop the minerals in the machine onto the ground when deconstructed.
/obj/machinery/r_n_d/circuit_imprinter/deconstruction()
for(var/obj/item/weapon/reagent_containers/glass/G in component_parts)
reagents.trans_to(G, G.reagents.maximum_volume)
if(g_amount >= MINERAL_MATERIAL_AMOUNT)
var/obj/item/stack/sheet/glass/G = new /obj/item/stack/sheet/glass(src.loc)
G.amount = round(g_amount / MINERAL_MATERIAL_AMOUNT)
if(gold_amount >= MINERAL_MATERIAL_AMOUNT)
var/obj/item/stack/sheet/mineral/gold/G = new /obj/item/stack/sheet/mineral/gold(src.loc)
G.amount = round(gold_amount / MINERAL_MATERIAL_AMOUNT)
if(diamond_amount >= MINERAL_MATERIAL_AMOUNT)
var/obj/item/stack/sheet/mineral/diamond/G = new /obj/item/stack/sheet/mineral/diamond(src.loc)
G.amount = round(diamond_amount / MINERAL_MATERIAL_AMOUNT)
..()
if(exchange_parts(user, O))
return
/obj/machinery/r_n_d/circuit_imprinter/Insert_Item(obj/item/O, mob/user)
if (panel_open)
if(istype(O, /obj/item/weapon/crowbar))
for(var/obj/item/weapon/reagent_containers/glass/G in component_parts)
reagents.trans_to(G, G.reagents.maximum_volume)
if(g_amount >= MINERAL_MATERIAL_AMOUNT)
var/obj/item/stack/sheet/glass/G = new /obj/item/stack/sheet/glass(src.loc)
G.amount = round(g_amount / MINERAL_MATERIAL_AMOUNT)
if(gold_amount >= MINERAL_MATERIAL_AMOUNT)
var/obj/item/stack/sheet/mineral/gold/G = new /obj/item/stack/sheet/mineral/gold(src.loc)
G.amount = round(gold_amount / MINERAL_MATERIAL_AMOUNT)
if(diamond_amount >= MINERAL_MATERIAL_AMOUNT)
var/obj/item/stack/sheet/mineral/diamond/G = new /obj/item/stack/sheet/mineral/diamond(src.loc)
G.amount = round(diamond_amount / MINERAL_MATERIAL_AMOUNT)
default_deconstruction_crowbar(O)
return
else
user << "<span class='warning'>You can't load the [src.name] while it's opened!</span>"
return
if (disabled)
return
if (!linked_console)
user << "<span class='warning'>The [name] must be linked to an R&D console first!</span>"
if (O.is_open_container()) //inserting reagents into the machine
return 1
if (O.is_open_container())
return
if (!istype(O, /obj/item/stack/sheet/glass) && !istype(O, /obj/item/stack/sheet/mineral/gold) && !istype(O, /obj/item/stack/sheet/mineral/diamond))
if (istype(O, /obj/item/stack/sheet/glass) || istype(O, /obj/item/stack/sheet/mineral/gold) || istype(O, /obj/item/stack/sheet/mineral/diamond))
. = 1
if(!is_insertion_ready(user))
return
var/obj/item/stack/sheet/stack = O
if ((TotalMaterials() + stack.perunit) > max_material_amount)
user << "<span class='warning'>The [name] is full! Please remove glass from the protolathe in order to insert more.</span>"
return
var/amount = round(input("How many sheets do you want to add?") as num)
if(amount <= 0 || stack.amount <= 0)
return
if(amount > stack.amount)
amount = min(stack.amount, round((max_material_amount-TotalMaterials())/stack.perunit))
busy = 1
use_power(max(1000, (MINERAL_MATERIAL_AMOUNT*amount/10)))
user << "<span class='notice'>You add [amount] sheets to the [src.name].</span>"
if(istype(stack, /obj/item/stack/sheet/glass))
g_amount += amount * MINERAL_MATERIAL_AMOUNT
else if(istype(stack, /obj/item/stack/sheet/mineral/gold))
gold_amount += amount * MINERAL_MATERIAL_AMOUNT
else if(istype(stack, /obj/item/stack/sheet/mineral/diamond))
diamond_amount += amount * MINERAL_MATERIAL_AMOUNT
stack.use(amount)
busy = 0
src.updateUsrDialog()
else if(user.a_intent != "harm")
user << "<span class='warning'>You cannot insert this item into the [name]!</span>"
return
if (stat)
return
if (busy)
user << "<span class='warning'>The [name] is busy! Please wait for completion of previous operation.</span>"
return
var/obj/item/stack/sheet/stack = O
if ((TotalMaterials() + stack.perunit) > max_material_amount)
user << "<span class='warning'>The [name] is full! Please remove glass from the protolathe in order to insert more.</span>"
return
var/amount = round(input("How many sheets do you want to add?") as num)
if(amount <= 0 || stack.amount <= 0)
return
if(amount > stack.amount)
amount = min(stack.amount, round((max_material_amount-TotalMaterials())/stack.perunit))
busy = 1
use_power(max(1000, (MINERAL_MATERIAL_AMOUNT*amount/10)))
user << "<span class='notice'>You add [amount] sheets to the [src.name].</span>"
if(istype(stack, /obj/item/stack/sheet/glass))
g_amount += amount * MINERAL_MATERIAL_AMOUNT
else if(istype(stack, /obj/item/stack/sheet/mineral/gold))
gold_amount += amount * MINERAL_MATERIAL_AMOUNT
else if(istype(stack, /obj/item/stack/sheet/mineral/diamond))
diamond_amount += amount * MINERAL_MATERIAL_AMOUNT
stack.use(amount)
busy = 0
src.updateUsrDialog()
else
return 0
+6 -29
View File
@@ -11,7 +11,6 @@ Note: Must be placed within 3 tiles of the R&D Console
name = "Destructive Analyzer"
desc = "Learn science by destroying things!"
icon_state = "d_analyzer"
var/obj/item/weapon/loaded_item = null
var/decon_mod = 0
/obj/machinery/r_n_d/destructive_analyzer/New()
@@ -36,30 +35,11 @@ Note: Must be placed within 3 tiles of the R&D Console
temp_list[O] = text2num(temp_list[O])
return temp_list
/obj/machinery/r_n_d/destructive_analyzer/attackby(obj/item/O, mob/user, params)
if (shocked)
shock(user,50)
if (default_deconstruction_screwdriver(user, "d_analyzer_t", "d_analyzer", O))
if(linked_console)
linked_console.linked_destroy = null
linked_console = null
return
if(exchange_parts(user, O))
return
default_deconstruction_crowbar(O)
if (disabled)
return
if (!linked_console)
user << "<span class='warning'>The [src.name] must be linked to an R&D console first!</span>"
return
if (busy)
user << "<span class='warning'>The [src.name] is busy right now.</span>"
return
if (istype(O, /obj/item) && !loaded_item)
/obj/machinery/r_n_d/destructive_analyzer/Insert_Item(obj/item/O, mob/user)
if(user.a_intent != "harm")
. = 1
if(!is_insertion_ready(user))
return
if(!O.origin_tech)
user << "<span class='warning'>This doesn't seem to have a tech origin!</span>"
return
@@ -75,7 +55,4 @@ Note: Must be placed within 3 tiles of the R&D Console
O.loc = src
user << "<span class='notice'>You add the [O.name] to the [src.name]!</span>"
flick("d_analyzer_la", src)
spawn(10)
icon_state = "d_analyzer_l"
busy = 0
return
+10 -33
View File
@@ -25,7 +25,6 @@
var/recentlyExperimented = 0
var/mob/trackedIan
var/mob/trackedRuntime
var/obj/item/loaded_item = null
var/badThingCoeff = 0
var/resetTime = 15
var/cloneMode = FALSE
@@ -111,36 +110,14 @@
return FALSE
return TRUE
/obj/machinery/r_n_d/experimentor/attackby(obj/item/O, mob/user, params)
if (shocked)
shock(user,50)
if (default_deconstruction_screwdriver(user, "h_lathe_maint", "h_lathe", O))
if(linked_console)
linked_console.linked_destroy = null
linked_console = null
return
if(exchange_parts(user, O))
return
if(panel_open && istype(O, /obj/item/weapon/crowbar))
default_deconstruction_crowbar(O)
return
if(!checkCircumstances(O))
user << "<span class='warning'>The [O] is not yet valid for the [src] and must be completed!</span>"
return
if (disabled)
return
if (!linked_console)
user << "<span class='warning'>The [src] must be linked to an R&D console first!</span>"
return
if (loaded_item)
user << "<span class='warning'>The [src] is already loaded.</span>"
return
if (istype(O, /obj/item))
/obj/machinery/r_n_d/experimentor/Insert_Item(obj/item/O, mob/user)
if(user.a_intent != "harm")
. = 1
if(!is_insertion_ready(user))
return
if(!checkCircumstances(O))
user << "<span class='warning'>The [O] is not yet valid for the [src] and must be completed!</span>"
return
if(!O.origin_tech)
user << "<span class='warning'>This doesn't seem to have a tech origin!</span>"
return
@@ -158,7 +135,7 @@
user << "<span class='notice'>You add the [O.name] to the machine.</span>"
flick("h_lathe_load", src)
return
/obj/machinery/r_n_d/experimentor/default_deconstruction_crowbar(obj/item/O)
ejectItem()
@@ -640,7 +617,7 @@
spawn(cooldownMax)
cooldown = FALSE
else
user << "<span class='notice'>You aren't quite sure what to do with this yet.</span>"
user << "<span class='notice'>You aren't quite sure what to do with this, yet.</span>"
//////////////// RELIC PROCS /////////////////////////////
+36 -52
View File
@@ -72,61 +72,45 @@ Note: Must be placed west/left of and R&D console to function.
A = A / max(1, (being_built.materials[M]))
return A
/obj/machinery/r_n_d/protolathe/attackby(obj/item/O, mob/user, params)
if (shocked)
shock(user,50)
if (default_deconstruction_screwdriver(user, "protolathe_t", "protolathe", O))
if(linked_console)
linked_console.linked_lathe = null
linked_console = null
return
//we eject the materials upon deconstruction.
/obj/machinery/r_n_d/protolathe/deconstruction()
for(var/obj/item/weapon/reagent_containers/glass/G in component_parts)
reagents.trans_to(G, G.reagents.maximum_volume)
materials.retrieve_all()
..()
if(exchange_parts(user, O))
return
/obj/machinery/r_n_d/protolathe/Insert_Item(obj/item/O, mob/user)
if (panel_open)
if(istype(O, /obj/item/weapon/crowbar))
for(var/obj/item/weapon/reagent_containers/glass/G in component_parts)
reagents.trans_to(G, G.reagents.maximum_volume)
materials.retrieve_all()
default_deconstruction_crowbar(O)
if(O.is_open_container()) //inserting reagents into the machine
return 1
if(istype(O,/obj/item/stack/sheet))
. = 1
if(!is_insertion_ready(user))
return
if(!materials.has_space( materials.get_item_material_amount(O) ))
user << "<span class='warning'>The [src.name]'s material bin is full! Please remove material before adding more.</span>"
return 1
var/obj/item/stack/sheet/stack = O
var/amount = round(input("How many sheets do you want to add?") as num)//No decimals
if(!in_range(src, stack) || !user.Adjacent(src))
return
var/amount_inserted = materials.insert_stack(O,amount)
if(!amount_inserted)
return 1
else
user << "<span class='warning'>You can't load the [src.name] while it's opened!</span>"
return 1
if (disabled)
return
if (!linked_console)
user << "<span class='warning'>The [src.name] must be linked to an R&D console first!</span>"
return 1
if (busy)
user << "<span class='warning'>The [src.name] is busy! Please wait for completion of previous operation.</span>"
return 1
if (O.is_open_container())
return
if (stat)
return 1
if(!istype(O,/obj/item/stack/sheet))
return 1
var/stack_name = stack.name
busy = 1
use_power(max(1000, (MINERAL_MATERIAL_AMOUNT*amount_inserted/10)))
user << "<span class='notice'>You add [amount_inserted] sheets to the [src.name].</span>"
overlays += "protolathe_[stack_name]"
sleep(10)
overlays -= "protolathe_[stack_name]"
busy = 0
updateUsrDialog()
if(!materials.has_space( materials.get_item_material_amount(O) ))
user << "<span class='warning'>The [src.name]'s material bin is full! Please remove material before adding more.</span>"
return 1
var/obj/item/stack/sheet/stack = O
var/amount = round(input("How many sheets do you want to add?") as num)//No decimals
if(!in_range(src, stack) || !user.Adjacent(src))
return
var/amount_inserted = materials.insert_stack(O,amount)
if(!amount_inserted)
return 1
else if(user.a_intent != "harm")
user << "<span class='warning'>You cannot insert this item into the [name]!</span>"
else
var/stack_name = stack.name
busy = 1
use_power(max(1000, (MINERAL_MATERIAL_AMOUNT*amount_inserted/10)))
user << "<span class='notice'>You add [amount_inserted] sheets to the [src.name].</span>"
overlays += "protolathe_[stack_name]"
sleep(10)
overlays -= "protolathe_[stack_name]"
busy = 0
updateUsrDialog()
return 0
+55 -1
View File
@@ -14,6 +14,7 @@
var/disabled = 0
var/shocked = 0
var/obj/machinery/computer/rdconsole/linked_console
var/obj/item/loaded_item = null //the item loaded inside the machine (currently only used by experimentor and destructive analyzer)
/obj/machinery/r_n_d/New()
..()
@@ -39,9 +40,62 @@
/obj/machinery/r_n_d/attack_hand(mob/user)
if(shocked)
shock(user,50)
if(shock(user,50))
return
if(panel_open)
wires.interact(user)
/obj/machinery/r_n_d/attackby(obj/item/O, mob/user, params)
if (shocked)
if(shock(user,50))
return 1
if (default_deconstruction_screwdriver(user, "[initial(icon_state)]_t", initial(icon_state), O))
if(linked_console)
linked_console.linked_lathe = null
linked_console = null
return
if(exchange_parts(user, O))
return
if(default_deconstruction_crowbar(O))
return
if(Insert_Item(O, user))
return 1
else
return ..()
//proc used to handle inserting items or reagents into r_n_d machines
/obj/machinery/r_n_d/proc/Insert_Item(obj/item/I, mob/user)
return
//whether the machine can have an item inserted in its current state.
/obj/machinery/r_n_d/proc/is_insertion_ready(mob/user)
if(panel_open)
user << "<span class='warning'>You can't load the [src.name] while it's opened!</span>"
return
if (disabled)
return
if (!linked_console)
user << "<span class='warning'>The [name] must be linked to an R&D console first!</span>"
return
if (busy)
user << "<span class='warning'>The [src.name] is busy right now.</span>"
return
if(stat & BROKEN)
user << "<span class='warning'>The [src.name] is broken.</span>"
return
if(stat & NOPOWER)
user << "<span class='warning'>The [src.name] has no power.</span>"
return
if(loaded_item)
user << "<span class='warning'>The [src] is already loaded.</span>"
return
return 1
//we eject the loaded item when deconstructing the machine
/obj/machinery/r_n_d/deconstruction()
if(loaded_item)
loaded_item.loc = loc
..()
+5 -16
View File
@@ -124,20 +124,10 @@
env.merge(removed)
air_update_turf()
/obj/machinery/r_n_d/server/attackby(obj/item/O, mob/user, params)
if (disabled)
return
if (shocked)
shock(user,50)
if (default_deconstruction_screwdriver(user, "server_o", "server", O))
return
if(exchange_parts(user, O))
return
if (panel_open)
if(istype(O, /obj/item/weapon/crowbar))
griefProtection()
default_deconstruction_crowbar(O)
return 1
//called when the server is deconstructed.
/obj/machinery/r_n_d/server/deconstruction()
griefProtection()
..()
/obj/machinery/r_n_d/server/attack_hand(mob/user as mob) // I guess only exists to stop ninjas or hell does it even work I dunno. See also ninja gloves.
if (disabled)
@@ -323,9 +313,8 @@
return
/obj/machinery/computer/rdservercontrol/attackby(obj/item/weapon/D, mob/user, params)
..()
. = ..()
src.updateUsrDialog()
return
/obj/machinery/computer/rdservercontrol/emag_act(mob/user)
if(!emagged)
+18 -31
View File
@@ -7,46 +7,31 @@
var/list/authorized = list()
/obj/machinery/computer/emergency_shuttle/attackby(obj/item/weapon/card/W, mob/user, params)
if(stat & (BROKEN|NOPOWER))
return
if(!istype(W, /obj/item/weapon/card))
return
if(SSshuttle.emergency.mode != SHUTTLE_DOCKED)
return
if(!user)
return
if(SSshuttle.emergency.timeLeft() < 11)
return
if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
if (istype(W, /obj/item/device/pda))
var/obj/item/device/pda/pda = W
W = pda.id
if (!W:access) //no access
user << "The access level of [W:registered_name]\'s card is not high enough. "
/obj/machinery/computer/emergency_shuttle/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/ID = I
if(stat & (BROKEN|NOPOWER))
return
var/list/cardaccess = W:access
if(!istype(cardaccess, /list) || !cardaccess.len) //no access
user << "The access level of [W:registered_name]\'s card is not high enough. "
if(SSshuttle.emergency.mode != SHUTTLE_DOCKED)
return
if(SSshuttle.emergency.timeLeft() < 11)
return
if(!(access_heads in ID.access)) //doesn't have this access
user << "The access level of [ID.registered_name]\'s card is not high enough. "
return
if(!(access_heads in W:access)) //doesn't have this access
user << "The access level of [W:registered_name]\'s card is not high enough. "
return 0
var/choice = alert(user, text("Would you like to (un)authorize a shortened launch time? [] authorization\s are still needed. Use abort to cancel all authorizations.", src.auth_need - src.authorized.len), "Shuttle Launch", "Authorize", "Repeal", "Abort")
if(SSshuttle.emergency.mode != SHUTTLE_DOCKED || user.get_active_hand() != W)
return 0
if(SSshuttle.emergency.mode != SHUTTLE_DOCKED || user.get_active_hand() != ID)
return
var/seconds = SSshuttle.emergency.timeLeft()
if(seconds <= 10)
return 0
return
switch(choice)
if("Authorize")
if(!authorized.Find(W:registered_name))
authorized += W:registered_name
if(!authorized.Find(ID.registered_name))
authorized += ID.registered_name
if(auth_need - authorized.len > 0)
message_admins("[key_name_admin(user.client)](<A HREF='?_src_=holder;adminmoreinfo=\ref[user]'>?</A>) (<A HREF='?_src_=holder;adminplayerobservefollow=\ref[user]'>FLW</A>) has authorized early shuttle launch ",0,1)
log_game("[key_name(user)] has authorized early shuttle launch in ([x],[y],[z])")
@@ -58,13 +43,15 @@
SSshuttle.emergency.setTimer(100)
if("Repeal")
if(authorized.Remove(W:registered_name))
if(authorized.Remove(ID.registered_name))
minor_announce("[auth_need - authorized.len] authorizations needed until shuttle is launched early")
if("Abort")
if(authorized.len)
minor_announce("All authorizations to launch the shuttle early have been revoked.")
authorized.Cut()
else
return ..()
/obj/machinery/computer/emergency_shuttle/emag_act(mob/user)
if(!emagged && SSshuttle.emergency.mode == SHUTTLE_DOCKED)
+19 -8
View File
@@ -40,7 +40,10 @@
if(exchange_parts(user, I))
return
default_deconstruction_crowbar(I)
if(default_deconstruction_crowbar(I))
return
return ..()
//CARGO TELEPAD//
@@ -64,7 +67,7 @@
else if(!anchored)
anchored = 1
user << "<span class='caution'>\The [src] is now secured.</span>"
if(istype(W, /obj/item/weapon/screwdriver))
else if(istype(W, /obj/item/weapon/screwdriver))
if(stage == 0)
playsound(src, 'sound/items/Screwdriver.ogg', 50, 1)
user << "<span class='caution'>You unscrew the telepad's tracking beacon.</span>"
@@ -73,12 +76,20 @@
playsound(src, 'sound/items/Screwdriver.ogg', 50, 1)
user << "<span class='caution'>You screw in the telepad's tracking beacon.</span>"
stage = 0
if(istype(W, /obj/item/weapon/weldingtool) && stage == 1)
playsound(src, 'sound/items/Welder.ogg', 50, 1)
user << "<span class='caution'>You disassemble the telepad.</span>"
new /obj/item/stack/sheet/metal(get_turf(src))
new /obj/item/stack/sheet/glass(get_turf(src))
qdel(src)
else if(istype(W, /obj/item/weapon/weldingtool) && stage == 1)
var/obj/item/weapon/weldingtool/WT = W
if(WT.remove_fuel(0,user))
playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1)
user << "<span class='notice'>You start disassembling [src]...</span>"
if(do_after(user,20/WT.toolspeed, target = src))
if(!WT.isOn())
return
user << "<span class='notice'>You disassemble [src].</span>"
new /obj/item/stack/sheet/metal(get_turf(src))
new /obj/item/stack/sheet/glass(get_turf(src))
qdel(src)
else
return ..()
///TELEPAD CALLER///
/obj/item/device/telepad_beacon
Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB