Change battle actions to use battle decisions instead.
This commit is contained in:
50
battle/action/BattleMove.gd
Normal file
50
battle/action/BattleMove.gd
Normal file
@@ -0,0 +1,50 @@
|
||||
class_name BattleMove extends BattleAction
|
||||
|
||||
enum MoveType {
|
||||
PHYSICAL,
|
||||
ABILITY,
|
||||
MAGICAL,
|
||||
}
|
||||
|
||||
var name:String
|
||||
var power:int
|
||||
var mpCost:int
|
||||
var accuracy:float
|
||||
var moveType:MoveType
|
||||
var fieldUse:bool
|
||||
|
||||
func _init(params:Dictionary) -> void:
|
||||
self.name = params.get("name", "Unknown Move")
|
||||
self.power = params.get("power", 0)
|
||||
self.mpCost = params.get("mpCost", 0)
|
||||
self.speedModifier = params.get("speedModifier", 1.0)
|
||||
self.accuracy = params.get("accuracy", 1.0)
|
||||
self.moveType = params.get("moveType", MoveType.PHYSICAL)
|
||||
self.fieldUse = params.get("fieldUse", false)
|
||||
|
||||
func getPriority(_fighter:BattleFighter) -> float:
|
||||
return 1.0
|
||||
|
||||
# Moves
|
||||
static var MOVE_PUNCH = BattleMove.new({
|
||||
"name": "Punch",
|
||||
"power": 15,
|
||||
"accuracy": 0.95,
|
||||
"moveType": MoveType.PHYSICAL
|
||||
})
|
||||
|
||||
static var MOVE_FIRE1 = BattleMove.new({
|
||||
"name": "Fire",
|
||||
"power": 25,
|
||||
"mpCost": 5,
|
||||
"accuracy": 0.9,
|
||||
"moveType": MoveType.MAGICAL
|
||||
})
|
||||
|
||||
static var MOVE_HEAL1 = BattleMove.new({
|
||||
"name": "Heal",
|
||||
"power": -20,
|
||||
"mpCost": 8,
|
||||
"accuracy": 1.0,
|
||||
"moveType": MoveType.ABILITY
|
||||
})
|
||||
Reference in New Issue
Block a user