12/21 modernizations from TG live (#103)
* sync (#3) * shuttle auto call * Merge /vore into /master (#39) * progress * Compile errors fixed No idea if it's test worthy tho as conflicts with race overhaul and narky removal. * Update admins.txt * efforts continue Fuck grab code, seriously * grab code is cancer * Execute the Narkism Do not hesitate. Show no mercy. * holy shit grab code is awful * have I bitched about grab code My bitching, let me show you it * código de agarre es una mierda No really it is * yeah I don't even know anymore. * Lolnope. Fuck grab code * I'm not even sure what to fix anymore * Self eating is not an acceptable fate * Taste the void, son. * My code doesn't pass it's own sanity check. Maybe it's a sign of things to come. * uncommented and notes * It Works and I Don't Know Why (#38) * shuttle auto call * it works and I don't know why * Subsystem 12/21 Most Recent TG subsystem folder * globalvars 12/21 Tossed out the flavor_misc and parallax files * Onclick 12/21 as well as .dme updates * _defines 12/21 ommited old _MC.dm * _HELPERS 12/21 Preserved snowflake placement of furry sprites * _defeines/genetics reapplied narkism holdover for snowflake races. * Oops forgot mutant colors * modules porting 12/21 + Sounds/icons Admin, Client and most of mob life files ommitted * enviroment file * Admin optimizations ahelp log system kept * Mob ports 12/21 Flavor text preserved * datums ported 12/21 * Game ported 12/21 * batch of duplicate fixes/dogborg work Dogborgs need to be modernized to refractored borg standards. * moar fixes * Maps and futher compile fixes
This commit is contained in:
+109
-108
@@ -16,34 +16,38 @@
|
||||
desc = "Used for building lights."
|
||||
icon = 'icons/obj/lighting.dmi'
|
||||
icon_state = "tube-construct-item"
|
||||
result_path = /obj/machinery/light_construct
|
||||
result_path = /obj/structure/light_construct
|
||||
inverse = 1
|
||||
|
||||
/obj/item/wallframe/light_fixture/small
|
||||
name = "small light fixture frame"
|
||||
icon_state = "bulb-construct-item"
|
||||
result_path = /obj/machinery/light_construct/small
|
||||
result_path = /obj/structure/light_construct/small
|
||||
materials = list(MAT_METAL=MINERAL_MATERIAL_AMOUNT)
|
||||
|
||||
|
||||
/obj/machinery/light_construct
|
||||
/obj/structure/light_construct
|
||||
name = "light fixture frame"
|
||||
desc = "A light fixture under construction."
|
||||
icon = 'icons/obj/lighting.dmi'
|
||||
icon_state = "tube-construct-stage1"
|
||||
anchored = 1
|
||||
layer = WALL_OBJ_LAYER
|
||||
obj_integrity = 200
|
||||
max_integrity = 200
|
||||
armor = list(melee = 50, bullet = 10, laser = 10, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 80, acid = 50)
|
||||
|
||||
var/stage = 1
|
||||
var/fixture_type = "tube"
|
||||
var/sheets_refunded = 2
|
||||
var/obj/machinery/light/newlight = null
|
||||
|
||||
/obj/machinery/light_construct/New(loc, ndir, building)
|
||||
/obj/structure/light_construct/New(loc, ndir, building)
|
||||
..()
|
||||
if(building)
|
||||
setDir(ndir)
|
||||
|
||||
/obj/machinery/light_construct/examine(mob/user)
|
||||
/obj/structure/light_construct/examine(mob/user)
|
||||
..()
|
||||
switch(src.stage)
|
||||
if(1)
|
||||
@@ -53,14 +57,14 @@
|
||||
if(3)
|
||||
user << "The casing is closed."
|
||||
|
||||
/obj/machinery/light_construct/attackby(obj/item/weapon/W, mob/user, params)
|
||||
/obj/structure/light_construct/attackby(obj/item/weapon/W, mob/user, params)
|
||||
add_fingerprint(user)
|
||||
switch(stage)
|
||||
if(1)
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
playsound(src.loc, W.usesound, 75, 1)
|
||||
usr << "<span class='notice'>You begin deconstructing [src]...</span>"
|
||||
if (!do_after(usr, 30/W.toolspeed, target = src))
|
||||
if (!do_after(usr, 30*W.toolspeed, target = src))
|
||||
return
|
||||
new /obj/item/stack/sheet/metal( get_turf(src.loc), sheets_refunded )
|
||||
user.visible_message("[user.name] deconstructs [src].", \
|
||||
@@ -116,13 +120,24 @@
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/structure/light_construct/blob_act(obj/structure/blob/B)
|
||||
if(B && B.loc == loc)
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/light_construct/small
|
||||
|
||||
/obj/structure/light_construct/deconstruct(disassembled = TRUE)
|
||||
if(!(flags & NODECONSTRUCT))
|
||||
new /obj/item/stack/sheet/metal(loc, sheets_refunded)
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/light_construct/small
|
||||
name = "small light fixture frame"
|
||||
icon_state = "bulb-construct-stage1"
|
||||
fixture_type = "bulb"
|
||||
sheets_refunded = 1
|
||||
|
||||
|
||||
|
||||
// the standard tube light fixture
|
||||
/obj/machinery/light
|
||||
name = "light fixture"
|
||||
@@ -132,6 +147,8 @@
|
||||
desc = "A lighting fixture."
|
||||
anchored = 1
|
||||
layer = WALL_OBJ_LAYER
|
||||
obj_integrity = 100
|
||||
max_integrity = 100
|
||||
use_power = 2
|
||||
idle_power_usage = 2
|
||||
active_power_usage = 20
|
||||
@@ -148,7 +165,6 @@
|
||||
// this is used to calc the probability the light burns out
|
||||
|
||||
var/rigged = 0 // true if rigged to explode
|
||||
var/health = 20
|
||||
|
||||
// the smaller bulb light fixture
|
||||
|
||||
@@ -159,12 +175,12 @@
|
||||
brightness = 4
|
||||
desc = "A small lighting fixture."
|
||||
light_type = /obj/item/weapon/light/bulb
|
||||
health = 15
|
||||
|
||||
|
||||
|
||||
/obj/machinery/light/Move()
|
||||
if(status != LIGHT_BROKEN)
|
||||
broken(1)
|
||||
break_light_tube(1)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/light/built/New()
|
||||
@@ -186,11 +202,11 @@
|
||||
if("tube")
|
||||
brightness = 8
|
||||
if(prob(2))
|
||||
broken(1)
|
||||
break_light_tube(1)
|
||||
if("bulb")
|
||||
brightness = 4
|
||||
if(prob(5))
|
||||
broken(1)
|
||||
break_light_tube(1)
|
||||
spawn(1)
|
||||
update(0)
|
||||
|
||||
@@ -222,23 +238,20 @@
|
||||
|
||||
update_icon()
|
||||
if(on)
|
||||
if(!light || light.light_range != brightness)
|
||||
if(!light || light.luminosity != brightness)
|
||||
switchcount++
|
||||
if(rigged)
|
||||
if(status == LIGHT_OK && trigger)
|
||||
explode()
|
||||
else if( prob( min(60, switchcount*switchcount*0.01) ) )
|
||||
if(status == LIGHT_OK && trigger)
|
||||
status = LIGHT_BURNED
|
||||
icon_state = "[base_state]-burned"
|
||||
on = 0
|
||||
set_light(0)
|
||||
if(trigger)
|
||||
burn_out()
|
||||
else
|
||||
use_power = 2
|
||||
set_light(brightness)
|
||||
SetLuminosity(brightness)
|
||||
else
|
||||
use_power = 1
|
||||
set_light(0)
|
||||
SetLuminosity(0)
|
||||
|
||||
active_power_usage = (brightness * 10)
|
||||
if(on != on_gs)
|
||||
@@ -250,6 +263,13 @@
|
||||
removeStaticPower(static_power_used, STATIC_LIGHT)
|
||||
|
||||
|
||||
/obj/machinery/light/proc/burn_out()
|
||||
if(status == LIGHT_OK)
|
||||
status = LIGHT_BURNED
|
||||
icon_state = "[base_state]-burned"
|
||||
on = 0
|
||||
SetLuminosity(0)
|
||||
|
||||
// attempt to set the light's on/off status
|
||||
// will not switch on if broken/burned/empty
|
||||
/obj/machinery/light/proc/seton(s)
|
||||
@@ -311,19 +331,7 @@
|
||||
playsound(src.loc, W.usesound, 75, 1)
|
||||
user.visible_message("[user.name] opens [src]'s casing.", \
|
||||
"<span class='notice'>You open [src]'s casing.</span>", "<span class='italics'>You hear a noise.</span>")
|
||||
var/obj/machinery/light_construct/newlight = null
|
||||
switch(fitting)
|
||||
if("tube")
|
||||
newlight = new /obj/machinery/light_construct(src.loc)
|
||||
newlight.icon_state = "tube-construct-stage2"
|
||||
|
||||
if("bulb")
|
||||
newlight = new /obj/machinery/light_construct/small(src.loc)
|
||||
newlight.icon_state = "bulb-construct-stage2"
|
||||
newlight.setDir(src.dir)
|
||||
newlight.stage = 2
|
||||
transfer_fingerprints_to(newlight)
|
||||
qdel(src)
|
||||
deconstruct()
|
||||
else
|
||||
user << "<span class='userdanger'>You stick \the [W] into the light socket!</span>"
|
||||
if(has_power() && (W.flags & CONDUCT))
|
||||
@@ -331,36 +339,64 @@
|
||||
s.set_up(3, 1, src)
|
||||
s.start()
|
||||
if (prob(75))
|
||||
electrocute_mob(user, get_area(src), src, rand(0.7,1.0))
|
||||
electrocute_mob(user, get_area(src), src, rand(0.7,1.0), TRUE)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/light/deconstruct(disassembled = TRUE)
|
||||
if(!(flags & NODECONSTRUCT))
|
||||
var/obj/structure/light_construct/newlight = null
|
||||
var/cur_stage = 2
|
||||
if(!disassembled)
|
||||
cur_stage = 1
|
||||
switch(fitting)
|
||||
if("tube")
|
||||
newlight = new /obj/structure/light_construct(src.loc)
|
||||
newlight.icon_state = "tube-construct-stage[cur_stage]"
|
||||
|
||||
if("bulb")
|
||||
newlight = new /obj/structure/light_construct/small(src.loc)
|
||||
newlight.icon_state = "bulb-construct-stage[cur_stage]"
|
||||
newlight.setDir(src.dir)
|
||||
newlight.stage = cur_stage
|
||||
if(!disassembled)
|
||||
newlight.obj_integrity = newlight.max_integrity * 0.5
|
||||
if(status != LIGHT_BROKEN)
|
||||
break_light_tube()
|
||||
if(status != LIGHT_EMPTY)
|
||||
drop_light_tube()
|
||||
new /obj/item/stack/cable_coil(loc, 1, "red")
|
||||
transfer_fingerprints_to(newlight)
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/light/attacked_by(obj/item/I, mob/living/user)
|
||||
..()
|
||||
if(status == LIGHT_BROKEN || status == LIGHT_EMPTY)
|
||||
if(on && (I.flags & CONDUCT))
|
||||
if(prob(12))
|
||||
electrocute_mob(user, get_area(src), src, 0.3)
|
||||
electrocute_mob(user, get_area(src), src, 0.3, TRUE)
|
||||
|
||||
/obj/machinery/light/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
|
||||
/obj/machinery/light/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1)
|
||||
. = ..()
|
||||
if(. && !qdeleted(src))
|
||||
if(prob(damage_amount * 5))
|
||||
break_light_tube()
|
||||
|
||||
|
||||
|
||||
|
||||
/obj/machinery/light/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
|
||||
switch(damage_type)
|
||||
if(BRUTE)
|
||||
if(sound_effect)
|
||||
switch(status)
|
||||
if(LIGHT_EMPTY)
|
||||
playsound(loc, 'sound/weapons/smash.ogg', 50, 1)
|
||||
if(LIGHT_BROKEN)
|
||||
playsound(loc, 'sound/effects/hit_on_shattered_glass.ogg', 90, 1)
|
||||
else
|
||||
playsound(loc, 'sound/effects/Glasshit.ogg', 90, 1)
|
||||
switch(status)
|
||||
if(LIGHT_EMPTY)
|
||||
playsound(loc, 'sound/weapons/smash.ogg', 50, 1)
|
||||
if(LIGHT_BROKEN)
|
||||
playsound(loc, 'sound/effects/hit_on_shattered_glass.ogg', 90, 1)
|
||||
else
|
||||
playsound(loc, 'sound/effects/Glasshit.ogg', 90, 1)
|
||||
if(BURN)
|
||||
if(sound_effect)
|
||||
playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
|
||||
else
|
||||
return
|
||||
health -= damage
|
||||
if(health <= 0)
|
||||
broken()
|
||||
playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
|
||||
|
||||
|
||||
// returns whether this light has power
|
||||
@@ -389,20 +425,6 @@
|
||||
src.flicker(1)
|
||||
return
|
||||
|
||||
/obj/machinery/light/bullet_act(obj/item/projectile/P)
|
||||
. = ..()
|
||||
take_damage(P.damage, P.damage_type, 0)
|
||||
|
||||
/obj/machinery/light/hitby(AM as mob|obj)
|
||||
..()
|
||||
var/tforce = 0
|
||||
if(ismob(AM))
|
||||
tforce = 40
|
||||
else if(isobj(AM))
|
||||
var/obj/item/I = AM
|
||||
tforce = I.throwforce
|
||||
take_damage(tforce)
|
||||
|
||||
// attack with hand - remove tube/bulb
|
||||
// if hands aren't protected and the light is on, burn the player
|
||||
|
||||
@@ -435,14 +457,16 @@
|
||||
else
|
||||
user << "<span class='warning'>You try to remove the light [fitting], but you burn your hand on it!</span>"
|
||||
|
||||
var/obj/item/bodypart/affecting = H.get_bodypart("[user.hand ? "l" : "r" ]_arm")
|
||||
if(affecting && affecting.take_damage( 0, 5 )) // 5 burn damage
|
||||
H.update_damage_overlays(0)
|
||||
H.updatehealth()
|
||||
var/obj/item/bodypart/affecting = H.get_bodypart("[(user.active_hand_index % 2 == 0) ? "r" : "l" ]_arm")
|
||||
if(affecting && affecting.receive_damage( 0, 5 )) // 5 burn damage
|
||||
H.update_damage_overlays()
|
||||
return // if burned, don't remove the light
|
||||
else
|
||||
user << "<span class='notice'>You remove the light [fitting].</span>"
|
||||
// create a light tube/bulb item and put it in the user's hand
|
||||
drop_light_tube(user)
|
||||
|
||||
/obj/machinery/light/proc/drop_light_tube(mob/user)
|
||||
var/obj/item/weapon/light/L = new light_type()
|
||||
L.status = status
|
||||
L.rigged = rigged
|
||||
@@ -453,10 +477,11 @@
|
||||
switchcount = 0
|
||||
|
||||
L.update()
|
||||
L.add_fingerprint(user)
|
||||
L.loc = loc
|
||||
L.forceMove(loc)
|
||||
|
||||
user.put_in_active_hand(L) //puts it in our active hand
|
||||
if(user) //puts it in our active hand
|
||||
L.add_fingerprint(user)
|
||||
user.put_in_active_hand(L)
|
||||
|
||||
status = LIGHT_EMPTY
|
||||
update()
|
||||
@@ -468,26 +493,13 @@
|
||||
|
||||
user << "<span class='notice'>You telekinetically remove the light [fitting].</span>"
|
||||
// create a light tube/bulb item and put it in the user's hand
|
||||
var/obj/item/weapon/light/L = new light_type()
|
||||
L.status = status
|
||||
L.rigged = rigged
|
||||
L.brightness = brightness
|
||||
drop_light_tube()
|
||||
|
||||
// light item inherits the switchcount, then zero it
|
||||
L.switchcount = switchcount
|
||||
switchcount = 0
|
||||
|
||||
L.update()
|
||||
L.add_fingerprint(user)
|
||||
L.loc = loc
|
||||
|
||||
status = LIGHT_EMPTY
|
||||
update()
|
||||
|
||||
// break the light and make sparks if was on
|
||||
|
||||
/obj/machinery/light/proc/broken(skip_sound_and_sparks = 0)
|
||||
if(status == LIGHT_EMPTY)
|
||||
/obj/machinery/light/proc/break_light_tube(skip_sound_and_sparks = 0)
|
||||
if(status == LIGHT_EMPTY || status == LIGHT_BROKEN)
|
||||
return
|
||||
|
||||
if(!skip_sound_and_sparks)
|
||||
@@ -508,19 +520,10 @@
|
||||
on = 1
|
||||
update()
|
||||
|
||||
// explosion effect
|
||||
// destroy the whole light fixture or just shatter it
|
||||
|
||||
/obj/machinery/light/ex_act(severity, target)
|
||||
..()
|
||||
if(!qdeleted(src))
|
||||
switch(severity)
|
||||
if(2)
|
||||
if(prob(50))
|
||||
broken()
|
||||
if(3)
|
||||
if(prob(25))
|
||||
broken()
|
||||
/obj/machinery/light/tesla_act(power, explosive = FALSE)
|
||||
if(explosive)
|
||||
explosion(src.loc,0,0,0,flame_range = 5, adminlog = 0)
|
||||
qdel(src)
|
||||
|
||||
// called when area power state changes
|
||||
/obj/machinery/light/power_change()
|
||||
@@ -532,14 +535,14 @@
|
||||
|
||||
/obj/machinery/light/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
||||
if(prob(max(0, exposed_temperature - 673))) //0% at <400C, 100% at >500C
|
||||
broken()
|
||||
break_light_tube()
|
||||
|
||||
// explode the light
|
||||
|
||||
/obj/machinery/light/proc/explode()
|
||||
set waitfor = 0
|
||||
var/turf/T = get_turf(src.loc)
|
||||
broken() // break it first to give a warning
|
||||
break_light_tube() // break it first to give a warning
|
||||
sleep(2)
|
||||
explosion(T, 0, 0, 2, 2)
|
||||
sleep(1)
|
||||
@@ -553,11 +556,11 @@
|
||||
icon = 'icons/obj/lighting.dmi'
|
||||
force = 2
|
||||
throwforce = 5
|
||||
w_class = 1
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
var/status = 0 // LIGHT_OK, LIGHT_BURNED or LIGHT_BROKEN
|
||||
var/base_state
|
||||
var/switchcount = 0 // number of times switched
|
||||
materials = list(MAT_METAL=60)
|
||||
materials = list(MAT_GLASS=100)
|
||||
var/rigged = 0 // true if rigged to explode
|
||||
var/brightness = 2 //how much light it gives off
|
||||
|
||||
@@ -567,7 +570,6 @@
|
||||
icon_state = "ltube"
|
||||
base_state = "ltube"
|
||||
item_state = "c_tube"
|
||||
materials = list(MAT_GLASS=100)
|
||||
brightness = 8
|
||||
|
||||
/obj/item/weapon/light/bulb
|
||||
@@ -576,7 +578,6 @@
|
||||
icon_state = "lbulb"
|
||||
base_state = "lbulb"
|
||||
item_state = "contvapour"
|
||||
materials = list(MAT_GLASS=100)
|
||||
brightness = 4
|
||||
|
||||
/obj/item/weapon/light/throw_impact(atom/hit_atom)
|
||||
|
||||
Reference in New Issue
Block a user