diff --git a/code/datums/martial.dm b/code/datums/martial.dm index d69b28cd0b1..d1b498f5070 100644 --- a/code/datums/martial.dm +++ b/code/datums/martial.dm @@ -540,38 +540,35 @@ if(C.stat) user << "It would be dishonorable to attack a foe while they cannot retaliate." return - switch(user.a_intent) - if("disarm") - if(!wielded) - return ..() - if(!ishuman(target)) - return ..() - var/mob/living/carbon/human/H = target - var/list/fluffmessages = list("[user] clubs [H] with [src]!", \ - "[user] smacks [H] with the butt of [src]!", \ - "[user] broadsides [H] with [src]!", \ - "[user] smashes [H]'s head with [src]!", \ - "[user] beats [H] with front of [src]!", \ - "[user] twirls and slams [H] with [src]!") - H.visible_message("[pick(fluffmessages)]", \ - "[pick(fluffmessages)]") - playsound(get_turf(user), 'sound/effects/woodhit.ogg', 75, 1, -1) - H.adjustStaminaLoss(rand(13,20)) - if(prob(10)) - H.visible_message("[H] collapses!", \ - "Your legs give out!") - H.Weaken(4) - if(H.staminaloss && !H.sleeping) - var/total_health = (H.health - H.staminaloss) - if(total_health <= config.health_threshold_crit && !H.stat) - H.visible_message("[user] delivers a heavy hit to [H]'s head, knocking them out cold!", \ - "[user] knocks you unconscious!") - H.SetSleeping(30) - H.adjustBrainLoss(25) - return - else + if(user.a_intent == "disarm") + if(!wielded) return ..() - return ..() + if(!ishuman(target)) + return ..() + var/mob/living/carbon/human/H = target + var/list/fluffmessages = list("[user] clubs [H] with [src]!", \ + "[user] smacks [H] with the butt of [src]!", \ + "[user] broadsides [H] with [src]!", \ + "[user] smashes [H]'s head with [src]!", \ + "[user] beats [H] with front of [src]!", \ + "[user] twirls and slams [H] with [src]!") + H.visible_message("[pick(fluffmessages)]", \ + "[pick(fluffmessages)]") + playsound(get_turf(user), 'sound/effects/woodhit.ogg', 75, 1, -1) + H.adjustStaminaLoss(rand(13,20)) + if(prob(10)) + H.visible_message("[H] collapses!", \ + "Your legs give out!") + H.Weaken(4) + if(H.staminaloss && !H.sleeping) + var/total_health = (H.health - H.staminaloss) + if(total_health <= config.health_threshold_crit && !H.stat) + H.visible_message("[user] delivers a heavy hit to [H]'s head, knocking them out cold!", \ + "[user] knocks you unconscious!") + H.SetSleeping(30) + H.adjustBrainLoss(25) + else + return ..() /obj/item/weapon/twohanded/bostaff/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance) if(wielded) diff --git a/code/game/gamemodes/handofgod/structures.dm b/code/game/gamemodes/handofgod/structures.dm index 309efa87a89..f86f4630683 100644 --- a/code/game/gamemodes/handofgod/structures.dm +++ b/code/game/gamemodes/handofgod/structures.dm @@ -52,15 +52,8 @@ return ..() -/obj/structure/divine/proc/healthcheck() - if(!health) - visible_message("\The [src] was destroyed!") - qdel(src) - /obj/structure/divine/attackby(obj/item/I, mob/user) - if(!I || (I.flags & ABSTRACT)) - return 0 //Structure conversion/capture if(istype(I, /obj/item/weapon/godstaff)) @@ -71,35 +64,52 @@ if(G.god && deity != G.god) assign_deity(G.god, alert_old_deity = TRUE) visible_message("\The [src] has been captured by [user]!") - return + else + return ..() +/obj/structure/divine/attacked_by(obj/item/I, mob/living/user) + ..() + take_damage(I.force, I.damtype, 1) + +/obj/structure/divine/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) + else + return + health -= damage + if(!health) + visible_message("\The [src] was destroyed!") + qdel(src) + + +/obj/structure/divine/bullet_act(obj/item/projectile/P) + . = ..() + take_damage(P.damage, P.damage_type, 0) + + +/obj/structure/divine/attack_alien(mob/living/carbon/alien/humanoid/user) user.changeNext_move(CLICK_CD_MELEE) user.do_attack_animation(src) - playsound(get_turf(src), I.hitsound, 50, 1) - visible_message("\The [src] has been attacked with \the [I][(user ? " by [user]" : ".")]!") - health = max(0, health-I.force) - healthcheck() + add_hiddenprint(user) + visible_message("\The [user] slashes at [src]!") + playsound(src.loc, 'sound/weapons/slash.ogg', 100, 1) + take_damage(20, BRUTE, 0) - -/obj/structure/divine/bullet_act(obj/item/projectile/Proj) - if(!Proj) - return 0 - - if(Proj.damage_type == BRUTE || Proj.damage_type == BURN) - health = max(0, health-Proj.damage) - healthcheck() - - -/obj/structure/divine/attack_animal(mob/living/simple_animal/M) - if(!M) - return 0 - - visible_message("\The [src] has been attacked by \the [M]!") - var/damage = rand(M.melee_damage_lower, M.melee_damage_upper) - if(!damage) - return - health = max(0, health-damage) - healthcheck() +/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) + M.visible_message("[M.name] smashes against \the [src.name].",\ + "You smash against the [src.name].") + take_damage(rand(M.melee_damage_lower,M.melee_damage_upper), M.melee_damage_type, 1) /obj/structure/divine/proc/assign_deity(mob/camera/god/new_deity, alert_old_deity = TRUE) @@ -199,7 +209,8 @@ user << "\The [src] does not require any more greater gems!" return - ..() + else + return ..() /obj/structure/divine/construction_holder/proc/check_completion() @@ -239,11 +250,22 @@ /obj/structure/divine/nexus/ex_act() return - -/obj/structure/divine/nexus/healthcheck() +/obj/structure/divine/nexus/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 + health -= damage if(deity) deity.update_health_hud() - if(!health) if(!qdeleted(deity) && deity.nexus_required) deity << "Your nexus was destroyed. You feel yourself fading..." @@ -257,7 +279,6 @@ /obj/structure/divine/nexus/process() - healthcheck() if(deity) deity.update_followers() deity.add_faith(faith_regen_rate + (powerpylons.len / 5) + (deity.alive_followers / 3)) diff --git a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm index f0c72d39e2a..4bebddd1564 100644 --- a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm +++ b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm @@ -371,44 +371,47 @@ mouse_opacity = 1 var/health = 30 -/obj/effect/swarmer/destructible/proc/TakeDamage(damage) +/obj/effect/swarmer/destructible/proc/take_damage(damage, damage_type = BRUTE, sound_effect = 1) + switch(damage_type) + if(BRUTE) + if(sound_effect) + playsound(loc, 'sound/weapons/Egloves.ogg', 80, 1) + if(BURN) + if(sound_effect) + playsound(src.loc, 'sound/items/Welder.ogg', 100, 1) + else + return health -= damage if(health <= 0) qdel(src) -/obj/effect/swarmer/destructible/bullet_act(obj/item/projectile/Proj) - if(Proj.damage) - if((Proj.damage_type == BRUTE || Proj.damage_type == BURN)) - TakeDamage(Proj.damage) - ..() +/obj/effect/swarmer/destructible/bullet_act(obj/item/projectile/P) + . = ..() + take_damage(P.damage, P.damage_type) -/obj/effect/swarmer/destructible/attackby(obj/item/weapon/I, mob/living/user, params) - if(istype(I, /obj/item/weapon)) - user.changeNext_move(CLICK_CD_MELEE) - user.do_attack_animation(src) - TakeDamage(I.force) - return +/obj/effect/swarmer/destructible/attacked_by(obj/item/I, mob/living/user) + ..() + take_damage(I.force, I.damtype) /obj/effect/swarmer/destructible/ex_act() qdel(src) - return /obj/effect/swarmer/destructible/blob_act() qdel(src) - return /obj/effect/swarmer/destructible/emp_act() qdel(src) - return -/obj/effect/swarmer/destructible/attack_animal(mob/living/user) - if(isanimal(user)) - var/mob/living/simple_animal/S = user - S.do_attack_animation(src) - user.changeNext_move(CLICK_CD_MELEE) - if(S.melee_damage_type == BRUTE || S.melee_damage_type == BURN) - TakeDamage(rand(S.melee_damage_lower, S.melee_damage_upper)) - return +/obj/effect/swarmer/destructible/attack_alien(mob/living/user) + user.do_attack_animation(src) + user.changeNext_move(CLICK_CD_MELEE) + take_damage(rand(20,30)) + +/obj/effect/swarmer/destructible/attack_animal(mob/living/simple_animal/S) + S.do_attack_animation(src) + S.changeNext_move(CLICK_CD_MELEE) + if(S.melee_damage_upper) + take_damage(rand(S.melee_damage_lower, S.melee_damage_upper), S.melee_damage_type) /mob/living/simple_animal/hostile/swarmer/proc/CreateTrap() set name = "Create trap" diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm index 5ef0cfdb794..5748be75618 100644 --- a/code/game/mecha/mech_fabricator.dm +++ b/code/game/mecha/mech_fabricator.dm @@ -459,6 +459,9 @@ return result +/obj/machinery/mecha_part_fabricator/deconstruction() + for(var/material in resources) + remove_material(material, resources[material]/MINERAL_MATERIAL_AMOUNT) /obj/machinery/mecha_part_fabricator/attackby(obj/W, mob/user, params) if(default_deconstruction_screwdriver(user, "fab-o", "fab-idle", W)) @@ -467,17 +470,13 @@ if(exchange_parts(user, W)) return - if(panel_open) - if(istype(W, /obj/item/weapon/crowbar)) - for(var/material in resources) - remove_material(material, resources[material]/MINERAL_MATERIAL_AMOUNT) - default_deconstruction_crowbar(W) - return 1 - else - user << "You can't load \the [name] while it's opened!" - return 1 + if(default_deconstruction_crowbar(W)) + return 1 if(istype(W, /obj/item/stack)) + if(panel_open) + user << "You can't load \the [name] while it's opened!" + return 1 var/material switch(W.type) if(/obj/item/stack/sheet/mineral/gold) @@ -519,7 +518,8 @@ overlays -= "fab-load-[material2name(material)]" //No matter what the overlay shall still be deleted else user << "\The [src] cannot hold any more [sname] sheet\s!" - return + else + return ..() /obj/machinery/mecha_part_fabricator/proc/material2name(ID) return copytext(ID,2) diff --git a/code/game/mecha/mecha_defense.dm b/code/game/mecha/mecha_defense.dm index 9b0fc6d69e6..badf0ee4804 100644 --- a/code/game/mecha/mecha_defense.dm +++ b/code/game/mecha/mecha_defense.dm @@ -183,7 +183,7 @@ else user << "You were unable to attach [W] to [src]!" return - if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) + if(W.GetID()) if(add_req_access || maint_access) if(internals_access_allowed(user)) var/obj/item/weapon/card/id/id_card @@ -223,7 +223,7 @@ else user << "You need two lengths of cable to fix this mech!" return - else if(istype(W, /obj/item/weapon/screwdriver)) + else if(istype(W, /obj/item/weapon/screwdriver) && user.a_intent != "harm") if(internal_damage & MECHA_INT_TEMP_CONTROL) clearInternalDamage(MECHA_INT_TEMP_CONTROL) user << "You repair the damaged temperature controller." @@ -278,22 +278,25 @@ W.forceMove(src) user.visible_message("[user] attaches [W] to [src].", "You attach [W] to [src].") return + else + return ..() - else if(!(W.flags&NOBLUDGEON)) - user.changeNext_move(CLICK_CD_MELEE) // Ugh. Ideally we shouldn't be setting cooldowns outside of click code. - user.do_attack_animation(src) - log_message("Attacked by [W]. Attacker - [user]") - var/deflection = 1 - var/dam_coeff = 1 - for(var/obj/item/mecha_parts/mecha_equipment/anticcw_armor_booster/B in equipment) - if(B.attack_react(user)) - deflection *= B.deflect_coeff - dam_coeff *= B.damage_coeff - break - user.visible_message("[user] hits [src] with [W].", "You hit [src] with [W].") - take_damage(round(W.force*dam_coeff),W.damtype, user.dir, deflection, dam_coeff) +/obj/mecha/attacked_by(obj/item/I, mob/living/user) + log_message("Attacked by [I]. Attacker - [user]") + var/deflection = deflect_chance + var/dam_coeff = 1 + for(var/obj/item/mecha_parts/mecha_equipment/anticcw_armor_booster/B in equipment) + if(B.attack_react(user)) + deflection *= B.deflect_coeff + dam_coeff *= B.damage_coeff + break + if(prob(deflection)) + user << "\The [I.name] bounces off [name]'s armor." + log_append_to_last("Armor saved.") + else + user.visible_message("[user] hits [src] with [I].", "You hit [src] with [I].") + take_damage(round(I.force*dam_coeff),I.damtype) check_for_internal_damage(list(MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST)) - return 1 /obj/mecha/proc/mech_toxin_damage(mob/living/target) diff --git a/code/game/objects/effects/aliens.dm b/code/game/objects/effects/aliens.dm index cc816f1d8f1..21ae2c75996 100644 --- a/code/game/objects/effects/aliens.dm +++ b/code/game/objects/effects/aliens.dm @@ -9,6 +9,40 @@ /obj/structure/alien icon = 'icons/mob/alien.dmi' + var/health = 100 + +/obj/structure/alien/attacked_by(obj/item/I, mob/user) + ..() + var/damage = I.force + switch(I.damtype) + if(BRUTE) + damage *= 0.25 + if(BURN) + damage *= 2 + else + damage = 0 //stamina damage does no damage + take_damage(damage, I.damtype) + +/obj/structure/alien/proc/take_damage(amount, damage_type = BRUTE, sound_effect = 1) + switch(damage_type) + if(BRUTE) + if(sound_effect) + playsound(loc, 'sound/effects/attackblob.ogg', 100, 1) + if(BURN) + if(sound_effect) + playsound(loc, 'sound/items/Welder.ogg', 100, 1) + else + return + health = max(health - amount, 0) + if(!health) + Break() + +/obj/structure/alien/proc/Break() + qdel(src) + +/obj/structure/alien/bullet_act(obj/item/projectile/P) + . = ..() + take_damage(P.damage, P.damage_type) /* * Resin @@ -22,9 +56,10 @@ opacity = 1 anchored = 1 canSmoothWith = list(/obj/structure/alien/resin) - var/health = 200 - var/resintype = null + health = 200 smooth = SMOOTH_TRUE + var/resintype = null + /obj/structure/alien/resin/New(location) @@ -66,32 +101,17 @@ resintype = "membrane" canSmoothWith = list(/obj/structure/alien/resin/wall, /obj/structure/alien/resin/membrane) -/obj/structure/alien/resin/proc/healthcheck() - if(health <=0) - qdel(src) - - -/obj/structure/alien/resin/bullet_act(obj/item/projectile/Proj) - health -= Proj.damage - ..() - healthcheck() - - /obj/structure/alien/resin/ex_act(severity, target) switch(severity) if(1) - health -= 150 + take_damage(150, BRUTE, 0) if(2) - health -= 100 + take_damage(100, BRUTE, 0) if(3) - health -= 50 - healthcheck() - - -/obj/structure/alien/resin/blob_act() - health -= 50 - healthcheck() + take_damage(50, BRUTE, 0) +/obj/structure/alien/blob_act() + take_damage(50, BRUTE, 0) /obj/structure/alien/resin/hitby(atom/movable/AM) ..() @@ -101,16 +121,12 @@ else var/obj/O = AM tforce = O.throwforce - playsound(loc, 'sound/effects/attackblob.ogg', 100, 1) - health -= tforce - healthcheck() + take_damage(tforce) /obj/structure/alien/resin/attack_hulk(mob/living/carbon/human/user) ..(user, 1) - user.do_attack_animation(src) user.visible_message("[user] destroys [src]!") - health = 0 - healthcheck() + take_damage(200) /obj/structure/alien/resin/attack_paw(mob/user) return attack_hand(user) @@ -119,23 +135,16 @@ /obj/structure/alien/resin/attack_alien(mob/living/user) user.changeNext_move(CLICK_CD_MELEE) user.do_attack_animation(src) - if(islarva(user)) - return user.visible_message("[user] claws at the resin!") - playsound(loc, 'sound/effects/attackblob.ogg', 100, 1) - health -= 50 - if(health <= 0) - user.visible_message("[user] slices the [name] apart!") - healthcheck() - - -/obj/structure/alien/resin/attackby(obj/item/I, mob/living/user, params) - user.changeNext_move(CLICK_CD_MELEE) - health -= I.force - playsound(loc, 'sound/effects/attackblob.ogg', 100, 1) - healthcheck() - ..() + take_damage(50) +/obj/structure/alien/resin/attack_animal(mob/living/simple_animal/M) + M.changeNext_move(CLICK_CD_MELEE) + M.do_attack_animation(src) + if(M.melee_damage_upper == 0 || (M.melee_damage_type != BRUTE && M.melee_damage_type != BURN)) + return + visible_message("[M] [M.attacktext] [src]!") + take_damage(M.melee_damage_upper, M.melee_damage_type) /obj/structure/alien/resin/CanPass(atom/movable/mover, turf/target, height=0) return !density @@ -155,7 +164,7 @@ density = 0 layer = TURF_LAYER + 0.09 icon_state = "weeds" - var/health = 15 + health = 15 var/obj/structure/alien/weeds/node/linked_node = null canSmoothWith = list(/obj/structure/alien/weeds, /turf/closed/wall) smooth = SMOOTH_MORE @@ -208,33 +217,9 @@ qdel(src) -/obj/structure/alien/weeds/attackby(obj/item/I, mob/user, params) - user.changeNext_move(CLICK_CD_MELEE) - if(I.attack_verb.len) - visible_message("[user] has [pick(I.attack_verb)] [src] with [I]!") - else - visible_message("[user] has attacked [src] with [I]!") - - var/damage = I.force / 4 - if(istype(I, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = I - if(WT.remove_fuel(0, user)) - damage = 15 - playsound(loc, 'sound/items/Welder.ogg', 100, 1) - - health -= damage - healthcheck() - - -/obj/structure/alien/weeds/proc/healthcheck() - if(health <= 0) - qdel(src) - - /obj/structure/alien/weeds/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) if(exposed_temperature > 300) - health -= 5 - healthcheck() + take_damage(5, BURN, 0) //Weed nodes @@ -271,7 +256,7 @@ icon_state = "egg_growing" density = 0 anchored = 1 - var/health = 100 + health = 100 var/status = GROWING //can be GROWING, GROWN or BURST; all mutually exclusive layer = MOB_LAYER @@ -340,43 +325,16 @@ remove_from_proximity_list(src, 1) ..() -/obj/structure/alien/egg/bullet_act(obj/item/projectile/Proj) - health -= Proj.damage - ..() - healthcheck() - - -/obj/structure/alien/egg/attackby(obj/item/I, mob/user, params) - if(I.attack_verb.len) - visible_message("[user] has [pick(I.attack_verb)] [src] with [I]!") - else - visible_message("[user] has attacked [src] with [I]!") - - var/damage = I.force / 4 - if(istype(I, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = I - - if(WT.remove_fuel(0, user)) - damage = 15 - playsound(loc, 'sound/items/Welder.ogg', 100, 1) - - health -= damage - user.changeNext_move(CLICK_CD_MELEE) - healthcheck() - - -/obj/structure/alien/egg/proc/healthcheck() - if(health <= 0) - if(status != BURST && status != BURSTING) - Burst() - else if(status == BURST && prob(50)) - qdel(src) //Remove the egg after it has been hit after bursting. +/obj/structure/alien/egg/Break() + if(status != BURST && status != BURSTING) + Burst() + else if(status == BURST) + qdel(src) //Remove the egg after it has been hit after bursting. /obj/structure/alien/egg/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) if(exposed_temperature > 500) - health -= 5 - healthcheck() + take_damage(5, BURN, 0) /obj/structure/alien/egg/HasProximity(atom/movable/AM) diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm index 528ccafa5b9..b8d0a99bba9 100644 --- a/code/game/objects/effects/spiders.dm +++ b/code/game/objects/effects/spiders.dm @@ -19,37 +19,32 @@ qdel(src) return -/obj/effect/spider/attackby(obj/item/weapon/W, mob/user, params) - if(W.attack_verb.len) - visible_message("[user] has [pick(W.attack_verb)] \the [src] with \the [W]!") - else - visible_message("[user] has attacked \the [src] with \the [W]!") - - var/damage = W.force / 4 - - if(istype(W, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = W - - if(WT.remove_fuel(0, user)) - damage = 15 - playsound(loc, 'sound/items/Welder.ogg', 100, 1) - - health -= damage - healthcheck() - -/obj/effect/spider/bullet_act(obj/item/projectile/Proj) +/obj/effect/spider/attacked_by(obj/item/I, mob/user) ..() - health -= Proj.damage - healthcheck() + var/damage = I.force + take_damage(damage, I.damtype, 1) -/obj/effect/spider/proc/healthcheck() +/obj/effect/spider/bullet_act(obj/item/projectile/P) + . = ..() + take_damage(P.damage, P.damage_type, 0) + +/obj/effect/spider/proc/take_damage(damage, damage_type = BRUTE, sound_effect = 1) + switch(damage_type) + if(BURN) + damage *= 2 + if(sound_effect) + playsound(loc, 'sound/items/Welder.ogg', 100, 1) + if(BRUTE)//the stickiness of the web mutes all attack sounds except fire damage type + damage *= 0.25 + else + return + health -= damage if(health <= 0) qdel(src) /obj/effect/spider/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) if(exposed_temperature > 300) - health -= 5 - healthcheck() + take_damage(5, BURN, 0) /obj/effect/spider/stickyweb icon_state = "stickyweb1" @@ -125,14 +120,6 @@ else ..() -/obj/effect/spider/spiderling/proc/die() - visible_message("[src] dies!") - qdel(src) - -/obj/effect/spider/spiderling/healthcheck() - if(health <= 0) - die() - /obj/effect/spider/spiderling/process() if(travelling_in_vent) if(istype(src.loc, /turf)) diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index 33760586938..ebd6e3d05c1 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -10,6 +10,7 @@ var/global/list/obj/item/device/pda/PDAs = list() icon = 'icons/obj/pda.dmi' icon_state = "pda" item_state = "electronic" + flags = NOBLUDGEON //phil235 test it w_class = 1 slot_flags = SLOT_ID | SLOT_BELT origin_tech = "programming=2" @@ -728,7 +729,6 @@ var/global/list/obj/item/device/pda/PDAs = list() // access to status display signals /obj/item/device/pda/attackby(obj/item/C, mob/user, params) - ..() if(istype(C, /obj/item/weapon/cartridge) && !cartridge) cartridge = C if(!user.unEquip(C)) @@ -777,7 +777,8 @@ var/global/list/obj/item/device/pda/PDAs = list() var/obj/item/weapon/photo/P = C photo = P.img user << "You scan \the [C]." - return + else + return ..() /obj/item/device/pda/attack(mob/living/carbon/C, mob/living/user) if(istype(C)) @@ -821,23 +822,26 @@ var/global/list/obj/item/device/pda/PDAs = list() var/obj/item/weapon/tank/T = A atmosanalyzer_scan(T.air_contents, user, T) else if (istype(A, /obj/machinery/portable_atmospherics)) - var/obj/machinery/portable_atmospherics/T = A - atmosanalyzer_scan(T.air_contents, user, T) + var/obj/machinery/portable_atmospherics/PA = A + atmosanalyzer_scan(PA.air_contents, user, PA) else if (istype(A, /obj/machinery/atmospherics/pipe)) - var/obj/machinery/atmospherics/pipe/T = A - atmosanalyzer_scan(T.parent.air, user, T) + var/obj/machinery/atmospherics/pipe/P = A + atmosanalyzer_scan(P.parent.air, user, P) else if (istype(A, /obj/machinery/power/rad_collector)) - var/obj/machinery/power/rad_collector/T = A - if(T.P) atmosanalyzer_scan(T.P.air_contents, user, T) + var/obj/machinery/power/rad_collector/RC = A + if(RC.loaded_tank) + atmosanalyzer_scan(RC.loaded_tank.air_contents, user, RC) else if (istype(A, /obj/item/weapon/flamethrower)) - var/obj/item/weapon/flamethrower/T = A - if(T.ptank) atmosanalyzer_scan(T.ptank.air_contents, user, T) + var/obj/item/weapon/flamethrower/F = A + if(F.ptank) + atmosanalyzer_scan(F.ptank.air_contents, user, F) if (!scanmode && istype(A, /obj/item/weapon/paper) && owner) - if (!A:info) + var/obj/item/weapon/paper/PP = A + if (!PP.info) user << "Unable to scan! Paper is blank." return - notehtml = A:info + notehtml = PP.info note = replacetext(notehtml, "
", "\[br\]") note = replacetext(note, "
  • ", "\[*\]") note = replacetext(note, "