Skip to content

Commit

Permalink
Migration V132
Browse files Browse the repository at this point in the history
  • Loading branch information
Janiczek committed Nov 7, 2024
1 parent cd4089a commit 4896fcc
Show file tree
Hide file tree
Showing 36 changed files with 1,390 additions and 0 deletions.
54 changes: 54 additions & 0 deletions src/Evergreen/Migrate/V132.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
module Evergreen.Migrate.V132 exposing (..)

{-| This migration file was automatically generated by the lamdera compiler.
It includes:
- A migration for each of the 6 Lamdera core types that has changed
- A function named `migrate_ModuleName_TypeName` for each changed/custom type
Expect to see:
- `Unimplementеd` values as placeholders wherever I was unable to figure out a clear migration path for you
- `@NOTICE` comments for things you should know about, i.e. new custom type constructors that won't get any
value mappings from the old type by default
You can edit this file however you wish! It won't be generated again.
See <https://dashboard.lamdera.app/docs/evergreen> for more info.
-}

import Evergreen.V129.Types
import Evergreen.V132.Types
import Lamdera.Migrations exposing (..)


frontendModel : Evergreen.V129.Types.FrontendModel -> ModelMigration Evergreen.V132.Types.FrontendModel Evergreen.V132.Types.FrontendMsg
frontendModel _ =
ModelReset


backendModel : Evergreen.V129.Types.BackendModel -> ModelMigration Evergreen.V132.Types.BackendModel Evergreen.V132.Types.BackendMsg
backendModel _ =
ModelReset


frontendMsg : Evergreen.V129.Types.FrontendMsg -> MsgMigration Evergreen.V132.Types.FrontendMsg Evergreen.V132.Types.FrontendMsg
frontendMsg _ =
MsgOldValueIgnored


toBackend : Evergreen.V129.Types.ToBackend -> MsgMigration Evergreen.V132.Types.ToBackend Evergreen.V132.Types.BackendMsg
toBackend _ =
MsgOldValueIgnored


backendMsg : Evergreen.V129.Types.BackendMsg -> MsgMigration Evergreen.V132.Types.BackendMsg Evergreen.V132.Types.BackendMsg
backendMsg _ =
MsgOldValueIgnored


toFrontend : Evergreen.V129.Types.ToFrontend -> MsgMigration Evergreen.V132.Types.ToFrontend Evergreen.V132.Types.FrontendMsg
toFrontend _ =
MsgOldValueIgnored
24 changes: 24 additions & 0 deletions src/Evergreen/V132/Data/Auth.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module Evergreen.V132.Data.Auth exposing (..)


type Plaintext
= Plaintext


type Password a
= Password String


type alias Auth a =
{ name : String
, password : Password a
, worldName : String
}


type Verified
= Verified


type Hashed
= Hashed
33 changes: 33 additions & 0 deletions src/Evergreen/V132/Data/Barter.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module Evergreen.V132.Data.Barter exposing (..)

import Dict
import Evergreen.V132.Data.Item
import SeqDict


type Message
= BarterIsEmpty
| PlayerOfferNotValuableEnough
| YouGaveStuffForFree


type TransferNPosition
= PlayerKeptItem Evergreen.V132.Data.Item.Id
| VendorKeptItem Evergreen.V132.Data.Item.Id
| PlayerTradedItem Evergreen.V132.Data.Item.Id
| VendorTradedItem Evergreen.V132.Data.Item.Id
| PlayerKeptCaps
| VendorKeptCaps
| PlayerTradedCaps
| VendorTradedCaps


type alias State =
{ playerItems : Dict.Dict Evergreen.V132.Data.Item.Id Int
, vendorItems : Dict.Dict Evergreen.V132.Data.Item.Id Int
, playerCaps : Int
, vendorCaps : Int
, lastMessage : Maybe Message
, transferNInputs : SeqDict.SeqDict TransferNPosition String
, activeN : Maybe TransferNPosition
}
20 changes: 20 additions & 0 deletions src/Evergreen/V132/Data/Enemy/Type.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module Evergreen.V132.Data.Enemy.Type exposing (..)


type EnemyType
= SilverGecko
| ToughSilverGecko
| GoldenGecko
| ToughGoldenGecko
| FireGecko
| ToughFireGecko
| Brahmin
| AngryBrahmin
| WeakBrahmin
| WildBrahmin
| GiantAnt
| ToughGiantAnt
| BlackRadscorpion
| LesserBlackRadscorpion
| LesserRadscorpion
| Radscorpion
88 changes: 88 additions & 0 deletions src/Evergreen/V132/Data/Fight.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
module Evergreen.V132.Data.Fight exposing (..)

import Evergreen.V132.Data.Fight.AttackStyle
import Evergreen.V132.Data.Fight.Critical
import Evergreen.V132.Data.Fight.OpponentType
import Evergreen.V132.Data.Item
import Evergreen.V132.Data.Item.Kind


type Who
= Attacker
| Target


type CommandRejectionReason
= Heal_ItemNotPresent
| Heal_ItemDoesNotHeal
| Heal_AlreadyFullyHealed
| HealWithAnything_NoHealingItem
| HealWithAnything_AlreadyFullyHealed
| MoveForward_AlreadyNextToEachOther
| Attack_NotCloseEnough
| Attack_NotEnoughAP


type Action
= Start
{ distanceHexes : Int
}
| ComeCloser
{ hexes : Int
, remainingDistanceHexes : Int
}
| Attack
{ damage : Int
, attackStyle : Evergreen.V132.Data.Fight.AttackStyle.AttackStyle
, remainingHp : Int
, critical : Maybe ( List Evergreen.V132.Data.Fight.Critical.Effect, Evergreen.V132.Data.Fight.Critical.Message )
, apCost : Int
}
| Miss
{ attackStyle : Evergreen.V132.Data.Fight.AttackStyle.AttackStyle
, apCost : Int
}
| Heal
{ itemKind : Evergreen.V132.Data.Item.Kind.Kind
, healedHp : Int
, newHp : Int
}
| SkipTurn
| KnockedOut
| StandUp
{ apCost : Int
}
| FailToDoAnything CommandRejectionReason


type Result
= AttackerWon
{ xpGained : Int
, capsGained : Int
, itemsGained : List Evergreen.V132.Data.Item.Item
}
| TargetWon
{ xpGained : Int
, capsGained : Int
, itemsGained : List Evergreen.V132.Data.Item.Item
}
| TargetAlreadyDead
| BothDead
| NobodyDead
| NobodyDeadGivenUp


type alias Equipment =
{ weapon : Maybe Evergreen.V132.Data.Item.Kind.Kind
, armor : Maybe Evergreen.V132.Data.Item.Kind.Kind
}


type alias Info =
{ attacker : Evergreen.V132.Data.Fight.OpponentType.OpponentType
, target : Evergreen.V132.Data.Fight.OpponentType.OpponentType
, log : List ( Who, Action )
, result : Result
, attackerEquipment : Maybe Equipment
, targetEquipment : Maybe Equipment
}
12 changes: 12 additions & 0 deletions src/Evergreen/V132/Data/Fight/AimedShot.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module Evergreen.V132.Data.Fight.AimedShot exposing (..)


type AimedShot
= Head
| Torso
| Eyes
| Groin
| LeftArm
| RightArm
| LeftLeg
| RightLeg
14 changes: 14 additions & 0 deletions src/Evergreen/V132/Data/Fight/AttackStyle.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module Evergreen.V132.Data.Fight.AttackStyle exposing (..)

import Evergreen.V132.Data.Fight.AimedShot


type AttackStyle
= UnarmedUnaimed
| UnarmedAimed Evergreen.V132.Data.Fight.AimedShot.AimedShot
| MeleeUnaimed
| MeleeAimed Evergreen.V132.Data.Fight.AimedShot.AimedShot
| Throw
| ShootSingleUnaimed
| ShootSingleAimed Evergreen.V132.Data.Fight.AimedShot.AimedShot
| ShootBurst
22 changes: 22 additions & 0 deletions src/Evergreen/V132/Data/Fight/Critical.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module Evergreen.V132.Data.Fight.Critical exposing (..)


type Effect
= Knockout
| Knockdown
| CrippledLeftLeg
| CrippledRightLeg
| CrippledLeftArm
| CrippledRightArm
| Blinded
| Death
| BypassArmor
| LoseNextTurn


type Message
= PlayerMessage
{ you : String
, them : String
}
| OtherMessage String
15 changes: 15 additions & 0 deletions src/Evergreen/V132/Data/Fight/OpponentType.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module Evergreen.V132.Data.Fight.OpponentType exposing (..)

import Evergreen.V132.Data.Enemy.Type
import Evergreen.V132.Data.Player.PlayerName


type alias PlayerOpponent =
{ name : Evergreen.V132.Data.Player.PlayerName.PlayerName
, xp : Int
}


type OpponentType
= Npc Evergreen.V132.Data.Enemy.Type.EnemyType
| Player PlayerOpponent
66 changes: 66 additions & 0 deletions src/Evergreen/V132/Data/FightStrategy.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
module Evergreen.V132.Data.FightStrategy exposing (..)

import Evergreen.V132.Data.Fight.AttackStyle
import Evergreen.V132.Data.Item.Kind


type Value
= MyHP
| MyMaxHP
| MyAP
| MyItemCount Evergreen.V132.Data.Item.Kind.Kind
| MyHealingItemCount
| MyAmmoCount
| ItemsUsed Evergreen.V132.Data.Item.Kind.Kind
| HealingItemsUsed
| AmmoUsed
| ChanceToHit Evergreen.V132.Data.Fight.AttackStyle.AttackStyle
| RangeNeeded Evergreen.V132.Data.Fight.AttackStyle.AttackStyle
| Distance
| Number Int


type Operator
= LT_
| LTE
| EQ_
| NE
| GTE
| GT_


type alias OperatorData =
{ lhs : Value
, op : Operator
, rhs : Value
}


type Condition
= Or Condition Condition
| And Condition Condition
| Operator OperatorData
| OpponentIsPlayer
| OpponentIsNPC


type alias IfData =
{ condition : Condition
, then_ : FightStrategy
, else_ : FightStrategy
}


type Command
= Attack Evergreen.V132.Data.Fight.AttackStyle.AttackStyle
| AttackRandomly
| Heal Evergreen.V132.Data.Item.Kind.Kind
| HealWithAnything
| MoveForward
| DoWhatever
| SkipTurn


type FightStrategy
= If IfData
| Command Command
13 changes: 13 additions & 0 deletions src/Evergreen/V132/Data/FightStrategy/Help.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module Evergreen.V132.Data.FightStrategy.Help exposing (..)


type Reference
= Strategy
| Command
| Condition
| Attack
| Aim
| Item
| Value
| Operator
| Number
16 changes: 16 additions & 0 deletions src/Evergreen/V132/Data/HealthStatus.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module Evergreen.V132.Data.HealthStatus exposing (..)


type HealthStatus
= ExactHp
{ current : Int
, max : Int
}
| Unhurt
| SlightlyWounded
| Wounded
| SeverelyWounded
| AlmostDead
| Dead
| Alive
| Unknown
Loading

0 comments on commit 4896fcc

Please sign in to comment.