-
Notifications
You must be signed in to change notification settings - Fork 0
Regenerate Abilities #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| [gd_resource type="Resource" script_class="StatusEffect" format=3 uid="uid://dnx5kk4jemlol"] | ||
|
|
||
| [ext_resource type="Script" uid="uid://c4rwprj6d61c0" path="res://scripts/status_effects/status_effect.gd" id="1_3lxtv"] | ||
| [ext_resource type="Script" uid="uid://c2ci25gmhnb4w" path="res://scripts/status_effects/status_effect_stack.gd" id="2_seamv"] | ||
| [ext_resource type="Script" uid="uid://w6h7oqtjl61k" path="res://scripts/status_effects/status_effect_modifier.gd" id="3_qvorr"] | ||
| [ext_resource type="Script" uid="uid://d0uvf6jnorxpw" path="res://scripts/status_effects/status_effect_trigger.gd" id="4_663xp"] | ||
| [ext_resource type="Script" uid="uid://c84i4tkx4t6au" path="res://scripts/ability/action/heal_action.gd" id="5_u1w0k"] | ||
|
|
||
| [sub_resource type="Resource" id="Resource_nr16a"] | ||
| script = ExtResource("5_u1w0k") | ||
| heal_amount = 10 | ||
| metadata/_custom_type_script = "uid://c84i4tkx4t6au" | ||
|
|
||
| [sub_resource type="Resource" id="Resource_kwfm3"] | ||
| script = ExtResource("4_663xp") | ||
| action = SubResource("Resource_nr16a") | ||
| metadata/_custom_type_script = "uid://d0uvf6jnorxpw" | ||
|
|
||
| [sub_resource type="Resource" id="Resource_c1t11"] | ||
| script = ExtResource("2_seamv") | ||
| description = "Heals you 10hp each turn." | ||
| triggers = Array[ExtResource("4_663xp")]([SubResource("Resource_kwfm3")]) | ||
| metadata/_custom_type_script = "uid://c2ci25gmhnb4w" | ||
|
|
||
| [resource] | ||
| script = ExtResource("1_3lxtv") | ||
| stacks = Array[ExtResource("2_seamv")]([SubResource("Resource_c1t11")]) | ||
| limited_duration = false | ||
| name = "Regenerate" | ||
| metadata/_custom_type_script = "uid://c4rwprj6d61c0" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| [gd_resource type="Resource" script_class="StatusEffect" format=3 uid="uid://drofrxl7aww0y"] | ||
|
|
||
| [ext_resource type="Script" uid="uid://c4rwprj6d61c0" path="res://scripts/status_effects/status_effect.gd" id="1_btp7v"] | ||
| [ext_resource type="Script" uid="uid://c2ci25gmhnb4w" path="res://scripts/status_effects/status_effect_stack.gd" id="2_a3qf0"] | ||
| [ext_resource type="Script" uid="uid://w6h7oqtjl61k" path="res://scripts/status_effects/status_effect_modifier.gd" id="3_4hhlr"] | ||
| [ext_resource type="Script" uid="uid://d0uvf6jnorxpw" path="res://scripts/status_effects/status_effect_trigger.gd" id="4_vxtwa"] | ||
| [ext_resource type="Script" uid="uid://c84i4tkx4t6au" path="res://scripts/ability/action/heal_action.gd" id="5_gqngc"] | ||
|
|
||
| [sub_resource type="Resource" id="Resource_nr16a"] | ||
| script = ExtResource("5_gqngc") | ||
| heal_amount = 20 | ||
| metadata/_custom_type_script = "uid://c84i4tkx4t6au" | ||
|
|
||
| [sub_resource type="Resource" id="Resource_kwfm3"] | ||
| script = ExtResource("4_vxtwa") | ||
| action = SubResource("Resource_nr16a") | ||
| metadata/_custom_type_script = "uid://d0uvf6jnorxpw" | ||
|
|
||
| [sub_resource type="Resource" id="Resource_c1t11"] | ||
| script = ExtResource("2_a3qf0") | ||
| description = "Heals you 20hp each turn." | ||
| triggers = Array[ExtResource("4_vxtwa")]([SubResource("Resource_kwfm3")]) | ||
| metadata/_custom_type_script = "uid://c2ci25gmhnb4w" | ||
|
|
||
| [resource] | ||
| script = ExtResource("1_btp7v") | ||
| stacks = Array[ExtResource("2_a3qf0")]([SubResource("Resource_c1t11")]) | ||
| limited_duration = false | ||
| name = "Regenerate Level 2" | ||
| metadata/_custom_type_script = "uid://c4rwprj6d61c0" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| [gd_resource type="Resource" script_class="StatusEffect" format=3 uid="uid://beqwfdr24afn5"] | ||
|
|
||
| [ext_resource type="Script" uid="uid://c4rwprj6d61c0" path="res://scripts/status_effects/status_effect.gd" id="1_omrdo"] | ||
| [ext_resource type="Script" uid="uid://c2ci25gmhnb4w" path="res://scripts/status_effects/status_effect_stack.gd" id="2_glgyw"] | ||
| [ext_resource type="Script" uid="uid://w6h7oqtjl61k" path="res://scripts/status_effects/status_effect_modifier.gd" id="3_wsmau"] | ||
| [ext_resource type="Script" uid="uid://d0uvf6jnorxpw" path="res://scripts/status_effects/status_effect_trigger.gd" id="4_2f3ui"] | ||
| [ext_resource type="Script" uid="uid://c84i4tkx4t6au" path="res://scripts/ability/action/heal_action.gd" id="5_hmm2u"] | ||
| [ext_resource type="Script" uid="uid://dkyoonc2qagl3" path="res://scripts/ability/action/luck_chance_action.gd" id="6_lchance"] | ||
| [ext_resource type="Script" uid="uid://4uj0ujy2m4of" path="res://scripts/ability/action/remove_status_action.gd" id="7_rmstat"] | ||
|
|
||
| [sub_resource type="Resource" id="Resource_nr16a"] | ||
| script = ExtResource("5_hmm2u") | ||
| heal_amount = 20 | ||
| metadata/_custom_type_script = "uid://c84i4tkx4t6au" | ||
|
|
||
| [sub_resource type="Resource" id="Resource_kwfm3"] | ||
| script = ExtResource("4_2f3ui") | ||
| action = SubResource("Resource_nr16a") | ||
| metadata/_custom_type_script = "uid://d0uvf6jnorxpw" | ||
|
|
||
| [sub_resource type="Resource" id="Resource_rmv01"] | ||
| script = ExtResource("7_rmstat") | ||
| remove_stacks = 99 | ||
| metadata/_custom_type_script = "uid://4uj0ujy2m4of" | ||
|
|
||
| [sub_resource type="Resource" id="Resource_luck01"] | ||
| script = ExtResource("6_lchance") | ||
| success_action = SubResource("Resource_rmv01") | ||
| metadata/_custom_type_script = "uid://dkyoonc2qagl3" | ||
|
|
||
| [sub_resource type="Resource" id="Resource_cure01"] | ||
| script = ExtResource("4_2f3ui") | ||
| action = SubResource("Resource_luck01") | ||
| metadata/_custom_type_script = "uid://d0uvf6jnorxpw" | ||
|
|
||
| [sub_resource type="Resource" id="Resource_c1t11"] | ||
| script = ExtResource("2_glgyw") | ||
| description = "Heals you 20hp each turn. May cure an ailment." | ||
| triggers = Array[ExtResource("4_2f3ui")]([SubResource("Resource_kwfm3"), SubResource("Resource_cure01")]) | ||
| metadata/_custom_type_script = "uid://c2ci25gmhnb4w" | ||
|
|
||
| [resource] | ||
| script = ExtResource("1_omrdo") | ||
| stacks = Array[ExtResource("2_glgyw")]([SubResource("Resource_c1t11")]) | ||
| limited_duration = false | ||
| name = "Regenerate Level 3" | ||
| metadata/_custom_type_script = "uid://c4rwprj6d61c0" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| [gd_resource type="Resource" script_class="StatusEffect" format=3 uid="uid://r64xcaj0mr4c"] | ||
|
|
||
| [ext_resource type="Script" uid="uid://c4rwprj6d61c0" path="res://scripts/status_effects/status_effect.gd" id="1_sqsqw"] | ||
| [ext_resource type="Script" uid="uid://c2ci25gmhnb4w" path="res://scripts/status_effects/status_effect_stack.gd" id="2_kggwh"] | ||
| [ext_resource type="Script" uid="uid://w6h7oqtjl61k" path="res://scripts/status_effects/status_effect_modifier.gd" id="3_cwu6n"] | ||
| [ext_resource type="Script" uid="uid://d0uvf6jnorxpw" path="res://scripts/status_effects/status_effect_trigger.gd" id="4_2gru0"] | ||
| [ext_resource type="Script" uid="uid://c84i4tkx4t6au" path="res://scripts/ability/action/heal_action.gd" id="5_o2d0y"] | ||
| [ext_resource type="Script" uid="uid://dkyoonc2qagl3" path="res://scripts/ability/action/luck_chance_action.gd" id="6_v6n5j"] | ||
| [ext_resource type="Script" uid="uid://4uj0ujy2m4of" path="res://scripts/ability/action/remove_status_action.gd" id="7_vnlfn"] | ||
|
|
||
| [sub_resource type="Resource" id="Resource_nr16a"] | ||
| script = ExtResource("5_o2d0y") | ||
| heal_amount = 30 | ||
| overheal = true | ||
| metadata/_custom_type_script = "uid://c84i4tkx4t6au" | ||
|
|
||
| [sub_resource type="Resource" id="Resource_kwfm3"] | ||
| script = ExtResource("4_2gru0") | ||
| action = SubResource("Resource_nr16a") | ||
| metadata/_custom_type_script = "uid://d0uvf6jnorxpw" | ||
|
|
||
| [sub_resource type="Resource" id="Resource_rmv01"] | ||
| script = ExtResource("7_vnlfn") | ||
| remove_stacks = 99 | ||
| metadata/_custom_type_script = "uid://4uj0ujy2m4of" | ||
|
|
||
| [sub_resource type="Resource" id="Resource_luck01"] | ||
| script = ExtResource("6_v6n5j") | ||
| success_action = SubResource("Resource_rmv01") | ||
| metadata/_custom_type_script = "uid://dkyoonc2qagl3" | ||
|
|
||
| [sub_resource type="Resource" id="Resource_cure01"] | ||
| script = ExtResource("4_2gru0") | ||
| action = SubResource("Resource_luck01") | ||
| metadata/_custom_type_script = "uid://d0uvf6jnorxpw" | ||
|
|
||
| [sub_resource type="Resource" id="Resource_c1t11"] | ||
| script = ExtResource("2_kggwh") | ||
| description = "Heals you 30hp each turn. May cure an ailment. Can heal past max HP." | ||
| triggers = Array[ExtResource("4_2gru0")]([SubResource("Resource_kwfm3"), SubResource("Resource_cure01")]) | ||
| metadata/_custom_type_script = "uid://c2ci25gmhnb4w" | ||
|
|
||
| [resource] | ||
| script = ExtResource("1_sqsqw") | ||
| stacks = Array[ExtResource("2_kggwh")]([SubResource("Resource_c1t11")]) | ||
| limited_duration = false | ||
| name = "Regenerate Level 4" | ||
| metadata/_custom_type_script = "uid://c4rwprj6d61c0" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,14 @@ extends TargetAction | |
| class_name HealAction | ||
|
|
||
| @export var heal_amount: int | ||
| @export var overheal: bool | ||
|
|
||
| func run(context: ActionContext) -> void: | ||
| for target in resolve_targets(context): | ||
| BattleManager.apply_healing(heal_amount, context.source, target) | ||
| if overheal: | ||
| var overflow = maxi(0, target.current_health + heal_amount - target.max_health) | ||
| target.max_health += overflow | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this directly modifies max health, it would permanently increase the maximum health of the character which I don't think is ideal. It might be better to add some sort of "overheal" or "shield" field to the BattleCharacter class to use here, and then update its "on_damage_received" function to reduce that field first before the character's actual health. |
||
| BattleManager.apply_healing(heal_amount, context.source, target) | ||
|
|
||
| else: | ||
| BattleManager.apply_healing(heal_amount, context.source, target) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Along with the overheal toggle, I believe there should also be a way to configure a maximum amount of overheal. This could also use -1 to disable the limit.