154 lines
4.2 KiB
Haskell
154 lines
4.2 KiB
Haskell
module Units.Debug
|
|
( basic
|
|
, freeMoveTester)
|
|
where
|
|
|
|
import GameModel
|
|
( Armor(..)
|
|
, BaseStats(..)
|
|
, BoardState
|
|
, CharacterIdentifier
|
|
, Choice
|
|
, DamageType(..)
|
|
, Effect(..)
|
|
, Stat(..)
|
|
, Token(..)
|
|
, Trigger(..), ixCharacter, tokenCount, ofToken
|
|
, forcedMove, ForcedMoveType (Pull), Player (..)
|
|
)
|
|
import Units.Components
|
|
( AttackT(..)
|
|
, anyTarget
|
|
, buildAttack
|
|
, SelfAbilityT(..)
|
|
, mkSelfAbility, inflictTokens, pull, push
|
|
)
|
|
import Lens.Micro
|
|
|
|
basic :: BaseStats
|
|
basic = BaseStats
|
|
{ name = "Basic Debug Unit"
|
|
, hp = 4
|
|
, mov = 4
|
|
, df = 4
|
|
, arm = NoArmor
|
|
, hooks = basicHooks
|
|
, actions = basicActions
|
|
, statBonus = basicStatBonuses
|
|
}
|
|
|
|
basicHooks :: BoardState -> CharacterIdentifier -> Trigger -> [Effect]
|
|
basicHooks _ _ TurnStart = []
|
|
basicHooks _ _ (TookDamage _) = []
|
|
basicHooks _ _ (Died _ _) = []
|
|
basicHooks _ _ (EndMove _) = []
|
|
|
|
basicActions :: [CharacterIdentifier -> Choice]
|
|
basicActions =
|
|
[ buildAttack $ AttackT
|
|
{ tName = "Peashooter"
|
|
, tRange = (1, 3)
|
|
, tValidTargets = anyTarget
|
|
, tMelee = False
|
|
, tDamageType = BasicDamage
|
|
, tDamageAmount = 1
|
|
, tHeadshotEffects = []
|
|
, tStandardEffects = []
|
|
}
|
|
, buildAttack $ AttackT
|
|
{ tName = "Jarate"
|
|
, tRange = (1, 3)
|
|
, tValidTargets = anyTarget
|
|
, tMelee = False
|
|
, tDamageType = BasicDamage
|
|
, tDamageAmount = 0
|
|
, tHeadshotEffects = []
|
|
, tStandardEffects = [inflictTokens VitalVulnr (-1)]
|
|
}
|
|
, buildAttack $ AttackT
|
|
{ tName = "Slime"
|
|
, tRange = (1, 3)
|
|
, tValidTargets = anyTarget
|
|
, tMelee = False
|
|
, tDamageType = BasicDamage
|
|
, tDamageAmount = 0
|
|
, tHeadshotEffects = []
|
|
, tStandardEffects = [inflictTokens SpeedSlow (-1)]
|
|
}
|
|
, buildAttack $ AttackT
|
|
{ tName = "Nerf"
|
|
, tRange = (1, 3)
|
|
, tValidTargets = anyTarget
|
|
, tMelee = False
|
|
, tDamageType = BasicDamage
|
|
, tDamageAmount = 0
|
|
, tHeadshotEffects = []
|
|
, tStandardEffects = [inflictTokens StrWeak (-1)]
|
|
}
|
|
, buildAttack $ AttackT
|
|
{ tName = "Yoink"
|
|
, tRange = (1, 4)
|
|
, tValidTargets = anyTarget
|
|
, tMelee = False
|
|
, tDamageType = BasicDamage
|
|
, tDamageAmount = 0
|
|
, tHeadshotEffects = []
|
|
, tStandardEffects = [pull 3]
|
|
}
|
|
, buildAttack $ AttackT
|
|
{ tName = "Yeet"
|
|
, tRange = (1, 4)
|
|
, tValidTargets = anyTarget
|
|
, tMelee = False
|
|
, tDamageType = BasicDamage
|
|
, tDamageAmount = 0
|
|
, tHeadshotEffects = []
|
|
, tStandardEffects = [push 3]
|
|
}
|
|
, mkSelfAbility $ SelfAbilityT
|
|
{ tName = "Calcify"
|
|
, tEffects = [inflictTokens VitalVulnr 1]
|
|
}
|
|
, mkSelfAbility $ SelfAbilityT
|
|
{ tName = "Zoomify"
|
|
, tEffects = [inflictTokens SpeedSlow 1]
|
|
}
|
|
, mkSelfAbility $ SelfAbilityT
|
|
{ tName = "Get String"
|
|
, tEffects = [inflictTokens StrWeak 1]
|
|
}
|
|
]
|
|
|
|
basicStatBonuses :: BoardState -> CharacterIdentifier -> Stat a -> a
|
|
basicStatBonuses _ _ AttackDice = 0
|
|
basicStatBonuses _ _ DefenseDice = 0
|
|
basicStatBonuses _ _ FreeMove = False
|
|
|
|
freeMoveTester :: BaseStats
|
|
freeMoveTester = BaseStats
|
|
{ name = "Free Move Debug Unit"
|
|
, hp = 4
|
|
, mov = 4
|
|
, df = 1
|
|
, arm = NoArmor
|
|
, hooks = freeMoveHooks
|
|
, actions = freeMoveActions
|
|
, statBonus = freeMoveStatBonuses
|
|
}
|
|
|
|
freeMoveHooks :: BoardState -> CharacterIdentifier -> Trigger -> [Effect]
|
|
freeMoveHooks _ _ TurnStart = []
|
|
freeMoveHooks _ _ (TookDamage _) = []
|
|
freeMoveHooks _ _ (Died _ _) = []
|
|
freeMoveHooks _ _ (EndMove _) = []
|
|
|
|
freeMoveActions :: [CharacterIdentifier -> Choice]
|
|
freeMoveActions =
|
|
[
|
|
]
|
|
|
|
freeMoveStatBonuses :: BoardState -> CharacterIdentifier -> Stat a -> a
|
|
freeMoveStatBonuses _ _ AttackDice = 0
|
|
freeMoveStatBonuses _ _ DefenseDice = 0
|
|
freeMoveStatBonuses board cid FreeMove = -- Has free movement when below max health
|
|
maybe True (<4) $ board ^? ixCharacter cid . tokenCount . ofToken Health |