Skip to content
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

Added @Override comments for children classes that implement a function declared in a parent class #13

Merged
merged 2 commits into from
Dec 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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