Skip to content

Commit

Permalink
readability UPD
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoonij committed Sep 22, 2024
1 parent eb67fc1 commit 9f7d2f1
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions code/datums/spells/charge.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,26 @@

if(living.pulling)
charge_result = pulling.magic_charge_act(pulling)

if(charge_result & RECHARGE_NO_EFFECT)
continue

charged_item = pulling
break

for(var/obj/item in hand_items)
charge_result = item.magic_charge_act(living)

if(charge_result & RECHARGE_NO_EFFECT)
continue

charged_item = item
break

if(!charged_item)
to_chat(user, span_notice("You feel magical power surging to your hands, but the feeling rapidly fades..."))
return

switch(charge_result)
if(RECHARGE_BURNOUT)
to_chat(user, span_caution("[charged_item] doesn't seem to be reacting to the spell..."))
Expand Down
1 change: 1 addition & 0 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@
if(contents)
for(var/obj/item/stock_parts/cell/cell in contents)
cell.magic_charge_act()

return RECHARGE_NO_EFFECT

/atom/proc/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
Expand Down
2 changes: 2 additions & 0 deletions code/game/gamemodes/wizard/spellbook.dm
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,7 @@
"SUCH FLAGRANT CHEESING IS WHY WE ACCEPTED YOUR APPLICATION!", \
"CUTE!", \
"YOU DIDN'T THINK IT'D BE THAT EASY, DID YOU?")))

return RECHARGE_BURNOUT

/obj/item/spellbook/attackby(obj/item/I, mob/living/user, params)
Expand Down Expand Up @@ -1029,6 +1030,7 @@
visible_message(span_warning("[src] catches fire!"))
qdel(src)
return RECHARGE_FAILED

used = FALSE
return RECHARGE_SUCCESSFUL

Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2308,13 +2308,15 @@
for(var/obj/effect/proc_holder/spell/spell as anything in mob_spell_list)
if(spell.cooldown_handler.is_on_cooldown())
continue

spell.revert_cast()
. = RECHARGE_SUCCESSFUL

if(LAZYLEN(mind?.spell_list))
for(var/obj/effect/proc_holder/spell/spell as anything in mind?.spell_list)
if(spell.cooldown_handler.is_on_cooldown())
continue

spell.revert_cast()
. = RECHARGE_SUCCESSFUL

Expand Down
1 change: 1 addition & 0 deletions code/modules/power/cell.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
. = RECHARGE_SUCCESSFUL
if(prob(80) && !adjust_maxcharge(-200))
. = RECHARGE_BURNOUT

charge = maxcharge
update_icon()
return .
Expand Down
2 changes: 2 additions & 0 deletions code/modules/projectiles/guns/magic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@
. = RECHARGE_SUCCESSFUL
if(prob(80) && !can_charge)
max_charges--

if(max_charges <= 0)
max_charges = 0
. = RECHARGE_BURNOUT

charges = max_charges
return .

Expand Down
1 change: 1 addition & 0 deletions code/modules/projectiles/guns/magic/wand.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
. = ..()
if(!max_charges)
. = RECHARGE_BURNOUT

update_icon_state()
return .

Expand Down

0 comments on commit 9f7d2f1

Please sign in to comment.