74 lines
1.6 KiB
Haskell
74 lines
1.6 KiB
Haskell
module Units.Carcass
|
|
( gunwight
|
|
)
|
|
where
|
|
|
|
import GameModel
|
|
( adjacentAllies
|
|
, ActingUnit
|
|
, Armor(..)
|
|
, BaseStats(..)
|
|
, BoardState
|
|
, CharacterIdentifier
|
|
, Choice
|
|
, DamageType(..)
|
|
, Stat(..)
|
|
, Token(..)
|
|
, Trait(..)
|
|
, Modifier(..)
|
|
)
|
|
import Units.Components
|
|
( AttackT(..)
|
|
, anyTarget
|
|
, buildAttack, inflictTokens, push
|
|
)
|
|
import Data.Monoid (Sum)
|
|
|
|
gunwight :: BaseStats
|
|
gunwight = BaseStats
|
|
{ name = "Gunwight"
|
|
, hp = 2
|
|
, mov = 2
|
|
, df = 4
|
|
, arm = NoArmor
|
|
, actions = gunwightActions
|
|
, traits = [formation]
|
|
}
|
|
|
|
gunwightActions :: [ActingUnit -> Choice]
|
|
gunwightActions =
|
|
[ buildAttack $ AttackT
|
|
{ tName = "OL45"
|
|
, tRange = (2, 3)
|
|
, tValidTargets = anyTarget
|
|
, tMelee = False
|
|
, tDamageType = Unblockable
|
|
, tDamageAmount = 2
|
|
, tHeadshotEffects = [inflictTokens VitalVulnr (-1)]
|
|
, tStandardEffects = []
|
|
}
|
|
, buildAttack $ AttackT
|
|
{ tName = "Baton"
|
|
, tRange = (1, 1)
|
|
, tValidTargets = anyTarget
|
|
, tMelee = True
|
|
, tDamageType = BasicDamage
|
|
, tDamageAmount = 0
|
|
, tStandardEffects = [push 1]
|
|
, tHeadshotEffects = []
|
|
}
|
|
]
|
|
|
|
formation :: Trait
|
|
formation = Trait
|
|
{ traitName = "Formation"
|
|
, traitHooks = []
|
|
, traitModifiers = [formationModifier]
|
|
}
|
|
where
|
|
formationF :: BoardState -> CharacterIdentifier -> Sum Int
|
|
formationF board cid = if adjacentAllies board cid /= Just [] then 1 else 0
|
|
formationModifier = Modifier
|
|
{ modifierStat = AttackDice
|
|
, modifierEffect = formationF
|
|
} |