From a02d0025851eb9feb508d1409a4ea687a89e4d45 Mon Sep 17 00:00:00 2001 From: Page Asgardius Date: Tue, 21 Jan 2025 12:27:36 -0700 Subject: [PATCH] elemental boost --- global.gd | 1 + levels/ui/tophud.gd | 21 +++++++++++++++++++++ sprites/common/bullet/aero.gd | 5 ++++- sprites/common/bullet/arrow.gd | 5 ++++- sprites/common/bullet/fireball.gd | 5 ++++- sprites/common/bullet/snowflake.gd | 5 ++++- sprites/common/bullet/tnt.gd | 5 ++++- 7 files changed, 42 insertions(+), 5 deletions(-) diff --git a/global.gd b/global.gd index a48cbea..f73fe2b 100644 --- a/global.gd +++ b/global.gd @@ -58,6 +58,7 @@ var quest = [0, 0, 0, 0, 0, 0] var isresume = false var xm = 0 var ym = 0 +var spboost = 0 # Called when the node enters the scene tree for the first time. func _ready(): pass # Replace with function body. diff --git a/levels/ui/tophud.gd b/levels/ui/tophud.gd index 69e5a12..96ec1bd 100644 --- a/levels/ui/tophud.gd +++ b/levels/ui/tophud.gd @@ -54,6 +54,7 @@ var boss var bossbg var ctime var ctimeset +var buffcalc # Called when the node enters the scene tree for the first time. func _ready(): @@ -132,6 +133,26 @@ func _process(delta): ctimeset = Time.get_time_string_from_system(false) ctimeset.erase(5, 3) ctime.set_text(ctimeset) + ctimeset.erase(2, 3) + buffcalc = int(ctimeset) + if buffcalc < 6 && buffcalc >= 20: + #print("water") + Global.spboost = 0 + elif buffcalc < 14 && buffcalc >= 12: + #print("fire") + Global.spboost = 1 + elif buffcalc < 20 && buffcalc >= 18: + #print("electricity") + Global.spboost = 2 + elif buffcalc < 10 && buffcalc >= 6: + #print("wood") + Global.spboost = 3 + elif buffcalc < 12 && buffcalc >= 10: + #print("earth") + Global.spboost = 4 + elif buffcalc < 18 && buffcalc >= 14: + #print("wind") + Global.spboost = 5 if Global.debug: chealthf.set_text(str(Global.dstats[Global.dparty[Global.dcpchar][0]][0])+"/"+str(Global.mstats[Global.dparty[Global.dcpchar][0]][0])) cstaminaf.set_text(str(Global.dstats[Global.dparty[Global.dcpchar][0]][1])+"/"+str(Global.mstats[Global.dparty[Global.dcpchar][0]][1])) diff --git a/sprites/common/bullet/aero.gd b/sprites/common/bullet/aero.gd index e9467f0..c4f579c 100644 --- a/sprites/common/bullet/aero.gd +++ b/sprites/common/bullet/aero.gd @@ -18,7 +18,10 @@ func _ready(): if is_in_group("players"): speciality = Global.pcspecialities[Global.dparty[Global.dcpchar][0]] add_to_group(btype) - attack = attack * Global.difdamage + if Global.spboost == speciality: + attack = (attack*attack) * Global.difdamage + else: + attack = attack * Global.difdamage #pass # Replace with function body. diff --git a/sprites/common/bullet/arrow.gd b/sprites/common/bullet/arrow.gd index 300c56e..d3875cd 100644 --- a/sprites/common/bullet/arrow.gd +++ b/sprites/common/bullet/arrow.gd @@ -18,7 +18,10 @@ func _ready(): rotation = velocity.angle() else: rotation = direction.angle() - attack = attack * Global.difdamage + if Global.spboost == speciality: + attack = (attack*attack) * Global.difdamage + else: + attack = attack * Global.difdamage #pass # Replace with function body. diff --git a/sprites/common/bullet/fireball.gd b/sprites/common/bullet/fireball.gd index 458b303..ab52925 100644 --- a/sprites/common/bullet/fireball.gd +++ b/sprites/common/bullet/fireball.gd @@ -12,7 +12,10 @@ var isjump = false func _ready(): isvisible = $VisibleOnScreenNotifier2D add_to_group(btype) - attack = attack * Global.difdamage + if Global.spboost == 1: + attack = (attack*attack) * Global.difdamage + else: + attack = attack * Global.difdamage #pass # Replace with function body. diff --git a/sprites/common/bullet/snowflake.gd b/sprites/common/bullet/snowflake.gd index ecf9d12..9f310b6 100644 --- a/sprites/common/bullet/snowflake.gd +++ b/sprites/common/bullet/snowflake.gd @@ -12,7 +12,10 @@ var isjump = false func _ready(): isvisible = $VisibleOnScreenNotifier2D add_to_group(btype) - attack = attack * Global.difdamage + if Global.spboost == 0: + attack = (attack*attack) * Global.difdamage + else: + attack = attack * Global.difdamage #pass # Replace with function body. diff --git a/sprites/common/bullet/tnt.gd b/sprites/common/bullet/tnt.gd index e97ea15..2e960c7 100644 --- a/sprites/common/bullet/tnt.gd +++ b/sprites/common/bullet/tnt.gd @@ -12,7 +12,10 @@ var isjump = false func _ready(): isvisible = $VisibleOnScreenNotifier2D add_to_group(btype) - attack = attack * Global.difdamage + if Global.spboost == 1: + attack = (attack*attack) * Global.difdamage + else: + attack = attack * Global.difdamage #pass # Replace with function body.