Skip to content

Commit

Permalink
Merge pull request #13 from Turtyo/3-override
Browse files Browse the repository at this point in the history
Added `@Override` comments for children classes that implement a function declared in a parent class
  • Loading branch information
Turtyo authored Dec 9, 2023
2 parents 2fa5088 + a8cbe21 commit 39dd5ad
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Buffs/Buff_Poison.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ extends BuffBase
class_name Buff_Poison
## Poison deals damage to the owning Entity at the start of their turn


# @Override
func on_turn_start() -> void:
var damage_data: DealDamageData = DealDamageData.new()
damage_data.damage = buff_power
Expand Down
2 changes: 1 addition & 1 deletion Buffs/Buff_Strength.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ extends BuffBase
class_name Buff_Strength
## Strength buff increases an Entity's damage stat


# @Override
func get_modified_stats(stats: EntityStats) -> EntityStats:
stats.damage_dealt_increase += buff_power
return stats
2 changes: 1 addition & 1 deletion Buffs/Buff_Vulnerability.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ extends BuffBase
class_name Buff_Vulnerability
## Vulnerability buff increases the amount of damage an Entity takes from attacks


# @Override
func get_modified_stats(stats: EntityStats) -> EntityStats:
stats.damage_taken_increase += buff_power
return stats
2 changes: 1 addition & 1 deletion Buffs/Buff_Weakness.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ extends BuffBase
class_name Buff_Weakness
## Vulnerability buff decreases the amount of damage that an Entity deals


# @Override
func get_modified_stats(stats: EntityStats) -> EntityStats:
stats.damage_dealt_increase -= buff_power
return stats
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ If you are writing code that implements something new, please provide test files

As of the writing of this CONTRIBUTING.md there is no code formatter for Godot, even though it might come later. Try to follow the code conventions of the [GDScript style guide](https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/gdscript_styleguide.html)

Use static typing whenever possible.
- Use static typing whenever possible.
- Add # @Override for children classes that implement a function declared in a parent class.
2 changes: 1 addition & 1 deletion Cards/Card_DamageHealth.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ extends CardBase
class_name Card_DamageHealth
# Deals damage equal to the amount of health that the caster has lost.


# @Override
func _deal_damage(caster: Entity, target: Entity) -> void:
var health_lost: float = caster.get_health_component().max_health - caster.get_health_component().current_health

Expand Down
2 changes: 1 addition & 1 deletion Entity/Enemy/Enemy.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ extends Entity
class_name Enemy
## Base enemy entity class.


# @Override
func _ready() -> void:
super()
PhaseManager.on_phase_changed.connect(_on_phase_changed)
Expand Down
2 changes: 1 addition & 1 deletion Entity/Player/Player.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ extends Entity
class_name Player
## Base player Entity class.


# @Override
func _ready() -> void:
super()
PlayerManager.set_player(self)
Expand Down

0 comments on commit 39dd5ad

Please sign in to comment.