diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 1b9fad977158d..09b8ccc832547 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -578,7 +578,15 @@ Turf and target are seperate in case you want to teleport some distance from a t /proc/get_turf_loc(var/atom/movable/M) //gets the location of the turf that the atom is on, or what the atom is in is on, etc //in case they're in a closet or sleeper or something var/atom/loc = M.loc - while(!istype(loc, /turf/)) + while(loc && !istype(loc, /turf/)) + loc = loc.loc + return loc + +// Returns the atom sitting on the turf. +// For example, using this on a disk, which is in a bag, on a mob, will return the mob because it's on the turf. +/proc/get_atom_on_turf(var/atom/movable/M) + var/atom/loc = M + while(loc && loc.loc && !istype(loc.loc, /turf/)) loc = loc.loc return loc diff --git a/code/datums/wires/explosive.dm b/code/datums/wires/explosive.dm new file mode 100644 index 0000000000000..5ba362ba2fd95 --- /dev/null +++ b/code/datums/wires/explosive.dm @@ -0,0 +1,32 @@ +/datum/wires/explosive + wire_count = 1 + +var/const/WIRE_EXPLODE = 1 + +/datum/wires/explosive/proc/explode() + return + +/datum/wires/explosive/UpdatePulsed(var/index) + switch(index) + if(WIRE_EXPLODE) + explode() + +/datum/wires/explosive/UpdateCut(var/index, var/mended) + switch(index) + if(WIRE_EXPLODE) + if(!mended) + explode() + +/datum/wires/explosive/plastic + holder_type = /obj/item/weapon/plastique + +/datum/wires/explosive/plastic/CanUse(var/mob/living/L) + var/obj/item/weapon/plastique/P = holder + if(P.open_panel) + return 1 + return 0 + +/datum/wires/explosive/plastic/explode() + var/obj/item/weapon/plastique/P = holder + P.explode(get_turf(P)) + diff --git a/code/datums/wires/particle_accelerator.dm b/code/datums/wires/particle_accelerator.dm index 610c4d59c62a7..b55995eb3eb5e 100644 --- a/code/datums/wires/particle_accelerator.dm +++ b/code/datums/wires/particle_accelerator.dm @@ -6,7 +6,7 @@ var/const/PARTICLE_TOGGLE_WIRE = 1 // Toggles whether the PA is on or not. var/const/PARTICLE_STRENGTH_WIRE = 2 // Determines the strength of the PA. var/const/PARTICLE_INTERFACE_WIRE = 4 // Determines the interface showing up. var/const/PARTICLE_LIMIT_POWER_WIRE = 8 // Determines how strong the PA can be. -var/const/PARTICLE_NOTHING_WIRE = 16 // Blank wire +//var/const/PARTICLE_NOTHING_WIRE = 16 // Blank wire /datum/wires/particle_acc/control_box/CanUse(var/mob/living/L) var/obj/machinery/particle_accelerator/control_box/C = holder diff --git a/code/datums/wires/wires.dm b/code/datums/wires/wires.dm index c97a93973c390..8ca8541803ae4 100644 --- a/code/datums/wires/wires.dm +++ b/code/datums/wires/wires.dm @@ -67,7 +67,7 @@ var/list/wireColours = list("red", "blue", "green", "black", "orange", "brown", /datum/wires/proc/Interact(var/mob/living/user) var/html = null - if(CanUse()) + if(holder && CanUse()) html = GetInteractWindow() user << browse(html, "window=wires") onclose(user, "wires") diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm index 1962c1e10bc70..c056f499b9cb4 100644 --- a/code/defines/obj/weapon.dm +++ b/code/defines/obj/weapon.dm @@ -553,19 +553,6 @@ var/obj/machinery/machine -/obj/item/weapon/plastique - name = "plastic explosives" - desc = "Used to put holes in specific areas without too much extra hole." - gender = PLURAL - icon = 'icons/obj/assemblies.dmi' - icon_state = "plastic-explosive0" - item_state = "plasticx" - flags = FPRINT | TABLEPASS | USEDELAY - w_class = 2.0 - origin_tech = "syndicate=2" - var/timer = 10 - var/atom/target = null - ///////////////////////////////////////Stock Parts ///////////////////////////////// /obj/item/weapon/stock_parts diff --git a/code/game/objects/items/weapons/explosives.dm b/code/game/objects/items/weapons/explosives.dm index 5304902e4e901..4bff1e72e019c 100644 --- a/code/game/objects/items/weapons/explosives.dm +++ b/code/game/objects/items/weapons/explosives.dm @@ -1,9 +1,37 @@ +/obj/item/weapon/plastique + name = "plastic explosives" + desc = "Used to put holes in specific areas without too much extra hole." + gender = PLURAL + icon = 'icons/obj/assemblies.dmi' + icon_state = "plastic-explosive0" + item_state = "plasticx" + flags = FPRINT | TABLEPASS | USEDELAY + w_class = 2.0 + origin_tech = "syndicate=2" + var/datum/wires/explosive/plastic/wires = null + var/timer = 10 + var/atom/target = null + var/open_panel = 0 + +/obj/item/weapon/plastique/New() + wires = new(src) + ..() + +/obj/item/weapon/plastique/attackby(var/obj/item/I, var/mob/user) + if(isscrewdriver(I)) + open_panel = !open_panel + user << "You [open_panel ? "open" : "close"] the wire panel." + else if(iswirecutter(I) || ismultitool(I) || istype(I, /obj/item/device/assembly/signaler )) + wires.Interact(user) + else + ..() + /obj/item/weapon/plastique/attack_self(mob/user as mob) var/newtime = input(usr, "Please set the timer.", "Timer", 10) as num - if(newtime < 10) - newtime = 10 - timer = newtime - user << "Timer set for [timer] seconds." + if(user.get_active_hand() == src) + newtime = Clamp(newtime, 10, 60000) + timer = newtime + user << "Timer set for [timer] seconds." /obj/item/weapon/plastique/afterattack(atom/target as obj|turf, mob/user as mob, flag) if (!flag) @@ -19,7 +47,7 @@ if(do_after(user, 50) && in_range(user, target)) user.drop_item() - target = target + src.target = target loc = null var/location if (isturf(target)) location = target @@ -30,15 +58,26 @@ target.overlays += image('icons/obj/assemblies.dmi', "plastic-explosive2") user << "Bomb has been planted. Timer counting down from [timer]." spawn(timer*10) - if(target) - explosion(location, -1, -1, 2, 3) - if (istype(target, /turf/simulated/wall)) target:dismantle_wall(1) - else target.ex_act(1) - if (isobj(target)) - if (target) - del(target) - if (src) - del(src) + explode(location) + +/obj/item/weapon/plastique/proc/explode(var/location) + + if(!target) + target = get_atom_on_turf(src) + if(!target) + target = src + if(location) + explosion(location, -1, 1, 3, 4) + + + if (istype(target, /turf/simulated/wall)) + target:dismantle_wall(1) + else + target.ex_act(1) + if (isobj(target)) + if (target) + del(target) + del(src) /obj/item/weapon/plastique/attack(mob/M as mob, mob/user as mob, def_zone) return \ No newline at end of file diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm index d0b64c5901bd0..a16112388c629 100644 --- a/code/modules/projectiles/guns/energy/special.dm +++ b/code/modules/projectiles/guns/energy/special.dm @@ -69,6 +69,8 @@ obj/item/weapon/gun/energy/staff desc = "An artefact that spits bolts of life-force which causes objects which are hit by it to animate and come to life! This magic doesn't affect machines." projectile_type = "/obj/item/projectile/animate" charge_cost = 100 + icon_state = "staffofanimation" + item_state = "staffofanimation" /obj/item/weapon/gun/energy/floragun name = "floral somatoray" diff --git a/code/modules/projectiles/projectile/animate.dm b/code/modules/projectiles/projectile/animate.dm index 3ea6d701045ef..94c48a1273c9b 100644 --- a/code/modules/projectiles/projectile/animate.dm +++ b/code/modules/projectiles/projectile/animate.dm @@ -1,6 +1,6 @@ /obj/item/projectile/animate name = "bolt of animation" - icon_state = "ice_1" + icon_state = "red_1" damage = 0 damage_type = BURN nodamage = 1 diff --git a/html/changelog.html b/html/changelog.html index 5ecc89acdbc6c..64bb10adef29d 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -53,6 +53,7 @@

13 February 2013

Giacom updated:

diff --git a/icons/mob/back.dmi b/icons/mob/back.dmi index 6b2bef1653951..01baceaf6c0b9 100644 Binary files a/icons/mob/back.dmi and b/icons/mob/back.dmi differ diff --git a/icons/mob/items_lefthand.dmi b/icons/mob/items_lefthand.dmi index 9aa0a41b60fa3..e11d43e2edaac 100644 Binary files a/icons/mob/items_lefthand.dmi and b/icons/mob/items_lefthand.dmi differ diff --git a/icons/mob/items_righthand.dmi b/icons/mob/items_righthand.dmi index 7a794bc6828f6..dedfe71eb6ce2 100644 Binary files a/icons/mob/items_righthand.dmi and b/icons/mob/items_righthand.dmi differ diff --git a/icons/obj/gun.dmi b/icons/obj/gun.dmi index e9d1940dd331e..dfc88f317dcba 100644 Binary files a/icons/obj/gun.dmi and b/icons/obj/gun.dmi differ diff --git a/icons/obj/projectiles.dmi b/icons/obj/projectiles.dmi index 14e1f5a1888f6..e46afd477bda8 100644 Binary files a/icons/obj/projectiles.dmi and b/icons/obj/projectiles.dmi differ diff --git a/tgstation.dme b/tgstation.dme index 7005724be8481..a68960095414e 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -176,6 +176,7 @@ #include "code\datums\wires\airlock.dm" #include "code\datums\wires\apc.dm" #include "code\datums\wires\camera.dm" +#include "code\datums\wires\explosive.dm" #include "code\datums\wires\mulebot.dm" #include "code\datums\wires\particle_accelerator.dm" #include "code\datums\wires\radio.dm"