Laser pointers, overchargeflashes, various fixes

Alcohol and thermite now flammable.  Laser pointers added!  Flash now
comes in delicious incendiary flavor.  Robot fire overlay bug fixed-ish.
Being lit on fire turns off a borg's lights but the fire still shows.
I'll take it.  Shield gens actually useable by the people they were
meant for.
This commit is contained in:
Duck-
2014-08-29 21:52:16 -04:00
parent 21f4703292
commit 83a06403dc
15 changed files with 327 additions and 22 deletions
+1
View File
@@ -552,6 +552,7 @@
#include "code\game\objects\items\devices\debugger.dm"
#include "code\game\objects\items\devices\flash.dm"
#include "code\game\objects\items\devices\flashlight.dm"
#include "code\game\objects\items\devices\laserpointer.dm"
#include "code\game\objects\items\devices\lightreplacer.dm"
#include "code\game\objects\items\devices\megaphone.dm"
#include "code\game\objects\items\devices\modkit.dm"
@@ -21,8 +21,8 @@ datum/design/shield_gen_ex
desc = "Allows for the construction of circuit boards used to build an experimental hull shield generator."
id = "shield_gen"
req_tech = list("bluespace" = 4, "plasmatech" = 3)
build_type = IMPRINTER
materials = list("$glass" = 2000, "sacid" = 20, "$plasma" = 10000, "$diamond" = 5000, "$gold" = 10000)
build_type = PROTOLATHE
materials = list("$glass" = 2000, "$plasma" = 5000, "$diamond" = 5000, "$gold" = 5000)
build_path = "/obj/machinery/shield_gen/external"
////////////////////////////////////////
@@ -47,8 +47,8 @@ datum/design/shield_gen
desc = "Allows for the construction of circuit boards used to build an experimental shield generator."
id = "shield_gen"
req_tech = list("bluespace" = 4, "plasmatech" = 3)
build_type = IMPRINTER
materials = list("$glass" = 2000, "sacid" = 20, "$plasma" = 10000, "$diamond" = 5000, "$gold" = 10000)
build_type = PROTOLATHE
materials = list("$glass" = 2000, "$plasma" = 5000, "$diamond" = 5000, "$gold" = 5000)
build_path = "/obj/machinery/shield_gen/external"
////////////////////////////////////////
@@ -73,6 +73,6 @@ datum/design/shield_cap
desc = "Allows for the construction of circuit boards used to build an experimental shielding capacitor."
id = "shield_cap"
req_tech = list("magnets" = 3, "powerstorage" = 4)
build_type = IMPRINTER
materials = list("$glass" = 2000, "sacid" = 20, "$plasma" = 10000, "$diamond" = 5000, "$silver" = 10000)
build_type = PROTOLATHE
materials = list("$glass" = 2000, "$plasma" = 5000, "$diamond" = 5000, "$silver" = 5000)
build_path = "/obj/machinery/shield_gen/external"
+8
View File
@@ -366,3 +366,11 @@ datum/projectile_data
var/dest_y = src_y + distance*cos(rotation);
return new /datum/projectile_data(src_x, src_y, time, distance, power_x, power_y, dest_x, dest_y)
/proc/flick_overlay(image/I, list/show_to, duration)
for(var/client/C in show_to)
C.images += I
sleep(duration)
for(var/client/C in show_to)
C.images -= I
+3
View File
@@ -178,6 +178,9 @@
playsound(loc, "sparks", 50, 1)
visible_message("\blue The camera has been sliced apart by [] with an energy blade!")
del(src)
else if(istype(W, /obj/item/device/laser_pointer))
var/obj/item/device/laser_pointer/L = W
L.laser_act(src, user)
else
..()
return
+2 -2
View File
@@ -322,7 +322,7 @@
icon_state = "Shield_Gen"
anchored = 0
density = 1
req_access = list(access_teleporter)
req_access = list(access_research)
var/active = 0
var/power = 0
var/state = 0
@@ -330,7 +330,7 @@
var/last_check = 0
var/check_delay = 10
var/recalc = 0
var/locked = 1
var/locked = 0
var/destroyed = 0
var/directwired = 1
// var/maxshieldload = 200
+62 -8
View File
@@ -13,6 +13,8 @@
var/times_used = 0 //Number of times it's been used.
var/broken = 0 //Is the flash burnt out?
var/last_used = 0 //last world.time it was used.
var/flashready = 0 //overcharge flashes
var/overcharge = 0 //overcharge check
/obj/item/device/flash/proc/clown_check(var/mob/user)
if(user && (CLUMSY in user.mutations) && prob(50))
@@ -51,7 +53,11 @@
switch(times_used)
if(0 to 5)
last_used = world.time
if(prob(times_used)) //if you use it 5 times in a minute it has a 10% chance to break!
if(overcharge == 1)
icon_state = "cellflashburnt"
broken = 1
user << "<span class='warning'>The bulb has burnt out!</span>"
else if(prob(times_used)) //if you use it 5 times in a minute it has a 10% chance to break!
broken = 1
user << "<span class='warning'>The bulb has burnt out!</span>"
icon_state = "flashburnt"
@@ -65,6 +71,13 @@
if(iscarbon(M))
var/safety = M:eyecheck()
if(overcharge == 1)
M.adjust_fire_stacks(5)
M.IgniteMob()
user.visible_message("<span class='notice'>[user]'s supercharged flash ignites [M]!</span>")
// broken = 1
// if(overcharge == 1)
// icon_state = "cellflashburnt"
if(safety <= 0)
M.Weaken(10)
flick("e_flash", M.flash)
@@ -90,7 +103,11 @@
flashfail = 1
else if(issilicon(M))
M.Weaken(rand(5,10))
M.Weaken(10) //why are robots more resistant to flashes than humans when it is their only weakness. besides ion rifles. used to be rand(5,10). changed to 10.
if(overcharge == 1)
M.adjust_fire_stacks(5)
M.IgniteMob()
user.visible_message("<span class='notice'>[user]'s supercharged flash ignites [M]!</span>")
else
flashfail = 1
@@ -106,7 +123,10 @@
del(animation)
if(!flashfail)
flick("flash2", src)
if(overcharge == 0)
flick("flash2", src)
else if(overcharge == 1)
flick("cellflash2", src)
if(!issilicon(M))
user.visible_message("<span class='disarm'>[user] blinds [M] with the flash!</span>")
@@ -134,7 +154,11 @@
//It will never break on the first use.
switch(times_used)
if(0 to 5)
if(prob(2*times_used)) //if you use it 5 times in a minute it has a 10% chance to break!
if(overcharge == 1)
icon_state = "cellflashburnt"
broken = 1
user << "<span class='warning'>The bulb has burnt out!</span>"
else if(prob(2*times_used)) //if you use it 5 times in a minute it has a 10% chance to break!
broken = 1
user << "<span class='warning'>The bulb has burnt out!</span>"
icon_state = "flashburnt"
@@ -144,7 +168,10 @@
user.show_message("<span class='warning'>*click* *click*</span>", 2)
return
playsound(src.loc, 'sound/weapons/flash.ogg', 100, 1)
flick("flash2", src)
if(overcharge == 0)
flick("flash2", src)
else if(overcharge == 1)
flick("cellflash2", src)
if(user && isrobot(user))
spawn(0)
var/atom/movable/overlay/animation = new(user.loc)
@@ -176,7 +203,10 @@
if(0 to 5)
if(prob(2*times_used))
broken = 1
icon_state = "flashburnt"
if(overcharge == 1)
icon_state = "cellflashburnt"
else if(overcharge == 0)
icon_state = "flashburnt"
return
times_used++
if(istype(loc, /mob/living/carbon))
@@ -202,11 +232,35 @@
if(!broken)
broken = 1
user << "\red The bulb has burnt out!"
icon_state = "flashburnt"
if(overcharge == 0)
icon_state = "flashburnt"
else if(overcharge == 1)
icon_state = "cellflashburnt"
/obj/item/device/flash/synthetic/attack_self(mob/living/carbon/user as mob, flag = 0, emp = 0)
..()
if(!broken)
broken = 1
user << "\red The bulb has burnt out!"
icon_state = "flashburnt"
if(overcharge == 0)
icon_state = "flashburnt"
else if(overcharge == 1)
icon_state = "cellflashburnt"
/obj/item/device/flash/attackby(obj/item/W, mob/user)
if(istype(W,/obj/item/weapon/cell))
if(flashready == 1 && overcharge == 0)
del(W)
overcharge = 1
icon_state = "cellflash"
user << "\red You attach the cell to the flash."
name = "cell/flash assembly"
desc = "When blinding and being an asshole just isn't enough."
else if(overcharge == 1)
user << "\red This flash already has a cell attached!"
else if(istype(W, /obj/item/weapon/screwdriver))
if(overcharge == 0)
user << "\red You ready the flash for modification."
flashready = 1
else if(flashready == 1)
user << "\red This flash has already been modified!."
@@ -0,0 +1,208 @@
/obj/item/device/laser_pointer
name = "laser pointer"
desc = "Don't shine it in your eyes!"
icon = 'icons/obj/device.dmi'
icon_state = "pointer"
item_state = "pen"
var/pointer_icon_state
flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY
slot_flags = SLOT_BELT
m_amt = 500
g_amt = 500
w_class = 2 //Increased to 2, because diodes are w_class 2. Conservation of matter.
origin_tech = "combat=1"
origin_tech = "magnets=2"
var/turf/pointer_loc
var/energy = 8
var/max_energy = 8
var/effectchance = 33
var/recharging = 0
var/recharge_locked = 0
var/obj/item/weapon/stock_parts/micro_laser/diode //used for upgrading!
/obj/item/device/laser_pointer/red
pointer_icon_state = "red_laser"
/obj/item/device/laser_pointer/green
pointer_icon_state = "green_laser"
/obj/item/device/laser_pointer/blue
pointer_icon_state = "blue_laser"
/obj/item/device/laser_pointer/purple
pointer_icon_state = "purple_laser"
/obj/item/device/laser_pointer/New()
..()
diode = new(src)
if(!pointer_icon_state)
pointer_icon_state = pick("red_laser","green_laser","blue_laser","purple_laser")
/obj/item/device/laser_pointer/upgraded/New()
..()
diode = new /obj/item/weapon/stock_parts/micro_laser/ultra
/obj/item/device/laser_pointer/attack(mob/living/M, mob/user)
laser_act(M, user)
/obj/item/device/laser_pointer/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/stock_parts/micro_laser))
if(!diode)
user.drop_item()
W.loc = src
diode = W
user << "<span class='notice'>You install a [diode.name] in [src].</span>"
else
user << "<span class='notice'>[src] already has a cell.</span>"
else if(istype(W, /obj/item/weapon/screwdriver))
if(diode)
user << "<span class='notice'>You remove the [diode.name] from the [src].</span>"
diode.loc = get_turf(src.loc)
diode = null
return
..()
return
/obj/item/device/laser_pointer/afterattack(var/atom/target, var/mob/living/user, flag, params)
if(flag) //we're placing the object on a table or in backpack
return
laser_act(target, user)
/obj/item/device/laser_pointer/proc/laser_act(var/atom/target, var/mob/living/user)
if( !(user in (viewers(7,target))) )
return
if (!diode)
user << "<span class='notice'>You point [src] at [target], but nothing happens!</span>"
return
if (!user.IsAdvancedToolUser())
user << "<span class='warning'>You don't have the dexterity to do this!</span>"
return
add_fingerprint(user)
//nothing happens if the battery is drained
if(recharge_locked)
user << "<span class='notice'>You point [src] at [target], but it's still charging.</span>"
return
var/outmsg
var/turf/targloc = get_turf(target)
//human/alien mobs
if(iscarbon(target))
if(user.zone_sel.selecting == "eyes")
var/mob/living/carbon/C = target
//20% chance to actually hit the eyes
if(prob(effectchance * diode.rating))
msg_admin_attack(user, C, "shone in the eyes", object="laser pointer")
//eye target check
outmsg = "<span class='notice'>You blind [C] by shining [src] in their eyes.</span>"
var/eye_prot = C.eyecheck()
if(C.blinded || eye_prot >= 2)
eye_prot = 4
var/severity = 3 - eye_prot
if(prob(33))
severity += 1
else if(prob(50))
severity -= 1
severity = min(max(severity, 0), 4)
var/mob/living/carbon/human/H = C
var/datum/organ/internal/eyes/E = H.internal_organs_by_name["eyes"]
switch(severity)
if(0)
//no effect
C << "<span class='info'>A small, bright dot appears in your vision.</span>"
if(1)
//industrial grade eye protection
E.damage += rand(0, 2)
C << "<span class='notice'>Something bright flashes in the corner of your vision!</span>"
if(2)
//basic eye protection (sunglasses)
flick("flash", C.flash)
E.damage += rand(2, 4)
C << "<span class='danger'>Your eyes were blinded!</span>"
if(3)
//no eye protection
if(prob(10))
C.Weaken(1)
flick("e_flash", C.flash)
E.damage += rand(3, 5)
C << "<span class='danger'>Your eyes were blinded!</span>"
if(4)
//the effect has been worsened by something
if(prob(5))
C.Weaken(1)
flick("e_flash", C.flash)
E.damage += rand(5, 10)
C << "<span class='danger'>Your eyes were blinded!</span>"
else
outmsg = "<span class='notice'>You fail to blind [C] by shining [src] at their eyes.</span>"
//robots and AI
else if(issilicon(target))
var/mob/living/silicon/S = target
//20% chance to actually hit the sensors
if(prob(effectchance * diode.rating))
S.Weaken(rand(5,10))
S << "<span class='warning'>Your sensors were overloaded by a laser!</span>"
outmsg = "<span class='notice'>You overload [S] by shining [src] at their sensors.</span>"
S.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had a laser pointer shone in their eyes by [user.name] ([user.ckey])</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='orange'>Shone a laser pointer in the eyes of [S.name] ([S.ckey])</font>")
log_attack("<font color='orange'>[user.name] ([user.ckey]) Shone a laser pointer in the eyes of [S.name] ([S.ckey])</font>")
else
outmsg = "<span class='notice'>You fail to overload [S] by shining [src] at their sensors.</span>"
//cameras
else if(istype(target, /obj/machinery/camera))
var/obj/machinery/camera/C = target
if(prob(effectchance * diode.rating))
C.emp_act(1)
outmsg = "<span class='notice'>You hit the lens of [C] with [src], temporarily disabling the camera!</span>"
msg_admin_attack("\[[time_stamp()]\] [user.name] ([user.ckey]) EMPd a camera with a laser pointer")
user.attack_log += text("\[[time_stamp()]\] [user.name] ([user.ckey]) EMPd a camera with a laser pointer")
else
outmsg = "<span class='info'>You missed the lens of [C] with [src].</span>"
//laser pointer image
icon_state = "pointer_[pointer_icon_state]"
var/list/showto = list()
for(var/mob/M in range(7,targloc))
if(M.client)
showto.Add(M.client)
var/image/I = image('icons/obj/projectiles.dmi',targloc,pointer_icon_state,10)
I.pixel_x = target.pixel_x + rand(-5,5)
I.pixel_y = target.pixel_y + rand(-5,5)
if(outmsg)
user << outmsg
else
user << "<span class='info'>You point [src] at [target].</span>"
energy -= 1
if(energy <= max_energy)
if(!recharging)
recharging = 1
processing_objects.Add(src)
if(energy <= 0)
user << "<span class='warning'>You've overused the battery of [src], now it needs time to recharge!</span>"
recharge_locked = 1
flick_overlay(I, showto, 10)
icon_state = "pointer"
/obj/item/device/laser_pointer/process()
if(prob(20 - recharge_locked*5))
energy += 1
if(energy >= max_energy)
energy = max_energy
recharging = 0
recharge_locked = 0
..()
@@ -337,7 +337,7 @@
overlays -= image("icon"='icons/mob/OnFire.dmi', "icon_state"="Standing")
if(on_fire)
overlays += image("icon"='icons/mob/OnFire.dmi', "icon_state"="Standing")
update_icons()
// update_icons()
return
/mob/living/silicon/robot/fire_act()
@@ -483,6 +483,7 @@
..(Proj)
updatehealth()
if(prob(75) && Proj.damage > 0) spark_system.start()
update_fire()
return 2
@@ -784,6 +785,7 @@
else
if( !(istype(W, /obj/item/device/robotanalyzer) || istype(W, /obj/item/device/healthanalyzer)) )
spark_system.start()
update_fire()
return ..()
/mob/living/silicon/robot/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
@@ -979,6 +981,7 @@
/mob/living/silicon/robot/proc/updateicon()
overlays.Cut()
update_fire()
if(stat == 0)
overlays += "eyes"
overlays.Cut()
@@ -1013,10 +1016,10 @@
else
icon_state = base_icon
return
/*
/mob/living/silicon/robot/proc/updatefire()
return
*
//Call when target overlay should be added/removed
/mob/living/silicon/robot/update_targeted()
if(!targeted_by && target_locked)
@@ -122,6 +122,11 @@ var/list/beam_master = list()
icon_state = "emitter"
damage = 30
/obj/item/projectile/beam/stunrevolver
name = "stun beam"
icon_state = "stun"
damage = 10
agony = 45
/obj/item/projectile/beam/lastertag/blue
name = "lasertag beam"
@@ -777,6 +777,13 @@ datum
reagent_state = SOLID
color = "#673910" // rgb: 103, 57, 16
reaction_mob(var/mob/living/M, var/method=TOUCH, var/volume)//Splashing people with welding fuel to make them easy to ignite!
if(!istype(M, /mob/living))
return
if(method == TOUCH)
M.adjust_fire_stacks(volume / 10)
return
reaction_turf(var/turf/T, var/volume)
src = null
if(volume >= 5)
@@ -3068,6 +3075,13 @@ datum
var/blur_start = 300 //amount absorbed after which mob starts getting blurred vision
var/pass_out = 400 //amount absorbed after which mob starts passing out
reaction_mob(var/mob/living/M, var/method=TOUCH, var/volume)//Splashing people with welding fuel to make them easy to ignite!
if(!istype(M, /mob/living))
return
if(method == TOUCH)
M.adjust_fire_stacks(volume / 10)
return
on_mob_life(var/mob/living/M as mob)
M:nutrition += nutriment_factor
holder.remove_reagent(src.id, FOOD_METABOLISM)
+10 -1
View File
@@ -1377,6 +1377,15 @@ datum/design/nanopaste
materials = list("$metal" = 7000, "$glass" = 7000)
build_path = "/obj/item/stack/nanopaste"
datum/design/laserpointer
name = "laser pointer"
desc = "Don't shine it in your eyes!"
id = "laser_pointer"
req_tech = list("magnets" = 3)
build_type = PROTOLATHE
materials = list("$metal" = 100, "$glass" = 50)
build_path = "/obj/item/device/laser_pointer"
datum/design/implant_loyal
name = "loyalty implant"
desc = "Makes you loyal or such."
@@ -1497,7 +1506,7 @@ datum/design/nuclear_gun
datum/design/stunrevolver
name = "Stun Revolver"
desc = "The prize of the Head of Security."
desc = "Occasionally prize of the Head of Security, but usually of asshole scientists."
id = "stunrevolver"
req_tech = list("combat" = 3, "materials" = 3, "powerstorage" = 2)
build_type = PROTOLATHE
+2 -2
View File
@@ -1,2 +1,2 @@
<small>14:59 [0x200777c] (92,152,1)</small> || the gravitational generator has regained power.<br>
<small>14:59 [0x200777c] (92,152,1)</small> || the gravitational generator is now charging.<br>
<small>21:21 [0x20077ce] (92,152,1)</small> || the gravitational generator has regained power.<br>
<small>21:21 [0x20077ce] (92,152,1)</small> || the gravitational generator is now charging.<br>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 30 KiB