- Standardized var definition for RND and radio code (possibly some other stuff)

- Removed all cases (that I saw anyway) of flags being defined by static numbers.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3663 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
baloh.matevz@gmail.com
2012-05-25 14:48:47 +00:00
parent 4413e5456d
commit a30aca4327
13 changed files with 107 additions and 92 deletions

View File

@@ -359,7 +359,7 @@
density = 0 density = 0
anchored = 1.0 anchored = 1.0
layer = 2.3 //under pipes layer = 2.3 //under pipes
// flags = 64.0 // flags = CONDUCT
/obj/structure/lattice/New() /obj/structure/lattice/New()
..() ..()

View File

@@ -629,7 +629,7 @@
name = "dummy" name = "dummy"
invisibility = 101.0 invisibility = 101.0
anchored = 1.0 anchored = 1.0
flags = 2.0 flags = TABLEPASS
/obj/item/weapon/extinguisher /obj/item/weapon/extinguisher
name = "fire extinguisher" name = "fire extinguisher"
@@ -734,7 +734,7 @@
throwforce = 5 throwforce = 5
w_class = 2.0 w_class = 2.0
throw_speed = 3 throw_speed = 3
throw_range = 5 throw_range = 5W
m_amt = 10000 m_amt = 10000
origin_tech = "magnets=1;bluespace=3" origin_tech = "magnets=1;bluespace=3"

View File

@@ -18,7 +18,7 @@ would spawn and follow the beaker, even if it is carried or thrown.
icon = 'effects.dmi' icon = 'effects.dmi'
icon_state = "extinguish" icon_state = "extinguish"
var/life = 15.0 var/life = 15.0
flags = 2.0 flags = TABLEPASS
mouse_opacity = 0 mouse_opacity = 0
/obj/effect/effect/smoke /obj/effect/effect/smoke

View File

@@ -42,7 +42,8 @@
icon_state = "camera" icon_state = "camera"
item_state = "electropack" item_state = "electropack"
w_class = 2.0 w_class = 2.0
flags = 466.0 flags = FPRINT | CONDUCT | USEDELAY | TABLEPASS | ONBELT
slot_flags = SLOT_BELT
m_amt = 2000 m_amt = 2000
throwforce = 5 throwforce = 5
throw_speed = 4 throw_speed = 4

View File

@@ -8,7 +8,8 @@
m_amt = 10000 m_amt = 10000
frequency = 1449 frequency = 1449
w_class = 5.0 w_class = 5.0
flags = 323 flags = FPRINT | CONDUCT | TABLEPASS
slot_flags = SLOT_BACK
item_state = "electropack" item_state = "electropack"
/obj/item/device/radio/electropack/examine() /obj/item/device/radio/electropack/examine()

View File

@@ -9,43 +9,41 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
suffix = "\[3\]" suffix = "\[3\]"
icon_state = "walkietalkie" icon_state = "walkietalkie"
item_state = "walkietalkie" item_state = "walkietalkie"
var var/on = 1 // 0 for off
on = 1 // 0 for off var/last_transmission
last_transmission var/frequency = 1459 //common chat
frequency = 1459 //common chat var/traitor_frequency = 0 //tune to frequency to unlock traitor supplies
traitor_frequency = 0 //tune to frequency to unlock traitor supplies var/canhear_range = 3 // the range which mobs can hear this radio from
canhear_range = 3 // the range which mobs can hear this radio from var/obj/item/device/radio/patch_link = null
obj/item/device/radio/patch_link = null var/obj/item/device/uplink/traitorradio = null
obj/item/device/uplink/traitorradio = null var/wires = WIRE_SIGNAL | WIRE_RECEIVE | WIRE_TRANSMIT
wires = WIRE_SIGNAL | WIRE_RECEIVE | WIRE_TRANSMIT var/b_stat = 0
b_stat = 0 var/broadcasting = 0
broadcasting = 0 var/listening = 1
listening = 1 var/freerange = 0 // 0 - Sanitize frequencies, 1 - Full range
freerange = 0 // 0 - Sanitize frequencies, 1 - Full range var/list/channels = list() //see communications.dm for full list. First channes is a "default" for :h
list/channels = list() //see communications.dm for full list. First channes is a "default" for :h var/subspace_transmission = 0
subspace_transmission = 0
// "Example" = FREQ_LISTENING|FREQ_BROADCASTING // "Example" = FREQ_LISTENING|FREQ_BROADCASTING
flags = 450 // hello i'm a fucking idiot why is this 450?? CODE GODS PLEASE EXPLAIN~ flags = FPRINT | CONDUCT | TABLEPASS
slot_flags = SLOT_BELT
throw_speed = 2 throw_speed = 2
throw_range = 9 throw_range = 9
w_class = 2 w_class = 2
g_amt = 25 g_amt = 25
m_amt = 75 m_amt = 75
var/const var/const/WIRE_SIGNAL = 1 //sends a signal, like to set off a bomb or electrocute someone
WIRE_SIGNAL = 1 //sends a signal, like to set off a bomb or electrocute someone var/const/WIRE_RECEIVE = 2
WIRE_RECEIVE = 2 var/const/WIRE_TRANSMIT = 4
WIRE_TRANSMIT = 4 var/const/TRANSMISSION_DELAY = 5 // only 2/second/radio
TRANSMISSION_DELAY = 5 // only 2/second/radio var/const/FREQ_LISTENING = 1
FREQ_LISTENING = 1
//FREQ_BROADCASTING = 2 //FREQ_BROADCASTING = 2
/obj/item/device/radio /obj/item/device/radio
var var/datum/radio_frequency/radio_connection
datum/radio_frequency/radio_connection var/list/datum/radio_frequency/secure_radio_connections = new
list/datum/radio_frequency/secure_radio_connections = new
proc proc/set_frequency(new_frequency)
set_frequency(new_frequency)
radio_controller.remove_object(src, frequency) radio_controller.remove_object(src, frequency)
frequency = new_frequency frequency = new_frequency
radio_connection = radio_controller.add_object(src, frequency, RADIO_CHAT) radio_connection = radio_controller.add_object(src, frequency, RADIO_CHAT)

View File

@@ -46,31 +46,43 @@
throw_range = 10 throw_range = 10
origin_tech = "magnets=1" origin_tech = "magnets=1"
var var/secured = 1
secured = 1 var/small_icon_state_left = null
small_icon_state_left = null var/small_icon_state_right = null
small_icon_state_right = null var/list/small_icon_state_overlays = null
list/small_icon_state_overlays = null var/obj/item/device/assembly_holder/holder = null
obj/item/device/assembly_holder/holder = null var/cooldown = 0//To prevent spam
cooldown = 0//To prevent spam var/wires = WIRE_RECEIVE | WIRE_PULSE
wires = WIRE_RECEIVE | WIRE_PULSE
var/const var/const/WIRE_RECEIVE = 1 //Allows Pulsed(0) to call Activate()
WIRE_RECEIVE = 1 //Allows Pulsed(0) to call Activate() var/const/WIRE_PULSE = 2 //Allows Pulse(0) to act on the holder
WIRE_PULSE = 2 //Allows Pulse(0) to act on the holder var/const/WIRE_PULSE_SPECIAL = 4 //Allows Pulse(0) to act on the holders special assembly
WIRE_PULSE_SPECIAL = 4 //Allows Pulse(0) to act on the holders special assembly var/const/WIRE_RADIO_RECEIVE = 8 //Allows Pulsed(1) to call Activate()
WIRE_RADIO_RECEIVE = 8 //Allows Pulsed(1) to call Activate() var/const/WIRE_RADIO_PULSE = 16 //Allows Pulse(1) to send a radio message
WIRE_RADIO_PULSE = 16 //Allows Pulse(1) to send a radio message
proc proc/activate() //What the device does when turned on
activate() //What the device does when turned on return
pulsed(var/radio = 0) //Called when another assembly acts on this one, var/radio will determine where it came from for wire calcs
pulse(var/radio = 0) //Called when this device attempts to act on another device, var/radio determines if it was sent via radio or direct proc/pulsed(var/radio = 0) //Called when another assembly acts on this one, var/radio will determine where it came from for wire calcs
toggle_secure() //Code that has to happen when the assembly is un\secured goes here return
attach_assembly(var/obj/A, var/mob/user) //Called when an assembly is attacked by another
process_cooldown() //Called via spawn(10) to have it count down the cooldown var proc/pulse(var/radio = 0) //Called when this device attempts to act on another device, var/radio determines if it was sent via radio or direct
holder_movement() //Called when the holder is moved return
interact(mob/user as mob) //Called when attack_self is called
proc/toggle_secure() //Code that has to happen when the assembly is un\secured goes here
return
proc/attach_assembly(var/obj/A, var/mob/user) //Called when an assembly is attacked by another
return
proc/process_cooldown() //Called via spawn(10) to have it count down the cooldown var
return
proc/holder_movement() //Called when the holder is moved
return
proc/interact(mob/user as mob) //Called when attack_self is called
return
process_cooldown() process_cooldown()

View File

@@ -11,16 +11,20 @@
throw_speed = 3 throw_speed = 3
throw_range = 10 throw_range = 10
var var/secured = 0
secured = 0 varobj/item/device/assembly/a_left = null
obj/item/device/assembly/a_left = null varobj/item/device/assembly/a_right = null
obj/item/device/assembly/a_right = null varobj/special_assembly = null
obj/special_assembly = null
proc/attach(var/obj/item/device/D, var/obj/item/device/D2, var/mob/user)
return
proc/attach_special(var/obj/O, var/mob/user)
return
proc/process_activation(var/obj/item/device/D)
return
proc
attach(var/obj/item/device/D, var/obj/item/device/D2, var/mob/user)
attach_special(var/obj/O, var/mob/user)
process_activation(var/obj/item/device/D)
IsAssemblyHolder() IsAssemblyHolder()

View File

@@ -6,9 +6,8 @@
pass_flags = PASSBLOB pass_flags = PASSBLOB
see_in_dark = 8 see_in_dark = 8
see_invisible = 2 see_invisible = 2
var var/ghost_name = "Unknown"
ghost_name = "Unknown" var/creating_blob = 0
creating_blob = 0
New() New()

View File

@@ -5,10 +5,10 @@
w_class = 100.0 w_class = 100.0
item_state = "electronic" item_state = "electronic"
flags = FPRINT|TABLEPASS | CONDUCT flags = FPRINT|TABLEPASS | CONDUCT
var
list/modules = list() var/list/modules = list()
obj/item/emag = null var/obj/item/emag = null
obj/item/borg/upgrade/jetpack = null var/obj/item/borg/upgrade/jetpack = null
emp_act(severity) emp_act(severity)

View File

@@ -2,7 +2,7 @@
icon = 'AM_Engine.dmi' icon = 'AM_Engine.dmi'
density = 1 density = 1
anchored = 1.0 anchored = 1.0
flags = 512.0 flags = ON_BORDER
/obj/machinery/power/am_engine/bits /obj/machinery/power/am_engine/bits
name = "Antimatter Engine" name = "Antimatter Engine"

View File

@@ -8,11 +8,11 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis).
name = "Circuit Imprinter" name = "Circuit Imprinter"
icon_state = "circuit_imprinter" icon_state = "circuit_imprinter"
flags = OPENCONTAINER flags = OPENCONTAINER
var
g_amount = 0 var/g_amount = 0
gold_amount = 0 var/gold_amount = 0
diamond_amount = 0 var/diamond_amount = 0
max_material_amount = 75000.0 var/max_material_amount = 75000.0
New() New()
..() ..()

View File

@@ -11,17 +11,17 @@ Note: Must be placed west/left of and R&D console to function.
name = "Protolathe" name = "Protolathe"
icon_state = "protolathe" icon_state = "protolathe"
flags = OPENCONTAINER flags = OPENCONTAINER
var
max_material_storage = 100000 //All this could probably be done better with a list but meh. var/max_material_storage = 100000 //All this could probably be done better with a list but meh.
m_amount = 0.0 var/m_amount = 0.0
g_amount = 0.0 var/g_amount = 0.0
gold_amount = 0.0 var/gold_amount = 0.0
silver_amount = 0.0 var/silver_amount = 0.0
plasma_amount = 0.0 var/plasma_amount = 0.0
uranium_amount = 0.0 var/uranium_amount = 0.0
diamond_amount = 0.0 var/diamond_amount = 0.0
clown_amount = 0.0 var/clown_amount = 0.0
adamantine_amount = 0.0 var/adamantine_amount = 0.0
New() New()