Skip to content

Commit

Permalink
Tiny fix + Show max amount of upgrades in the spell book
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorDinamit committed Jan 20, 2024
1 parent b57a591 commit e0a976c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 5 additions & 1 deletion code/modules/spellbook/_spellbook.dm
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,11 @@ GLOBAL_LIST_EMPTY(spells_by_categories)
var/datum/spell/OS = locate(S) in user.mind.learned_spells
if(!istype(OS))
dat += "<A href='byond://?src=\ref[src];purchase=[S]'>Purchase ([initial(S.spell_cost)] points)</a><br>"
else
else if(OS.level_max[UPGRADE_TOTAL] > 0)
var/up_count = 0
for(var/up_type in spell_levels)

Check failure on line 230 in code/modules/spellbook/_spellbook.dm

View workflow job for this annotation

GitHub Actions / DreamChecker

undefined var: "spell_levels"
up_count += spell_levels[up_type]

Check failure on line 231 in code/modules/spellbook/_spellbook.dm

View workflow job for this annotation

GitHub Actions / DreamChecker

undefined var: "spell_levels"
dat += "Maximum amount of upgrades: [up_count]/[OS.level_max[UPGRADE_TOTAL]]"
for(var/upgrade_type in OS.spell_levels)
if(OS.level_max[upgrade_type] <= 0)
continue
Expand Down
4 changes: 3 additions & 1 deletion code/modules/spells/_spell.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
/// The current spell levels - total spell levels can be obtained by just adding the two values;
/// The list is auto-generated on New(), based on level_max list
var/list/spell_levels = list()
/// Maximum possible levels in each category. Total does cover both.
/// Maximum possible levels in each category. Total covers maximum amount of upgrades.
var/list/level_max = list(UPGRADE_TOTAL = 4, UPGRADE_SPEED = 4, UPGRADE_POWER = 0)
/// If set, defines how much charge_max drops by every speed upgrade
var/cooldown_reduc = 0
Expand Down Expand Up @@ -111,6 +111,8 @@
..()

for(var/U in level_max)
if(U == UPGRADE_TOTAL)
continue
if(!(U in upgrade_cost))
upgrade_cost[U] = spell_cost
if(!(U in spell_levels))
Expand Down
4 changes: 0 additions & 4 deletions code/modules/spells/aimed/spell_steal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,7 @@
return ImproveSpellStealDuration()

/datum/spell/aimed/spell_steal/proc/ImproveSpellStealDuration()
if(!..())
return FALSE

stolen_spell_duration += 30 SECONDS

return "The stolen spells now remain under your control for [stolen_spell_duration / 10] seconds!"

/datum/spell/aimed/spell_steal/proc/ForgetSpell(datum/spell/S)
Expand Down

0 comments on commit e0a976c

Please sign in to comment.