Change battle actions to use battle decisions instead.
This commit is contained in:
@@ -102,8 +102,8 @@ func mpRestore(amount:int) -> void:
|
||||
mp = min(mp + amount, maxMp)
|
||||
mpChanged.emit(amount)
|
||||
|
||||
func isCrit() -> bool:
|
||||
# 10% chance of a crit
|
||||
var chance = 10 + min(luck * 5, 60)
|
||||
var roll = randi() % 100
|
||||
return roll < chance
|
||||
func isPlayerControlled() -> bool:
|
||||
return controller == FighterController.PLAYER
|
||||
|
||||
func getAIDecision() -> BattleDecision:
|
||||
return null
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class_name BattleMove
|
||||
class_name BattleMove extends BattleAction
|
||||
|
||||
enum MoveType {
|
||||
PHYSICAL,
|
||||
@@ -9,24 +9,19 @@ enum MoveType {
|
||||
var name:String
|
||||
var power:int
|
||||
var mpCost:int
|
||||
var speedModifier:float
|
||||
var accuracy:float
|
||||
var moveType:MoveType
|
||||
var fieldUse:bool
|
||||
|
||||
func _init(params:Dictionary) -> void:
|
||||
super(params)
|
||||
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 start(_params:Dictionary) -> void:
|
||||
# Implement move execution logic here
|
||||
await UI.TEXTBOX.setTextAndWait("Action")
|
||||
|
||||
# Moves
|
||||
static var MOVE_PUNCH = BattleMove.new({
|
||||
"name": "Punch",
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://gb08hhwk0paw
|
||||
uid://bgq0u537pt5lm
|
||||
|
||||
Reference in New Issue
Block a user