Files
Aurora.3/code/game/objects/items/weapons/explosives.dm
Alberyk 76b743a986 Adds the Aut'akh unathi (#5919)
* Base work for the unathi robot subspecies.

* Adds metabolism species, kidney vars, and the robot unathi organs.

* Moves some action buttons to organs, pretty much a bay port right now. Todo: the unathi and alien stuff should also go here.

* First autakh implant power.

* Fixes the organs action button this time.

* Finishes more implants, and interactions with flashs and vaurca.

* Prepare for great changes.

* Drops the real bomb, boss.

* He who fights with monsters.

* Far more work into augments and limb removing powers.

* Limb verbs should be good now.

* A LOT of work into the assited organ, allowing it to bleed and etc, as well adding a new chem that will stop bleeding in their case.

* Probably the last work on implants.

* Some extra touches.

* Some tweaks to the species.

* More fixes and adds kyre's sprites.

* More runtime fixes.

* Fixes the species name too.

* Fixes travis.

* Updates this file too to work with the new tools procs.

* Adds changelog

* Fixed changelog.

* Unathi hair and lore description.

* Some tweaks to this too.

* Locks away them for now, they will be released after we got all the events and etc done.

* Changes this chemical.

* Fixes an airlock runtime.

* Adds the non scan flag to the autakh, mostly due to some bizzare interactions with changelings and cloning.

* Organs removal changes; can't take out the organ if it is too damage.

* Restricts them back again.

* Robotic organs now have the proper icons and names.

* Adds sprites for their organs and some extra tweaks.

* Fixes this missing icon.

* emp should also now hurt assited organs.

* Tweaks more organ related things.

* Fixes the head not being properly set as well.

* Fixes their flags.

* fixes the flag for real this time.

* Poze's review.

* Changes the au'takh organ buttons to don't be animated.

* Helps with adminbus or something.

* Fowl's requested changes.

* Fixes a typo.

* Robotic limb's brute and burn mods are now controlled by the limb model.

* Fowl's changes once more.

* Stops some spam.

* More grammar.

* No eal.

* Skull's review.
2019-01-23 19:27:44 +01:00

93 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 = 2.0
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/Initialize()
. = ..()
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(I.isscrewdriver())
open_panel = !open_panel
user << "<span class='notice'>You [open_panel ? "open" : "close"] the wire panel.</span>"
else if(I.iswirecutter() || I.ismultitool() || 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)|| isopenturf(target) || 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() //TODO: Look into this
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",ckey=key_name(user))
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",ckey=key_name(user))
target.add_overlay(image_overlay, TRUE)
user << "Bomb has been planted. Timer counting down from [timer]."
addtimer(CALLBACK(src, .proc/explode, get_turf(target)), timer * 10)
/obj/item/weapon/plastique/proc/explode(turf/location)
if(!target)
target = get_atom_on_turf(src)
if(!target)
target = src
target.cut_overlay(image_overlay, TRUE)
if(location)
explosion(location, -1, -1, 2, 3, spreading = 0)
if(target)
if (istype(target, /turf/simulated/wall))
var/turf/simulated/wall/W = target
W.dismantle_wall(1, no_product = TRUE)
else if(istype(target, /mob/living))
target.ex_act(2) // c4 can't gib mobs anymore.
else
target.ex_act(1)
qdel(src)
/obj/item/weapon/plastique/attack(mob/M as mob, mob/user as mob, def_zone)
return