Skip to content

Commit

Permalink
Merge pull request #5873 from Trilbyspaceclone/psionic_cells_removal
Browse files Browse the repository at this point in the history
oddification tweaks and cell spawning fixes
  • Loading branch information
Trilbyspaceclone authored Nov 26, 2024
2 parents 9522001 + a23dd66 commit 98df3eb
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 5 deletions.
17 changes: 12 additions & 5 deletions code/game/objects/items/weapons/tools/_tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,25 @@
var/precision = 0 //Subtracted from failure rates
var/workspeed = 1 //Worktimes are divided by this

var/spawn_full = TRUE


/******************************
/* Core Procs */
*******************************/
//Fuel and cell spawn
/obj/item/tool/New()
..()
if(cell)
if(cell && spawn_full)
cell = new cell(src) //So when we have a cell spawn it spawns a cell, otherwise it will pick a suitable cell

if(!cell && suitable_cell)
if(!cell && suitable_cell && spawn_full)
cell = new suitable_cell(src) //No cell? We add are suitable cell

if(use_fuel_cost)
create_reagents(max_fuel)
reagents.add_reagent(my_fuel, max_fuel)
if(spawn_full)
reagents.add_reagent(my_fuel, max_fuel)

if(use_stock_cost)
stock = max_stock
Expand All @@ -109,7 +112,7 @@
/obj/item/tool/Created()
QDEL_NULL(cell)
if(use_fuel_cost)
consume_fuel(get_fuel())
consume_fuel(get_fuel(), forced = TRUE)



Expand Down Expand Up @@ -911,7 +914,11 @@
/obj/item/proc/get_fuel()
return ( reagents ? reagents.get_reagent_amount(my_fuel) : 0 )

/obj/item/tool/proc/consume_fuel(volume)
/obj/item/tool/proc/consume_fuel(volume, forced)
if(forced)
reagents.remove_reagent(my_fuel, volume)
return TRUE

//Fixes tool off-state behavior
if(toggleable && !switched_on)
return TRUE
Expand Down
12 changes: 12 additions & 0 deletions code/modules/psionics/psionic_items/psi_weptools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
matter = list()
tool_qualities = list(QUALITY_LASER_CUTTING = 42, QUALITY_SAWING = 23, QUALITY_CLAMPING = 6, QUALITY_CAUTERIZING = 8, QUALITY_RETRACTING = 22, QUALITY_BONE_SETTING = 19) //It's a surgical chainsaw
max_fuel = 123
spawn_full = FALSE

/obj/item/tool/saw/chain/cult/deepmaints
name = "mindripper"
Expand All @@ -72,6 +73,7 @@
damtype = BURN
tool_qualities = list(QUALITY_LASER_CUTTING = 50, QUALITY_SAWING = 45, QUALITY_CLAMPING = 10, QUALITY_CAUTERIZING = 10, QUALITY_RETRACTING = 25, QUALITY_BONE_SETTING = 20) //It's a surgical chainsaw
max_fuel = 246
spawn_full = FALSE

/obj/item/tool/sword/machete/cult
name = "scorch sword"
Expand Down Expand Up @@ -120,13 +122,15 @@
matter = list()
switched_on_qualities = list(QUALITY_HAMMERING = 13, QUALITY_SHOVELING = 13, QUALITY_DIGGING = 13)
switched_off_qualities = list(QUALITY_HAMMERING = 3, QUALITY_SHOVELING = 3, QUALITY_DIGGING = 3)
spawn_full = FALSE

/obj/item/tool/power_fist/cult/deepmaints
name = "mind repeater"
desc = "Mysteriously fitting any hand perfectly despite being always the same size, this gauntlet makes you able to attack twice as fast with its burning psionic dark pistons."
damtype = BURN
switched_on_qualities = list(QUALITY_HAMMERING = 15, QUALITY_SHOVELING = 15, QUALITY_DIGGING = 15)
switched_off_qualities = list(QUALITY_HAMMERING = 5, QUALITY_SHOVELING = 5, QUALITY_DIGGING = 5)
spawn_full = FALSE

/obj/item/tool/power_fist/cult/deepmaints/attack()
..()
Expand Down Expand Up @@ -277,6 +281,7 @@
workspeed = 1.2
max_upgrades = 4
suitable_cell = /obj/item/cell/medium
spawn_full = FALSE

/obj/item/tool/multitool/advanced/cult/deepmaints
name = "multi-mind"
Expand All @@ -289,6 +294,7 @@
use_power_cost = 0.25
workspeed = 1.3
max_upgrades = 4
spawn_full = FALSE

/obj/item/tool/shovel/power/cult
name = "pit delver"
Expand All @@ -299,11 +305,13 @@
origin_tech = list()
price_tag = 0
tool_qualities = list(QUALITY_SHOVELING = 53, QUALITY_DIGGING = 42, QUALITY_EXCAVATION = 34, QUALITY_HAMMERING = 6)
spawn_full = FALSE

/obj/item/tool/shovel/power/cult/deepmaints
name = "hollow labour"
desc = "A tool made from lackadaisical thoughts while doing manual laboring tasks, such as digging and plowing earth."
tool_qualities = list(QUALITY_SHOVELING = 60, QUALITY_DIGGING = 50, QUALITY_EXCAVATION = 70, QUALITY_HAMMERING = 10)
spawn_full = FALSE

/obj/item/tool/screwdriver/combi_driver/cult
name = "rotary spanner"
Expand All @@ -313,12 +321,14 @@
origin_tech = list()
price_tag = 0
tool_qualities = list(QUALITY_SCREW_DRIVING = 42, QUALITY_BOLT_TURNING = 42, QUALITY_DRILLING = 36, QUALITY_RETRACTING = 22)
spawn_full = FALSE

/obj/item/tool/screwdriver/combi_driver/cult/deepmaints
name = "mind-driver"
desc = "A screwdriver and wrench combo willed into reality from the thoughts of an engineering mind wishing for a tool that could make them able to turn even the most rusted and stripped screw or loosen the tightest, rustiest bolt."
icon_state = "psi_driver"
tool_qualities = list(QUALITY_SCREW_DRIVING = 70, QUALITY_BOLT_TURNING = 70, QUALITY_DRILLING = 60, QUALITY_RETRACTING = 25)
spawn_full = FALSE

/obj/item/tool/weldingtool/advanced/cult
name = "thought scorcher"
Expand All @@ -331,6 +341,7 @@
matter = list()
origin_tech = list()
price_tag = 0
spawn_full = FALSE

/obj/item/tool/weldingtool/advanced/cult/deepmaints
name = "mind candle"
Expand All @@ -339,6 +350,7 @@
max_fuel = 80
sparks_on_use = FALSE
eye_hazard = FALSE
spawn_full = FALSE

/obj/item/tool/shovel/combat/cult
name = "cognitive pry-cutter"
Expand Down
16 changes: 16 additions & 0 deletions code/modules/scrap/oldificator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,22 @@
QDEL_NULL(trash_mod)
health = rand(10, max_health)
refresh_upgrades() //So we dont null upgrades.
if(prob(60) && cell)
QDEL_NULL(cell)
if(prob(60) && use_fuel_cost)
var/random = rand(0, max_fuel)
consume_fuel(random, forced = TRUE)
update_icon()

/obj/item/device/scanner/make_old()
.=..()
if(prob(60))
QDEL_NULL(cell)

/obj/item/device/t_scanner/make_old()
.=..()
if(prob(60))
QDEL_NULL(cell)

/obj/item/gun/make_old()
. = ..()
Expand Down

0 comments on commit 98df3eb

Please sign in to comment.