Skip to content

Commit

Permalink
Add the new migration
Browse files Browse the repository at this point in the history
  • Loading branch information
Janiczek committed Oct 19, 2024
1 parent 6dabc9d commit d692ed9
Show file tree
Hide file tree
Showing 35 changed files with 2,715 additions and 0 deletions.
1,514 changes: 1,514 additions & 0 deletions src/Evergreen/Migrate/V105.elm

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions src/Evergreen/V105/Data/Auth.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module Evergreen.V105.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/V105/Data/Barter.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module Evergreen.V105.Data.Barter exposing (..)

import Dict
import Evergreen.V105.Data.Item
import SeqDict


type Message
= BarterIsEmpty
| PlayerOfferNotValuableEnough
| YouGaveStuffForFree


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


type alias State =
{ playerItems : Dict.Dict Evergreen.V105.Data.Item.Id Int
, vendorItems : Dict.Dict Evergreen.V105.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/V105/Data/Enemy.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module Evergreen.V105.Data.Enemy exposing (..)


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

import Evergreen.V105.Data.Fight.AttackStyle
import Evergreen.V105.Data.Fight.OpponentType
import Evergreen.V105.Data.Item
import Evergreen.V105.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.V105.Data.Fight.AttackStyle.AttackStyle
, remainingHp : Int
, isCritical : Bool
, apCost : Int
}
| Miss
{ attackStyle : Evergreen.V105.Data.Fight.AttackStyle.AttackStyle
, apCost : Int
}
| Heal
{ itemKind : Evergreen.V105.Data.Item.Kind.Kind
, healedHp : Int
, newHp : Int
}
| SkipTurn
| FailToDoAnything CommandRejectionReason


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


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


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

import Evergreen.V105.Data.Fight.AimedShot


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

import Evergreen.V105.Data.Enemy
import Evergreen.V105.Data.Player.PlayerName


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


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

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


type Value
= MyHP
| MyMaxHP
| MyAP
| MyItemCount Evergreen.V105.Data.Item.Kind.Kind
| MyHealingItemCount
| MyAmmoCount
| ItemsUsed Evergreen.V105.Data.Item.Kind.Kind
| HealingItemsUsed
| AmmoUsed
| ChanceToHit Evergreen.V105.Data.Fight.AttackStyle.AttackStyle
| RangeNeeded Evergreen.V105.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.V105.Data.Fight.AttackStyle.AttackStyle
| AttackRandomly
| Heal Evergreen.V105.Data.Item.Kind.Kind
| HealWithAnything
| MoveForward
| DoWhatever
| SkipTurn


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


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


type HealthStatus
= ExactHp
{ current : Int
, max : Int
}
| Unhurt
| SlightlyWounded
| Wounded
| SeverelyWounded
| AlmostDead
| Dead
| Alive
| Unknown
19 changes: 19 additions & 0 deletions src/Evergreen/V105/Data/Item.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module Evergreen.V105.Data.Item exposing (..)

import Evergreen.V105.Data.Item.Kind


type alias Id =
Int


type alias Item =
{ id : Id
, kind : Evergreen.V105.Data.Item.Kind.Kind
, count : Int
}


type alias UniqueKey =
{ kind : Evergreen.V105.Data.Item.Kind.Kind
}
Loading

0 comments on commit d692ed9

Please sign in to comment.