Skip to content

Commit

Permalink
- Added plastic explosive wire(s). It has a single wire which when c…
Browse files Browse the repository at this point in the history
…ut/pulsed will cause it to explode. Yeah you can attach a signaler to it.

 - Gave the c4 a little bit more power.
 - Added a new icon for the staff of animation. Created by Teh Wolf.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5698 316c924e-a436-60f5-8080-3fe189b3f50e
  • Loading branch information
giacomand@gmail.com committed Feb 13, 2013
1 parent 310fd67 commit d2a41ee
Show file tree
Hide file tree
Showing 15 changed files with 101 additions and 31 deletions.
10 changes: 9 additions & 1 deletion code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
32 changes: 32 additions & 0 deletions code/datums/wires/explosive.dm
Original file line number Diff line number Diff line change
@@ -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))

2 changes: 1 addition & 1 deletion code/datums/wires/particle_accelerator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion code/datums/wires/wires.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
13 changes: 0 additions & 13 deletions code/defines/obj/weapon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
67 changes: 53 additions & 14 deletions code/game/objects/items/weapons/explosives.dm
Original file line number Diff line number Diff line change
@@ -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 << "<span class='notice'>You [open_panel ? "open" : "close"] the wire panel.</span>"
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)
Expand All @@ -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
Expand All @@ -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
2 changes: 2 additions & 0 deletions code/modules/projectiles/guns/energy/special.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/projectiles/projectile/animate.dm
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions html/changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ <h2 class="date">13 February 2013</h2>
<h3 class="author">Giacom updated:</h3>
<ul class="changes bgimages16">
<li class="rscadd">There are now hackable wires for the PA computer. To open the interface, click on it while the wires are exposed/panel is open. All but one wire will do something interesting, see if you can figure it out. You can also attach signallers to the wires so have fun remotely releasing the singularity.</li>
<li class="imageadd">New staff of animation icon by Teh Wolf!</li>
</ul>
</div>

Expand Down
Binary file modified icons/mob/back.dmi
Binary file not shown.
Binary file modified icons/mob/items_lefthand.dmi
Binary file not shown.
Binary file modified icons/mob/items_righthand.dmi
Binary file not shown.
Binary file modified icons/obj/gun.dmi
Binary file not shown.
Binary file modified icons/obj/projectiles.dmi
Binary file not shown.
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit d2a41ee

Please sign in to comment.