mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-09 16:14:13 +00:00
Fixes Issue 1081 - Not being able to analyze tanks with PDA/analyzers. The tank attackby proc was overridden by the one tank bombs.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5025 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -77,10 +77,11 @@
|
||||
/obj/item/weapon/tank/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
var/obj/icon = src
|
||||
|
||||
if (istype(src.loc, /obj/item/assembly))
|
||||
icon = src.loc
|
||||
if ((istype(W, /obj/item/device/analyzer) || (istype(W, /obj/item/device/pda))) && get_dist(user, src) <= 1)
|
||||
|
||||
if ((istype(W, /obj/item/device/analyzer) || (istype(W, /obj/item/device/pda))) && get_dist(user, src) <= 1)
|
||||
for (var/mob/O in viewers(user, null))
|
||||
O << "\red [user] has used [W] on \icon[icon] [src]"
|
||||
|
||||
@@ -112,8 +113,9 @@
|
||||
var/obj/item/latexballon/LB = W
|
||||
LB.blow(src)
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/device/assembly_holder))
|
||||
bomb_assemble(W,user)
|
||||
|
||||
/obj/item/weapon/tank/attack_self(mob/user as mob)
|
||||
if (!(src.air_contents))
|
||||
|
||||
@@ -75,29 +75,29 @@
|
||||
|
||||
// ---------- Procs below are for tanks that are used exclusively in 1-tank bombs ----------
|
||||
|
||||
/obj/item/weapon/tank/attackby(obj/item/weapon/W as obj, mob/user as mob) //Bomb assembly proc. This turns assembly+tank into a bomb
|
||||
if(istype(W, /obj/item/device/assembly_holder))
|
||||
var/obj/item/device/assembly_holder/S = W
|
||||
if(!S.secured) //Check if the assembly is secured
|
||||
return
|
||||
if(isigniter(S.a_left) == isigniter(S.a_right)) //Check if either part of the assembly has an igniter, but if both parts are igniters, then fuck it
|
||||
return
|
||||
|
||||
var/obj/item/device/onetankbomb/R = new /obj/item/device/onetankbomb(loc)
|
||||
|
||||
user.drop_item() //Remove the assembly from your hands
|
||||
user.remove_from_mob(src) //Remove the tank from your character,in case you were holding it
|
||||
user.put_in_hands(R) //Equips the bomb if possible, or puts it on the floor.
|
||||
|
||||
R.bombassembly = S //Tell the bomb about its assembly part
|
||||
S.master = R //Tell the assembly about its new owner
|
||||
S.loc = R //Move the assembly out of the fucking way
|
||||
|
||||
R.bombtank = src //Same for tank
|
||||
master = R
|
||||
loc = R
|
||||
R.update_icon()
|
||||
/obj/item/weapon/tank/proc/bomb_assemble(W,user) //Bomb assembly proc. This turns assembly+tank into a bomb
|
||||
var/obj/item/device/assembly_holder/S = W
|
||||
var/mob/M = user
|
||||
if(!S.secured) //Check if the assembly is secured
|
||||
return
|
||||
if(isigniter(S.a_left) == isigniter(S.a_right)) //Check if either part of the assembly has an igniter, but if both parts are igniters, then fuck it
|
||||
return
|
||||
|
||||
var/obj/item/device/onetankbomb/R = new /obj/item/device/onetankbomb(loc)
|
||||
|
||||
M.drop_item() //Remove the assembly from your hands
|
||||
M.remove_from_mob(src) //Remove the tank from your character,in case you were holding it
|
||||
M.put_in_hands(R) //Equips the bomb if possible, or puts it on the floor.
|
||||
|
||||
R.bombassembly = S //Tell the bomb about its assembly part
|
||||
S.master = R //Tell the assembly about its new owner
|
||||
S.loc = R //Move the assembly out of the fucking way
|
||||
|
||||
R.bombtank = src //Same for tank
|
||||
master = R
|
||||
loc = R
|
||||
R.update_icon()
|
||||
return
|
||||
|
||||
/obj/item/weapon/tank/proc/ignite() //This happens when a bomb is told to explode
|
||||
var/fuel_moles = air_contents.toxins + air_contents.oxygen/6
|
||||
|
||||
Reference in New Issue
Block a user