mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-27 18:42:19 +00:00
Adds toolspeed var, which is a multiplier on how 'fast' the tool works. 0.5 means it goes twice as fast. Adds usesound var, which determines what sound is used when a tool is being used. Changes a lot of code to use those two vars instead. Adds 'ayyy' tools, which are ported from /tg/'s abductor gamemode. They're currently admin only but I might make them obtainable by xenoarch later. Adds powertools, also from /tg/. CE starts with them in a new toolbelt that spawns in their locker, ported from (you guessed it) /tg/. Changes welder sprites to look nicer, ported yet again from /tg/. Modified the blue welder slightly so it can be the electric welder sprite. Adds various sounds from /tg/, for tools and welders.
94 lines
3.6 KiB
Plaintext
94 lines
3.6 KiB
Plaintext
/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 = NOBLUDGEON
|
|
w_class = ITEMSIZE_SMALL
|
|
origin_tech = list(TECH_ILLEGAL = 2)
|
|
var/datum/wires/explosive/c4/wires = null
|
|
var/timer = 10
|
|
var/atom/target = null
|
|
var/open_panel = 0
|
|
var/image_overlay = null
|
|
|
|
/obj/item/weapon/plastique/New()
|
|
wires = new(src)
|
|
image_overlay = image('icons/obj/assemblies.dmi', "plastic-explosive2")
|
|
..()
|
|
|
|
/obj/item/weapon/plastique/Destroy()
|
|
qdel(wires)
|
|
wires = null
|
|
return ..()
|
|
|
|
/obj/item/weapon/plastique/attackby(var/obj/item/I, var/mob/user)
|
|
if(istype(I, /obj/item/weapon/screwdriver))
|
|
open_panel = !open_panel
|
|
user << "<span class='notice'>You [open_panel ? "open" : "close"] the wire panel.</span>"
|
|
playsound(src, I.usesound, 50, 1)
|
|
else if(istype(I, /obj/item/weapon/wirecutters) || istype(I, /obj/item/device/multitool) || 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(user.get_active_hand() == src)
|
|
newtime = Clamp(newtime, 10, 60000)
|
|
timer = newtime
|
|
user << "Timer set for [timer] seconds."
|
|
|
|
/obj/item/weapon/plastique/afterattack(atom/movable/target, mob/user, flag)
|
|
if (!flag)
|
|
return
|
|
if (ismob(target) || istype(target, /turf/unsimulated) || istype(target, /turf/simulated/shuttle) || istype(target, /obj/item/weapon/storage/) || istype(target, /obj/item/clothing/accessory/storage/) || istype(target, /obj/item/clothing/under))
|
|
return
|
|
user << "Planting explosives..."
|
|
user.do_attack_animation(target)
|
|
|
|
if(do_after(user, 50) && in_range(user, target))
|
|
user.drop_item()
|
|
src.target = target
|
|
loc = null
|
|
|
|
if (ismob(target))
|
|
add_logs(user, target, "planted [name] on")
|
|
user.visible_message("<span class='danger'>[user.name] finished planting an explosive on [target.name]!</span>")
|
|
message_admins("[key_name(user, user.client)](<A HREF='?_src_=holder;adminmoreinfo=\ref[user]'>?</A>) planted [src.name] on [key_name(target)](<A HREF='?_src_=holder;adminmoreinfo=\ref[target]'>?</A>) with [timer] second fuse",0,1)
|
|
log_game("[key_name(user)] planted [src.name] on [key_name(target)] with [timer] second fuse")
|
|
|
|
else
|
|
message_admins("[key_name(user, user.client)](<A HREF='?_src_=holder;adminmoreinfo=\ref[user]'>?</A>) planted [src.name] on [target.name] at ([target.x],[target.y],[target.z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[target.x];Y=[target.y];Z=[target.z]'>JMP</a>) with [timer] second fuse",0,1)
|
|
log_game("[key_name(user)] planted [src.name] on [target.name] at ([target.x],[target.y],[target.z]) with [timer] second fuse")
|
|
|
|
target.overlays += image_overlay
|
|
user << "Bomb has been planted. Timer counting down from [timer]."
|
|
spawn(timer*10)
|
|
explode(get_turf(target))
|
|
|
|
/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, 2, 3)
|
|
|
|
if(target)
|
|
if (istype(target, /turf/simulated/wall))
|
|
var/turf/simulated/wall/W = target
|
|
W.dismantle_wall(1,1,1)
|
|
else if(istype(target, /mob/living))
|
|
target.ex_act(2) // c4 can't gib mobs anymore.
|
|
else
|
|
target.ex_act(1)
|
|
if(target)
|
|
target.overlays -= image_overlay
|
|
qdel(src)
|
|
|
|
/obj/item/weapon/plastique/attack(mob/M as mob, mob/user as mob, def_zone)
|
|
return
|