Recoded flashbangs/empnades slightly.

AIs now have a 50% chance to actually get the sender correct if they intercept a PDA message.
Moved Paint and DNAInjectors into their own files
edit_player renamed to show_player_panel 
Cleaned up the grille code a bit


git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2007 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
mport2004@gmail.com
2011-08-12 21:57:09 +00:00
parent 7012df9b00
commit c03b746cc1
15 changed files with 601 additions and 628 deletions
+5 -2
View File
@@ -473,8 +473,11 @@
P.tnote += "<i><b>&larr; From <a href='byond://?src=\ref[P];choice=Message;target=\ref[src]'>[owner]</a>:</b></i><br>[t]<br>"
if (prob(15)) //Give the AI a chance of intercepting the message
for (var/mob/living/silicon/ai/A in world)
A.show_message("<i>Intercepted message from <b>[P:owner]</b>: [t]</i>")
var/who = src.owner
if(prob(50))
who = P:owner
for(var/mob/living/silicon/ai/ai in world)
ai.show_message("<i>Intercepted message from <b>[who]</b>: [t]</i>")
if (!P.silent)
playsound(P.loc, 'twobeep.ogg', 50, 1)
+3 -3
View File
@@ -1,10 +1,10 @@
proc/empulse(turf/epicenter, heavy_range, light_range, nolog=0)
proc/empulse(turf/epicenter, heavy_range, light_range, log=0)
if(!epicenter) return
if (!istype(epicenter, /turf))
if(!istype(epicenter, /turf))
epicenter = get_turf(epicenter.loc)
if (!nolog)
if(log)
message_admins("EMP with size ([heavy_range], [light_range]) in area [epicenter.loc.name] ")
log_game("EMP with size ([heavy_range], [light_range]) in area [epicenter.loc.name] ")
+150 -158
View File
@@ -1,122 +1,163 @@
/obj/grille
desc = "A piece of metal with evenly spaced gridlike holes in it. Blocks large object but lets small items, gas, or energy beams through. Strangely enough these grilles also lets meteors pass through them, whether they be small or huge station breaking death stones."
name = "grille"
icon = 'structures.dmi'
icon_state = "grille"
density = 1
anchored = 1.0
flags = FPRINT | CONDUCT
pressure_resistance = 5*ONE_ATMOSPHERE
layer = 2.9
var
health = 10
destroyed = 0
proc
healthcheck()
shock(mob/user, prb)
/obj/grille/ex_act(severity)
switch(severity)
if(1.0)
del(src)
return
if(2.0)
if (prob(50))
//SN src = null
ex_act(severity)
switch(severity)
if(1.0)
del(src)
return
if(3.0)
if (prob(25))
src.health -= 11
healthcheck()
if(2.0)
if(prob(50))
del(src)
return
if(3.0)
if(prob(25))
src.health -= 11
healthcheck()
return
blob_act()
del(src)
return
meteorhit(var/obj/M)
if (M.icon_state == "flaming")
src.health -= 2
healthcheck()
return
attack_hand(var/mob/user)
playsound(src.loc, 'grillehit.ogg', 80, 1)
user.visible_message("[user.name] kicks the [src.name].", \
"You kick the [src.name].", \
"You hear a noise")
if((usr.mutations & HULK))
src.health -= 5
else if(!shock(user, 70))
src.health -= 3
healthcheck()
return
attack_paw(var/mob/user)
attack_hand(user)
attack_alien(var/mob/user)
if (istype(usr, /mob/living/carbon/alien/larva)) return
playsound(src.loc, 'grillehit.ogg', 80, 1)
user.visible_message("[user.name] mangles the [src.name].", \
"You mangle the [src.name].", \
"You hear a noise")
if(!shock(usr, 70))
src.health -= 5
healthcheck()
return
attack_metroid(var/mob/user)
if(!istype(usr, /mob/living/carbon/metroid/adult)) return
playsound(src.loc, 'grillehit.ogg', 80, 1)
user.visible_message("[user.name] smashes against the [src.name].", \
"You smash against the [src.name].", \
"You hear a noise")
src.health -= rand(2,3)
healthcheck()
return
CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(air_group || (height==0)) return 1
if(istype(mover) && mover.checkpass(PASSGRILLE))
return 1
else
return
if (istype(mover, /obj/item/projectile))
return prob(30)
else
return !src.density
/obj/grille/blob_act()
del(src)
/obj/grille/meteorhit(var/obj/M)
if (M.icon_state == "flaming")
src.health -= 2
healthcheck()
return
/obj/grille/attack_hand(var/obj/M)
if ((usr.mutations & HULK))
usr << text("\blue You kick the grille.")
for(var/mob/O in oviewers())
if ((O.client && !( O.blinded )))
O << text("\red [] kicks the grille.", usr)
src.health -= 5
healthcheck()
return
else if(!shock(usr, 70))
usr << text("\blue You kick the grille.")
for(var/mob/O in oviewers())
if ((O.client && !( O.blinded )))
O << text("\red [] kicks the grille.", usr)
playsound(src.loc, 'grillehit.ogg', 80, 1)
src.health -= 3
healthcheck()
/obj/grille/attack_paw(var/obj/M)
if ((usr.mutations & HULK))
usr << text("\blue You kick the grille.")
for(var/mob/O in oviewers())
if ((O.client && !( O.blinded )))
O << text("\red [] kicks the grille.", usr)
src.health -= 5
healthcheck()
return
else if(!shock(usr, 70))
usr << text("\blue You kick the grille.")
for(var/mob/O in oviewers())
if ((O.client && !( O.blinded )))
O << text("\red [] kicks the grille.", usr)
playsound(src.loc, 'grillehit.ogg', 80, 1)
src.health -= 3
/obj/grille/attack_alien(var/obj/M)
if (istype(usr, /mob/living/carbon/alien/larva))//Safety check for larva, in case they get attack_alien in the future. /N
return
if (!shock(usr, 70))
usr << text("\green You mangle the grille.")
for(var/mob/O in oviewers())
if ((O.client && !( O.blinded )))
O << text("\red [] mangles the grille.", usr)
playsound(src.loc, 'grillehit.ogg', 80, 1)
src.health -= 3
healthcheck()
return
/obj/grille/attack_metroid(var/obj/M)
if(!istype(usr, /mob/living/carbon/metroid/adult))
return
usr<< text("\green You smash against the grille.")
for(var/mob/O in oviewers())
if ((O.client && !( O.blinded )))
O << text("\red [] smashes against the grille.", usr)
playsound(src.loc, 'grillehit.ogg', 80, 1)
src.health -= rand(2,3)
healthcheck()
return
return
/obj/grille/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(air_group || (height==0)) return 1
if(istype(mover) && mover.checkpass(PASSGRILLE))
return 1
else
if (istype(mover, /obj/item/projectile))
return prob(30)
else
return !src.density
/obj/grille/attackby(obj/item/weapon/W, mob/user)
if (istype(W, /obj/item/weapon/wirecutters))
if(!(destroyed))
attackby(obj/item/weapon/W, mob/user)
if(iswirecutter(W))
if(!shock(user, 100))
playsound(src.loc, 'Wirecutter.ogg', 100, 1)
src.health = 0
else
playsound(src.loc, 'Wirecutter.ogg', 100, 1)
src.health = -100
if(!destroyed)
src.health = -100
else if ((isscrewdriver(W)) && (istype(src.loc, /turf/simulated) || src.anchored))
if(!shock(user, 90))
playsound(src.loc, 'Screwdriver.ogg', 100, 1)
src.anchored = !( src.anchored )
user << (src.anchored ? "You have fastened the grille to the floor." : "You have unfastened the grill.")
for(var/mob/O in oviewers())
O << text("\red [user] [src.anchored ? "fastens" : "unfastens"] the grille.")
return
else if(istype(W, /obj/item/weapon/shard))
src.health -= W.force * 0.1
else if(!shock(user, 70))
playsound(src.loc, 'grillehit.ogg', 80, 1)
switch(W.damtype)
if("fire")
src.health -= W.force
if("brute")
src.health -= W.force * 0.1
src.healthcheck()
..()
return
healthcheck()
if (src.health <= 0)
if (!( src.destroyed ))
src.icon_state = "brokengrille"
src.density = 0
src.destroyed = 1
new /obj/item/stack/rods( src.loc )
else
if (src.health <= -10.0)
new /obj/item/stack/rods( src.loc )
//SN src = null
del(src)
return
return
// shock user with probability prb (if all connections & power are working)
// returns 1 if shocked, 0 otherwise
shock(mob/user, prb)
if(!anchored || destroyed) // anchored/destroyed grilles are never connected
return 0
if(!prob(prb))
return 0
var/turf/T = get_turf(src)
if (electrocute_mob(user, T.get_cable_node(), src))
var/datum/effects/system/spark_spread/s = new /datum/effects/system/spark_spread
s.set_up(5, 1, src)
s.start()
return 1
else
return 0
else if ((istype(W, /obj/item/weapon/screwdriver) && (istype(src.loc, /turf/simulated) || src.anchored)))
if(!shock(user, 90))
playsound(src.loc, 'Screwdriver.ogg', 100, 1)
src.anchored = !( src.anchored )
user << (src.anchored ? "You have fastened the grille to the floor." : "You have unfastened the grill.")
for(var/mob/O in oviewers())
O << text("\red [user] [src.anchored ? "fastens" : "unfastens"] the grille.")
return
else if(istype(W, /obj/item/weapon/shard))
src.health -= W.force * 0.1
/*if(ishuman(user)) //Let's check if the guy's wearing electrically insulated gloves --Agourimarkan
var/mob/living/carbon/human/H = user
if(H.gloves)
@@ -159,52 +200,3 @@
return
else //Alright, he's not a human. Can monkeys or aliens even wear gloves?
src.health -= W.force *0.1*/ //10% damage only for non-glorious human master race members
else // anything else, chance of a shock
if(!shock(user, 70))
playsound(src.loc, 'grillehit.ogg', 80, 1)
switch(W.damtype)
if("fire")
src.health -= W.force
if("brute")
src.health -= W.force * 0.1
src.healthcheck()
..()
return
/obj/grille/proc/healthcheck()
if (src.health <= 0)
if (!( src.destroyed ))
src.icon_state = "brokengrille"
src.density = 0
src.destroyed = 1
new /obj/item/stack/rods( src.loc )
else
if (src.health <= -10.0)
new /obj/item/stack/rods( src.loc )
//SN src = null
del(src)
return
return
// shock user with probability prb (if all connections & power are working)
// returns 1 if shocked, 0 otherwise
/obj/grille/proc/shock(mob/user, prb)
if(!anchored || destroyed) // anchored/destroyed grilles are never connected
return 0
if(!prob(prb))
return 0
var/turf/T = get_turf(src)
if (electrocute_mob(user, T.get_cable_node(), src))
var/datum/effects/system/spark_spread/s = new /datum/effects/system/spark_spread
s.set_up(5, 1, src)
s.start()
return 1
else
return 0
@@ -0,0 +1,340 @@
/obj/item/weapon/dnainjector
name = "DNA-Injector"
desc = "This injects the person with DNA."
icon = 'items.dmi'
icon_state = "dnainjector"
var/dnatype = null
var/dna = null
var/block = null
var/owner = null
var/ue = null
var/s_time = 10.0
throw_speed = 1
throw_range = 5
w_class = 1.0
var/uses = 1
var/nofail
var/is_bullet = 0
/obj/item/weapon/dnainjector/attack_paw(mob/user as mob)
return attack_hand(user)
/obj/item/weapon/dnainjector/proc/inject(mob/M as mob)
M.radiation += rand(20,50)
if (dnatype == "ui")
if (!block) //isolated block?
if (ue) //unique enzymes? yes
M.dna.uni_identity = dna
updateappearance(M, M.dna.uni_identity)
M.real_name = ue
M.name = ue
uses--
else //unique enzymes? no
M.dna.uni_identity = dna
updateappearance(M, M.dna.uni_identity)
uses--
else
M.dna.uni_identity = setblock(M.dna.uni_identity,block,dna,3)
updateappearance(M, M.dna.uni_identity)
uses--
if (dnatype == "se")
if (!block) //isolated block?
M.dna.struc_enzymes = dna
domutcheck(M, null)
uses--
else
M.dna.struc_enzymes = setblock(M.dna.struc_enzymes,block,dna,3)
domutcheck(M, null,1)
uses--
spawn(0)//this prevents the collapse of space-time continuum
del(src)
return uses
/obj/item/weapon/dnainjector/attack(mob/M as mob, mob/user as mob)
if (!istype(M, /mob))
return
if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
user << "\red You don't have the dexterity to do this!"
return
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been injected with [name] by [user.name] ([user.ckey])</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [name] to inject [M.name] ([M.ckey])</font>")
if (user)
if (istype(M, /mob/living/carbon/human))
var/obj/equip_e/human/O = new /obj/equip_e/human( )
O.source = user
O.target = M
O.item = src
O.s_loc = user.loc
O.t_loc = M.loc
O.place = "dnainjector"
M.requests += O
if (dnatype == "se")
if (isblockon(getblock(dna, 14,3),14) && istype(M, /mob/living/carbon/human))
message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name] \red(MONKEY)")
log_game("[key_name(user)] injected [key_name(M)] with the [name] (MONKEY)")
else
message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]")
log_game("[key_name(user)] injected [key_name(M)] with the [name]")
else
message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]")
log_game("[key_name(user)] injected [key_name(M)] with the [name]")
spawn( 0 )
O.process()
return
else
for(var/mob/O in viewers(M, null))
O.show_message(text("\red [] has been injected with [] by [].", M, src, user), 1)
//Foreach goto(192)
if (!(istype(M, /mob/living/carbon/human) || istype(M, /mob/living/carbon/monkey)))
user << "\red Apparently it didn't work."
return
if (dnatype == "se")
if (isblockon(getblock(dna, 14,3),14) && istype(M, /mob/living/carbon/human))
message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name] \red(MONKEY)")
log_game("[key_name(user)] injected [key_name(M)] with the [name] (MONKEY)")
else
message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]")
log_game("[key_name(user)] injected [key_name(M)] with the [name]")
else
message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]")
log_game("[key_name(user)] injected [key_name(M)] with the [name]")
inject(M)//Now we actually do the heavy lifting.
/*
A user injecting themselves could mean their own transformation and deletion of mob.
I don't have the time to figure out how this code works so this will do for now.
I did rearrange things a bit.
*/
if(!isnull(user))//If the user still exists. Their mob may not.
user.show_message(text("\red You inject [M]"))
return
/obj/item/weapon/dnainjector/antihulk
name = "DNA-Injector (Anti-Hulk)"
desc = "Cures green skin."
dnatype = "se"
dna = "708"
//block = 2
New()
..()
block = HULKBLOCK
/obj/item/weapon/dnainjector/hulkmut
name = "DNA-Injector (Hulk)"
desc = "This will make you big and strong, but give you a bad skin condition."
dnatype = "se"
dna = "FED"
//block = 2
New()
..()
block = HULKBLOCK
/obj/item/weapon/dnainjector/xraymut
name = "DNA-Injector (Xray)"
desc = "Finally you can see what the Captain does."
dnatype = "se"
dna = "FED"
//block = 8
New()
..()
block = XRAYBLOCK
/obj/item/weapon/dnainjector/antixray
name = "DNA-Injector (Anti-Xray)"
desc = "It will make you see harder."
dnatype = "se"
dna = "708"
//block = 8
New()
..()
block = XRAYBLOCK
/////////////////////////////////////
/obj/item/weapon/dnainjector/antiglasses
name = "DNA-Injector (Anti-Glasses)"
desc = "Toss away those glasses!"
dnatype = "se"
dna = "708"
block = 1
/obj/item/weapon/dnainjector/glassesmut
name = "DNA-Injector (Glasses)"
desc = "Will make you need dorkish glasses."
dnatype = "se"
dna = "BD6"
block = 1
/obj/item/weapon/dnainjector/epimut
name = "DNA-Injector (Epi.)"
desc = "Shake shake shake the room!"
dnatype = "se"
dna = "FA0"
block = 3
/obj/item/weapon/dnainjector/antiepi
name = "DNA-Injector (Anti-Epi.)"
desc = "Will fix you up from shaking the room."
dnatype = "se"
dna = "708"
block = 3
////////////////////////////////////
/obj/item/weapon/dnainjector/anticough
name = "DNA-Injector (Anti-Cough)"
desc = "Will stop that aweful noise."
dnatype = "se"
dna = "708"
block = 5
/obj/item/weapon/dnainjector/coughmut
name = "DNA-Injector (Cough)"
desc = "Will bring forth a sound of horror from your throat."
dnatype = "se"
dna = "BD6"
block = 5
/obj/item/weapon/dnainjector/clumsymut
name = "DNA-Injector (Clumsy)"
desc = "Makes clown minions."
dnatype = "se"
dna = "FA0"
//block = 6
New()
..()
block = CLUMSYBLOCK
/obj/item/weapon/dnainjector/anticlumsy
name = "DNA-Injector (Anti-Clumy)"
desc = "Apply this for Security Clown."
dnatype = "se"
dna = "708"
//block = 6
New()
..()
block = CLUMSYBLOCK
/obj/item/weapon/dnainjector/antitour
name = "DNA-Injector (Anti-Tour.)"
desc = "Will cure tourrets."
dnatype = "se"
dna = "708"
block = 7
/obj/item/weapon/dnainjector/tourmut
name = "DNA-Injector (Tour.)"
desc = "Gives you a nasty case off tourrets."
dnatype = "se"
dna = "BD6"
block = 7
/obj/item/weapon/dnainjector/stuttmut
name = "DNA-Injector (Stutt.)"
desc = "Makes you s-s-stuttterrr"
dnatype = "se"
dna = "FA0"
block = 9
/obj/item/weapon/dnainjector/antistutt
name = "DNA-Injector (Anti-Stutt.)"
desc = "Fixes that speaking impairment."
dnatype = "se"
dna = "708"
block = 9
/obj/item/weapon/dnainjector/antifire
name = "DNA-Injector (Anti-Fire)"
desc = "Cures fire."
dnatype = "se"
dna = "708"
//block = 10
New()
..()
block = FIREBLOCK
/obj/item/weapon/dnainjector/firemut
name = "DNA-Injector (Fire)"
desc = "Gives you fire."
dnatype = "se"
dna = "FED"
//block = 10
New()
..()
block = FIREBLOCK
/obj/item/weapon/dnainjector/blindmut
name = "DNA-Injector (Blind)"
desc = "Makes you not see anything."
dnatype = "se"
dna = "FA0"
//block = 11
New()
..()
block = BLINDBLOCK
/obj/item/weapon/dnainjector/antiblind
name = "DNA-Injector (Anti-Blind)"
desc = "ITS A MIRACLE!!!"
dnatype = "se"
dna = "708"
//block = 11
New()
..()
block = BLINDBLOCK
/obj/item/weapon/dnainjector/antitele
name = "DNA-Injector (Anti-Tele.)"
desc = "Will make you not able to control your mind."
dnatype = "se"
dna = "708"
//block = 12
New()
..()
block = TELEBLOCK
/obj/item/weapon/dnainjector/telemut
name = "DNA-Injector (Tele.)"
desc = "Super brain man!"
dnatype = "se"
dna = "FED"
//block = 12
New()
..()
block = TELEBLOCK
/obj/item/weapon/dnainjector/deafmut
name = "DNA-Injector (Deaf)"
desc = "Sorry, what did you say?"
dnatype = "se"
dna = "FA0"
//block = 13
New()
..()
block = DEAFBLOCK
/obj/item/weapon/dnainjector/antideaf
name = "DNA-Injector (Anti-Deaf)"
desc = "Will make you hear once more."
dnatype = "se"
dna = "708"
//block = 13
New()
..()
block = DEAFBLOCK
/obj/item/weapon/dnainjector/h2m
name = "DNA-Injector (Human > Monkey)"
desc = "Will make you a flea bag."
dnatype = "se"
dna = "FA0"
block = 14
/obj/item/weapon/dnainjector/m2h
name = "DNA-Injector (Monkey > Human)"
desc = "Will make you...less hairy."
dnatype = "se"
dna = "708"
block = 14
+223 -205
View File
@@ -5,226 +5,244 @@ FLASHBANG
*/
/obj/item/weapon/empgrenade/afterattack(atom/target as mob|obj|turf|area, mob/user as mob)
if (user.equipped() == src)
if ((user.mutations & CLOWN) && prob(50))
user << "\red Huh? How does this thing work?!"
src.state = 1
src.icon_state = "empar"
playsound(src.loc, 'armbomb.ogg', 75, 1, -3)
spawn( 5 )
prime()
return
else if (!( src.state ))
/obj/item/weapon/empgrenade
desc = "It is set to detonate in 5 seconds."
name = "emp grenade"
w_class = 2.0
icon = 'device.dmi'
icon_state = "emp"
item_state = "emp"
throw_speed = 4
throw_range = 20
flags = FPRINT | TABLEPASS | CONDUCT | ONBELT
origin_tech = "materials=2;magnets=3"
var
active = 0
det_time = 50
proc
prime()
clown_check(var/mob/living/user)
afterattack(atom/target as mob|obj|turf|area, mob/user as mob)
if((user.equipped() == src)&&(!active)&&(clown_check(user)))
user << "\red You prime the emp grenade! [det_time/10] seconds!"
src.state = 1
src.active = 1
src.icon_state = "empar"
playsound(src.loc, 'armbomb.ogg', 75, 1, -3)
spawn( src.det_time )
prime()
return
user.dir = get_dir(user, target)
user.drop_item()
var/t = (isturf(target) ? target : target.loc)
walk_towards(src, t, 3)
src.add_fingerprint(user)
return
user.dir = get_dir(user, target)
user.drop_item()
var/t = (isturf(target) ? target : target.loc)
walk_towards(src, t, 3)
return
/obj/item/weapon/empgrenade/proc/prime()
playsound(src.loc, 'Welder2.ogg', 25, 1)
var/turf/T = get_turf(src)
if(T)
T.hotspot_expose(700,125)
var/grenade = src // detaching the proc - in theory
empulse(src, 5, 7)
attack_self(mob/user as mob)
if(!active)
if(clown_check(user))
user << "\red You prime the EMP grenade! [det_time/10] seconds!"
src.active = 1
src.icon_state = "empar"
add_fingerprint(user)
spawn(src.det_time)
prime()
return
return
del(grenade)
return
prime()
playsound(src.loc, 'Welder2.ogg', 25, 1)
var/turf/T = get_turf(src)
if(T)
T.hotspot_expose(700,125)
if(empulse(src, 5, 7))
del(src)
return
/obj/item/weapon/flashbang/attackby(obj/item/weapon/W as obj, mob/user as mob)
..()
if (istype(W, /obj/item/weapon/screwdriver))
switch(src.det_time)
if ("1")
src.det_time = 30
user.show_message("\blue You set the flashbang for 3 second detonation time.")
src.desc = "It is set to detonate in 3 seconds."
if ("30")
src.det_time = 100
user.show_message("\blue You set the flashbang for 10 second detonation time.")
src.desc = "It is set to detonate in 10 seconds."
if ("100")
src.det_time = 1
user.show_message("\blue You set the flashbang for instant detonation.")
src.desc = "It is set to detonate instantly."
src.add_fingerprint(user)
return
/obj/item/weapon/flashbang/afterattack(atom/target as mob|obj|turf|area, mob/user as mob)
if (user.equipped() == src)
clown_check(var/mob/living/user)
if((user.mutations & CLOWN) && prob(50))
user << "\red Huh? How does this thing work?!"
src.active = 1
src.icon_state = "empar"
playsound(src.loc, 'armbomb.ogg', 75, 1, -3)
spawn( 5 )
prime()
return 0
return 1
/****************************Flashbang***********************************************/
/obj/item/weapon/flashbang
desc = "It is set to detonate in 3 seconds."
name = "flashbang"
icon = 'grenade.dmi'
icon_state = "flashbang"
w_class = 2.0
item_state = "flashbang"
throw_speed = 4
throw_range = 20
flags = FPRINT | TABLEPASS | CONDUCT | ONBELT
origin_tech = "materials=2;combat=1"
var
active = 0
det_time = 30
proc
prime()
clown_check(var/mob/living/user)
attackby(obj/item/weapon/W as obj, mob/user as mob)
if (isscrewdriver(W))
switch(src.det_time)
if ("1")
src.det_time = 30
user.show_message("\blue You set the flashbang for 3 second detonation time.")
src.desc = "It is set to detonate in 3 seconds."
if ("30")
src.det_time = 100
user.show_message("\blue You set the flashbang for 10 second detonation time.")
src.desc = "It is set to detonate in 10 seconds."
if ("100")
src.det_time = 1
user.show_message("\blue You set the flashbang for instant detonation.")
src.desc = "It is set to detonate instantly."
src.add_fingerprint(user)
..()
return
afterattack(atom/target as mob|obj|turf|area, mob/user as mob)
if((user.equipped() == src)&&(!active)&&(clown_check(user)))
user << "\red You prime the flashbang! [det_time/10] seconds!"
src.active = 1
src.icon_state = "flashbang1"
playsound(src.loc, 'armbomb.ogg', 75, 1, -3)
spawn(src.det_time)
prime()
return
user.dir = get_dir(user, target)
user.drop_item()
var/t = (isturf(target) ? target : target.loc)
walk_towards(src, t, 3)
return
attack_paw(mob/user as mob)
return src.attack_hand(user)
attack_hand()
walk(src, null, null)
..()
return
prime()
playsound(src.loc, 'bang.ogg', 25, 1)
var/turf/T = get_turf(src)
if(T)
T.hotspot_expose(700,125)
for(var/mob/living/carbon/M in viewers(T, null))
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"
M << "\red <B>BANG</B>"
//Checking for protections
var/eye_safety = 0
var/ear_safety = 0
if(iscarbon(M))
eye_safety = M.eyecheck()
if(ishuman(M))
if(istype(M:ears, /obj/item/clothing/ears/earmuffs))
ear_safety = 1
if(M.mutations & HULK)
ear_safety = 1
//Flashing everyone
if(!eye_safety)
flick("e_flash", M.flash)
M.eye_stat += rand(1, 3)
M.weakened = max(M.weakened,10)
//Now applying sound
if((get_dist(M, T) <= 2 || src.loc == M.loc || src.loc == M))
if(ear_safety)
M.stunned = max(M.stunned,2)
M.weakened = max(M.weakened,1)
else
M.stunned = max(M.stunned,10)
M.weakened = max(M.weakened,3)
if ((prob(14) || (M == src.loc && prob(70))))
M.ear_damage += rand(1, 10)
else
M.ear_damage += rand(0, 5)
M.ear_deaf = max(M.ear_deaf,15)
else if(get_dist(M, T) <= 5)
if(!ear_safety)
M.stunned = max(M.stunned,8)
M.ear_damage += rand(0, 3)
M.ear_deaf = max(M.ear_deaf,10)
else if(!ear_safety)
M.stunned = max(M.stunned,4)
M.ear_damage += rand(0, 1)
M.ear_deaf = max(M.ear_deaf,5)
//This really should be in mob not every check
if (M.eye_stat >= 20)
M << "\red Your eyes start to burn badly!"
M.disabilities |= 1
if (prob(M.eye_stat - 20 + 1))
M << "\red You can't see anything!"
M.sdisabilities |= 1
if (M.ear_damage >= 15)
M << "\red Your ears start to ring badly!"
if (prob(M.ear_damage - 10 + 5))
M << "\red You can't hear anything!"
M.sdisabilities |= 4
else
if (M.ear_damage >= 5)
M << "\red Your ears start to ring!"
//Blob damage here
for(var/obj/blob/B in view(8,T))
var/damage = round(30/(get_dist(B,T)+1))
B.health -= damage
B.update()
del(src)
return
attack_self(mob/user as mob)
if(!active)
if(clown_check(user))
user << "\red You prime the flashbang! [det_time/10] seconds!"
src.active = 1
src.icon_state = "flashbang1"
add_fingerprint(user)
spawn( src.det_time )
prime()
return
return
clown_check(var/mob/living/user)
if ((user.mutations & CLOWN) && prob(50))
user << "\red Huh? How does this thing work?!"
src.state = 1
src.active = 1
src.icon_state = "flashbang1"
playsound(src.loc, 'armbomb.ogg', 75, 1, -3)
spawn( 5 )
prime()
return
else if (!( src.state ))
user << "\red You prime the flashbang! [det_time/10] seconds!"
src.state = 1
src.icon_state = "flashbang1"
playsound(src.loc, 'armbomb.ogg', 75, 1, -3)
spawn( src.det_time )
prime()
return
user.dir = get_dir(user, target)
user.drop_item()
var/t = (isturf(target) ? target : target.loc)
walk_towards(src, t, 3)
src.add_fingerprint(user)
return
/obj/item/weapon/flashbang/attack_paw(mob/user as mob)
return src.attack_hand(user)
/obj/item/weapon/flashbang/attack_hand()
walk(src, null, null)
..()
return
/obj/item/weapon/flashbang/proc/prime()
playsound(src.loc, 'bang.ogg', 25, 1)
var/turf/T = get_turf(src)
if(T)
T.hotspot_expose(700,125)
for(var/mob/living/carbon/M in viewers(T, null))
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"
if ((get_dist(M, T) <= 2 || src.loc == M.loc || src.loc == M))
flick("e_flash", M.flash)
if(!(M.mutations & HULK)) M.stunned = 10
if(!(M.mutations & HULK)) M.weakened = 3
M << "\red <B>BANG</B>"
if ((prob(14) || (M == src.loc && prob(70))))
M.ear_damage += rand(1, 10)
else
if (prob(30))
M.ear_damage += rand(0, 5)
if (!( M.paralysis ))
M.eye_stat += rand(0, 5)
if (prob(10))
M.eye_stat += rand(0, 4)
M.ear_deaf += 30
if (M == src.loc)
M.eye_stat += rand(2, 5)
if (prob(60))
if (istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
if (!( istype(H.ears, /obj/item/clothing/ears/earmuffs) ))
M.ear_damage += 15
M.ear_deaf += 60
else
M.ear_damage += 15
M.ear_deaf += 60
else
if (get_dist(M, T) <= 5)
flick("e_flash", M.flash)
if (!( istype(M, /mob/living/carbon/human) ))
if(!(M.mutations & HULK)) M.stunned = 7
if(!(M.mutations & HULK)) M.weakened = 2
else
var/mob/living/carbon/human/H = M
M.ear_deaf += 10
if (prob(20))
M.ear_damage += rand(0, 4)
var/safe = 0
if (istype(H.glasses, /obj/item/clothing/glasses/sunglasses))
safe = 1
if (istype(H.head, /obj/item/clothing/head/helmet/welding))
if(!H.head:up)
safe = 1
if(!safe)
if(!(M.mutations & HULK)) M.stunned = 7
if(!(M.mutations & HULK)) M.weakened = 2
else
if (!( M.paralysis ))
M.eye_stat += rand(1, 3)
M << "\red <B>BANG</B>"
else
if (!( istype(M, /mob/living/carbon/human) ))
flick("flash", M.flash)
else
var/mob/living/carbon/human/H = M
var/safe = 0
if (istype(H.glasses, /obj/item/clothing/glasses/sunglasses))
safe = 1
if (istype(H.head, /obj/item/clothing/head/helmet/welding))
if(!H.head:up)
safe = 1
if(!safe)
flick("flash", M.flash)
M.eye_stat += rand(1, 2)
M.ear_deaf += 5
M << "\red <B>BANG</B>"
if (M.eye_stat >= 20)
M << "\red Your eyes start to burn badly!"
M.disabilities |= 1
if (prob(M.eye_stat - 20 + 1))
M << "\red You can't see anything!"
M.sdisabilities |= 1
if (M.ear_damage >= 15)
M << "\red Your ears start to ring badly!"
if (prob(M.ear_damage - 10 + 5))
M << "\red You can't hear anything!"
M.sdisabilities |= 4
else
if (M.ear_damage >= 5)
M << "\red Your ears start to ring!"
for(var/obj/blob/B in view(8,T))
var/damage = round(30/(get_dist(B,T)+1))
B.health -= damage
B.update()
del(src)
return
/obj/item/weapon/flashbang/attack_self(mob/user as mob)
if (!src.state)
if (user.mutations & CLOWN)
user << "\red Huh? How does this thing work?!"
spawn( 5 )
prime()
return
else
user << "\red You prime the flashbang! [det_time/10] seconds!"
src.state = 1
src.icon_state = "flashbang1"
add_fingerprint(user)
spawn( src.det_time )
prime()
return
return
/obj/item/weapon/empgrenade/attack_self(mob/user as mob)
if (!src.state)
if (user.mutations & CLOWN)
user << "\red Huh? How does this thing work?!"
spawn( 5 )
prime()
return
else
user << "\red You prime the EMP grenade! [det_time/10] seconds!"
src.state = 1
src.icon_state = "empar"
add_fingerprint(user)
spawn( src.det_time )
prime()
return
return
return 0
return 1
-193
View File
@@ -1,193 +0,0 @@
/*
CONTAINS:
PAINT
DNA INJECTOR
*/
var/global/list/cached_icons = list()
/obj/item/weapon/paint/red
name = "Red paint"
color = "FF0000"
icon_state = "paint_red"
/obj/item/weapon/paint/green
name = "Green paint"
color = "00FF00"
icon_state = "paint_green"
/obj/item/weapon/paint/blue
name = "Blue paint"
color = "0000FF"
icon_state = "paint_blue"
/obj/item/weapon/paint/yellow
name = "Yellow paint"
color = "FFFF00"
icon_state = "paint_yellow"
/obj/item/weapon/paint/violet //no icon
name = "Violet paint"
color = "FF00FF"
icon_state = "paint_neutral"
/obj/item/weapon/paint/black
name = "Black paint"
color = "333333"
icon_state = "paint_black"
/obj/item/weapon/paint/white
name = "White paint"
color = "FFFFFF"
icon_state = "paint_white"
/obj/item/weapon/paint/anycolor
name = "Any color"
icon_state = "paint_neutral"
attack_self(mob/user as mob)
var/t1 = input(user, "Please select a color:", "Locking Computer", null) in list( "red", "blue", "green", "yellow", "black", "white")
if ((user.equipped() != src || user.stat || user.restrained()))
return
switch(t1)
if("red")
color = "FF0000"
if("blue")
color = "0000FF"
if("green")
color = "00FF00"
if("yellow")
color = "FFFF00"
/*
if("violet")
color = "FF00FF"
*/
if("white")
color = "FFFFFF"
if("black")
color = "333333"
icon_state = "paint_[t1]"
add_fingerprint(user)
return
/obj/item/weapon/paint/afterattack(turf/target, mob/user as mob)
if(!istype(target) || istype(target, /turf/space))
return
var/ind = "[initial(target.icon)][color]"
if(!cached_icons[ind])
var/icon/overlay = new/icon(initial(target.icon))
overlay.Blend("#[color]",ICON_MULTIPLY)
overlay.SetIntensity(1.4)
target.icon = overlay
cached_icons[ind] = target.icon
else
target.icon = cached_icons[ind]
return
/obj/item/weapon/paint/paint_remover
name = "Paint remover"
icon_state = "paint_neutral"
afterattack(turf/target, mob/user as mob)
if(istype(target) && target.icon != initial(target.icon))
target.icon = initial(target.icon)
return
/obj/item/weapon/dnainjector/attack_paw(mob/user as mob)
return attack_hand(user)
/obj/item/weapon/dnainjector/proc/inject(mob/M as mob)
M.radiation += rand(20,50)
if (dnatype == "ui")
if (!block) //isolated block?
if (ue) //unique enzymes? yes
M.dna.uni_identity = dna
updateappearance(M, M.dna.uni_identity)
M.real_name = ue
M.name = ue
uses--
else //unique enzymes? no
M.dna.uni_identity = dna
updateappearance(M, M.dna.uni_identity)
uses--
else
M.dna.uni_identity = setblock(M.dna.uni_identity,block,dna,3)
updateappearance(M, M.dna.uni_identity)
uses--
if (dnatype == "se")
if (!block) //isolated block?
M.dna.struc_enzymes = dna
domutcheck(M, null)
uses--
else
M.dna.struc_enzymes = setblock(M.dna.struc_enzymes,block,dna,3)
domutcheck(M, null,1)
uses--
spawn(0)//this prevents the collapse of space-time continuum
del(src)
return uses
/obj/item/weapon/dnainjector/attack(mob/M as mob, mob/user as mob)
if (!istype(M, /mob))
return
if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
user << "\red You don't have the dexterity to do this!"
return
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been injected with [name] by [user.name] ([user.ckey])</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [name] to inject [M.name] ([M.ckey])</font>")
if (user)
if (istype(M, /mob/living/carbon/human))
var/obj/equip_e/human/O = new /obj/equip_e/human( )
O.source = user
O.target = M
O.item = src
O.s_loc = user.loc
O.t_loc = M.loc
O.place = "dnainjector"
M.requests += O
if (dnatype == "se")
if (isblockon(getblock(dna, 14,3),14) && istype(M, /mob/living/carbon/human))
message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name] \red(MONKEY)")
log_game("[key_name(user)] injected [key_name(M)] with the [name] (MONKEY)")
else
message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]")
log_game("[key_name(user)] injected [key_name(M)] with the [name]")
else
message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]")
log_game("[key_name(user)] injected [key_name(M)] with the [name]")
spawn( 0 )
O.process()
return
else
for(var/mob/O in viewers(M, null))
O.show_message(text("\red [] has been injected with [] by [].", M, src, user), 1)
//Foreach goto(192)
if (!(istype(M, /mob/living/carbon/human) || istype(M, /mob/living/carbon/monkey)))
user << "\red Apparently it didn't work."
return
if (dnatype == "se")
if (isblockon(getblock(dna, 14,3),14) && istype(M, /mob/living/carbon/human))
message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name] \red(MONKEY)")
log_game("[key_name(user)] injected [key_name(M)] with the [name] (MONKEY)")
else
message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]")
log_game("[key_name(user)] injected [key_name(M)] with the [name]")
else
message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]")
log_game("[key_name(user)] injected [key_name(M)] with the [name]")
inject(M)//Now we actually do the heavy lifting.
/*
A user injecting themselves could mean their own transformation and deletion of mob.
I don't have the time to figure out how this code works so this will do for now.
I did rearrange things a bit.
*/
if(!isnull(user))//If the user still exists. Their mob may not.
user.show_message(text("\red You inject [M]"))
return
+99
View File
@@ -0,0 +1,99 @@
var/global/list/cached_icons = list()
/obj/item/weapon/paint
name = "Paint Can"
desc = "Used to recolor floors and walls. Can not be removed by the janitor."
icon = 'items.dmi'
icon_state = "paint_neutral"
var/color = "neutral"
item_state = "paintcan"
w_class = 3.0
/obj/item/weapon/paint/red
name = "Red paint"
color = "FF0000"
icon_state = "paint_red"
/obj/item/weapon/paint/green
name = "Green paint"
color = "00FF00"
icon_state = "paint_green"
/obj/item/weapon/paint/blue
name = "Blue paint"
color = "0000FF"
icon_state = "paint_blue"
/obj/item/weapon/paint/yellow
name = "Yellow paint"
color = "FFFF00"
icon_state = "paint_yellow"
/obj/item/weapon/paint/violet //no icon
name = "Violet paint"
color = "FF00FF"
icon_state = "paint_neutral"
/obj/item/weapon/paint/black
name = "Black paint"
color = "333333"
icon_state = "paint_black"
/obj/item/weapon/paint/white
name = "White paint"
color = "FFFFFF"
icon_state = "paint_white"
/obj/item/weapon/paint/anycolor
name = "Any color"
icon_state = "paint_neutral"
attack_self(mob/user as mob)
var/t1 = input(user, "Please select a color:", "Locking Computer", null) in list( "red", "blue", "green", "yellow", "black", "white")
if ((user.equipped() != src || user.stat || user.restrained()))
return
switch(t1)
if("red")
color = "FF0000"
if("blue")
color = "0000FF"
if("green")
color = "00FF00"
if("yellow")
color = "FFFF00"
/*
if("violet")
color = "FF00FF"
*/
if("white")
color = "FFFFFF"
if("black")
color = "333333"
icon_state = "paint_[t1]"
add_fingerprint(user)
return
/obj/item/weapon/paint/afterattack(turf/target, mob/user as mob)
if(!istype(target) || istype(target, /turf/space))
return
var/ind = "[initial(target.icon)][color]"
if(!cached_icons[ind])
var/icon/overlay = new/icon(initial(target.icon))
overlay.Blend("#[color]",ICON_MULTIPLY)
overlay.SetIntensity(1.4)
target.icon = overlay
cached_icons[ind] = target.icon
else
target.icon = cached_icons[ind]
return
/obj/item/weapon/paint/paint_remover
name = "Paint remover"
icon_state = "paint_neutral"
afterattack(turf/target, mob/user as mob)
if(istype(target) && target.icon != initial(target.icon))
target.icon = initial(target.icon)
return