diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm
index ccb53acc440..3168fe4e7d9 100644
--- a/code/game/machinery/doors/airlock.dm
+++ b/code/game/machinery/doors/airlock.dm
@@ -1203,6 +1203,8 @@ About the new airlock wires panel:
var/obj/item/weapon/airlock_electronics/ae
if(!electronics)
ae = new/obj/item/weapon/airlock_electronics( src.loc )
+ if(!src.req_access)
+ src.check_access()
if(src.req_access.len)
ae.conf_access = src.req_access
else if (src.req_one_access.len)
@@ -1329,4 +1331,4 @@ About the new airlock wires panel:
src.locked = 0
src.open()
src.locked = 1
- return
+ return
\ No newline at end of file
diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm
index 152d6de60c0..61d26340a55 100644
--- a/code/game/machinery/doors/windowdoor.dm
+++ b/code/game/machinery/doors/windowdoor.dm
@@ -130,6 +130,8 @@
var/obj/item/weapon/airlock_electronics/ae
if(!electronics)
ae = new/obj/item/weapon/airlock_electronics( src.loc )
+ if(!src.req_access)
+ src.check_access()
if(src.req_access.len)
ae.conf_access = src.req_access
else if (src.req_one_access.len)
@@ -227,6 +229,8 @@
var/obj/item/weapon/airlock_electronics/ae
if(!electronics)
ae = new/obj/item/weapon/airlock_electronics( src.loc )
+ if(!src.req_access)
+ src.check_access()
if(src.req_access.len)
ae.conf_access = src.req_access
else if (src.req_one_access.len)
@@ -342,5 +346,4 @@
/obj/machinery/door/window/brigdoor/southright
dir = SOUTH
icon_state = "rightsecure"
- base_state = "rightsecure"
-
+ base_state = "rightsecure"
diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm
index ec1e6195d20..7f954721d4d 100755
--- a/code/game/objects/items/devices/PDA/PDA.dm
+++ b/code/game/objects/items/devices/PDA/PDA.dm
@@ -330,10 +330,11 @@ var/global/list/obj/item/device/pda/PDAs = list()
/obj/item/device/pda/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
ui_tick++
+ var/datum/nanoui/old_ui = nanomanager.get_open_ui(user, src, "main")
var/auto_update = 1
if(mode in no_auto_update)
auto_update = 0
- if(mode == lastmode && ui_tick % 5 && mode in update_every_five)
+ if(old_ui && (mode == lastmode && ui_tick % 5 && mode in update_every_five))
return
lastmode = mode
diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm
index bd3eeb495d4..ea3a2168785 100644
--- a/code/game/objects/items/devices/radio/radio.dm
+++ b/code/game/objects/items/devices/radio/radio.dm
@@ -742,20 +742,25 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
src.channels = list()
src.syndie = 0
+ var/mob/living/silicon/robot/D = src.loc
+ if(D.module)
+ for(var/ch_name in D.module.channels)
+ if(ch_name in src.channels)
+ continue
+ src.channels += ch_name
+ src.channels[ch_name] += D.module.channels[ch_name]
if(keyslot)
for(var/ch_name in keyslot.channels)
if(ch_name in src.channels)
continue
src.channels += ch_name
- src.channels[ch_name] = keyslot.channels[ch_name]
-
+ src.channels[ch_name] += keyslot.channels[ch_name]
+
if(keyslot.syndie)
src.syndie = 1
- var/mob/living/silicon/robot/Ro = usr
- if(Ro.module)
- src.config(Ro.module.channels)
+
- for (var/ch_name in channels)
+ for (var/ch_name in src.channels)
if(!radio_controller)
sleep(30) // Waiting for the radio_controller to be created.
if(!radio_controller)
diff --git a/code/modules/mining/machine_processing.dm b/code/modules/mining/machine_processing.dm
index 5ccf7540494..01e009232de 100644
--- a/code/modules/mining/machine_processing.dm
+++ b/code/modules/mining/machine_processing.dm
@@ -1,3 +1,12 @@
+#define ORE_PROC_GOLD 1
+#define ORE_PROC_SILVER 2
+#define ORE_PROC_DIAMOND 4
+#define ORE_PROC_GLASS 8
+#define ORE_PROC_PLASMA 16
+#define ORE_PROC_URANIUM 32
+#define ORE_PROC_IRON 64
+#define ORE_PROC_CLOWN 128
+
/**********************Mineral processing unit console**************************/
/obj/machinery/mineral/processing_unit_console
@@ -32,84 +41,83 @@
//iron
if(machine.ore_iron || machine.ore_glass || machine.ore_plasma || machine.ore_uranium || machine.ore_gold || machine.ore_silver || machine.ore_diamond || machine.ore_clown || machine.ore_adamantine)
if(machine.ore_iron)
- if (machine.selected_iron==1)
+ if (machine.selected & ORE_PROC_IRON)
dat += text("Smelting ")
else
dat += text("Not smelting ")
dat += text("Iron: [machine.ore_iron]
")
else
- machine.selected_iron = 0
+ machine.selected &= ~ORE_PROC_IRON
//sand - glass
if(machine.ore_glass)
- if (machine.selected_glass==1)
+ if (machine.selected & ORE_PROC_GLASS)
dat += text("Smelting ")
else
dat += text("Not smelting ")
dat += text("Sand: [machine.ore_glass]
")
else
- machine.selected_glass = 0
+ machine.selected &= ~ORE_PROC_GLASS
//plasma
if(machine.ore_plasma)
- if (machine.selected_plasma==1)
+ if (machine.selected & ORE_PROC_PLASMA)
dat += text("Smelting ")
else
dat += text("Not smelting ")
dat += text("Plasma: [machine.ore_plasma]
")
else
- machine.selected_plasma = 0
+ machine.selected &= ~ORE_PROC_PLASMA
//uranium
if(machine.ore_uranium)
- if (machine.selected_uranium==1)
+ if (machine.selected & ORE_PROC_URANIUM)
dat += text("Smelting ")
else
dat += text("Not smelting ")
dat += text("Uranium: [machine.ore_uranium]
")
else
- machine.selected_uranium = 0
+ machine.selected &= ~ORE_PROC_URANIUM
//gold
if(machine.ore_gold)
- if (machine.selected_gold==1)
+ if (machine.selected & ORE_PROC_GOLD)
dat += text("Smelting ")
else
dat += text("Not smelting ")
dat += text("Gold: [machine.ore_gold]
")
else
- machine.selected_gold = 0
+ machine.selected &= ~ORE_PROC_GOLD
//silver
if(machine.ore_silver)
- if (machine.selected_silver==1)
+ if (machine.selected & ORE_PROC_SILVER)
dat += text("Smelting ")
else
dat += text("Not smelting ")
dat += text("Silver: [machine.ore_silver]
")
else
- machine.selected_silver = 0
+ machine.selected &= ~ORE_PROC_SILVER
//diamond
if(machine.ore_diamond)
- if (machine.selected_diamond==1)
+ if (machine.selected & ORE_PROC_DIAMOND)
dat += text("Smelting ")
else
dat += text("Not smelting ")
dat += text("Diamond: [machine.ore_diamond]
")
else
- machine.selected_diamond = 0
+ machine.selected &= ~ORE_PROC_DIAMOND
//bananium
-/* if(machine.ore_clown)
- if (machine.selected_clown==1)
+ if(machine.ore_clown)
+ if (machine.selected & ORE_PROC_CLOWN)
dat += text("Smelting ")
else
dat += text("Not smelting ")
dat += text("Bananium: [machine.ore_clown]
")
else
- machine.selected_clown = 0*/
-
+ machine.selected &= ~ORE_PROC_CLOWN
//On or off
dat += text("Machine is currently ")
@@ -132,44 +140,45 @@
src.add_fingerprint(usr)
if(href_list["sel_iron"])
if (href_list["sel_iron"] == "yes")
- machine.selected_iron = 1
+ machine.selected |= ORE_PROC_IRON
else
- machine.selected_iron = 0
+ machine.selected &= ~ORE_PROC_IRON
if(href_list["sel_glass"])
if (href_list["sel_glass"] == "yes")
- machine.selected_glass = 1
+ machine.selected |= ORE_PROC_GLASS
else
- machine.selected_glass = 0
+ machine.selected &= ~ORE_PROC_GLASS
if(href_list["sel_plasma"])
if (href_list["sel_plasma"] == "yes")
- machine.selected_plasma = 1
+ machine.selected |= ORE_PROC_PLASMA
else
- machine.selected_plasma = 0
+ machine.selected &= ~ORE_PROC_PLASMA
if(href_list["sel_uranium"])
if (href_list["sel_uranium"] == "yes")
- machine.selected_uranium = 1
+ machine.selected |= ORE_PROC_URANIUM
else
- machine.selected_uranium = 0
+ machine.selected &= ~ORE_PROC_URANIUM
if(href_list["sel_gold"])
if (href_list["sel_gold"] == "yes")
- machine.selected_gold = 1
+ machine.selected |= ORE_PROC_GOLD
else
- machine.selected_gold = 0
+ machine.selected &= ~ORE_PROC_GOLD
if(href_list["sel_silver"])
if (href_list["sel_silver"] == "yes")
- machine.selected_silver = 1
+ machine.selected |= ORE_PROC_SILVER
else
- machine.selected_silver = 0
+ machine.selected &= ~ORE_PROC_SILVER
if(href_list["sel_diamond"])
if (href_list["sel_diamond"] == "yes")
- machine.selected_diamond = 1
+ machine.selected |= ORE_PROC_DIAMOND
else
- machine.selected_diamond = 0
-/* if(href_list["sel_clown"])
+ machine.selected &= ~ORE_PROC_DIAMOND
+ if(href_list["sel_clown"])
if (href_list["sel_clown"] == "yes")
- machine.selected_clown = 1
+ machine.selected |= ORE_PROC_CLOWN
else
- machine.selected_clown = 0*/
+ machine.selected &= ~ORE_PROC_CLOWN
+
if(href_list["set_on"])
if (href_list["set_on"] == "on")
machine.on = 1
@@ -187,6 +196,7 @@
icon_state = "furnace"
density = 1
anchored = 1.0
+ luminosity = 3 //Big fire with window, yeah it puts out a little light.
var/obj/machinery/mineral/input = null
var/obj/machinery/mineral/output = null
var/obj/machinery/mineral/CONSOLE = null
@@ -199,6 +209,8 @@
var/ore_iron = 0;
var/ore_clown = 0;
var/ore_adamantine = 0;
+ var/selected = 0
+/*
var/selected_gold = 0
var/selected_silver = 0
var/selected_diamond = 0
@@ -207,8 +219,10 @@
var/selected_uranium = 0
var/selected_iron = 0
var/selected_clown = 0
+*/
var/on = 0 //0 = off, 1 =... oh you know!
+
/obj/machinery/mineral/processing_unit/New()
..()
spawn( 5 )
@@ -227,14 +241,17 @@
var/i
for (i = 0; i < 10; i++)
if (on)
- if (selected_glass == 1 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0)
+
+
+
+ if (selected == ORE_PROC_GLASS)
if (ore_glass > 0)
ore_glass--;
new /obj/item/stack/sheet/glass(output.loc)
else
on = 0
continue
- if (selected_glass == 1 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 1 && selected_clown == 0)
+ if (selected == ORE_PROC_GLASS + ORE_PROC_IRON)
if (ore_glass > 0 && ore_iron > 0)
ore_glass--;
ore_iron--;
@@ -242,49 +259,49 @@
else
on = 0
continue
- if (selected_glass == 0 && selected_gold == 1 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0)
+ if (selected == ORE_PROC_GOLD)
if (ore_gold > 0)
ore_gold--;
new /obj/item/stack/sheet/mineral/gold(output.loc)
else
on = 0
continue
- if (selected_glass == 0 && selected_gold == 0 && selected_silver == 1 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0)
+ if (selected == ORE_PROC_SILVER)
if (ore_silver > 0)
ore_silver--;
new /obj/item/stack/sheet/mineral/silver(output.loc)
else
on = 0
continue
- if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 1 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0)
+ if (selected == ORE_PROC_DIAMOND)
if (ore_diamond > 0)
ore_diamond--;
new /obj/item/stack/sheet/mineral/diamond(output.loc)
else
on = 0
continue
- if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 1 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0)
+ if (selected == ORE_PROC_PLASMA)
if (ore_plasma > 0)
ore_plasma--;
new /obj/item/stack/sheet/mineral/plasma(output.loc)
else
on = 0
continue
- if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 1 && selected_iron == 0 && selected_clown == 0)
+ if (selected == ORE_PROC_URANIUM)
if (ore_uranium > 0)
ore_uranium--;
new /obj/item/stack/sheet/mineral/uranium(output.loc)
else
on = 0
continue
- if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 1 && selected_clown == 0)
+ if (selected == ORE_PROC_IRON)
if (ore_iron > 0)
ore_iron--;
new /obj/item/stack/sheet/metal(output.loc)
else
on = 0
continue
- if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 1 && selected_uranium == 0 && selected_iron == 1 && selected_clown == 0)
+ if (selected == ORE_PROC_IRON + ORE_PROC_PLASMA)
if (ore_iron > 0 && ore_plasma > 0)
ore_iron--;
ore_plasma--;
@@ -292,20 +309,23 @@
else
on = 0
continue
-/* if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 1)
+ if (selected == ORE_PROC_CLOWN)
if (ore_clown > 0)
ore_clown--;
new /obj/item/stack/sheet/mineral/clown(output.loc)
else
on = 0
- if (selected_glass == 1 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 1 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0)
+ continue
+ /*
+ if (selected == ORE_PROC_GLASS + ORE_PROC_PLASMA)
if (ore_glass > 0 && ore_plasma > 0)
ore_glass--;
ore_plasma--;
new /obj/item/stack/sheet/glass/plasmaglass(output.loc)
else
on = 0
- if (selected_glass == 1 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 1 && selected_uranium == 0 && selected_iron == 1 && selected_clown == 0)
+ continue
+ if (selected == ORE_PROC_GLASS + ORE_PROC_IRON + ORE_PROC_PLASMA)
if (ore_glass > 0 && ore_plasma > 0 && ore_iron > 0)
ore_glass--;
ore_iron--;
@@ -313,55 +333,75 @@
new /obj/item/stack/sheet/glass/plasmarglass(output.loc)
else
on = 0
- continue*/
+ continue
+ */
+
+
+ if (selected == ORE_PROC_URANIUM + ORE_PROC_DIAMOND)
+ if (ore_uranium >= 2 && ore_diamond >= 1)
+ ore_uranium -= 2
+ ore_diamond -= 1
+ new /obj/item/stack/sheet/mineral/adamantine(output.loc)
+ else
+ on = 0
+ continue
+ if (selected == ORE_PROC_SILVER + ORE_PROC_PLASMA)
+ if (ore_silver >= 1 && ore_plasma >= 3)
+ ore_silver -= 1
+ ore_plasma -= 3
+ new /obj/item/stack/sheet/mineral/mythril(output.loc)
+ else
+ on = 0
+ continue
+
//if a non valid combination is selected
var/b = 1 //this part checks if all required ores are available
- if (!(selected_gold || selected_silver ||selected_diamond || selected_uranium | selected_plasma || selected_iron || selected_iron))
+ if (!selected)
b = 0
- if (selected_gold == 1)
+ if (selected & ORE_PROC_GOLD)
if (ore_gold <= 0)
b = 0
- if (selected_silver == 1)
+ if (selected & ORE_PROC_SILVER)
if (ore_silver <= 0)
b = 0
- if (selected_diamond == 1)
+ if (selected & ORE_PROC_DIAMOND)
if (ore_diamond <= 0)
b = 0
- if (selected_uranium == 1)
+ if (selected & ORE_PROC_URANIUM)
if (ore_uranium <= 0)
b = 0
- if (selected_plasma == 1)
+ if (selected & ORE_PROC_PLASMA)
if (ore_plasma <= 0)
b = 0
- if (selected_iron == 1)
+ if (selected & ORE_PROC_IRON)
if (ore_iron <= 0)
b = 0
- if (selected_glass == 1)
+ if (selected & ORE_PROC_GLASS)
if (ore_glass <= 0)
b = 0
- if (selected_clown == 1)
+ if (selected & ORE_PROC_CLOWN)
if (ore_clown <= 0)
b = 0
if (b) //if they are, deduct one from each, produce slag and shut the machine off
- if (selected_gold == 1)
+ if (selected & ORE_PROC_GOLD)
ore_gold--
- if (selected_silver == 1)
+ if (selected & ORE_PROC_SILVER)
ore_silver--
- if (selected_diamond == 1)
+ if (selected & ORE_PROC_DIAMOND)
ore_diamond--
- if (selected_uranium == 1)
+ if (selected & ORE_PROC_URANIUM)
ore_uranium--
- if (selected_plasma == 1)
+ if (selected & ORE_PROC_PLASMA)
ore_plasma--
- if (selected_iron == 1)
+ if (selected & ORE_PROC_IRON)
ore_iron--
- if (selected_clown == 1)
+ if (selected & ORE_PROC_CLOWN)
ore_clown--
new /obj/item/weapon/ore/slag(output.loc)
on = 0
@@ -378,44 +418,44 @@
if (istype(O,/obj/item/weapon/ore/iron))
ore_iron++;
O.loc = null
- del(O)
+ //del(O)
continue
if (istype(O,/obj/item/weapon/ore/glass))
ore_glass++;
O.loc = null
- del(O)
+ //del(O)
continue
if (istype(O,/obj/item/weapon/ore/diamond))
ore_diamond++;
O.loc = null
- del(O)
+ //del(O)
continue
if (istype(O,/obj/item/weapon/ore/plasma))
ore_plasma++
O.loc = null
- del(O)
+ //del(O)
continue
if (istype(O,/obj/item/weapon/ore/gold))
ore_gold++
O.loc = null
- del(O)
+ //del(O)
continue
if (istype(O,/obj/item/weapon/ore/silver))
ore_silver++
O.loc = null
- del(O)
+ //del(O)
continue
if (istype(O,/obj/item/weapon/ore/uranium))
ore_uranium++
O.loc = null
- del(O)
+ //del(O)
continue
if (istype(O,/obj/item/weapon/ore/clown))
ore_clown++
O.loc = null
- del(O)
+ //del(O)
continue
O.loc = src.output.loc
else
break
- return
\ No newline at end of file
+ return
diff --git a/code/modules/mining/machine_stacking.dm b/code/modules/mining/machine_stacking.dm
index 86f844f6237..138a42aaaa7 100644
--- a/code/modules/mining/machine_stacking.dm
+++ b/code/modules/mining/machine_stacking.dm
@@ -242,85 +242,108 @@
/obj/machinery/mineral/stacking_machine/process()
if (src.output && src.input)
- var/obj/item/O
+ var/obj/item/stack/O
while (locate(/obj/item, input.loc))
- O = locate(/obj/item, input.loc)
+ O = locate(/obj/item/stack, input.loc)
+ if(isnull(O))
+ var/obj/item/I = locate(/obj/item, input.loc)
+ if (istype(I,/obj/item/weapon/ore/slag))
+ I.loc = null
+ else
+ I.loc = output.loc
+ continue
if (istype(O,/obj/item/stack/sheet/metal))
- ore_iron+= O:amount;
- del(O)
+ ore_iron+= O.amount
+ O.loc = null
+ //del(O)
continue
if (istype(O,/obj/item/stack/sheet/mineral/diamond))
- ore_diamond+= O:amount;
- del(O)
+ ore_diamond+= O.amount
+ O.loc = null
+ //del(O)
continue
if (istype(O,/obj/item/stack/sheet/mineral/plasma))
- ore_plasma+= O:amount
- del(O)
+ ore_plasma+= O.amount
+ O.loc = null
+ //del(O)
continue
if (istype(O,/obj/item/stack/sheet/mineral/gold))
- ore_gold+= O:amount
- del(O)
+ ore_gold+= O.amount
+ O.loc = null
+ //del(O)
continue
if (istype(O,/obj/item/stack/sheet/mineral/silver))
- ore_silver+= O:amount
- del(O)
+ ore_silver+= O.amount
+ O.loc = null
+ //del(O)
continue
if (istype(O,/obj/item/stack/sheet/mineral/clown))
- ore_clown+= O:amount
- del(O)
+ ore_clown+= O.amount
+ O.loc = null
+ //del(O)
continue
if (istype(O,/obj/item/stack/sheet/mineral/uranium))
- ore_uranium+= O:amount
- del(O)
+ ore_uranium+= O.amount
+ O.loc = null
+ //del(O)
continue
if (istype(O,/obj/item/stack/sheet/glass/plasmaglass))
- ore_plasmaglass+= O:amount
- del(O)
+ ore_plasmaglass+= O.amount
+ O.loc = null
+ //del(O)
continue
if (istype(O,/obj/item/stack/sheet/glass/plasmarglass))
- ore_plasmarglass+= O:amount
- del(O)
+ ore_plasmarglass+= O.amount
+ O.loc = null
+ //del(O)
continue
if (istype(O,/obj/item/stack/sheet/glass))
- ore_glass+= O:amount
- del(O)
+ ore_glass+= O.amount
+ O.loc = null
+ //del(O)
continue
if (istype(O,/obj/item/stack/sheet/rglass))
- ore_rglass+= O:amount
- del(O)
+ ore_rglass+= O.amount
+ O.loc = null
+ //del(O)
continue
if (istype(O,/obj/item/stack/sheet/plasteel))
- ore_plasteel+= O:amount
- del(O)
+ ore_plasteel+= O.amount
+ O.loc = null
+ //del(O)
continue
if (istype(O,/obj/item/stack/sheet/mineral/adamantine))
- ore_adamantine+= O:amount
- del(O)
+ ore_adamantine+= O.amount
+ O.loc = null
+ //del(O)
continue
if (istype(O,/obj/item/stack/sheet/mineral/mythril))
- ore_mythril+= O:amount
- del(O)
+ ore_mythril+= O.amount
+ O.loc = null
+ //del(O)
continue
if (istype(O,/obj/item/stack/sheet/cardboard))
- ore_cardboard+= O:amount
- del(O)
+ ore_cardboard+= O.amount
+ O.loc = null
+ //del(O)
continue
if (istype(O,/obj/item/stack/sheet/wood))
- ore_wood+= O:amount
- del(O)
+ ore_wood+= O.amount
+ O.loc = null
+ //del(O)
continue
if (istype(O,/obj/item/stack/sheet/cloth))
- ore_cloth+= O:amount
- del(O)
+ ore_cloth+= O.amount
+ O.loc = null
+ //del(O)
continue
if (istype(O,/obj/item/stack/sheet/leather))
- ore_leather+= O:amount
- del(O)
- continue
- if (istype(O,/obj/item/weapon/ore/slag))
- del(O)
+ ore_leather+= O.amount
+ O.loc = null
+ //del(O)
continue
O.loc = src.output.loc
+
if (ore_gold >= stack_amt)
var/obj/item/stack/sheet/mineral/gold/G = new /obj/item/stack/sheet/mineral/gold
G.amount = stack_amt
diff --git a/code/modules/mining/ores_coins.dm b/code/modules/mining/ores_coins.dm
index b01be5edf93..b59ec2114b2 100644
--- a/code/modules/mining/ores_coins.dm
+++ b/code/modules/mining/ores_coins.dm
@@ -81,45 +81,46 @@
throwforce = 0.0
w_class = 1.0
var/string_attached
+ var/sides = 2
/obj/item/weapon/coin/New()
pixel_x = rand(0,16)-8
pixel_y = rand(0,8)-8
/obj/item/weapon/coin/gold
- name = "Gold coin"
+ name = "gold coin"
icon_state = "coin_gold"
/obj/item/weapon/coin/silver
- name = "Silver coin"
+ name = "silver coin"
icon_state = "coin_silver"
/obj/item/weapon/coin/diamond
- name = "Diamond coin"
+ name = "diamond coin"
icon_state = "coin_diamond"
/obj/item/weapon/coin/iron
- name = "Iron coin"
+ name = "iron coin"
icon_state = "coin_iron"
/obj/item/weapon/coin/plasma
- name = "Solid plasma coin"
+ name = "solid plasma coin"
icon_state = "coin_plasma"
/obj/item/weapon/coin/uranium
- name = "Uranium coin"
+ name = "uranium coin"
icon_state = "coin_uranium"
/obj/item/weapon/coin/clown
- name = "Bananaium coin"
+ name = "bananaium coin"
icon_state = "coin_clown"
/obj/item/weapon/coin/adamantine
- name = "Adamantine coin"
+ name = "adamantine coin"
icon_state = "coin_adamantine"
/obj/item/weapon/coin/mythril
- name = "Mythril coin"
+ name = "mythril coin"
icon_state = "coin_mythril"
/obj/item/weapon/coin/attackby(obj/item/weapon/W as obj, mob/user as mob)
@@ -150,3 +151,13 @@
string_attached = null
user << "\blue You detach the string from the coin."
else ..()
+
+/obj/item/weapon/coin/attack_self(mob/user as mob)
+ var/result = rand(1, sides)
+ var/comment = ""
+ if(result == 1)
+ comment = "tails"
+ else if(result == 2)
+ comment = "heads"
+ user.visible_message("[user] has thrown the [src]. It lands on [comment]! ", \
+ "You throw the [src]. It lands on [comment]! ")
diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm
index fb82ca3e7ed..018f154b864 100644
--- a/code/modules/mob/living/carbon/human/death.dm
+++ b/code/modules/mob/living/carbon/human/death.dm
@@ -58,6 +58,12 @@
dizziness = 0
jitteriness = 0
+
+ hud_updateflag |= 1 << HEALTH_HUD
+ hud_updateflag |= 1 << STATUS_HUD
+
+ handle_hud_list()
+
//Handle species-specific deaths.
if(species) species.handle_death(src)
diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm
index db6400cea11..9ddb5a7c088 100644
--- a/code/modules/mob/living/carbon/human/life.dm
+++ b/code/modules/mob/living/carbon/human/life.dm
@@ -1126,6 +1126,10 @@
return 1
proc/handle_regular_hud_updates()
+ if(hud_updateflag)
+ handle_hud_list()
+
+
if(!client) return 0
if(hud_updateflag)
@@ -1671,26 +1675,27 @@
if(hud_updateflag & 1 << SPECIALROLE_HUD)
var/image/holder = hud_list[SPECIALROLE_HUD]
holder.icon_state = "hudblank"
- switch(mind.special_role)
- if("traitor","Syndicate")
- holder.icon_state = "hudsyndicate"
- if("Revolutionary")
- holder.icon_state = "hudrevolutionary"
- if("Head Revolutionary")
- holder.icon_state = "hudheadrevolutionary"
- if("Cultist")
- holder.icon_state = "hudcultist"
- if("Changeling")
- holder.icon_state = "hudchangeling"
- if("Wizard","Fake Wizard")
- holder.icon_state = "hudwizard"
- if("Death Commando")
- holder.icon_state = "huddeathsquad"
- if("Ninja")
- holder.icon_state = "hudninja"
-
- hud_list[SPECIALROLE_HUD] = holder
-
+ if(mind)
+
+ switch(mind.special_role)
+ if("traitor","Syndicate")
+ holder.icon_state = "hudsyndicate"
+ if("Revolutionary")
+ holder.icon_state = "hudrevolutionary"
+ if("Head Revolutionary")
+ holder.icon_state = "hudheadrevolutionary"
+ if("Cultist")
+ holder.icon_state = "hudcultist"
+ if("Changeling")
+ holder.icon_state = "hudchangeling"
+ if("Wizard","Fake Wizard")
+ holder.icon_state = "hudwizard"
+ if("Death Commando")
+ holder.icon_state = "huddeathsquad"
+ if("Ninja")
+ holder.icon_state = "hudninja"
+
+ hud_list[SPECIALROLE_HUD] = holder
hud_updateflag = 0
diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm
index 30cd98d4441..c95620f7074 100644
--- a/code/modules/mob/living/carbon/monkey/life.dm
+++ b/code/modules/mob/living/carbon/monkey/life.dm
@@ -22,15 +22,16 @@
if(loc)
environment = loc.return_air()
- if (stat != DEAD && !istype(src,/mob/living/carbon/monkey/diona)) //still breathing
- //First, resolve location and get a breath
- if(air_master.current_cycle%4==2)
- //Only try to take a breath every 4 seconds, unless suffocating
- breathe()
- else //Still give containing object the chance to interact
- if(istype(loc, /obj/))
- var/obj/location_as_object = loc
- location_as_object.handle_internal_lifeform(src, 0)
+ if (stat != DEAD)
+ if(!istype(src,/mob/living/carbon/monkey/diona)) //still breathing
+ //First, resolve location and get a breath
+ if(air_master.current_cycle%4==2)
+ //Only try to take a breath every 4 seconds, unless suffocating
+ breathe()
+ else //Still give containing object the chance to interact
+ if(istype(loc, /obj/))
+ var/obj/location_as_object = loc
+ location_as_object.handle_internal_lifeform(src, 0)
//Updates the number of stored chemicals for powers
diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm
index 41d0396a889..66625d9ef68 100644
--- a/code/modules/power/apc.dm
+++ b/code/modules/power/apc.dm
@@ -217,7 +217,7 @@
// update the APC icon to show the three base states
// also add overlays for indicator lights
/obj/machinery/power/apc/update_icon()
-
+
if (!status_overlays)
status_overlays = 1
status_overlays_lock = new
@@ -235,9 +235,9 @@
status_overlays_lock[1] = image(icon, "apcox-0") // 0=blue 1=red
status_overlays_lock[2] = image(icon, "apcox-1")
- status_overlays_charging[1] = image(icon, "apco3-0")
+ status_overlays_charging[1] = image(icon, "apco3-0")
status_overlays_charging[2] = image(icon, "apco3-1")
- status_overlays_charging[3] = image(icon, "apco3-2")
+ status_overlays_charging[3] = image(icon, "apco3-2")
status_overlays_equipment[1] = image(icon, "apco0-0") // 0=red, 1=green, 2=blue
status_overlays_equipment[2] = image(icon, "apco0-1")
@@ -248,13 +248,13 @@
status_overlays_lighting[2] = image(icon, "apco1-1")
status_overlays_lighting[3] = image(icon, "apco1-2")
status_overlays_lighting[4] = image(icon, "apco1-3")
-
+
status_overlays_environ[1] = image(icon, "apco2-0")
status_overlays_environ[2] = image(icon, "apco2-1")
status_overlays_environ[3] = image(icon, "apco2-2")
status_overlays_environ[4] = image(icon, "apco2-3")
-
+
var/update = check_updates() //returns 0 if no need to update icons.
// 1 if we need to update the icon_state
@@ -280,7 +280,7 @@
icon_state = "apcemag"
else if(update_state & UPSTATE_WIREEXP)
icon_state = "apcewires"
-
+
if(!(update_state & UPSTATE_ALLGOOD))
@@ -291,7 +291,7 @@
if(update & 2)
-
+
if(overlays.len)
overlays = 0
@@ -306,7 +306,7 @@
/obj/machinery/power/apc/proc/check_updates()
- var/last_update_state = update_state
+ var/last_update_state = update_state
var/last_update_overlay = update_overlay
update_state = 0
update_overlay = 0
@@ -349,7 +349,7 @@
update_overlay |= APC_UPOVERLAY_EQUIPMENT1
else if(equipment == 2)
update_overlay |= APC_UPOVERLAY_EQUIPMENT2
-
+
if(!lighting)
update_overlay |= APC_UPOVERLAY_LIGHTING0
else if(lighting == 1)
@@ -649,6 +649,7 @@
user << "\blue You slot your fingers into the APC interface and siphon off some of the stored charge for your own use."
if(src.cell.charge < 0) src.cell.charge = 0
if(H.nutrition > 500) H.nutrition = 500
+ src.charging = 1
else
user << "\blue You are already fully charged."
diff --git a/code/modules/virus2/helpers.dm b/code/modules/virus2/helpers.dm
index 0b9a144dbf2..93acbd6ef41 100644
--- a/code/modules/virus2/helpers.dm
+++ b/code/modules/virus2/helpers.dm
@@ -110,6 +110,10 @@ proc/airborne_can_reach(turf/source, turf/target)
infect_virus2(M,D,1)
M.hud_updateflag |= 1 << STATUS_HUD
+//Fancy prob() function.
+/proc/dprob(var/p)
+ return(prob(sqrt(p)) && prob(sqrt(p)))
+
/mob/living/carbon/proc/spread_disease_to(var/mob/living/carbon/victim, var/vector = "Airborne")
if (src == victim)
return "retardation"
diff --git a/icons/effects/blood.dmi b/icons/effects/blood.dmi
index c254397a20d..9820bb1f8ac 100644
Binary files a/icons/effects/blood.dmi and b/icons/effects/blood.dmi differ