Skip to content

Commit 171cd3d

Browse files
committed
Migrate
1 parent b595f0d commit 171cd3d

36 files changed

+1291
-0
lines changed

src/Evergreen/Migrate/V118.elm

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
module Evergreen.Migrate.V118 exposing (..)
2+
3+
{-| This migration file was automatically generated by the lamdera compiler.
4+
5+
It includes:
6+
7+
- A migration for each of the 6 Lamdera core types that has changed
8+
- A function named `migrate_ModuleName_TypeName` for each changed/custom type
9+
10+
Expect to see:
11+
12+
- `Unimplementеd` values as placeholders wherever I was unable to figure out a clear migration path for you
13+
- `@NOTICE` comments for things you should know about, i.e. new custom type constructors that won't get any
14+
value mappings from the old type by default
15+
16+
You can edit this file however you wish! It won't be generated again.
17+
18+
See <https://dashboard.lamdera.app/docs/evergreen> for more info.
19+
20+
-}
21+
22+
import Evergreen.V114.Types
23+
import Evergreen.V118.Types
24+
import Lamdera.Migrations exposing (..)
25+
26+
27+
frontendModel : Evergreen.V114.Types.FrontendModel -> ModelMigration Evergreen.V118.Types.FrontendModel Evergreen.V118.Types.FrontendMsg
28+
frontendModel _ =
29+
ModelReset
30+
31+
32+
backendModel : Evergreen.V114.Types.BackendModel -> ModelMigration Evergreen.V118.Types.BackendModel Evergreen.V118.Types.BackendMsg
33+
backendModel _ =
34+
ModelReset
35+
36+
37+
frontendMsg : Evergreen.V114.Types.FrontendMsg -> MsgMigration Evergreen.V118.Types.FrontendMsg Evergreen.V118.Types.FrontendMsg
38+
frontendMsg _ =
39+
MsgOldValueIgnored
40+
41+
42+
toBackend : Evergreen.V114.Types.ToBackend -> MsgMigration Evergreen.V118.Types.ToBackend Evergreen.V118.Types.BackendMsg
43+
toBackend _ =
44+
MsgOldValueIgnored
45+
46+
47+
backendMsg : Evergreen.V114.Types.BackendMsg -> MsgMigration Evergreen.V118.Types.BackendMsg Evergreen.V118.Types.BackendMsg
48+
backendMsg _ =
49+
MsgOldValueIgnored
50+
51+
52+
toFrontend : Evergreen.V114.Types.ToFrontend -> MsgMigration Evergreen.V118.Types.ToFrontend Evergreen.V118.Types.FrontendMsg
53+
toFrontend _ =
54+
MsgOldValueIgnored

src/Evergreen/V118/Data/Auth.elm

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
module Evergreen.V118.Data.Auth exposing (..)
2+
3+
4+
type Plaintext
5+
= Plaintext
6+
7+
8+
type Password a
9+
= Password String
10+
11+
12+
type alias Auth a =
13+
{ name : String
14+
, password : Password a
15+
, worldName : String
16+
}
17+
18+
19+
type Verified
20+
= Verified
21+
22+
23+
type Hashed
24+
= Hashed

src/Evergreen/V118/Data/Barter.elm

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
module Evergreen.V118.Data.Barter exposing (..)
2+
3+
import Dict
4+
import Evergreen.V118.Data.Item
5+
import SeqDict
6+
7+
8+
type Message
9+
= BarterIsEmpty
10+
| PlayerOfferNotValuableEnough
11+
| YouGaveStuffForFree
12+
13+
14+
type TransferNPosition
15+
= PlayerKeptItem Evergreen.V118.Data.Item.Id
16+
| VendorKeptItem Evergreen.V118.Data.Item.Id
17+
| PlayerTradedItem Evergreen.V118.Data.Item.Id
18+
| VendorTradedItem Evergreen.V118.Data.Item.Id
19+
| PlayerKeptCaps
20+
| VendorKeptCaps
21+
| PlayerTradedCaps
22+
| VendorTradedCaps
23+
24+
25+
type alias State =
26+
{ playerItems : Dict.Dict Evergreen.V118.Data.Item.Id Int
27+
, vendorItems : Dict.Dict Evergreen.V118.Data.Item.Id Int
28+
, playerCaps : Int
29+
, vendorCaps : Int
30+
, lastMessage : Maybe Message
31+
, transferNInputs : SeqDict.SeqDict TransferNPosition String
32+
, activeN : Maybe TransferNPosition
33+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module Evergreen.V118.Data.Enemy.Type exposing (..)
2+
3+
4+
type EnemyType
5+
= SilverGecko
6+
| ToughSilverGecko
7+
| GoldenGecko
8+
| ToughGoldenGecko
9+
| FireGecko
10+
| ToughFireGecko
11+
| Brahmin
12+
| AngryBrahmin
13+
| WeakBrahmin
14+
| WildBrahmin
15+
| GiantAnt
16+
| ToughGiantAnt
17+
| BlackRadscorpion
18+
| LesserBlackRadscorpion
19+
| LesserRadscorpion
20+
| Radscorpion

src/Evergreen/V118/Data/Fight.elm

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
module Evergreen.V118.Data.Fight exposing (..)
2+
3+
import Evergreen.V118.Data.Fight.AttackStyle
4+
import Evergreen.V118.Data.Fight.Critical
5+
import Evergreen.V118.Data.Fight.OpponentType
6+
import Evergreen.V118.Data.Item
7+
import Evergreen.V118.Data.Item.Kind
8+
9+
10+
type Who
11+
= Attacker
12+
| Target
13+
14+
15+
type CommandRejectionReason
16+
= Heal_ItemNotPresent
17+
| Heal_ItemDoesNotHeal
18+
| Heal_AlreadyFullyHealed
19+
| HealWithAnything_NoHealingItem
20+
| HealWithAnything_AlreadyFullyHealed
21+
| MoveForward_AlreadyNextToEachOther
22+
| Attack_NotCloseEnough
23+
| Attack_NotEnoughAP
24+
25+
26+
type Action
27+
= Start
28+
{ distanceHexes : Int
29+
}
30+
| ComeCloser
31+
{ hexes : Int
32+
, remainingDistanceHexes : Int
33+
}
34+
| Attack
35+
{ damage : Int
36+
, attackStyle : Evergreen.V118.Data.Fight.AttackStyle.AttackStyle
37+
, remainingHp : Int
38+
, critical : Maybe ( List Evergreen.V118.Data.Fight.Critical.Effect, Evergreen.V118.Data.Fight.Critical.Message )
39+
, apCost : Int
40+
}
41+
| Miss
42+
{ attackStyle : Evergreen.V118.Data.Fight.AttackStyle.AttackStyle
43+
, apCost : Int
44+
}
45+
| Heal
46+
{ itemKind : Evergreen.V118.Data.Item.Kind.Kind
47+
, healedHp : Int
48+
, newHp : Int
49+
}
50+
| SkipTurn
51+
| KnockedOut
52+
| StandUp
53+
{ apCost : Int
54+
}
55+
| FailToDoAnything CommandRejectionReason
56+
57+
58+
type Result
59+
= AttackerWon
60+
{ xpGained : Int
61+
, capsGained : Int
62+
, itemsGained : List Evergreen.V118.Data.Item.Item
63+
}
64+
| TargetWon
65+
{ xpGained : Int
66+
, capsGained : Int
67+
, itemsGained : List Evergreen.V118.Data.Item.Item
68+
}
69+
| TargetAlreadyDead
70+
| BothDead
71+
| NobodyDead
72+
| NobodyDeadGivenUp
73+
74+
75+
type alias Info =
76+
{ attacker : Evergreen.V118.Data.Fight.OpponentType.OpponentType
77+
, target : Evergreen.V118.Data.Fight.OpponentType.OpponentType
78+
, log : List ( Who, Action )
79+
, result : Result
80+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module Evergreen.V118.Data.Fight.AimedShot exposing (..)
2+
3+
4+
type AimedShot
5+
= Head
6+
| Torso
7+
| Eyes
8+
| Groin
9+
| LeftArm
10+
| RightArm
11+
| LeftLeg
12+
| RightLeg
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module Evergreen.V118.Data.Fight.AttackStyle exposing (..)
2+
3+
import Evergreen.V118.Data.Fight.AimedShot
4+
5+
6+
type AttackStyle
7+
= UnarmedUnaimed
8+
| UnarmedAimed Evergreen.V118.Data.Fight.AimedShot.AimedShot
9+
| MeleeUnaimed
10+
| MeleeAimed Evergreen.V118.Data.Fight.AimedShot.AimedShot
11+
| Throw
12+
| ShootSingleUnaimed
13+
| ShootSingleAimed Evergreen.V118.Data.Fight.AimedShot.AimedShot
14+
| ShootBurst
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module Evergreen.V118.Data.Fight.Critical exposing (..)
2+
3+
4+
type Effect
5+
= Knockout
6+
| Knockdown
7+
| CrippledLeftLeg
8+
| CrippledRightLeg
9+
| CrippledLeftArm
10+
| CrippledRightArm
11+
| Blinded
12+
| Death
13+
| BypassArmor
14+
| LoseNextTurn
15+
16+
17+
type Message
18+
= PlayerMessage
19+
{ you : String
20+
, them : String
21+
}
22+
| OtherMessage String
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module Evergreen.V118.Data.Fight.OpponentType exposing (..)
2+
3+
import Evergreen.V118.Data.Enemy.Type
4+
import Evergreen.V118.Data.Player.PlayerName
5+
6+
7+
type alias PlayerOpponent =
8+
{ name : Evergreen.V118.Data.Player.PlayerName.PlayerName
9+
, xp : Int
10+
}
11+
12+
13+
type OpponentType
14+
= Npc Evergreen.V118.Data.Enemy.Type.EnemyType
15+
| Player PlayerOpponent
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
module Evergreen.V118.Data.FightStrategy exposing (..)
2+
3+
import Evergreen.V118.Data.Fight.AttackStyle
4+
import Evergreen.V118.Data.Item.Kind
5+
6+
7+
type Value
8+
= MyHP
9+
| MyMaxHP
10+
| MyAP
11+
| MyItemCount Evergreen.V118.Data.Item.Kind.Kind
12+
| MyHealingItemCount
13+
| MyAmmoCount
14+
| ItemsUsed Evergreen.V118.Data.Item.Kind.Kind
15+
| HealingItemsUsed
16+
| AmmoUsed
17+
| ChanceToHit Evergreen.V118.Data.Fight.AttackStyle.AttackStyle
18+
| RangeNeeded Evergreen.V118.Data.Fight.AttackStyle.AttackStyle
19+
| Distance
20+
| Number Int
21+
22+
23+
type Operator
24+
= LT_
25+
| LTE
26+
| EQ_
27+
| NE
28+
| GTE
29+
| GT_
30+
31+
32+
type alias OperatorData =
33+
{ lhs : Value
34+
, op : Operator
35+
, rhs : Value
36+
}
37+
38+
39+
type Condition
40+
= Or Condition Condition
41+
| And Condition Condition
42+
| Operator OperatorData
43+
| OpponentIsPlayer
44+
| OpponentIsNPC
45+
46+
47+
type alias IfData =
48+
{ condition : Condition
49+
, then_ : FightStrategy
50+
, else_ : FightStrategy
51+
}
52+
53+
54+
type Command
55+
= Attack Evergreen.V118.Data.Fight.AttackStyle.AttackStyle
56+
| AttackRandomly
57+
| Heal Evergreen.V118.Data.Item.Kind.Kind
58+
| HealWithAnything
59+
| MoveForward
60+
| DoWhatever
61+
| SkipTurn
62+
63+
64+
type FightStrategy
65+
= If IfData
66+
| Command Command
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module Evergreen.V118.Data.FightStrategy.Help exposing (..)
2+
3+
4+
type Reference
5+
= Strategy
6+
| Command
7+
| Condition
8+
| Attack
9+
| Aim
10+
| Item
11+
| Value
12+
| Operator
13+
| Number
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module Evergreen.V118.Data.HealthStatus exposing (..)
2+
3+
4+
type HealthStatus
5+
= ExactHp
6+
{ current : Int
7+
, max : Int
8+
}
9+
| Unhurt
10+
| SlightlyWounded
11+
| Wounded
12+
| SeverelyWounded
13+
| AlmostDead
14+
| Dead
15+
| Alive
16+
| Unknown

0 commit comments

Comments
 (0)