-Added the Light Replacer (LR)

ABOUT THE DEVICE

This is a device supposedly to be used by Janitors and Janitor Cyborgs which will
allow them to easily replace lights. This was mostly designed for Janitor Cyborgs since
they don't have hands or a way to replace lightbulbs.

HOW IT WORKS

You attack a light fixture with it, if the light fixture is broken it will replace the
light fixture with a working light; the broken light is then placed on the floor for the
user to then pickup with a trash bag. If it's empty then it will just place a light in the fixture.

HOW TO REFILL THE DEVICE

It will need to be manually refilled with glass.
If it's part of a robot module, it will charge when the Robot is inside a Recharge Station.

EMAGGED FEATURES

NOTICE: The Cyborg cannot use the emagged Light Replacer and the light's explosion was nerfed. It cannot create holes in the station anymore.

I'm not sure everyone will react the emag's features so please say what your opinions are of it.

When emagged it will rig every light it replaces, which will explode when the light is on.
This is VERY noticable, even the device's name changes when you emag it so if anyone
examines you when you're holding it in your hand, you will be discovered.
It will also be very obvious who is setting all these lights off, since only Janitor Borgs and Janitors have easy
access to them, and only one of them can emag their device.

The explosion cannot insta-kill anyone with 30% or more health.

-Changed the broken bottle item icon to "broken_beer"
-Made the flavour text, for hitting yourself on the haad with a bottle, better.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4108 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
giacomand@gmail.com
2012-07-18 22:51:28 +00:00
parent 286fba8f64
commit 156696be7a
8 changed files with 351 additions and 5 deletions

View File

@@ -108,6 +108,10 @@
var/obj/item/weapon/reagent_containers/glass/bottle/robot/B = O
if(B.reagent && (B.reagents.get_reagent_amount(B.reagent) < B.volume))
B.reagents.add_reagent(B.reagent, 2)
//Janitor
if(istype(O, /obj/item/device/lightreplacer))
var/obj/item/device/lightreplacer/LR = O
LR.charge(R)
if(R)
if(R.module)

View File

@@ -11,4 +11,5 @@
new /obj/item/weapon/caution(src)
new /obj/item/weapon/caution(src)
new /obj/item/weapon/caution(src)
new /obj/item/weapon/trashbag(src)
new /obj/item/weapon/trashbag(src)
new /obj/item/device/lightreplacer(src)

View File

@@ -2646,7 +2646,7 @@
/obj/item/weapon/reagent_containers/food/drinks/bottle
amount_per_transfer_from_this = 10
volume = 100
item_state = "beer" //Generic held-item sprite until unique ones are made.
item_state = "broken_beer" //Generic held-item sprite until unique ones are made.
var/const/duration = 13 //Directly relates to the 'weaken' duration. Lowered by armor (i.e. helmets)
var/isGlass = 1 //Whether the 'bottle' is made of glass or not so that milk cartons dont shatter when someone gets hit by it
@@ -2724,7 +2724,7 @@
//Display an attack message.
for(var/mob/O in viewers(user, null))
if(target != user) O.show_message(text("\red <B>[target] has been hit over the head with a bottle of [src.name], by [user]!</B>"), 1)
else O.show_message(text("\red <B>[target] has hit himself with a bottle of [src.name] over his head!</B>"), 1)
else O.show_message(text("\red <B>[target] hit himself with a bottle of [src.name] on the head!</B>"), 1)
//Weaken the target for the duration that we calculated and divide it by 5.
if(armor_duration)
target.apply_effect(min(armor_duration, 10) , WEAKEN) // Never weaken more than a flash!

View File

@@ -149,7 +149,8 @@
..()
src.modules += new /obj/item/weapon/soap/nanotrasen(src)
src.modules += new /obj/item/weapon/trashbag(src)
src.modules += new/obj/item/weapon/mop(src)
src.modules += new /obj/item/weapon/mop(src)
src.modules += new /obj/item/device/lightreplacer(src)
src.emag = new /obj/item/weapon/cleaner(src)
var/datum/reagents/R = new/datum/reagents(1000)

View File

@@ -352,6 +352,51 @@
/obj/machinery/light/attackby(obj/item/W, mob/user)
//Light replacer code
if(istype(W, /obj/item/device/lightreplacer))
if(status != LIGHT_OK)
if(isliving(user))
var/obj/item/device/lightreplacer/LR = W
var/mob/living/U = user
if(LR.CanUse(U))
if(!LR.Use(U)) return
U << "<span class='notice'>You replace the [src.fitting] with the [W].</span>"
if(status != LIGHT_EMPTY)
var/obj/item/weapon/light/L1 = new light_type(src.loc)
L1.status = status
L1.rigged = rigged
L1.brightness = src.brightness
L1.switchcount = switchcount
switchcount = 0
L1.update()
status = LIGHT_EMPTY
update()
var/obj/item/weapon/light/L2 = new light_type()
status = L2.status
switchcount = L2.switchcount
rigged = LR.emagged
brightness = L2.brightness
on = has_power()
update()
del(L2)
// Leaving this here in case I get the go ahead to make emagged light replacers to insert rigged lights
if(on && rigged)
explode()
return
else
user << LR.failmsg
return
else
user << "There is a working [fitting] already inserted."
return
// attempt to insert light
if(istype(W, /obj/item/weapon/light))
if(status != LIGHT_EMPTY)
@@ -592,7 +637,7 @@
spawn(0)
broken() // break it first to give a warning
sleep(2)
explosion(T, 0, 1, 2, 2)
explosion(T, 0, 0, 2, 2)
sleep(1)
del(src)