mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 04:30:44 +01:00
Merge pull request #13526 from Lo6a4evskiy/ninja-fixes
Fixes ninja suit not draining energy after running out of it once
This commit is contained in:
@@ -1,28 +1,22 @@
|
||||
|
||||
|
||||
/obj/item/clothing/suit/space/space_ninja/proc/ntick(mob/living/carbon/human/U = affecting)
|
||||
set background = BACKGROUND_ENABLED
|
||||
|
||||
//Runs in the background while the suit is initialized.
|
||||
//Requires charge or stealth to process.
|
||||
spawn while(cell.charge || s_active)
|
||||
|
||||
if(s_initialized && !affecting)
|
||||
spawn while(s_initialized)
|
||||
if(!affecting)
|
||||
terminate()//Kills the suit and attached objects.
|
||||
if(!s_initialized)
|
||||
return
|
||||
|
||||
if(cell.charge)
|
||||
else if(cell.charge > 0)
|
||||
if(s_coold)
|
||||
s_coold--//Checks for ability s_cooldown first.
|
||||
|
||||
var/A = s_cost//s_cost is the default energy cost each ntick, usually 5.
|
||||
cell.charge -= s_cost//s_cost is the default energy cost each ntick, usually 5.
|
||||
if(s_active)//If stealth is active.
|
||||
A += s_acost
|
||||
cell.charge-=A
|
||||
cell.charge -= s_acost
|
||||
|
||||
if(cell.charge <= 0)
|
||||
cell.charge=0
|
||||
else
|
||||
cell.charge = 0
|
||||
cancel_stealth()
|
||||
|
||||
sleep(10)//Checks every second.
|
||||
|
||||
Reference in New Issue
Block a user