init
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
extends RefCounted
|
||||
|
||||
# Custom battle action executor: deals triple damage based on user's Attack
|
||||
# ActionId must match the battle action ID in the character's JSON data
|
||||
# The execute method returns a GDBattleResult with SourceDamage/TargetDamage etc.
|
||||
|
||||
func get_action_id():
|
||||
return "gds.triple_attack"
|
||||
|
||||
func execute(action, user, target):
|
||||
var result = GDBattleResult.new()
|
||||
|
||||
var damage = user.AttackValue * 3 - target.DefenceValue
|
||||
if damage < 1:
|
||||
damage = 1
|
||||
|
||||
result.TargetDamage = damage
|
||||
result.TargetDefence = target.DefenceValue
|
||||
result.Result = true
|
||||
|
||||
return result
|
||||
Reference in New Issue
Block a user