-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Comment most of the codebase (except stuff related to animations and map UI)
- Loading branch information
Showing
86 changed files
with
773 additions
and
282 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
class_name EffectAddEnergy extends EffectBase | ||
## Add energy to the player | ||
## | ||
## Refer to [EnergyComponent] for more information. | ||
|
||
# @overide | ||
## @Override [br] | ||
## Refer to [EffectBase] | ||
func apply_effect(_caster: Entity, _target: Entity, value: int) -> void: | ||
PlayerManager.player.get_energy_component().add_energy(value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
class_name EffectApplyStatus extends EffectBase | ||
## Apply a status to the target entity | ||
## | ||
## This class is useful to not have one effect per Status to apply (which was the case before). [br] | ||
## Refer to [StatusBase] and [StatusComponent] for more information about statuses. | ||
|
||
## The status to apply | ||
@export var status_to_apply: StatusBase | ||
|
||
# @Override | ||
## @Override [br] | ||
## Refer to [EffectBase] | ||
@warning_ignore("unused_parameter") | ||
func apply_effect(caster: Entity, target: Entity, value: int) -> void: | ||
target.get_status_component().add_status(status_to_apply, caster) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,19 @@ | ||
# Base class for card effects | ||
class_name EffectBase extends Resource | ||
## The parent class of all effects | ||
## | ||
## An effect is the smallest unit of action that can be done in the game. [br] | ||
## It is a simple action that can be applied to an entity. | ||
## For example, dealing damage, healing, drawing cards... [br] | ||
## Some effects don't do anything on their own and need something more (see [EffectApplyStatus] which applies a status). [br] | ||
## Cards have one or more effects that are applied when the card is played. | ||
|
||
|
||
## Apply the effect to the target entity [br] | ||
## [param caster] The entity that is applying the effect [br] | ||
## [param target] The entity that is the target of the effect [br] | ||
## [param value] A numerical value to quantify the strength of the effect [br] | ||
## The [param caster] and [param target] parameters are used to determine the modification of the [param value] due to the entities' stats (usually modified via Status) [br] | ||
## Refer to [EntityStats] and the related effects to see how this calculation is done. [br] | ||
@warning_ignore("unused_parameter") | ||
func apply_effect(caster: Entity, target: Entity, value: int) -> void: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
class_name EffectDiscardRandom extends EffectBase | ||
## Discard a random card from the player's hand. | ||
## | ||
## This is often used as a penalty effect / side effect of a powerful card. | ||
|
||
# @Override | ||
## @Override [br] | ||
## Refer to [EffectBase] | ||
@warning_ignore("unused_parameter") | ||
func apply_effect(caster: Entity, target: Entity, value: int) -> void: | ||
CardManager.card_container.discard_random_card(value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
class_name EffectDraw extends EffectBase | ||
## Draw one or more cards from the draw pile. [br] | ||
## | ||
## The value of the effect is the number of cards to draw. [br] | ||
## If there are not enough cards in the draw pile, the effect will draw as many cards as possible. [br] | ||
## The discard pile will then be shuffled into the draw pile, and the remaining cards will be drawn. [br] | ||
## This continues until either all the cards are drawn, or the player hand is full. [br] | ||
## Refer to [param max_hand_size] in [CardContainer] for the maximum number of cards that can be held in the player hand. [br] | ||
|
||
# @Override | ||
## @Override [br] | ||
## Refer to [EffectBase] | ||
func apply_effect(caster: Entity, target: Entity, value: int) -> void: | ||
var modified_value: int = EntityStats.get_value_modified_by_stats(GlobalEnums.PossibleModifierNames.DRAW, caster, target, value) | ||
CardManager.card_container.draw_cards(modified_value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
extends Resource | ||
class_name EnergyData | ||
## Defines how much energy is needed to perform an action | ||
## | ||
## This is mainly used for cards for now, but it could be used for other things. [br] | ||
## It also only contains an energy cost for now. Having its own class helps with typing and organization, instead of just using an int. | ||
|
||
|
||
## The energy cost of the action [br] | ||
@export var energy_cost: int = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 11 additions & 11 deletions
22
Cards/Resource/Card_DamageAll.tres → Cards/Resource/Card_DamageAllEnemies.tres
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
[gd_resource type="Resource" script_class="CardBase" load_steps=10 format=3 uid="uid://0x385c3nuq8f"] | ||
|
||
[ext_resource type="Script" path="res://Cards/CardBase.gd" id="1_j02oq"] | ||
[ext_resource type="Script" path="res://Cards/Effects/EffectDamage.gd" id="1_ktww3"] | ||
[ext_resource type="Script" path="res://Cards/Effects/EffectData.gd" id="2_ar7ey"] | ||
[ext_resource type="Script" path="res://Cards/EnergyData.gd" id="3_fws2c"] | ||
[ext_resource type="Script" path="res://Cards/Targeting/TargetAllEnemies.gd" id="3_qkswr"] | ||
[ext_resource type="Script" path="res://Cards/Effects/EffectDamage.gd" id="1_fpg0t"] | ||
[ext_resource type="Script" path="res://Cards/Effects/EffectData.gd" id="2_ib0yg"] | ||
[ext_resource type="Script" path="res://Cards/Targeting/TargetAllEnemies.gd" id="3_rqas5"] | ||
[ext_resource type="Script" path="res://Cards/EnergyData.gd" id="4_yc1ma"] | ||
[ext_resource type="Script" path="res://Cards/CardBase.gd" id="5_cj041"] | ||
|
||
[sub_resource type="Resource" id="Resource_f6djy"] | ||
script = ExtResource("1_ktww3") | ||
script = ExtResource("1_fpg0t") | ||
|
||
[sub_resource type="Resource" id="Resource_4lyyh"] | ||
script = ExtResource("3_qkswr") | ||
script = ExtResource("3_rqas5") | ||
|
||
[sub_resource type="Resource" id="Resource_cwhuj"] | ||
script = ExtResource("2_ar7ey") | ||
script = ExtResource("2_ib0yg") | ||
effect = SubResource("Resource_f6djy") | ||
value = 2 | ||
targeting_function = SubResource("Resource_4lyyh") | ||
|
||
[sub_resource type="Resource" id="Resource_noiey"] | ||
script = ExtResource("3_fws2c") | ||
script = ExtResource("4_yc1ma") | ||
energy_cost = 1 | ||
|
||
[resource] | ||
script = ExtResource("1_j02oq") | ||
script = ExtResource("5_cj041") | ||
application_type = 1 | ||
card_title = "Damage All" | ||
card_description = "Deal 2 to all enemies" | ||
card_effects_data = Array[ExtResource("2_ar7ey")]([SubResource("Resource_cwhuj")]) | ||
card_effects_data = Array[ExtResource("2_ib0yg")]([SubResource("Resource_cwhuj")]) | ||
energy_info = SubResource("Resource_noiey") |
Oops, something went wrong.