Files
Bubberstation/code/game/objects/items/weapons/singularityhammer.dm
supersayu a993ce62db Bugfixen and minor changes. Fixes #136.
Adjusts the click code to not use client/Click().  The code is largely unchanged, except that it allows the compiler default behaviour of calling atom/Click(), and then forwards the call to mob/ClickOn().  I had some reports that melee combat mixed with movement was behaving oddly, and I believe it may be due to the use of client/Click; the byond documentation says that redefining client/Click() causes additional overhead, and it isn't strictly necessary.

Alters the way double clicks are handled, in an attempt to better handle clickspam, as often occurs during pitched combat.  This may also be responsible for the above, but I don't know.

Inserts proximity (aka flag) checks in all afterattack() procs.  The old assumption was that unless an item used the USEDELAY flag, afterattack() was only called when adjacent, but this is no longer true.  This led to beakers, soap, crayons, etc, all being usable at all ranges.

Removes the NODELAY flag, which was unused.  Removes all existing uses of the USEDELAY flag so that it can be readded to things that need extra delay.

Removes the hand_* procs, previously used by restrained actions.  Instead, the mob helper mob/RestrainedClickOn() has abosrbed basically all the functionality they were used for, which is really only monkeys with jungle fever.

Adds a special case of the Adjacency() proc for doors.  This fixes #136, airlocks being unreachable due to border fire doors.  However, this only takes us back to the unpleasant position where you have to open-hand the door, switch to a crowbar, and pry open the firedoor; it still needs a better fix.
2013-09-17 18:19:14 -04:00

133 lines
3.4 KiB
Plaintext

/obj/item/weapon/twohanded/singularityhammer
name = "singularity hammer"
desc = "The pinnacle of close combat technology, the hammer harnesses the power of a miniaturized singularity to deal crushing blows."
icon_state = "mjollnir0"
flags = FPRINT | TABLEPASS
slot_flags = SLOT_BACK
force = 5
force_unwielded = 5
force_wielded = 20
throwforce = 15
throw_range = 1
w_class = 5
var/charged = 5
origin_tech = "combat=5, bluespace=4"
New()
..()
processing_objects.Add(src)
Del()
processing_objects.Remove(src)
..()
process()
if(charged < 5)
charged++
return
/obj/item/weapon/twohanded/singularityhammer/update_icon() //Currently only here to fuck with the on-mob icons.
icon_state = "mjollnir[wielded]"
return
/obj/item/weapon/twohanded/singularityhammer/proc/vortex(var/turf/pull as turf, mob/wielder as mob)
for(var/atom/X in orange(5,pull))
if(istype(X, /atom/movable))
if(X == wielder) continue
if((X) &&(!X:anchored) && (!istype(X,/mob/living/carbon/human)))
step_towards(X,pull)
step_towards(X,pull)
step_towards(X,pull)
else if(istype(X,/mob/living/carbon/human))
var/mob/living/carbon/human/H = X
if(istype(H.shoes,/obj/item/clothing/shoes/magboots))
var/obj/item/clothing/shoes/magboots/M = H.shoes
if(M.magpulse)
continue
H.apply_effect(1, WEAKEN, 0)
step_towards(H,pull)
step_towards(H,pull)
step_towards(H,pull)
return
/obj/item/weapon/twohanded/singularityhammer/afterattack(atom/A as mob|obj|turf|area, mob/user as mob, proximity)
if(!proximity) return
if(wielded)
if(charged == 5)
charged = 0
if(istype(A, /mob/living/))
var/mob/living/Z = A
Z.take_organ_damage(20,0)
playsound(user, 'sound/weapons/marauder.ogg', 50, 1)
var/turf/target = get_turf(A)
vortex(target,user)
/obj/item/weapon/twohanded/mjollnir
name = "Mjollnir"
desc = "A weapon worthy of a god, able to strike with the force of a lightning bolt. It crackles with barely contained energy."
icon_state = "mjollnir0"
flags = FPRINT | TABLEPASS
slot_flags = SLOT_BACK
force = 5
force_unwielded = 5
force_wielded = 20
throwforce = 30
throw_range = 10
w_class = 5
//var/charged = 5
origin_tech = "combat=5, power=5"
/*
New()
..()
processing_objects.Add(src)
Del()
processing_objects.Remove(src)
..()
process()
if(charged < 5)
charged++
return
*/
/obj/item/weapon/twohanded/mjollnir/proc/shock(mob/living/target as mob)
var/datum/effect/effect/system/lightning_spread/s = new /datum/effect/effect/system/lightning_spread
s.set_up(5, 1, target.loc)
s.start()
target.take_organ_damage(0,30)
target.visible_message("\red [target.name] was shocked by the [src.name]!", \
"\red <B>You feel a powerful shock course through your body sending you flying!</B>", \
"\red You hear a heavy electrical crack")
var/atom/throw_target = get_edge_target_turf(target, get_dir(src, get_step_away(target, src)))
target.throw_at(throw_target, 200, 4)
return
/obj/item/weapon/twohanded/mjollnir/attack(mob/M as mob, mob/user as mob)
..()
spawn(0)
if(wielded)
//if(charged == 5)
//charged = 0
playsound(src.loc, "sparks", 50, 1)
if(istype(M, /mob/living))
M.Stun(10)
shock(M)
/obj/item/weapon/twohanded/mjollnir/update_icon() //Currently only here to fuck with the on-mob icons.
icon_state = "mjollnir[wielded]"
return