Files
Paradise/code/game/objects/items/weapons/explosives.dm
johnsonmt88@gmail.com fd529891ca Sanitized a large number of input()s.
- Hopefully this will cut down on the server spamming/crashing escapades happening on other servers. (This wont stop that from happening, this just makes it less severe)
- Some of the sanitizes were probably unnecessary, but better safe then sorry.

Added MAX_NAME_LEN constant which is initialized to 26.
- Please use MAX_NAME_LEN instead of typing in 26 when cutting inputs short. 26's are annoying when they have to be changed and you have to hunt through over a hundred files and tens of thousands of lines of code to find them all.

Moved uplink_kits.dm to code/game/objects/storage

Moved uplinks.dm to code/game/objects
- The stuff inside uplinks.dm could really be chopped up and split into separate dm files but this will do for now.


*********************************************************
**********************Important**************************
*********************************************************
When you create code that asks the user for an input consider whether or not it gets shown to the user through html or the like.

If it does please sanatize() or strip_html() it. Also use copytext() to cutoff spam by using MAX_NAME_LEN and MAX_MESSAGE_LEN as the cutoff var.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3652 316c924e-a436-60f5-8080-3fe189b3f50e
2012-05-24 19:34:04 +00:00

44 lines
1.8 KiB
Plaintext

/obj/item/weapon/plastique/attack_self(mob/user as mob)
var/newtime = input(usr, "Please set the timer.", "Timer", 10) as num
if(newtime < 1)
newtime = 10
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)
return
if (istype(target, /turf/unsimulated) || istype(target, /turf/simulated/shuttle) || istype(target, /obj/item/weapon/storage/))
return
user << "Planting explosives..."
if(ismob(target))
user.attack_log += "\[[time_stamp()]\] <font color='red'> [user.real_name] tried planting [name] on [target:real_name] ([target:ckey])</font>"
log_attack("<font color='red'> [user.real_name] ([user.ckey]) tried planting [name] on [target:real_name] ([target:ckey])</font>")
user.visible_message("\red [user.name] is trying to plant some kind of explosive on [target.name]!")
if(do_after(user, 50) && in_range(user, target))
user.drop_item()
target = target
loc = null
var/location
if (isturf(target)) location = target
if (isobj(target)) location = target.loc
if (ismob(target))
target:attack_log += "\[[time_stamp()]\]<font color='orange'> Had the [name] planted on them by [user.real_name] ([user.ckey])</font>"
user.visible_message("\red [user.name] finished planting an explosive on [target.name]!")
target.overlays += image('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)
/obj/item/weapon/plastique/attack(mob/M as mob, mob/user as mob, def_zone)
return