compilies/??

This commit is contained in:
lolman360
2020-08-15 17:09:12 +10:00
parent 2ff1529df2
commit 7ca4fa2f55
7 changed files with 200 additions and 51 deletions
@@ -121,6 +121,7 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \
new/datum/stack_recipe("iron door", /obj/structure/mineral_door/iron, 20, one_per_turf = TRUE, on_floor = TRUE), \
new/datum/stack_recipe("pestle", /obj/item/pestle, 1, time = 50), \
new/datum/stack_recipe("floodlight frame", /obj/structure/floodlight_frame, 5, one_per_turf = TRUE, on_floor = TRUE), \
new/datum/stack_recipe("iron ingot", /obj/item/ingot/iron, 6, time = 100), \
))
/obj/item/stack/sheet/metal
@@ -42,7 +42,7 @@
slot_flags = ITEM_SLOT_BELT
var/cooldown = 35
var/current_cooldown = 0
var/range = 7
/obj/item/t_scanner/adv_mining_scanner/lesser
name = "automatic mining scanner"
@@ -81,9 +81,3 @@
/obj/effect/temp_visual/mining_overlay/Initialize()
. = ..()
animate(src, alpha = 0, time = duration, easing = EASE_IN)
/obj/item/mining_scanner/prospector
name = "prospector's pickaxe"
desc = "A pickaxe that can sound rocks to find mineral deposits and stop gibtonite detonations."
icon = 'icons/obj/mining.dmi'
icon_state = "pickaxe"
+38 -27
View File
@@ -20,33 +20,35 @@
/obj/structure/anvil
name = "anvil"
desc = "Base class of anvil. This shouldn't exist, but is useable."
icon = 'icons/obj/hydroponics/equipment.dmi'
icon_state = "loom"
icon = 'icons/obj/smith.dmi'
icon_state = "anvil"
density = TRUE
anchored = TRUE
var/workpiece_state = FALSE
var/datum/material = workpiece_material
var/datum/material/workpiece_material
var/qualitymod = 0
var/currentquality = qualitymod
var/currentquality = 0
var/currentsteps = 0
var/strengthstepcostmod = 1
var/stepsdone
var/list/smithrecipes = (RECIPE_AXE = obj/item/smithing/axehead,
RECIPE_HAMMER = obj/item/smithing/hammerhead,
RECIPE_SCYTHE = obj/item/smithing/scytheblade,
RECIPE_SHOVEL = obj/item/smithing/shovelhead,
RECIPE_COGHEAD = obj/item/smithing/cogheadclubhead,
RECIPE_JAVELIN = obj/item/smithing/javelinhead,
RECIPE_LARGEPICK = obj/item/smithing/pickaxehead,
RECIPE_SMALLPICK = obj/item/smithing/prospectingpickhead,
RECIPE_SHORTSWORD = obj/item/smithing/shortswordblade,
RECIPE_SMALLKNIFE = obj/item/smithing/knifeblade,
RECIPE_BROADSWORD = obj/item/smithing/broadblade,
RECIPE_HALBERD = obj/item/smithing/halberdhead)
var/stepsdone = 0
var/list/smithrecipes = list(RECIPE_AXE = /obj/item/smithing/axehead,
RECIPE_HAMMER = /obj/item/smithing/hammerhead,
RECIPE_SCYTHE = /obj/item/smithing/scytheblade,
RECIPE_SHOVEL = /obj/item/smithing/shovelhead,
RECIPE_COGHEAD = /obj/item/smithing/cogheadclubhead,
RECIPE_JAVELIN = /obj/item/smithing/javelinhead,
RECIPE_LARGEPICK = /obj/item/smithing/pickaxehead,
RECIPE_SMALLPICK = /obj/item/smithing/prospectingpickhead,
RECIPE_SHORTSWORD = /obj/item/smithing/shortswordblade,
RECIPE_SMALLKNIFE = /obj/item/smithing/knifeblade,
RECIPE_BROADSWORD = /obj/item/smithing/broadblade,
RECIPE_HALBERD = /obj/item/smithing/halberdhead)
/obj/structure/anvil/attackby(obj/item/I, mob/user)
if(istype(I, obj/item/smithing/ingot))
var/obj/item/smithing/ingot/notsword = I
if(istype(I, /obj/item/ingot))
var/obj/item/ingot/notsword = I
if(workpiece_state)
to_chat(user, "There's already a workpiece! Finish it or take it off.")
return FALSE
@@ -54,15 +56,16 @@
workpiece_state = WORKPIECE_PRESENT
workpiece_material = notsword.custom_materials
to_chat(user, "You place the [notsword] on the [src].")
currentquality = qualitymod
qdel(notsword)
else
to_chat(user, "The ingot isn't workable yet!")
return FALSE
return
else if(istype(I, obj/item/hammer))
var/obj/item/melee/hammer/hammertime = I
if(workpiece_state = WORKPIECE_PRESENT || WORKPIECE_INPROGRESS)
do_shaping(user, hammer.qualitymod)
else if(istype(I, /obj/item/melee/smith/hammer))
var/obj/item/melee/smith/hammer/hammertime = I
if(workpiece_state == WORKPIECE_PRESENT || WORKPIECE_INPROGRESS)
do_shaping(user, hammertime.qualitymod)
else
to_chat(user, "You can't work an empty anvil!")
return FALSE
@@ -76,7 +79,7 @@
/obj/structure/anvil/proc/do_shaping(mob/user, var/qualitychange)
qualitymod += qualitychange
var/list/shapingsteps = ("weak hit", "strong hit", "heavy hit", "fold", "draw", "shrink", "bend", "punch", "upset") //weak/strong/heavy hit affect strength. All the other steps shape.
var/list/shapingsteps = list("weak hit", "strong hit", "heavy hit", "fold", "draw", "shrink", "bend", "punch", "upset") //weak/strong/heavy hit affect strength. All the other steps shape.
workpiece_state = WORKPIECE_INPROGRESS
var/stepdone = input(user, "How would you like to work the metal?") in shapingsteps
switch(stepdone)
@@ -122,12 +125,20 @@
var/turf/T = get_turf(user)
workpiece_state = FALSE
new /obj/item/stack/ore/slag(T)
currentquality = qualitymod
for(var/solutions in smithrecipes)
if(!solution == stepsdone)
if(!solutions == stepsdone)
return FALSE
else
var/finisheditem = smithrecipes[stepsdone]
var/obj/item/smithing/finisheditem = smithrecipes[stepsdone]
var/turf/T = get_turf(user)
workpiece_state = FALSE
new finisheditem(T)
finisheditem.set_custom_materials(workpiece_material)
to_chat(user, "You finish your [finisheditem]!")
new finisheditem(T)
currentquality = qualitymod
#undef WORKPIECE_PRESENT
#undef WORKPIECE_INPROGRESS
#undef WORKPIECE_FINISHED
#undef WORKPIECE_SLAG
+78
View File
@@ -0,0 +1,78 @@
/obj/item/melee/smith
name = "base class obj/item/melee/smith" //tin. handles overlay and quality and shit.
icon = 'icons/obj/smith.dmi'
icon_state = "mace_greyscale"
item_state = "mace_greyscale"
material_flags = MATERIAL_COLOR | MATERIAL_AFFECT_STATISTICS
lefthand_file = 'icons/mob/inhands/weapons/melee_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/melee_righthand.dmi'
var/quality
var/overlay_state = "stick"
var/mutable_appearance/overlay
/obj/item/melee/smith/Initialize()
desc = "A handmade [name]."
. = ..()
overlay = mutable_appearance(icon, overlay_state)
overlay.appearance_flags = RESET_COLOR
add_overlay(overlay)
///////////////////////////
// Mining //
///////////////////////////
/obj/item/mining_scanner/prospector
name = "prospector's pickaxe"
desc = "A pickaxe that can sound rocks to find mineral deposits and stop gibtonite detonations."
icon = 'icons/obj/mining.dmi'
icon_state = "pickaxe" //todo:sprite
/obj/item/pickaxe/smithed
name = "pickaxe"
desc = "A pickaxe that can sound rocks to find mineral deposits and stop gibtonite detonations."
icon = 'icons/obj/mining.dmi'
icon_state = "pickaxe"
/obj/item/shovel/smithed
name = "prospector's pickaxe"
desc = "A pickaxe that can sound rocks to find mineral deposits and stop gibtonite detonations."
icon = 'icons/obj/mining.dmi'
icon_state = "pickaxe"
///////////////////////////
// Spears //
///////////////////////////
/obj/item/melee/smith/halberd
/obj/item/melee/smith/javelin
//////////////////////////
// Other Melee //
///////////////////////////
/obj/item/melee/smith/axe
/obj/item/melee/smith/hammer//blacksmithing, not warhammer.
var/qualitymod = 0
/obj/item/scythe/smithed //we need to inherit scythecode
/obj/item/melee/smith/cogheadclub
/obj/item/melee/smith/shortsword
/obj/item/melee/smith/shortsword
+79 -17
View File
@@ -1,10 +1,24 @@
/obj/item/smithing
name = "base class /obj/item/smithing"
desc = "A [src]. Hit it with a [finishingitem] to create a [finalitem]."
icon = 'icons/obj/smith.dmi'
icon_state = "unfinished"
material_flags = MATERIAL_COLOR | MATERIAL_ADD_PREFIX
var/quality = 0 //quality. Changed by the smithing process.
var/obj/item/finishingitem = /obj/item/stick //What this item needs to be hit by to create finalitem
var/obj/item/finalitem = /obj/item
var/obj/item/finalitem = /obj/item/melee/smith
/obj/item/ingot
name = "ingot"
icon = 'icons/obj/smith.dmi'
icon_state = "unfinished"
material_flags = MATERIAL_COLOR | MATERIAL_ADD_PREFIX
var/workability = "shapeable"
/obj/item/ingot/iron
custom_materials = list(/datum/material/iron=12000)
/obj/item/smithing/Initialize()
desc = "A [src]. Hit it with a [finishingitem] to create a [finalitem]."
/obj/item/smithing/attackby(obj/item/I, mob/user)
if(istype(I, finishingitem))
to_chat(user, "You finish the [src].")
@@ -16,12 +30,37 @@
/obj/item/smithing/proc/dofinish()
var/turf/T = get_turf(src)
new finalitem(T)
. = new finalitem(T)
finalitem.set_custom_materials(custom_materials)
var/qualname
switch(quality)
if(-1000 to -5)
qualname = "awful"
if(-1000 to -2)
qualname = "shoddy"
if(-1000 to 0)
qualname = "poor"
if(0)
qualname = "normal"
if(10 to INFINITY)
qualname = "legendary"
if(8,9)
qualname = "masterwork"
if(6,7)
qualname = "excellent"
if(4,5)
qualname = "good"
if(1,2,3)
qualname = "above-average"
var/datum/material/mat = custom_materials[1]
mat = mat.name
finalitem.name = "[qualname] [mat] [finalitem.name]."
qdel(src)
return
/obj/item/smithing/axehead
name = "smithed axe head"
finalitem = /obj/item/hatchet/smithed
finalitem = /obj/item/melee/smith/axe
/obj/item/smithing/axehead/dofinish()
finalitem.force += quality
@@ -29,11 +68,12 @@
/obj/item/smithing/hammerhead
name = "smithed hammer head"
finalitem = /obj/item/melee/hammer
var/obj/item/melee/smith/hammer/finalforreal = /obj/item/melee/smith/hammer
/obj/item/smithing/hammerhead/dofinish()
finalitem.force += quality/2
finalitem.qualitymod = quality/4
finalforreal.force += quality/2
finalforreal.qualitymod = quality/4
finalitem = finalforreal
..()
/obj/item/smithing/scytheblade
@@ -55,7 +95,7 @@
/obj/item/smithing/cogheadclubhead
name = "smithed coghead club head"
finalitem = /obj/item/melee/cleric_mace/cogheadclub
finalitem = /obj/item/melee/smith/cogheadclub
/obj/item/smithing/cogheadclubhead/dofinish()
finalitem.force += quality
@@ -63,7 +103,7 @@
/obj/item/smithing/javelinhead
name = "smithed javelin head"
finalitem = /obj/item/spear/javelin
finalitem = /obj/item/melee/smith/javelin
/obj/item/smithing/javelinhead/dofinish()
finalitem.force += quality
@@ -71,20 +111,29 @@
/obj/item/smithing/pickaxehead
name = "smithed pickaxe head"
finalitem = /obj/item/pickaxe/smithed
var/obj/item/pickaxe/smithed/finalforreal = /obj/item/pickaxe/smithed
/obj/item/smithing/pickaxehead/dofinish()
finalitem.force += quality/2
finalitem.toolspeed /= quality
finalforreal.force += quality/2
finalforreal.toolspeed /= quality
switch(quality)
if(10 to INFINITY)
finalforreal.digrange = 4
if(5 to 9)
finalforreal.digrange = 3
if(3,4)
finalforreal.digrange = 2
finalitem = finalforreal
..()
/obj/item/smithing/prospectingpickhead
name = "smithed prospector's pickaxe head"
finalitem = /obj/item/mining_scanner/prospector
var/obj/item/mining_scanner/prospector/finalforreal = /obj/item/mining_scanner/prospector
/obj/item/smithing/prospectingpickhead/dofinish()
finalitem.range = 2 + quality
finalitem.cooldown = 50/quality
finalforreal.range = 2 + quality
finalforreal.cooldown = 100/quality
finalitem = finalforreal
..()
/obj/item/smithing/shortswordblade
@@ -108,7 +157,7 @@
/obj/item/smithing/broadblade
name = "smithed broadsword blade"
finishingitem = /obj/item/swordhandle
finalitem = /obj/item/melee/smith/broadsword
finalitem = /obj/item/melee/smith/shortsword
/obj/item/smithing/broadblade/dofinish()
finalitem.force += quality
@@ -116,8 +165,21 @@
/obj/item/smithing/halberdhead
name = "smithed halberd head"
finalitem = /obj/item/spear/halberd
finalitem = /obj/item/melee/smith/halberd
/obj/item/smithing/halberdhead/dofinish()
finalitem.force += quality
..()
/obj/item/stick
name = "wooden rod"
desc = "It's a rod, suitable for use of a handle of a tool. Also could serve as a weapon, in a pinch."
icon = 'icons/obj/smith.dmi'
icon_state = "stick"
force = 7
/obj/item/swordhandle
name = "sword handle"
desc = "It's a rod, suitable for use of a handle of a tool. Also could serve as a weapon, in a pinch."
icon = 'icons/obj/smith.dmi'
icon_state = "stick"
Binary file not shown.

After

Width:  |  Height:  |  Size: 481 B

+3
View File
@@ -3260,6 +3260,9 @@
#include "code\modules\shuttle\shuttle_creation\shuttle_creator_eye.dm"
#include "code\modules\shuttle\shuttle_creation\shuttle_creator_overlay.dm"
#include "code\modules\shuttle\shuttle_creation\shuttle_upgrades.dm"
#include "code\modules\smithing\anvil.dm"
#include "code\modules\smithing\finished_items.dm"
#include "code\modules\smithing\smithed_items.dm"
#include "code\modules\spells\spell.dm"
#include "code\modules\spells\spell_types\aimed.dm"
#include "code\modules\spells\spell_types\area_teleport.dm"