Files
Paradise/code/game/objects/devices/flash.dm
mport2004@gmail.com 6c90edd6f6 Moved the space suits into the clothing module section, will do more later.
Forgot to add the bioprotection to the actual radiation suits.
Bedsheets actually use the bedsheet item icon now.
Tracking implant ID's work again.
Certain Critters can be harvested by the chef's knives for meat.
Renamed a few critter files.


git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2053 316c924e-a436-60f5-8080-3fe189b3f50e
2011-08-28 07:05:06 +00:00

167 lines
3.9 KiB
Plaintext

/obj/item/device/flash
name = "flash"
desc = "Used for blinding and being an asshole."
icon_state = "flash"
throwforce = 5
w_class = 1.0
throw_speed = 4
throw_range = 10
flags = FPRINT | TABLEPASS| CONDUCT
item_state = "electronic"
origin_tech = "magnets=2;combat=1"
var
shots_left = 5
max_shots = 5
broken = 0
proc
clown_check(var/mob/user)
recharge()
attack(mob/living/M as mob, mob/user as mob)
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been flashed (attempt) with [src.name] by [user.name] ([user.ckey])</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [src.name] to flash [M.name] ([M.ckey])</font>")
if(!clown_check(user)) return
if(broken)
user.show_message("\red The [src.name] is broken", 2)
return
if(shots_left <= 0)
user.show_message("\red *click* *click*", 2)
return
playsound(src.loc, 'flash.ogg', 100, 1)
shots_left--
var/flashfail = 0
if(iscarbon(M))
var/safety = M:eyecheck()
if(safety <= 0)
if(M.weakened <= 10)
M.weakened = 10
flick("e_flash", M.flash)
if(ishuman(M))
if(user.mind in ticker.mode.head_revolutionaries)
var/revsafe = 0
for(var/obj/item/weapon/implant/loyalty/L in M)
if(L && L.implanted)
revsafe = 1
break
if(M.mind.has_been_rev)
revsafe = 2
if(!revsafe)
M.mind.has_been_rev = 1
ticker.mode.add_revolutionary(M.mind)
else if(revsafe == 1)
user << "\red Something seems to be blocking the flash!"
else
user << "\red This mind seems resistant to the flash!"
else
flashfail = 1
else if(issilicon(M))
M.weakened = max(user.weakened, rand(5,10))
if(isrobot(user))
spawn(0)
var/atom/movable/overlay/animation = new(user.loc)
animation.layer = user.layer + 1
animation.icon_state = "blank"
animation.icon = 'mob.dmi'
animation.master = user
flick("blspell", animation)
sleep(5)
del(animation)
if(!flashfail)
for(var/mob/O in viewers(user, null))
O.show_message(text("\red [] blinds [] with the flash!", user, M))
else
for(var/mob/O in viewers(user, null))
O.show_message(text("\blue [] fails to blind [] with the flash!", user, M))
if (prob(2))
broken = 1
user << "\red The bulb has burnt out!"
spawn(60)
recharge()
return
attack_self(mob/living/carbon/user as mob, flag = 0, emp = 0)
if(!emp)
if (!clown_check(user)) return
if(broken)
user.show_message("\red The [src.name] is broken", 2)
return
if(shots_left <= 0)
user.show_message("\red *click* *click*", 2)
return
playsound(src.loc, 'flash.ogg', 100, 1)
shots_left--
flick("flash2", src)
if(isrobot(user))
spawn(0)
var/atom/movable/overlay/animation = new(user.loc)
animation.layer = user.layer + 1
animation.icon_state = "blank"
animation.icon = 'mob.dmi'
animation.master = user
flick("blspell", animation)
sleep(5)
del(animation)
for(var/mob/living/carbon/M in oviewers(3, null))
if(prob(50))
if (locate(/obj/item/weapon/cloaking_device, M))
for(var/obj/item/weapon/cloaking_device/S in M)
S.active = 0
S.icon_state = "shield0"
var/safety = M:eyecheck()
if(!safety)
flick("flash", M.flash)
if (prob(2))
broken = 1
user << "\red The bulb has burnt out!"
return
spawn(60)
recharge()
return
emp_act(severity)
src.attack_self(null,1,1)
..()
clown_check(var/mob/user)
if((user.mutations & CLOWN) && prob(50))
user << "\red The Flash slips out of your hand."
user.drop_item()
return 0
return 1
recharge()
if(max_shots > shots_left)
shots_left++
if(max_shots > shots_left)
spawn(60)//more or less 10 seconds
recharge()
return