mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
TG: Tonnes of stuff, please check the changelog.
In short: massive updates to security, the library, hydroponics, the kitchen and the bar, by Flazeo and Ikarrus Massive updates to the PA, with Invisty's new sprites, done by Sieve New sprites for field gens too, also by Invisty Borg and battery updates by Sieve Fake gloves by Sieve I messed around with some pressure_resistance stuff on Dumpdavidson's suggestion (only in paperwork) PROBABLY A BUNCH OF OTHER SHIT Revision: r3505 Author: petethegoat
This commit is contained in:
@@ -21,42 +21,32 @@ field_generator power level display
|
||||
density = 1
|
||||
use_power = 0
|
||||
var
|
||||
const/num_power_levels = 15 // Total number of power level icon has
|
||||
const/num_power_levels = 6 // Total number of power level icon has
|
||||
Varedit_start = 0
|
||||
Varpower = 0
|
||||
active = 0
|
||||
power = 20 // Current amount of power
|
||||
state = 0
|
||||
warming_up = 0
|
||||
powerlevel = 0 // Current Power level in overlays list
|
||||
list/obj/machinery/containment_field/fields
|
||||
list/obj/machinery/field_generator/connected_gens
|
||||
clean_up = 0
|
||||
|
||||
|
||||
update_icon()
|
||||
if (!active)
|
||||
//Set icon_state has not been set, set to "Field_Gen"
|
||||
if (icon_state != "Field_Gen")
|
||||
icon_state = "Field_Gen"
|
||||
warming_up = 0
|
||||
else if (warming_up && icon_state != "Field_Gen +a[warming_up]")
|
||||
icon_state = "Field_Gen +a[warming_up]"
|
||||
|
||||
overlays = null
|
||||
if(!active)
|
||||
if(warming_up)
|
||||
overlays += "+a[warming_up]"
|
||||
if(fields.len)
|
||||
overlays += "+on"
|
||||
// Power level indicator
|
||||
// Scale % power to % num_power_levels and truncate value
|
||||
var/level = round(num_power_levels * power / field_generator_max_power)
|
||||
// Clamp between 0 and num_power_levels for out of range power values
|
||||
level = between(0, level, num_power_levels)
|
||||
|
||||
// Do nothing unless new level is diffrent the powerlevel
|
||||
if (powerlevel!=level)
|
||||
if (powerlevel) //Remove old powerlevel overlay from overlays
|
||||
overlays -= "Field_Gen +p[powerlevel]"
|
||||
powerlevel = level
|
||||
// If new power level exists add it to overlays
|
||||
if (powerlevel)
|
||||
overlays += "Field_Gen +p[powerlevel]"
|
||||
if(level)
|
||||
overlays += "+p[level]"
|
||||
|
||||
return
|
||||
|
||||
|
||||
@@ -37,6 +37,22 @@ CC|FC|
|
||||
PE|PE|PE
|
||||
|
||||
|
||||
Icon Addemdum
|
||||
Icon system is much more robust, and the icons are all variable based.
|
||||
Each part has a reference string, powered, strength, and contruction values.
|
||||
Using this the update_icon() proc is simplified a bit (using for absolutely was problematic with naming),
|
||||
so the icon_state comes out be:
|
||||
"[reference][strength]", with a switch controlling construction_states and ensuring that it doesn't
|
||||
power on while being contructed, and all these variables are set by the computer through it's scan list
|
||||
Essential order of the icons:
|
||||
Standard - [reference]
|
||||
Wrenched - [reference]
|
||||
Wired - [reference]w
|
||||
Closed - [reference]c
|
||||
Powered - [reference]p[strength]
|
||||
Strength being set by the computer and a null strength (Computer is powered off or inactive) returns a 'null', counting as empty
|
||||
So, hopefully this is helpful if any more icons are to be added/changed/wondering what the hell is going on here
|
||||
|
||||
*/
|
||||
|
||||
/obj/structure/particle_accelerator
|
||||
@@ -49,13 +65,59 @@ PE|PE|PE
|
||||
var
|
||||
obj/machinery/particle_accelerator/control_box/master = null
|
||||
construction_state = 0
|
||||
reference = null
|
||||
powered = 0
|
||||
strength = null
|
||||
desc_holder = null
|
||||
|
||||
end_cap
|
||||
name = "Alpha Particle Generation Array"
|
||||
desc_holder = "This is where Alpha particles are generated from \[REDACTED\]"
|
||||
icon_state = "end_cap"
|
||||
reference = "end_cap"
|
||||
|
||||
/* update_icon()
|
||||
switch(construction_state)
|
||||
if(0)
|
||||
icon_state="[reference]"
|
||||
if(1)
|
||||
icon_state="[reference]"
|
||||
if(2)
|
||||
icon_state="[reference]w"
|
||||
if(3)
|
||||
if(powered)
|
||||
switch(strength)
|
||||
if(0)
|
||||
icon_state="[reference]p0"
|
||||
if(1)
|
||||
icon_state="[reference]p1"
|
||||
if(2)
|
||||
icon_state="[reference]p2"
|
||||
else
|
||||
icon_state="[reference]p"
|
||||
else
|
||||
icon_state="[reference]c"
|
||||
return
|
||||
*/
|
||||
|
||||
update_icon()
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
verb/rotate()
|
||||
set name = "Rotate"
|
||||
set name = "Rotate Clockwise"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if (src.anchored || usr:stat)
|
||||
usr << "It is fastened to the floor!"
|
||||
return 0
|
||||
src.dir = turn(src.dir, 270)
|
||||
return 1
|
||||
|
||||
verb/rotateccw()
|
||||
set name = "Rotate Counter Clockwise"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
@@ -65,18 +127,18 @@ PE|PE|PE
|
||||
src.dir = turn(src.dir, 90)
|
||||
return 1
|
||||
|
||||
|
||||
examine()
|
||||
set src in oview(1)
|
||||
switch(src.construction_state)
|
||||
if(0)
|
||||
src.desc = text("Part of a Particle Accelerator, looks like its not attached to the flooring")
|
||||
src.desc = text("A [name], looks like it's not attached to the flooring")
|
||||
if(1)
|
||||
src.desc = text("Part of a Particle Accelerator, looks like its missing some cables")
|
||||
src.desc = text("A [name], it is missing some cables")
|
||||
if(2)
|
||||
src.desc = text("Part of a Particle Accelerator, looks like its got an open panel")
|
||||
src.desc = text("A [name], the panel is open")
|
||||
if(3)
|
||||
src.desc = text("Part of a Particle Accelerator, looks like its all setup")
|
||||
src.desc = text("The [name] is assembled")
|
||||
if(powered)
|
||||
src.desc = src.desc_holder
|
||||
..()
|
||||
return
|
||||
|
||||
@@ -117,6 +179,20 @@ PE|PE|PE
|
||||
del(src)
|
||||
return
|
||||
|
||||
update_icon()
|
||||
switch(construction_state)
|
||||
if(0)
|
||||
icon_state="[reference]"
|
||||
if(1)
|
||||
icon_state="[reference]"
|
||||
if(2)
|
||||
icon_state="[reference]w"
|
||||
if(3)
|
||||
if(powered)
|
||||
icon_state="[reference]p[strength]"
|
||||
else
|
||||
icon_state="[reference]c"
|
||||
return
|
||||
|
||||
proc
|
||||
update_state()
|
||||
@@ -160,6 +236,7 @@ PE|PE|PE
|
||||
src.anchored = 1
|
||||
user.visible_message("[user.name] secures the [src.name] to the floor.", \
|
||||
"You secure the external bolts.")
|
||||
// icon_state = "[reference]"
|
||||
temp_state++
|
||||
if(1)
|
||||
if(iswrench(O))
|
||||
@@ -167,25 +244,30 @@ PE|PE|PE
|
||||
src.anchored = 0
|
||||
user.visible_message("[user.name] detaches the [src.name] from the floor.", \
|
||||
"You remove the external bolts.")
|
||||
// icon_state = "[reference]"
|
||||
temp_state--
|
||||
else if(iscoil(O))
|
||||
if(O:use(1,user))
|
||||
user.visible_message("[user.name] adds wires to the [src.name].", \
|
||||
"You add some wires.")
|
||||
// icon_state = "[reference]w"
|
||||
temp_state++
|
||||
if(2)
|
||||
if(iswirecutter(O))//TODO:Shock user if its on?
|
||||
user.visible_message("[user.name] removes some wires from the [src.name].", \
|
||||
"You remove some wires.")
|
||||
// icon_state = "[reference]"
|
||||
temp_state--
|
||||
else if(isscrewdriver(O))
|
||||
user.visible_message("[user.name] closes the [src.name]'s access panel.", \
|
||||
"You close the access panel.")
|
||||
// icon_state = "[reference]c"
|
||||
temp_state++
|
||||
if(3)
|
||||
if(isscrewdriver(O))
|
||||
user.visible_message("[user.name] opens the [src.name]'s access panel.", \
|
||||
"You open the access panel.")
|
||||
// icon_state = "[reference]w"
|
||||
temp_state--
|
||||
if(temp_state == src.construction_state)//Nothing changed
|
||||
return 0
|
||||
@@ -212,10 +294,25 @@ PE|PE|PE
|
||||
var
|
||||
construction_state = 0
|
||||
active = 0
|
||||
reference = null
|
||||
powered = null
|
||||
strength = 0
|
||||
desc_holder = null
|
||||
|
||||
|
||||
verb/rotate()
|
||||
set name = "Rotate"
|
||||
set name = "Rotate Clockwise"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if (src.anchored || usr:stat)
|
||||
usr << "It is fastened to the floor!"
|
||||
return 0
|
||||
src.dir = turn(src.dir, 270)
|
||||
return 1
|
||||
|
||||
verb/rotateccw()
|
||||
set name = "Rotate Counter-Clockwise"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
@@ -225,17 +322,21 @@ PE|PE|PE
|
||||
src.dir = turn(src.dir, 90)
|
||||
return 1
|
||||
|
||||
update_icon()
|
||||
return
|
||||
|
||||
examine()
|
||||
switch(src.construction_state)
|
||||
if(0)
|
||||
src.desc = text("Part of a Particle Accelerator, looks like its not attached to the flooring")
|
||||
src.desc = text("A [name], looks like it's not attached to the flooring")
|
||||
if(1)
|
||||
src.desc = text("Part of a Particle Accelerator, looks like its missing some cables")
|
||||
src.desc = text("A [name], it is missing some cables")
|
||||
if(2)
|
||||
src.desc = text("Part of a Particle Accelerator, looks like its got an open panel")
|
||||
src.desc = text("A [name], the panel is open")
|
||||
if(3)
|
||||
src.desc = text("Part of a Particle Accelerator, looks like its all setup")
|
||||
src.desc = text("The [name] is assembled")
|
||||
if(powered)
|
||||
src.desc = src.desc_holder
|
||||
..()
|
||||
return
|
||||
|
||||
@@ -294,6 +395,7 @@ PE|PE|PE
|
||||
src.anchored = 1
|
||||
user.visible_message("[user.name] secures the [src.name] to the floor.", \
|
||||
"You secure the external bolts.")
|
||||
//icon_state = "[reference]"
|
||||
temp_state++
|
||||
if(1)
|
||||
if(iswrench(O))
|
||||
@@ -301,25 +403,30 @@ PE|PE|PE
|
||||
src.anchored = 0
|
||||
user.visible_message("[user.name] detaches the [src.name] from the floor.", \
|
||||
"You remove the external bolts.")
|
||||
//icon_state = "[reference]"
|
||||
temp_state--
|
||||
else if(iscoil(O))
|
||||
if(O:use(1))
|
||||
user.visible_message("[user.name] adds wires to the [src.name].", \
|
||||
"You add some wires.")
|
||||
//icon_state = "[reference]w"
|
||||
temp_state++
|
||||
if(2)
|
||||
if(iswirecutter(O))//TODO:Shock user if its on?
|
||||
user.visible_message("[user.name] removes some wires from the [src.name].", \
|
||||
"You remove some wires.")
|
||||
//icon_state = "[reference]"
|
||||
temp_state--
|
||||
else if(isscrewdriver(O))
|
||||
user.visible_message("[user.name] closes the [src.name]'s access panel.", \
|
||||
"You close the access panel.")
|
||||
//icon_state = "[reference]c"
|
||||
temp_state++
|
||||
if(3)
|
||||
if(isscrewdriver(O))
|
||||
user.visible_message("[user.name] opens the [src.name]'s access panel.", \
|
||||
"You open the access panel.")
|
||||
//icon_state = "[reference]w"
|
||||
temp_state--
|
||||
if(temp_state == src.construction_state)//Nothing changed
|
||||
return 0
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
/obj/structure/particle_accelerator/fuel_chamber
|
||||
name = "Particle Accelerator Fuel Control"
|
||||
desc = "Part of a Particle Accelerator."
|
||||
name = "EM Acceleration Chamber"
|
||||
desc_holder = "This is where the Alpha particles are accelerated to <b><i>radical speeds</i></b>."
|
||||
icon = 'particle_accelerator.dmi'
|
||||
icon_state = "fuel_chamber"
|
||||
icon_state = "fuel_chamber"
|
||||
reference = "fuel_chamber"
|
||||
|
||||
update_icon()
|
||||
..()
|
||||
return
|
||||
@@ -1,8 +1,9 @@
|
||||
/obj/machinery/particle_accelerator/control_box
|
||||
name = "Particle Accelerator Control Box"
|
||||
desc = "Part of a Particle Accelerator."
|
||||
name = "Particle Accelerator Control Computer"
|
||||
desc = "This controls the density of the particles."
|
||||
icon = 'particle_accelerator.dmi'
|
||||
icon_state = "control_box"
|
||||
reference = "control_box"
|
||||
anchored = 0
|
||||
density = 1
|
||||
use_power = 0
|
||||
@@ -13,7 +14,7 @@
|
||||
var
|
||||
list/obj/structure/particle_accelerator/connected_parts
|
||||
assembled = 0
|
||||
strength = 0
|
||||
parts = null
|
||||
|
||||
|
||||
New()
|
||||
@@ -40,6 +41,28 @@
|
||||
|
||||
return
|
||||
|
||||
update_icon()
|
||||
if(active)
|
||||
icon_state = "[reference]p1"
|
||||
else
|
||||
if(use_power)
|
||||
icon_state = "[reference]p"
|
||||
else
|
||||
icon_state = "[reference]c"
|
||||
switch(construction_state)
|
||||
if(0)
|
||||
icon_state = "[reference]"
|
||||
if(1)
|
||||
icon_state = "[reference]"
|
||||
if(2)
|
||||
icon_state = "[reference]w"
|
||||
if(3)
|
||||
icon_state = "[reference]c"
|
||||
return
|
||||
|
||||
update_icon()
|
||||
..()
|
||||
return
|
||||
|
||||
Topic(href, href_list)
|
||||
..()
|
||||
@@ -61,17 +84,30 @@
|
||||
src.part_scan()
|
||||
if(href_list["strengthup"])
|
||||
src.strength++
|
||||
for(var/obj/structure/particle_accelerator/part in connected_parts)
|
||||
part.strength++
|
||||
part.update_icon()
|
||||
if(src.strength > 2)
|
||||
src.strength = 2
|
||||
message_admins("[usr] increased particle accelerator power to [strength].")
|
||||
log_admin("[usr] increased particle accelerator power to [strength].")
|
||||
message_admins("[usr] increased particle accelerator power to [strength].")
|
||||
log_admin("[usr] increased particle accelerator power to [strength].")
|
||||
for(var/obj/structure/particle_accelerator/part in connected_parts)
|
||||
part.strength = 2
|
||||
part.update_icon()
|
||||
if(href_list["strengthdown"])
|
||||
src.strength--
|
||||
for(var/obj/structure/particle_accelerator/part in connected_parts)
|
||||
part.strength--
|
||||
part.update_icon()
|
||||
if(src.strength < 0)
|
||||
src.strength = 0
|
||||
message_admins("[usr] decreased particle accelerator power to [strength].")
|
||||
log_admin("[usr] decreased particle accelerator power to [strength].")
|
||||
message_admins("[usr] decreased particle accelerator power to [strength].")
|
||||
log_admin("[usr] decreased particle accelerator power to [strength].")
|
||||
for(var/obj/structure/particle_accelerator/part in connected_parts)
|
||||
part.strength = 0
|
||||
part.update_icon()
|
||||
src.updateDialog()
|
||||
src.update_icon()
|
||||
return
|
||||
|
||||
|
||||
@@ -80,7 +116,7 @@
|
||||
if(stat & NOPOWER)
|
||||
active = 0
|
||||
use_power = 0
|
||||
else if(!stat)
|
||||
else if(!stat && construction_state == 3)
|
||||
use_power = 1
|
||||
return
|
||||
|
||||
@@ -150,8 +186,16 @@
|
||||
src.active = !src.active
|
||||
if(src.active)
|
||||
src.use_power = 2
|
||||
for(var/obj/structure/particle_accelerator/part in connected_parts)
|
||||
part.strength = src.strength
|
||||
part.powered = 1
|
||||
part.update_icon()
|
||||
else
|
||||
src.use_power = 1
|
||||
for(var/obj/structure/particle_accelerator/part in connected_parts)
|
||||
part.strength = null
|
||||
part.powered = 0
|
||||
part.update_icon()
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/obj/structure/particle_accelerator/particle_emitter
|
||||
name = "Particle Accelerator Emitter"
|
||||
desc = "Part of a Particle Accelerator, might not want to stand near this end."
|
||||
name = "EM Containment Grid"
|
||||
desc_holder = "This launchs the Alpha particles, might not want to stand near this end."
|
||||
icon = 'particle_accelerator.dmi'
|
||||
icon_state = "none"
|
||||
var
|
||||
@@ -9,17 +9,19 @@
|
||||
|
||||
center
|
||||
icon_state = "emitter_center"
|
||||
reference = "emitter_center"
|
||||
|
||||
left
|
||||
icon_state = "emitter_left"
|
||||
reference = "emitter_left"
|
||||
|
||||
right
|
||||
icon_state = "emitter_right"
|
||||
|
||||
reference = "emitter_right"
|
||||
|
||||
update_icon()
|
||||
return//Add overlays here
|
||||
|
||||
..()
|
||||
return
|
||||
|
||||
proc
|
||||
set_delay(var/delay)
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
/obj/structure/particle_accelerator/power_box
|
||||
name = "Particle Accelerator"
|
||||
desc = "Part of a Particle Accelerator, this part seems to have a maintenance panel on it."
|
||||
name = "Particle Focusing EM Lens"
|
||||
desc_holder = "This uses electromagnetic waves to focus the Alpha-Particles."
|
||||
icon = 'particle_accelerator.dmi'
|
||||
icon_state = "power_box"
|
||||
anchored = 0
|
||||
density = 1
|
||||
reference = "power_box"
|
||||
|
||||
update_icon()
|
||||
..()
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user