Skip to content
This repository has been archived by the owner on Jan 28, 2023. It is now read-only.

Commit

Permalink
fixed formatting and bench detection
Browse files Browse the repository at this point in the history
  • Loading branch information
NanakoAC committed Jul 14, 2019
1 parent 41ce373 commit 00a9d9f
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 12 deletions.
1 change: 1 addition & 0 deletions baystation12.dme
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@
#include "code\datums\craft\recipes\furniture.dm"
#include "code\datums\craft\recipes\machinery.dm"
#include "code\datums\craft\recipes\misc.dm"
#include "code\datums\craft\recipes\salvage.dm"
#include "code\datums\craft\recipes\tools.dm"
#include "code\datums\craft\recipes\weapon.dm"
#include "code\datums\extensions\_defines.dm"
Expand Down
1 change: 1 addition & 0 deletions code/datums/craft/menu.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"icon" = getAtomCacheFilename(CR.result),
"ref" = "\ref[CR]",
"desc" = CR.get_description(),
"steps" = CR.get_step_descriptions()
)
var/list/temp = data["cur_item"]
world << "[temp["icon"]]"
Expand Down
18 changes: 12 additions & 6 deletions code/datums/craft/recipe.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
var/category = "Misc"
var/icon_state = "device"
var/result
var/desc = null //If set, overrides the automatically retrieved description

var/list/steps
var/list/passive_steps
Expand Down Expand Up @@ -56,12 +57,17 @@

/datum/craft_recipe/proc/get_description()
. = list()
var/atom/A = result
.+="[initial(A.desc)]<br>"
for(var/item in steps)
var/datum/craft_step/CS = item
. += CS.desc
return jointext(., "<br>")
if (desc)
.+=desc
else
var/atom/A = result
.+="[initial(A.desc)]"

/datum/craft_recipe/proc/get_step_descriptions()
var/list/data = list()
for(var/datum/craft_step/CS in steps)
data += list(list("icon" = getAtomCacheFilename(CS.icon_type), "desc" = CS.desc))
return data


/datum/craft_recipe/proc/can_build(mob/living/user, var/turf/T)
Expand Down
22 changes: 22 additions & 0 deletions code/datums/craft/recipes/salvage.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/datum/craft_recipe/salvage
category = "Salvage"
time = 150
icon_state = "gun"

/datum/craft_recipe/salvage/salvage_sawblade
name = "Salvage sawblade"
desc = "Disassemble a circular saw to get a sawblade which can be used for other purposes."
result = /obj/item/ammo_casing/sawblade
steps = list(
list(CRAFT_OBJECT, /obj/item/weapon/tool/saw/circular),
list(CRAFT_TOOL, QUALITY_SCREW_DRIVING, 10, "time" = 150),
)

/datum/craft_recipe/salvage/salvage_sawblade_adv
name = "Salvage diamond sawblade"
desc = "Disassemble an advanced circular saw to get a diamond sawblade which can be used for other purposes."
result = /obj/item/ammo_casing/sawblade/diamond
steps = list(
list(CRAFT_OBJECT, /obj/item/weapon/tool/saw/advanced_circular),
list(CRAFT_TOOL, QUALITY_SCREW_DRIVING, 10, "time" = 300),
)
7 changes: 5 additions & 2 deletions code/datums/craft/recipes/weapon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,14 @@
/datum/craft_recipe/weapon/ripper
name = "RC-DS Remote Control Disc Ripper"
result = /obj/item/weapon/gun/projectile/ripper
passive_steps = list(CRAFT_PASSIVE, QUALITY_WORKBENCH, 1, 0)
passive_steps = list(
list(CRAFT_PASSIVE, QUALITY_WORKBENCH, 1, 0)
)
time = 100
steps = list(
list(CRAFT_OBJECT, /obj/item/weapon/tool/wrench),
list(CRAFT_OBJECT, /obj/item/weapon/stock_parts/matter_bin),
list(CRAFT_STACK, /obj/item/stack/cable_coil, 5),
list(CRAFT_STACK, /obj/item/stack/power_node, 1)
)
)

1 change: 1 addition & 0 deletions code/datums/craft/step.dm
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
if (centrepoint)
items.Add(range(centrepoint, apply_range))

world << "Searchlist: [english_list(items)]"
return items

//Override in child classes
Expand Down
3 changes: 2 additions & 1 deletion code/datums/craft/step_types.dm
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,10 @@
return TRUE


/datum/craft_step/tool/find_item(mob/living/user, var/atom/craft = null)
/datum/craft_step/passive/find_item(mob/living/user, var/atom/craft = null)
var/list/items = get_search_list(user, craft)
for (var/obj/I in items)
world << "[I] [I.type] Workbench:[I.get_tool_quality(required_quality)]/[required_level]"
if (I.get_tool_quality(required_quality) >= required_level)
return I

Expand Down
2 changes: 1 addition & 1 deletion nano/css/shared.css
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ div.notice {
width: 100%;
float: left;
color: #e9c183;
font-size: 18px;
font-size: 20px;
margin: 0;
padding: 12px 0 6px 0;
clear: both;
Expand Down
11 changes: 9 additions & 2 deletions nano/templates/craft.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,15 @@
</div>
<div class='itemContent'>
{{if data.cur_item}}
<div class="itemLabelHeader">{{:data.cur_item.name}}</div><div style ='float: left; margin-top:-8px; margin-right:4px; max-height:48px; max-width:48px; height:48px; width:48px; margin-left:0px'><img src= {{:data.cur_item.icon}} height=48 width=48></div>
{{:data.cur_item.desc}}
<div class="itemLabelHeader">{{:data.cur_item.name}}</div></br>
<div style="vertical-align:top; font-size:16px; margin-top:-8px; margin-right:10px; max-height:96px; height:96px; width:100%; margin-left:0px">
<img style="float:left;" src= {{:data.cur_item.icon}} height=96 width=96>{{:data.cur_item.desc}}</div>
</br>
</br>
</br>
{{for data.cur_item.steps}}
<div style ='height:32px;line-height:32px;'><img style="float:left;" src= {{:value.icon}} height=32 width=32>{{:value.desc}}</div>
{{/for}}
</br>
{{:helper.link("Build", null, {'build' : data.cur_item.ref})}}
{{if data.is_admin}}
Expand Down

0 comments on commit 00a9d9f

Please sign in to comment.