diff --git a/code/defines/obj.dm b/code/defines/obj.dm index ca7e3df9f44..df6b4d90e4c 100644 --- a/code/defines/obj.dm +++ b/code/defines/obj.dm @@ -129,19 +129,6 @@ name = "monkey" var/mob/living/carbon/monkey/target = null -/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 - var/health = 10.0 - var/destroyed = 0.0 - anchored = 1.0 - flags = FPRINT | CONDUCT - pressure_resistance = 5*ONE_ATMOSPHERE - layer = 2.9 - /obj/securearea desc = "A warning sign which reads 'SECURE AREA'. This obviously applies to a nun-Clown." name = "SECURE AREA" diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm index b4ddfac1450..f5e0b8b34b1 100644 --- a/code/defines/obj/weapon.dm +++ b/code/defines/obj/weapon.dm @@ -707,35 +707,6 @@ icon_state = "fcardholder0" item_state = "clipboard" - -/obj/item/weapon/flashbang - desc = "It is set to detonate in 3 seconds." - name = "flashbang" - icon = 'grenade.dmi' - icon_state = "flashbang" - var/state = null - var/det_time = 30.0 - w_class = 2.0 - item_state = "flashbang" - throw_speed = 4 - throw_range = 20 - flags = FPRINT | TABLEPASS | CONDUCT | ONBELT - origin_tech = "materials=2;combat=1" - -/obj/item/weapon/empgrenade - desc = "It is set to detonate in 5 seconds." - name = "emp grenade" - var/state = null - var/det_time = 50.0 - 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" - /obj/item/weapon/flasks name = "flask" icon = 'Cryogenic2.dmi' @@ -1159,15 +1130,6 @@ flags = FPRINT | TABLEPASS -/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/paper name = "Paper" desc = "It is made from wood." diff --git a/code/game/gamemodes/wizard/spells.dm b/code/game/gamemodes/wizard/spells.dm index e83c54857e6..28a90bdbfe4 100644 --- a/code/game/gamemodes/wizard/spells.dm +++ b/code/game/gamemodes/wizard/spells.dm @@ -259,7 +259,7 @@ usr.say("NEC CANTIO") usr.spellvoice() - empulse(src, 6, 10, nolog=1) + empulse(src, 6, 10) return //BLINK diff --git a/code/game/objects/devices/PDA/PDA.dm b/code/game/objects/devices/PDA/PDA.dm index e8bdade75c4..533d554f781 100644 --- a/code/game/objects/devices/PDA/PDA.dm +++ b/code/game/objects/devices/PDA/PDA.dm @@ -473,8 +473,11 @@ P.tnote += "← From [owner]:
[t]
" if (prob(15)) //Give the AI a chance of intercepting the message - for (var/mob/living/silicon/ai/A in world) - A.show_message("Intercepted message from [P:owner]: [t]") + var/who = src.owner + if(prob(50)) + who = P:owner + for(var/mob/living/silicon/ai/ai in world) + ai.show_message("Intercepted message from [who]: [t]") if (!P.silent) playsound(P.loc, 'twobeep.ogg', 50, 1) diff --git a/code/game/objects/empulse.dm b/code/game/objects/empulse.dm index 0a0144b2f24..bf6fce545c9 100644 --- a/code/game/objects/empulse.dm +++ b/code/game/objects/empulse.dm @@ -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] ") diff --git a/code/game/objects/grille.dm b/code/game/objects/grille.dm index 222352adf3d..ac4f3dd8ffb 100644 --- a/code/game/objects/grille.dm +++ b/code/game/objects/grille.dm @@ -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 \ No newline at end of file diff --git a/code/defines/obj/injector.dm b/code/game/objects/items/weapons/dna_injector.dm similarity index 54% rename from code/defines/obj/injector.dm rename to code/game/objects/items/weapons/dna_injector.dm index 54007e68099..f82345cbf4e 100644 --- a/code/defines/obj/injector.dm +++ b/code/game/objects/items/weapons/dna_injector.dm @@ -16,6 +16,104 @@ 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()]\] Has been injected with [name] by [user.name] ([user.ckey])") + user.attack_log += text("\[[time_stamp()]\] Used the [name] to inject [M.name] ([M.ckey])") + + 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." diff --git a/code/game/objects/items/weapons/grenades.dm b/code/game/objects/items/weapons/grenades.dm index 58c9b3acd9d..4c2074bb5bf 100644 --- a/code/game/objects/items/weapons/grenades.dm +++ b/code/game/objects/items/weapons/grenades.dm @@ -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 BANG" + +//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 BANG" - 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 BANG" - 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 BANG" - 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 \ No newline at end of file + return 0 + return 1 diff --git a/code/game/objects/items/weapons/misc.dm b/code/game/objects/items/weapons/misc.dm deleted file mode 100644 index 0b6a0bbf004..00000000000 --- a/code/game/objects/items/weapons/misc.dm +++ /dev/null @@ -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()]\] Has been injected with [name] by [user.name] ([user.ckey])") - user.attack_log += text("\[[time_stamp()]\] Used the [name] to inject [M.name] ([M.ckey])") - - 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 diff --git a/code/game/objects/items/weapons/paint.dm b/code/game/objects/items/weapons/paint.dm new file mode 100644 index 00000000000..91b3d639f3e --- /dev/null +++ b/code/game/objects/items/weapons/paint.dm @@ -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 diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 7c059493104..b8b9cad5e88 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -714,7 +714,7 @@ if (href_list["adminplayeropts"]) var/mob/M = locate(href_list["adminplayeropts"]) - edit_player(M) + show_player_panel(M) if (href_list["jumpto"]) if(rank in list("Badmin", "Game Admin", "Game Master")) @@ -1516,9 +1516,9 @@ ///////////////////////////////////////////////////////////////////////////////////////////////Panels -/obj/admins/proc/edit_player(var/mob/M in world) +/obj/admins/proc/show_player_panel(var/mob/M in world) set category = "Admin" - set name = "Edit player" + set name = "Show Player Panel" set desc="Edit player (respawn, ban, heal, etc)" if(!M) usr << "You seem to be selecting a mob that doesn't exist anymore." diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 024c563f31a..6f50c1b8c54 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -236,7 +236,7 @@ verbs += /obj/admins/proc/vmode verbs += /obj/admins/proc/votekill verbs += /client/proc/voting - verbs += /obj/admins/proc/edit_player + verbs += /obj/admins/proc/show_player_panel verbs += /client/proc/cmd_admin_prison verbs += /obj/admins/proc/unprison verbs += /client/proc/hide_verbs @@ -353,7 +353,7 @@ verbs -= /obj/admins/proc/vmode verbs -= /obj/admins/proc/votekill verbs -= /client/proc/voting - verbs -= /obj/admins/proc/edit_player + verbs -= /obj/admins/proc/show_player_panel verbs -= /client/proc/cmd_admin_prison verbs -= /obj/admins/proc/unprison verbs -= /client/proc/hide_verbs @@ -361,6 +361,7 @@ verbs -= /client/proc/air_report verbs -= /client/proc/cmd_admin_say verbs -= /client/proc/cmd_admin_gib_self + verbs -= /client/proc/restartcontroller return diff --git a/code/modules/mob/living/silicon/pai/software.dm b/code/modules/mob/living/silicon/pai/software.dm index 6d0302368b7..0968358bce7 100644 --- a/code/modules/mob/living/silicon/pai/software.dm +++ b/code/modules/mob/living/silicon/pai/software.dm @@ -160,14 +160,14 @@ var/t = input(usr, "Please enter message", name, null) as text t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN) - if (!t) + if(!t) return var/target = locate(href_list["target"]) // PDA Message if(istype(target, /obj/item/device/pda)) var/obj/item/device/pda/P = target - if (isnull(P)||P.toff) + if(isnull(P)||P.toff) return for (var/obj/machinery/message_server/MS in world) @@ -176,11 +176,14 @@ tnote += "→ To [P.owner]:
[t]
" P.tnote += "← From [src]:
[t]
" - if (prob(15)) //Give the AI a chance of intercepting the message - for (var/mob/living/silicon/ai/ai in world) - ai.show_message("Intercepted message from [P:owner]: [t]") + if(prob(15)) //Give the AI a chance of intercepting the message + var/who = src + if(prob(50)) + who = P:owner + for(var/mob/living/silicon/ai/ai in world) + ai.show_message("Intercepted message from [who]: [t]") - if (!P.silent) + if(!P.silent) playsound(P.loc, 'twobeep.ogg', 50, 1) for (var/mob/O in hearers(3, P.loc)) O.show_message(text("\icon[P] *[P.ttone]*")) @@ -200,8 +203,11 @@ MS.send_pda_message("[P]","[src]","[t]") if (prob(15)) //Give the AI a chance of intercepting the message + var/who = src + if(prob(50)) + who = P for (var/mob/living/silicon/ai/ai in world) - ai.show_message("Intercepted message from [P]: [t]") + ai.show_message("Intercepted message from [who]: [t]") playsound(P.loc, 'twobeep.ogg', 50, 1) diff --git a/code/modules/power/singularity/singularity.dm b/code/modules/power/singularity/singularity.dm index a8bc112d0b5..8c6dae813f2 100644 --- a/code/modules/power/singularity/singularity.dm +++ b/code/modules/power/singularity/singularity.dm @@ -426,7 +426,7 @@ var/global/list/uneatable = list( emp_area() - empulse(src, 6, 8, nolog=1) + empulse(src, 6, 8) return diff --git a/tgstation.dme b/tgstation.dme index 4d6f8443ecb..96603ac09b4 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -255,7 +255,6 @@ #include "code\defines\obj\decal.dm" #include "code\defines\obj\door.dm" #include "code\defines\obj\hydro.dm" -#include "code\defines\obj\injector.dm" #include "code\defines\obj\machinery.dm" #include "code\defines\obj\radio.dm" #include "code\defines\obj\spawner.dm" @@ -566,6 +565,7 @@ #include "code\game\objects\items\weapons\cards_ids.dm" #include "code\game\objects\items\weapons\cigs_lighters.dm" #include "code\game\objects\items\weapons\clown_items.dm" +#include "code\game\objects\items\weapons\dna_injector.dm" #include "code\game\objects\items\weapons\explosives.dm" #include "code\game\objects\items\weapons\flamethrower.dm" #include "code\game\objects\items\weapons\grenades.dm" @@ -576,8 +576,8 @@ #include "code\game\objects\items\weapons\kitchen.dm" #include "code\game\objects\items\weapons\manuals.dm" #include "code\game\objects\items\weapons\medical.dm" -#include "code\game\objects\items\weapons\misc.dm" #include "code\game\objects\items\weapons\mops_cleaners.dm" +#include "code\game\objects\items\weapons\paint.dm" #include "code\game\objects\items\weapons\paiwire.dm" #include "code\game\objects\items\weapons\papers_bins.dm" #include "code\game\objects\items\weapons\RCD.dm"