Fixes typos and errors I made.

Fixes unscrewing a broken computer only dropping one glass shard instead of two.
Fixes AI holopad, recharger, keycard authentication device, reagent_dispensers reagentgrinder, and APC  not being attackable.
Fixes APC cover knockdown being random, it now uses the take_damage() proc, which also allows animals and xenos to knock down the cover of a broken apc.
This commit is contained in:
phil235
2016-04-25 22:29:17 +02:00
parent fcf544283d
commit bb1f60e769
18 changed files with 102 additions and 86 deletions
+2 -2
View File
@@ -101,7 +101,7 @@
update_icon()
/obj/machinery/pdapainter/attack_hand(mob/user)
if(..())
if(!..())
add_fingerprint(user)
if(storedpda)
@@ -118,7 +118,7 @@
ejectpda()
else
user << "<span class='notice'>The [src] is empty.</span>"
user << "<span class='notice'>\The [src] is empty.</span>"
/obj/machinery/pdapainter/verb/ejectpda()
+1 -2
View File
@@ -75,8 +75,7 @@ var/list/announcement_systems = list()
if(istype(P, /obj/item/weapon/screwdriver))
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
panel_open = !panel_open
if(!panel_open)
user << "<span class='notice'>You [panel_open ? "open" : "close"] the maintenance hatch of [src].</span>"
user << "<span class='notice'>You [panel_open ? "open" : "close"] the maintenance hatch of [src].</span>"
update_icon()
else if(default_deconstruction_crowbar(P))
return
-4
View File
@@ -238,10 +238,6 @@
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 ..()
/obj/machinery/camera/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
+2 -1
View File
@@ -93,7 +93,8 @@
C.loc = src.loc
if (stat & BROKEN)
user << "<span class='notice'>The broken glass falls out.</span>"
new /obj/item/weapon/shard( src.loc )
new /obj/item/weapon/shard(src.loc)
new /obj/item/weapon/shard(src.loc)
A.state = 3
A.icon_state = "3"
else
+3 -1
View File
@@ -69,7 +69,9 @@ var/const/HOLOPAD_MODE = RANGE_BASED
if(default_unfasten_wrench(user, P))
return
default_deconstruction_crowbar(P)
if(default_deconstruction_crowbar(P))
return
return ..()
/obj/machinery/hologram/holopad/AltClick(mob/living/carbon/human/user)
+10 -10
View File
@@ -326,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>"
@@ -341,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)
@@ -471,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>"
+9 -8
View File
@@ -31,35 +31,35 @@
user << "<span class='notice'>You [anchored ? "attached" : "detached"] [src].</span>"
playsound(loc, 'sound/items/Ratchet.ogg', 75, 1)
return
if(istype(user,/mob/living/silicon))
return
if(istype(G, /obj/item/weapon/gun/energy) || istype(G, /obj/item/weapon/melee/baton) || istype(G, /obj/item/ammo_box/magazine/recharge))
if(anchored)
if(charging || panel_open)
return
return 1
//Checks to make sure he's not in space doing it, and that the area got proper power.
var/area/a = get_area(src)
if(!isarea(a) || a.power_equip == 0)
user << "<span class='notice'>[src] blinks red as you try to insert [G].</span>"
return
return 1
if (istype(G, /obj/item/weapon/gun/energy))
var/obj/item/weapon/gun/energy/gun = G
if(!gun.can_charge)
user << "<span class='notice'>Your gun has no external power connector.</span>"
return
if(!user.drop_item())
return
return 1
if(!user.drop_item())
return 1
G.loc = src
charging = G
use_power = 2
update_icon()
else
user << "<span class='notice'>[src] isn't connected to anything!</span>"
return 1
if (anchored && !charging)
if(anchored && !charging)
if(default_deconstruction_screwdriver(user, "rechargeropen", "recharger0", G))
return
@@ -69,6 +69,7 @@
if(exchange_parts(user, G))
return
return ..()
/obj/machinery/recharger/attack_hand(mob/user)
if(issilicon(user))
-2
View File
@@ -282,8 +282,6 @@
var/locked = 1
var/obj/structure/cable/attached // the attached cable
var/storedpower = 0
flags = CONDUCT
use_power = 0
/obj/machinery/shieldwallgen/proc/power()
if(!anchored)
+1 -1
View File
@@ -141,7 +141,7 @@
/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))
if(!M.melee_damage_upper)
return
visible_message("<span class='danger'>[M] [M.attacktext] [src]!</span>")
take_damage(M.melee_damage_upper, M.melee_damage_type)
@@ -336,7 +336,7 @@
continue
if(G.amount >= G.max_amount)
continue
G.attackby(G, user)
G.attackby(NG, user)
user << "<span class='notice'>You add the newly-formed glass to the stack. It now contains [NG.amount] sheet\s.</span>"
qdel(src)
else
@@ -193,6 +193,7 @@
"You put the [what] into [src].")
user.drop_item()
what.loc = src
return 1
else
if(user.a_intent != "harm")
user << "<span class='warning'>That probably won't blend!</span>"
+6 -2
View File
@@ -73,17 +73,21 @@
return
if(istype(O, /obj/item/weapon/reagent_containers/glass))
. = 1 //no afterattack
if(!panel_open)
if(beaker)
user << "<span class='warning'>A container is already loaded into the machine.</span>"
else
user.unEquip(O)
if(!user.drop_item())
return
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
user << "<span class='warning'>Close the maintenance panel first.</span>"
return
else if(istype(O, /obj/item/weapon/storage/bag/plants))
var/obj/item/weapon/storage/bag/plants/PB = O
+12 -13
View File
@@ -1,4 +1,4 @@
/proc/seedify(obj/item/O, t_max, obj/machinery/seed_extractor/extractor)
/proc/seedify(obj/item/O, t_max, obj/machinery/seed_extractor/extractor, mob/living/user)
var/t_amount = 0
if(t_max == -1)
if(extractor)
@@ -13,6 +13,8 @@
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)
if(user && !user.drop_item()) //couldn't drop the item
return
while(t_amount < t_max)
var/obj/item/seeds/t_prod = F.seed.Copy()
t_prod.loc = seedloc
@@ -23,6 +25,8 @@
else if(istype(O, /obj/item/weapon/grown))
var/obj/item/weapon/grown/F = O
if(F.seed)
if(user && !user.drop_item())
return
while(t_amount < t_max)
var/obj/item/seeds/t_prod = F.seed.Copy()
t_prod.loc = seedloc
@@ -89,17 +93,13 @@
user << "<span class='notice'>There are no seeds in \the [O.name].</span>"
return
if(!user.drop_item()) //couldn't drop the item
user << "<span class='warning'>\The [O] is stuck to your hand, you cannot put it in the seed extractor!</span>"
return
else if(seedify(O,-1, src))
else if(seedify(O,-1, src, user))
user << "<span class='notice'>You extract some seeds.</span>"
return
else if (istype(O,/obj/item/seeds))
add_seed(O)
user << "<span class='notice'>You add [O] to [src.name].</span>"
updateUsrDialog()
if(add_seed(O))
user << "<span class='notice'>You add [O] to [src.name].</span>"
updateUsrDialog()
return
else if(user.a_intent != "harm")
user << "<span class='warning'>You can't extract any seeds from \the [O.name]!</span>"
@@ -188,15 +188,14 @@
if(istype(O.loc,/mob))
var/mob/M = O.loc
if(!M.unEquip(O))
usr << "<span class='warning'>\the [O] is stuck to your hand, you cannot put it in \the [src]!</span>"
return
if(!M.drop_item())
return 0
else if(istype(O.loc,/obj/item/weapon/storage))
var/obj/item/weapon/storage/S = O.loc
S.remove_from_storage(O,src)
O.loc = src
. = 1
for (var/datum/seed_pile/N in piles)
if (O.plantname == N.name && O.lifespan == N.lifespan && O.endurance == N.endurance && O.maturation == N.maturation && O.production == N.production && O.yield == N.yield && O.potency == N.potency)
++N.amount
+35 -22
View File
@@ -91,6 +91,7 @@
var/global/list/status_overlays_equipment
var/global/list/status_overlays_lighting
var/global/list/status_overlays_environ
var/health = 50
/obj/machinery/power/apc/connect_to_network()
//Override because the APC does not directly connect to the network; it goes through a terminal.
@@ -442,7 +443,7 @@
user << "The wires have been [panel_open ? "exposed" : "unexposed"]"
update_icon()
else if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) // trying to unlock the interface with an ID card
else if (W.GetID()) // trying to unlock the interface with an ID card
if(emagged)
user << "<span class='warning'>The interface is broken!</span>"
else if(opened)
@@ -544,14 +545,21 @@
if (opened==2)
opened = 1
update_icon()
else if(panel_open && !opened && is_wire_tool(W))
wires.interact(user)
else
if(panel_open && !opened && is_wire_tool(W))
wires.interact(user)
if(((stat & BROKEN) || malfhack) && !opened && W.force >= 5 && W.w_class >= 3 && prob(20))
return ..()
/obj/machinery/power/apc/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
..()
if((malfhack || (stat & BROKEN)) && !opened)
if(damage < 10)
return
health -= damage
if(health <= 0)
opened = 2
user.visible_message("<span class='warning'>[user.name] has knocked down the APC cover with the [W.name].</span>", \
"<span class='danger'>You knock down the APC cover with your [W.name]!</span>", \
"<span class='italics'>You hear bang.</span>")
visible_message("<span class='warning'>The APC cover is knocked down!</span>")
update_icon()
/obj/machinery/power/apc/emag_act(mob/user)
@@ -590,23 +598,28 @@
..()
/obj/machinery/power/apc/attack_alien(mob/living/carbon/alien/humanoid/user)
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src)
user.visible_message("<span class='danger'>[user.name] slashes at the [src.name]!</span>", "<span class='notice'>You slash at the [src.name]!</span>")
playsound(src.loc, 'sound/weapons/slash.ogg', 100, 1)
..()
if(malfhack || (stat & BROKEN))
return
if(opened == 0)
if(!panel_open)
panel_open = 1
update_icon()
visible_message("<span class='danger'>The [src.name]'s cover flies open, exposing the wires!</span>")
if(beenhit >= pick(3, 4) && panel_open != 1)
panel_open = 1
update_icon()
visible_message("<span class='danger'>The [src.name]'s cover flies open, exposing the wires!</span>")
else if(panel_open && !wires.is_all_cut())
wires.cut_all()
update_icon()
visible_message("<span class='danger'>The [src.name]'s wires are shredded!</span>")
else if(opened == 1)
if(cell)
cell.loc = user.loc
cell.updateicon()
cell = null
visible_message("<span class='danger'>The [src.name]'s power cell flies off!</span>")
charging = 0
update_icon()
else if(panel_open == 1 && !wires.is_all_cut())
wires.cut_all()
update_icon()
visible_message("<span class='danger'>The [src.name]'s wires are shredded!</span>")
else
beenhit += 1
return
/obj/machinery/power/apc/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)
@@ -104,17 +104,16 @@
return
if (istype(I, /obj/item/weapon/reagent_containers) && (I.flags & OPENCONTAINER) )
. = 1 //no afterattack
if (beaker)
return 1
else
if (!beaker)
if(!user.drop_item())
return 1
beaker = I
beaker.loc = src
update_icon()
src.updateUsrDialog()
return 0
else
user << "<span class='warning'>There's already a container inside.</span>"
return 1 //no afterattack
if(is_type_in_list(I, dried_items))
if(istype(I, /obj/item/weapon/reagent_containers/food/snacks/grown))
@@ -144,14 +143,17 @@
return 1
if (!is_type_in_list(I, blend_items) && !is_type_in_list(I, juice_items))
user << "<span class='warning'>Cannot refine into a reagent!</span>"
return 1
if(user.a_intent == "harm")
return ..()
else
user << "<span class='warning'>Cannot refine into a reagent!</span>"
return 1
user.unEquip(I)
I.loc = src
holdingitems += I
src.updateUsrDialog()
return 0
if(user.drop_item())
I.loc = src
holdingitems += I
src.updateUsrDialog()
return 0
/obj/machinery/reagentgrinder/attack_paw(mob/user)
return src.attack_hand(user)
+4 -1
View File
@@ -28,7 +28,10 @@
qdel(src)
/obj/structure/reagent_dispensers/attackby(obj/item/weapon/W, mob/user, params)
return
if(istype(W, /obj/item/weapon/reagent_containers))
return 0 //so we can refill them via their afterattack.
else
return ..()
/obj/structure/reagent_dispensers/New()
create_reagents(1000)
+1 -1
View File
@@ -92,7 +92,7 @@
return
user << "<span class='notice'>You slice the floorweld off \the [src].</span>"
Deconstruct()
return
return
if(user.a_intent != "harm")
if(!user.drop_item() || (I.flags & ABSTRACT))
@@ -26,9 +26,6 @@ var/datum/events/keycard_events = new()
qdel(ev)
. = ..()
/obj/machinery/keycard_auth/attackby(obj/item/weapon/W, mob/user, params)
return
/obj/machinery/keycard_auth/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)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)