Skip to content

Commit b383174

Browse files
Reworking hive frames.
1 parent dbe0f59 commit b383174

File tree

12 files changed

+86
-129
lines changed

12 files changed

+86
-129
lines changed

maps/ministation/ministation-1.dmm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5716,9 +5716,9 @@
57165716
/obj/item/tool/hoe/mini,
57175717
/obj/item/tool/spade,
57185718
/obj/item/tool/spade,
5719-
/obj/item/honey_frame,
5720-
/obj/item/honey_frame,
5721-
/obj/item/honey_frame,
5719+
/obj/item/hive_frame/crafted,
5720+
/obj/item/hive_frame/crafted,
5721+
/obj/item/hive_frame/crafted,
57225722
/turf/floor/tiled,
57235723
/area/ministation/hydro)
57245724
"yg" = (

mods/content/beekeeping/_beekeeping.dm

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,5 @@
33

44
/datum/storage/hopper/industrial/centrifuge/New()
55
..()
6-
can_hold |= /obj/item/honey_frame
6+
can_hold |= /obj/item/hive_frame
77

8-
// Terrible, will be replaced in beewrite.
9-
/datum/storage/hopper/industrial/centrifuge/should_ingest(mob/user, obj/item/thing)
10-
if(istype(thing, /obj/item/honey_frame))
11-
var/obj/item/honey_frame/frame = thing
12-
if(frame.honey > 0)
13-
return TRUE
14-
if(user)
15-
to_chat(user, SPAN_WARNING("\The [thing] is empty."))
16-
return FALSE
17-
return ..()

mods/content/beekeeping/_beekeeping.dme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#define MODPACK_BEEKEEPING
33
// BEGIN_INCLUDE
44
#include "_beekeeping.dm"
5-
#include "centrifuge.dm"
65
#include "closets.dm"
6+
#include "hive_frame.dm"
77
#include "items.dm"
88
#include "recipes.dm"
99
#include "trading.dm"

mods/content/beekeeping/centrifuge.dm

Lines changed: 0 additions & 53 deletions
This file was deleted.

mods/content/beekeeping/closets.dm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
. = ..()
77
new /obj/item/beehive_assembly(src)
88
new /obj/item/bee_smoker(src)
9-
new /obj/item/honey_frame(src)
10-
new /obj/item/honey_frame(src)
11-
new /obj/item/honey_frame(src)
12-
new /obj/item/honey_frame(src)
13-
new /obj/item/honey_frame(src)
9+
new /obj/item/hive_frame/crafted(src)
10+
new /obj/item/hive_frame/crafted(src)
11+
new /obj/item/hive_frame/crafted(src)
12+
new /obj/item/hive_frame/crafted(src)
13+
new /obj/item/hive_frame/crafted(src)
1414
new /obj/item/bee_pack(src)
1515
new /obj/item/crowbar(src)
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/obj/item/hive_frame
2+
abstract_type = /obj/item/hive_frame
3+
icon_state = ICON_STATE_WORLD
4+
w_class = ITEM_SIZE_SMALL
5+
material_alteration = MAT_FLAG_ALTERATION_ALL
6+
var/destroy_on_centrifuge = FALSE
7+
8+
/obj/item/hive_frame/Initialize(ml, material_key)
9+
. = ..()
10+
initialize_reagents()
11+
12+
/obj/item/hive_frame/initialize_reagents(populate = TRUE)
13+
create_reagents(20)
14+
. = ..()
15+
16+
/obj/item/hive_frame/on_reagent_change()
17+
. = ..()
18+
if(reagents?.total_volume)
19+
SetName("filled [initial(name)] ([reagents.get_primary_reagent_name()])")
20+
else
21+
SetName(initial(name))
22+
queue_icon_update()
23+
24+
/obj/item/hive_frame/on_update_icon()
25+
. = ..()
26+
var/mesh_state = "[icon_state]-mesh"
27+
if(check_state_in_icon(mesh_state, icon))
28+
add_overlay(overlay_image(icon, mesh_state, COLOR_WHITE, RESET_COLOR))
29+
if(reagents?.total_volume)
30+
var/comb_state = "[icon_state]-comb"
31+
if(check_state_in_icon(comb_state, icon))
32+
add_overlay(overlay_image(icon, comb_state, reagents.get_color(), RESET_COLOR))
33+
34+
/obj/item/hive_frame/handle_centrifuge_process(obj/machinery/centrifuge/centrifuge)
35+
if(!(. = ..()))
36+
return
37+
if(reagents.total_volume)
38+
reagents.trans_to_holder(centrifuge.loaded_beaker.reagents, reagents.total_volume)
39+
for(var/obj/item/thing in contents)
40+
thing.dropInto(centrifuge.loc)
41+
if(destroy_on_centrifuge)
42+
for(var/atom/movable/thing in convert_matter_to_lumps())
43+
thing.dropInto(centrifuge.loc)
44+
45+
// Crafted frame used in apiaries.
46+
/obj/item/hive_frame/crafted
47+
name = "hive frame"
48+
desc = "A wooden frame for insect hives that the workers will fill with products like honey."
49+
icon = 'mods/content/beekeeping/icons/frame.dmi'
50+
material = /decl/material/solid/organic/wood
51+
52+
// TEMP until beewrite redoes hives.
53+
/obj/item/hive_frame/crafted/filled/Initialize()
54+
. = ..()
55+
new /obj/item/stack/material/bar/wax(src)
56+
update_icon()
57+
58+
/obj/item/hive_frame/crafted/filled/populate_reagents()
59+
. = ..()
60+
reagents.add_reagent(/decl/material/liquid/nutriment/honey, reagents?.maximum_volume)

mods/content/beekeeping/hives/_hive.dm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@
6363
smoked = 30
6464
update_icon()
6565
return TRUE
66-
else if(istype(I, /obj/item/honey_frame))
66+
else if(istype(I, /obj/item/hive_frame/crafted))
6767
if(closed)
6868
to_chat(user, "<span class='notice'>You need to open \the [src] with a crowbar before inserting \the [I].</span>")
6969
return TRUE
7070
if(frames >= maxFrames)
7171
to_chat(user, "<span class='notice'>There is no place for an another frame.</span>")
7272
return TRUE
73-
var/obj/item/honey_frame/H = I
74-
if(H.honey)
73+
var/obj/item/hive_frame/crafted/H = I
74+
if(H.reagents?.total_volume)
7575
to_chat(user, "<span class='notice'>\The [I] is full with beeswax and honey, empty it in the extractor first.</span>")
7676
return TRUE
7777
++frames
@@ -140,7 +140,7 @@
140140
return
141141
user.visible_message("<span class='notice'>\The [user] starts taking the honeycombs out of \the [src].</span>", "<span class='notice'>You start taking the honeycombs out of \the [src]...</span>")
142142
while(honeycombs >= 100 && do_after(user, 30, src))
143-
new /obj/item/honey_frame/filled(loc)
143+
new /obj/item/hive_frame/crafted/filled(loc)
144144
honeycombs -= 100
145145
--frames
146146
update_icon()
File renamed without changes.
1.28 KB
Binary file not shown.

mods/content/beekeeping/items.dm

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/obj/item/beehive_assembly
22
name = "beehive assembly"
33
desc = "Contains everything you need to build a beehive."
4-
icon = 'mods/content/beekeeping/apiary_bees_etc.dmi'
4+
icon = 'mods/content/beekeeping/icons/apiary_bees_etc.dmi'
55
icon_state = "apiary"
66
material = /decl/material/solid/organic/wood
77

@@ -12,15 +12,6 @@
1212
new /obj/machinery/beehive(get_turf(user))
1313
qdel(src)
1414

15-
/obj/item/stock_parts/circuitboard/honey
16-
name = "circuitboard (honey extractor)"
17-
build_path = /obj/machinery/honey_extractor
18-
board_type = "machine"
19-
origin_tech = @'{"biotech":2,"engineering":1}'
20-
req_components = list(
21-
/obj/item/stock_parts/manipulator = 2,
22-
/obj/item/stock_parts/matter_bin = 2)
23-
2415
/obj/item/bee_smoker
2516
name = "bee smoker"
2617
desc = "A device used to calm down bees before harvesting honey."
@@ -29,35 +20,6 @@
2920
w_class = ITEM_SIZE_SMALL
3021
material = /decl/material/solid/metal/steel
3122

32-
/obj/item/honey_frame
33-
name = "beehive frame"
34-
desc = "A frame for the beehive that the bees will fill with honeycombs."
35-
icon = 'mods/content/beekeeping/icons/beekeeping.dmi'
36-
icon_state = "honeyframe"
37-
w_class = ITEM_SIZE_SMALL
38-
material = /decl/material/solid/organic/wood
39-
var/honey = 0
40-
41-
/obj/item/honey_frame/filled
42-
name = "filled beehive frame"
43-
desc = "A frame for the beehive that the bees have filled with honeycombs."
44-
honey = 20
45-
material = /decl/material/solid/organic/wood
46-
47-
/obj/item/honey_frame/filled/Initialize()
48-
. = ..()
49-
overlays += "honeycomb"
50-
51-
// This is crap, will be replaced in beewrite PR.
52-
/obj/item/honey_frame/handle_centrifuge_process(obj/machinery/centrifuge/centrifuge)
53-
if(!(. = ..()) || !honey)
54-
return
55-
centrifuge?.loaded_beaker?.add_to_reagents(/decl/material/liquid/nutriment/honey, honey)
56-
honey = 0
57-
new /obj/item/honey_frame(centrifuge.loc)
58-
new /obj/item/stack/material/bar(centrifuge.loc, 1, /decl/material/solid/organic/wax)
59-
qdel(src)
60-
6123
/obj/item/bee_pack
6224
name = "bee pack"
6325
desc = "Contains a queen bee and some worker bees. Everything you'll need to start a hive!"

0 commit comments

Comments
 (0)