Skip to content

Commit

Permalink
Powercrovel (#4974)
Browse files Browse the repository at this point in the history
* Adds Powercrovel

Powercrovel and sprites

* Spriting credits

* Crafting value adjustment

* Adjusted description

* Fixed cells too while I'm at it

* Fixed the Fix

Implemented fuel use bugfix in a less potentially dangerous way.
  • Loading branch information
Xaytan authored Jan 27, 2024
1 parent 5017988 commit 0bf6630
Show file tree
Hide file tree
Showing 10 changed files with 91 additions and 7 deletions.
18 changes: 18 additions & 0 deletions code/datums/craft/recipes/guild.dm
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,24 @@
list(QUALITY_BOLT_TURNING, 30, "time" = 10)
)

/datum/craft_recipe/guild/turbo_shovel
name = "Artificer's power crovel"
result = /obj/item/tool/shovel/combat/turbo
steps = list(
list(/obj/item/tool/shovel/combat, 1),
list(QUALITY_SAWING, 45, "time" = 40),
list(QUALITY_HAMMERING, 30, "time" = 40),
list(CRAFT_MATERIAL, 4, MATERIAL_PLASTEEL, "time" = 60),
list(/obj/item/tool_upgrade/productivity/motor, 1, "time" = 60),
list(QUALITY_SCREW_DRIVING, 40, "time" = 30),
list(/obj/item/tool_upgrade/augment/fuel_tank, 1),
list(QUALITY_BOLT_TURNING, 40, "time" = 10),
list(QUALITY_DRILLING, 45, 10),
list(QUALITY_SAWING, 45, "time" = 40),
list(QUALITY_WELDING, 30, "time" = 60)
)


/datum/craft_recipe/guild/rocket_engine
name = "rocket engine"
result = /obj/item/tool_upgrade/productivity/rocket_engine
Expand Down
28 changes: 28 additions & 0 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,34 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
/obj/item/proc/pwr_drain()
return 0 // Process Kill

//Power and fuel drain, sparks spawn
//Moved here from _tools because we need tools to use certain tool only variables in the logic, but we don't want to break anything unexpected
/obj/item/proc/check_tool_effects(mob/living/user, time)
if(use_power_cost)
if(!cell || !cell.check_charge(use_power_cost*time))
to_chat(user, SPAN_WARNING("[src] battery is dead or missing."))
return FALSE

if(use_fuel_cost)
if(get_fuel() < (use_fuel_cost*time))
to_chat(user, SPAN_NOTICE("You need more welding fuel to complete this task."))
return FALSE

if(use_stock_cost)
if(stock < (use_stock_cost*time))
to_chat(user, SPAN_NOTICE("There is not enough left in [src] to complete this task."))
return FALSE

if(eye_hazard)
eyecheck(user)

if(sparks_on_use && !(item_flags & SILENT))
var/datum/effect/effect/system/spark_spread/sparks = new /datum/effect/effect/system/spark_spread()
sparks.set_up(3, 0, get_turf(src))
sparks.start()

update_icon()
return TRUE

//Called when a human swaps hands to a hand which is holding this item
/obj/item/proc/swapped_to(mob/user)
Expand Down
14 changes: 9 additions & 5 deletions code/game/objects/items/weapons/tools/_tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -834,20 +834,21 @@
adjustToolHealth(-degradation, user)

//Power and fuel drain, sparks spawn
/obj/item/proc/check_tool_effects(mob/living/user, time)

/obj/item/tool/check_tool_effects(mob/living/user, time)
//Check if our tool is something that needs to be turned on to spend resources
var/can_spend_resources = (!toggleable || (toggleable && switched_on))
if(use_power_cost)
if(!cell || !cell.check_charge(use_power_cost*time))
if(!cell || !cell.check_charge(use_power_cost*time) && can_spend_resources)
to_chat(user, SPAN_WARNING("[src] battery is dead or missing."))
return FALSE

if(use_fuel_cost)
if(get_fuel() < (use_fuel_cost*time))
if(get_fuel() < (use_fuel_cost*time) && can_spend_resources)
to_chat(user, SPAN_NOTICE("You need more welding fuel to complete this task."))
return FALSE

if(use_stock_cost)
if(stock < (use_stock_cost*time))
if(stock < (use_stock_cost*time) && can_spend_resources)
to_chat(user, SPAN_NOTICE("There is not enough left in [src] to complete this task."))
return FALSE

Expand All @@ -867,6 +868,9 @@
return ( reagents ? reagents.get_reagent_amount(my_fuel) : 0 )

/obj/item/tool/proc/consume_fuel(volume)
//Fixes tool off-state behavior
if(toggleable && !switched_on)
return TRUE
if(get_fuel() >= volume)
reagents.remove_reagent(my_fuel, volume)
return TRUE
Expand Down
38 changes: 36 additions & 2 deletions code/game/objects/items/weapons/tools/shovel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
edge = TRUE
max_health = 500
tool_qualities = list(QUALITY_SHOVELING = 35, QUALITY_DIGGING = 35, QUALITY_EXCAVATION = 10)
effective_faction = list("spider") // Spiders are weak to crushing.
effective_faction = list("spiders") // Spiders are weak to crushing.
damage_mult = 2
hitsound = 'sound/weapons/smash.ogg'
price_tag = 15
Expand Down Expand Up @@ -52,7 +52,7 @@

/obj/item/tool/shovel/combat/marqua
name = "Mar'quaian crovel"
desc = "A sharp, balanced crovel made from made of a strange alloy."
desc = "A sharp, balanced crovel made from a strange alloy."
icon_state = "clustertool-shovel"
force = WEAPON_FORCE_DANGEROUS
throwforce = WEAPON_FORCE_DANGEROUS
Expand All @@ -63,6 +63,40 @@
workspeed = 1.5
price_tag = 2875

/obj/item/tool/shovel/combat/turbo
name = "Artificer Power Crovel"
desc = "A creation of the Artificer's Guild dreamed up by an adept with a love for combustion. Rather than a cell this device uses a higher power gas burning engine for high-octane shoveling. An engraving on the handle reads, \"THIS MACHINE KILLS SPIDERS.\""
icon_state = "Powercrovel" //Sprites by Dromkii
item_state = "Powercrovel"

slot_flags = SLOT_BELT|SLOT_BACK //I PAID FOR THE WHOLE BACK SPRITE, I'M GONNA USE THE WHOLE BACK SPRITE
switched_on_icon_state = "Powercrovel-on"
wielded_icon = "Powercrovel_wielded"
switched_on_forcemult = 1.3 //26 damage. Slightly worse than a chainsaw. Gets bonus damage vs spiders, like all shovels
workspeed = 1.3
w_class = ITEM_SIZE_NORMAL //Bigger than a normal crovel, doesn't fit in your pocket

toggleable = TRUE
use_fuel_cost = 0.1
passive_fuel_cost = 0.05
max_fuel = 80

switched_on_qualities = list(QUALITY_SHOVELING = 60, QUALITY_DIGGING = 60, QUALITY_PRYING = 45, QUALITY_CUTTING = 10, QUALITY_SAWING = 15)
switched_off_qualities = list(QUALITY_SHOVELING = 25, QUALITY_DIGGING = 25, QUALITY_PRYING = 25, QUALITY_CUTTING = 5, QUALITY_SAWING = 5) //Still kindof usable when off

/obj/item/tool/shovel/combat/turbo/turn_on(mob/user)
.=..()
if(.)
to_chat(user, SPAN_NOTICE("You rev up the [src]."))
playsound(loc, 'sound/items/chainsaw_on.ogg', 40)
hitsound = WORKSOUND_CHAINSAW //It only makes chainsaw noises when it's on!
START_PROCESSING(SSobj, src)

/obj/item/tool/shovel/combat/turbo/turn_off()
playsound(loc, 'sound/items/chainsaw_off.ogg', 80)
hitsound = 'sound/weapons/smash.ogg'
..()

/obj/item/tool/shovel/onestar_shovel
name = "Greyson Positronic shovel"
desc = "A large tool for digging and moving dirt and rock with the finest engineering put into it for maximum lift and heaving."
Expand Down
Binary file modified icons/inventory/back/mob.dmi
Binary file not shown.
Binary file modified icons/inventory/on_suit/mob.dmi
Binary file not shown.
Binary file modified icons/mob/items/lefthand.dmi
Binary file not shown.
Binary file modified icons/mob/items/righthand.dmi
Binary file not shown.
Binary file added icons/obj/powercrovel.dmi
Binary file not shown.
Binary file modified icons/obj/tools.dmi
Binary file not shown.

0 comments on commit 0bf6630

Please sign in to comment.