You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
109 lines
3.4 KiB
109 lines
3.4 KiB
extends Node
|
|
|
|
|
|
class Someone extends Object:
|
|
var name : String
|
|
|
|
func _init(name : String) -> void:
|
|
self.name = name
|
|
|
|
class Motion extends Object:
|
|
var originator : Someone
|
|
var animation : String
|
|
var stamina_change : float
|
|
|
|
func _init(originator : Someone, animation : String, stamina_change : float = 0) -> void:
|
|
self.originator = originator
|
|
self.animation = animation
|
|
self.stamina_change = stamina_change
|
|
|
|
class Recover extends Motion:
|
|
''' Animation '''
|
|
pass
|
|
|
|
class Reaction extends Motion:
|
|
var hp_change : float
|
|
|
|
func _init(originator : Someone, animation: String, stamina_costs: float, hp_change : float):
|
|
super._init(originator, animation, -stamina_costs)
|
|
self.hp_change = hp_change
|
|
|
|
class Counter extends Reaction:
|
|
var damage : float
|
|
|
|
func _init(originator : Someone, animation: String, stamina_costs: float, damage : float):
|
|
super._init(originator, animation, -stamina_costs, 0)
|
|
self.damage = damage
|
|
|
|
class Defense extends Reaction:
|
|
var successful : bool
|
|
|
|
func _init(originator : Someone, animation: String, stamina_costs: float, hp_change : float):
|
|
super._init(originator, animation, -stamina_costs, hp_change)
|
|
self.successful = hp_change == 0.0
|
|
|
|
class Block extends Defense:
|
|
func _init(originator : Someone, animation : String, stamina_costs: float, hp_change : float):
|
|
super._init(originator, animation, stamina_costs, hp_change)
|
|
|
|
class Evade extends Defense:
|
|
''' Successfully, evaded? '''
|
|
|
|
func _init(originator : Someone, animation : String, stamina_costs: float, hp_change : float):
|
|
super._init(originator, animation, stamina_costs, hp_change)
|
|
|
|
class Absorb extends Reaction:
|
|
''' Actually, accept being hit '''
|
|
|
|
func _init(originator : Someone, animation: String, stamina_costs: float, hp_change : float):
|
|
super._init(originator, animation, -stamina_costs, hp_change)
|
|
|
|
|
|
class Action extends Motion:
|
|
pass
|
|
|
|
class ActionOnSelf extends Action:
|
|
pass
|
|
|
|
class Wait extends ActionOnSelf:
|
|
func _init(originator : Someone, animation : String, stamina_gain : float):
|
|
super._init(originator, animation, stamina_gain)
|
|
|
|
class Buff extends ActionOnSelf:
|
|
func _init(originator : Someone, animation : String) -> void:
|
|
super._init(originator, animation, 1.0)
|
|
|
|
class ActionOnOpponent extends Action:
|
|
var opponent : Someone
|
|
var reaction : Reaction
|
|
|
|
func _init(originator : Someone, animation : String, opponent : Someone, stamina_costs : float, reaction : Reaction) -> void:
|
|
super._init(originator, animation, -stamina_costs)
|
|
self.opponent = opponent
|
|
self.reaction = reaction
|
|
|
|
class Attack extends ActionOnOpponent:
|
|
var damage : float
|
|
|
|
func _init(originator : Someone, animation : String, opponent : Someone, stamina_costs : float, reaction : Reaction) -> void:
|
|
super._init(originator, animation, opponent, stamina_costs, reaction)
|
|
|
|
class Debuff extends ActionOnOpponent:
|
|
func _init(originator : Someone, animation : String, opponent : Someone, stamina_costs : float, reaction : Reaction) -> void:
|
|
super._init(originator, animation, opponent, stamina_costs, reaction)
|
|
|
|
class MotionReport:
|
|
var player1 : Someone
|
|
var player2 : Someone
|
|
var motions : Array[Motion]
|
|
|
|
func _init():
|
|
self.player1 = Someone.new("John")
|
|
self.player2 = Someone.new("Joe")
|
|
self.motions = [
|
|
Attack.new(player1, "Kick", player2, 1.0, Absorb.new(player2, "Hit", 1, 12.0)),
|
|
Buff.new(player2, "SSJ"),
|
|
Attack.new(player1, "Punch", player2, 2.0, Block.new(player2, "Block", 1.0, true)),
|
|
Wait.new(player2, "Wait", 5.0)
|
|
]
|