begin adding variant for STRAIGHT_BAT enemy

This commit is contained in:
2025-02-11 18:05:44 +00:00
parent 534852c8bf
commit 3202c67f47
4 changed files with 96 additions and 57 deletions

View File

@@ -25,7 +25,8 @@ struct
| W_PLAT_ID of int
| W_NEXT_PLAT_ID of int
fun mkEnemy (id, health, x, y, xAxis, yAxis, variant, platID, nextPlatID) =
fun mkEnemy
(id, health, x, y, xAxis, yAxis, variant, platID, nextPlatID, batRest) =
{ id = id
, health = health
, x = x
@@ -35,27 +36,106 @@ struct
, variant = variant
, platID = platID
, nextPlatID = nextPlatID
, batRest = batRest
}
fun withPatch (enemy, patch) =
let
val {id, health, x, y, xAxis, yAxis, variant, platID, nextPlatID} = enemy
val {id, health, x, y, xAxis, yAxis, variant, platID, nextPlatID, batRest} =
enemy
in
case patch of
W_HEALTH health =>
mkEnemy (id, health, x, y, xAxis, yAxis, variant, platID, nextPlatID)
mkEnemy
( id
, health
, x
, y
, xAxis
, yAxis
, variant
, platID
, nextPlatID
, batRest
)
| W_X x =>
mkEnemy (id, health, x, y, xAxis, yAxis, variant, platID, nextPlatID)
mkEnemy
( id
, health
, x
, y
, xAxis
, yAxis
, variant
, platID
, nextPlatID
, batRest
)
| W_X_AXIS xAxis =>
mkEnemy (id, health, x, y, xAxis, yAxis, variant, platID, nextPlatID)
mkEnemy
( id
, health
, x
, y
, xAxis
, yAxis
, variant
, platID
, nextPlatID
, batRest
)
| W_Y y =>
mkEnemy (id, health, x, y, xAxis, yAxis, variant, platID, nextPlatID)
mkEnemy
( id
, health
, x
, y
, xAxis
, yAxis
, variant
, platID
, nextPlatID
, batRest
)
| W_Y_AXIS yAxis =>
mkEnemy (id, health, x, y, xAxis, yAxis, variant, platID, nextPlatID)
mkEnemy
( id
, health
, x
, y
, xAxis
, yAxis
, variant
, platID
, nextPlatID
, batRest
)
| W_PLAT_ID platID =>
mkEnemy (id, health, x, y, xAxis, yAxis, variant, platID, nextPlatID)
mkEnemy
( id
, health
, x
, y
, xAxis
, yAxis
, variant
, platID
, nextPlatID
, batRest
)
| W_NEXT_PLAT_ID nextPlatID =>
mkEnemy (id, health, x, y, xAxis, yAxis, variant, platID, nextPlatID)
mkEnemy
( id
, health
, x
, y
, xAxis
, yAxis
, variant
, platID
, nextPlatID
, batRest
)
end
fun withPatches (enemy, lst) =