Merge pull request #3510 from FTangSteve/engieBorg

Ports inflatable dispensers from Bay
This commit is contained in:
Neerti
2017-06-20 00:56:23 -04:00
committed by GitHub
3 changed files with 107 additions and 1 deletions
@@ -313,4 +313,104 @@
name = "mobility module"
desc = "By retracting limbs and tucking in its head, a combat android can roll at high speeds."
icon = 'icons/obj/decals.dmi'
icon_state = "shock"
icon_state = "shock"
/obj/item/weapon/inflatable_dispenser
name = "inflatables dispenser"
desc = "Hand-held device which allows rapid deployment and removal of inflatables."
icon = 'icons/obj/storage.dmi'
icon_state = "inf_deployer"
w_class = ITEMSIZE_LARGE
var/stored_walls = 5
var/stored_doors = 2
var/max_walls = 5
var/max_doors = 2
var/mode = 0 // 0 - Walls 1 - Doors
/obj/item/weapon/inflatable_dispenser/robot
w_class = ITEMSIZE_HUGE
stored_walls = 10
stored_doors = 5
max_walls = 10
max_doors = 5
/obj/item/weapon/inflatable_dispenser/examine(var/mob/user)
if(!..(user))
return
to_chat(user, "It has [stored_walls] wall segment\s and [stored_doors] door segment\s stored.")
to_chat(user, "It is set to deploy [mode ? "doors" : "walls"]")
/obj/item/weapon/inflatable_dispenser/attack_self()
mode = !mode
to_chat(usr, "You set \the [src] to deploy [mode ? "doors" : "walls"].")
/obj/item/weapon/inflatable_dispenser/afterattack(var/atom/A, var/mob/user)
..(A, user)
if(!user)
return
if(!user.Adjacent(A))
to_chat(user, "You can't reach!")
return
if(istype(A, /turf))
try_deploy_inflatable(A, user)
if(istype(A, /obj/item/inflatable) || istype(A, /obj/structure/inflatable))
pick_up(A, user)
/obj/item/weapon/inflatable_dispenser/proc/try_deploy_inflatable(var/turf/T, var/mob/living/user)
if(mode) // Door deployment
if(!stored_doors)
to_chat(user, "\The [src] is out of doors!")
return
if(T && istype(T))
new /obj/structure/inflatable/door(T)
stored_doors--
else // Wall deployment
if(!stored_walls)
to_chat(user, "\The [src] is out of walls!")
return
if(T && istype(T))
new /obj/structure/inflatable(T)
stored_walls--
playsound(T, 'sound/items/zip.ogg', 75, 1)
to_chat(user, "You deploy the inflatable [mode ? "door" : "wall"]!")
/obj/item/weapon/inflatable_dispenser/proc/pick_up(var/obj/A, var/mob/living/user)
if(istype(A, /obj/structure/inflatable))
if(!istype(A, /obj/structure/inflatable/door))
if(stored_walls >= max_walls)
to_chat(user, "\The [src] is full.")
return
stored_walls++
qdel(A)
else
if(stored_doors >= max_doors)
to_chat(user, "\The [src] is full.")
return
stored_doors++
qdel(A)
playsound(loc, 'sound/machines/hiss.ogg', 75, 1)
visible_message("\The [user] deflates \the [A] with \the [src]!")
return
if(istype(A, /obj/item/inflatable))
if(!istype(A, /obj/item/inflatable/door))
if(stored_walls >= max_walls)
to_chat(user, "\The [src] is full.")
return
stored_walls++
qdel(A)
else
if(stored_doors >= max_doors)
to_chat(usr, "\The [src] is full!")
return
stored_doors++
qdel(A)
visible_message("\The [user] picks up \the [A] with \the [src]!")
return
to_chat(user, "You fail to pick up \the [A] with \the [src]")
return
@@ -397,11 +397,13 @@ var/global/list/robot_modules = list(
src.modules += new /obj/item/device/lightreplacer(src)
src.modules += new /obj/item/device/pipe_painter(src)
src.modules += new /obj/item/device/floor_painter(src)
src.modules += new /obj/item/weapon/inflatable_dispenser/robot(src)
src.emag = new /obj/item/weapon/melee/baton/robot/arm(src)
src.modules += new /obj/item/device/geiger(src)
var/datum/matter_synth/metal = new /datum/matter_synth/metal(40000)
var/datum/matter_synth/glass = new /datum/matter_synth/glass(40000)
var/datum/matter_synth/plasteel = new /datum/matter_synth/plasteel(20000)
var/datum/matter_synth/wire = new /datum/matter_synth/wire()
synths += metal
synths += glass
@@ -428,6 +430,10 @@ var/global/list/robot_modules = list(
C.synths = list(wire)
src.modules += C
var/obj/item/stack/material/cyborg/plasteel/P = new (src)
P.synths = list(plasteel)
src.modules += P
var/obj/item/stack/tile/floor/cyborg/S = new /obj/item/stack/tile/floor/cyborg(src)
S.synths = list(metal)
src.modules += S