diff --git a/src/Evergreen/Migrate/V105.elm b/src/Evergreen/Migrate/V105.elm new file mode 100644 index 0000000..71ae1c0 --- /dev/null +++ b/src/Evergreen/Migrate/V105.elm @@ -0,0 +1,1514 @@ +module Evergreen.Migrate.V105 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 for more info. + +-} + +import BiDict +import Dict +import Evergreen.V104.Data.Auth +import Evergreen.V104.Data.Barter +import Evergreen.V104.Data.Enemy +import Evergreen.V104.Data.Fight +import Evergreen.V104.Data.Fight.ShotType +import Evergreen.V104.Data.FightStrategy +import Evergreen.V104.Data.FightStrategy.Help +import Evergreen.V104.Data.HealthStatus +import Evergreen.V104.Data.Item +import Evergreen.V104.Data.Message +import Evergreen.V104.Data.NewChar +import Evergreen.V104.Data.Perk +import Evergreen.V104.Data.Player +import Evergreen.V104.Data.Skill +import Evergreen.V104.Data.Special +import Evergreen.V104.Data.Tick +import Evergreen.V104.Data.Trait +import Evergreen.V104.Data.Vendor +import Evergreen.V104.Data.World +import Evergreen.V104.Data.WorldData +import Evergreen.V104.Frontend.HoveredItem +import Evergreen.V104.Frontend.Route +import Evergreen.V104.Types +import Evergreen.V105.Data.Auth +import Evergreen.V105.Data.Barter +import Evergreen.V105.Data.Enemy +import Evergreen.V105.Data.Fight +import Evergreen.V105.Data.Fight.AimedShot +import Evergreen.V105.Data.Fight.AttackStyle +import Evergreen.V105.Data.Fight.OpponentType +import Evergreen.V105.Data.FightStrategy +import Evergreen.V105.Data.FightStrategy.Help +import Evergreen.V105.Data.HealthStatus +import Evergreen.V105.Data.Item +import Evergreen.V105.Data.Item.Kind +import Evergreen.V105.Data.Message +import Evergreen.V105.Data.NewChar +import Evergreen.V105.Data.Perk +import Evergreen.V105.Data.Player +import Evergreen.V105.Data.Skill +import Evergreen.V105.Data.Special +import Evergreen.V105.Data.Tick +import Evergreen.V105.Data.Trait +import Evergreen.V105.Data.Vendor.Shop +import Evergreen.V105.Data.World +import Evergreen.V105.Data.WorldData +import Evergreen.V105.Data.WorldInfo +import Evergreen.V105.Frontend.HoveredItem +import Evergreen.V105.Frontend.Route +import Evergreen.V105.Types +import Lamdera.Migrations exposing (..) +import List +import Maybe +import Queue +import Random +import SeqDict +import SeqSet +import Time + + +frontendModel : Evergreen.V104.Types.FrontendModel -> ModelMigration Evergreen.V105.Types.FrontendModel Evergreen.V105.Types.FrontendMsg +frontendModel old = + ModelMigrated ( migrate_Types_FrontendModel old, Cmd.none ) + + +backendModel : Evergreen.V104.Types.BackendModel -> ModelMigration Evergreen.V105.Types.BackendModel Evergreen.V105.Types.BackendMsg +backendModel old = + ModelMigrated ( migrate_Types_BackendModel old, Cmd.none ) + + +frontendMsg : Evergreen.V104.Types.FrontendMsg -> MsgMigration Evergreen.V105.Types.FrontendMsg Evergreen.V105.Types.FrontendMsg +frontendMsg old = + MsgMigrated ( migrate_Types_FrontendMsg old, Cmd.none ) + + +toBackend : Evergreen.V104.Types.ToBackend -> MsgMigration Evergreen.V105.Types.ToBackend Evergreen.V105.Types.BackendMsg +toBackend old = + MsgMigrated ( migrate_Types_ToBackend old, Cmd.none ) + + +backendMsg : Evergreen.V104.Types.BackendMsg -> MsgMigration Evergreen.V105.Types.BackendMsg Evergreen.V105.Types.BackendMsg +backendMsg old = + MsgMigrated ( migrate_Types_BackendMsg old, Cmd.none ) + + +toFrontend : Evergreen.V104.Types.ToFrontend -> MsgMigration Evergreen.V105.Types.ToFrontend Evergreen.V105.Types.FrontendMsg +toFrontend old = + MsgMigrated ( migrate_Types_ToFrontend old, Cmd.none ) + + +migrate_Types_BackendModel : Evergreen.V104.Types.BackendModel -> Evergreen.V105.Types.BackendModel +migrate_Types_BackendModel old = + { worlds = old.worlds |> Dict.map (\_ -> migrate_Data_World_World) + , time = old.time + , loggedInPlayers = + old.loggedInPlayers + |> Dict.toList + |> List.map + (\( clientId, { worldName, playerName } ) -> + ( clientId, ( worldName, playerName ) ) + ) + |> BiDict.fromList + , adminLoggedIn = old.adminLoggedIn + , lastTenToBackendMsgs = Queue.empty + , randomSeed = Random.initialSeed 0 + , playerDataCache = Dict.empty + } + + +migrate_Types_FrontendModel : Evergreen.V104.Types.FrontendModel -> Evergreen.V105.Types.FrontendModel +migrate_Types_FrontendModel old = + { key = old.key + , route = old.route |> migrate_Frontend_Route_Route + , time = old.time + , zone = old.zone + , loginForm = + { name = old.loginForm.name + , password = Evergreen.V105.Data.Auth.Password "" + , worldName = old.loginForm.worldName + } + , worlds = old.worlds |> Maybe.map (List.map migrate_Data_WorldInfo_WorldInfo) + , worldData = old.worldData |> migrate_Data_WorldData_WorldData + , alertMessage = old.alertMessage + , newChar = old.newChar |> migrate_Data_NewChar_NewChar + , mapMouseCoords = old.mapMouseCoords + , hoveredItem = old.hoveredItem |> Maybe.map migrate_Frontend_HoveredItem_HoveredItem + , fightInfo = old.fightInfo |> Maybe.map migrate_Data_Fight_Info + , barter = old.barter |> migrate_Data_Barter_State + , fightStrategyText = old.fightStrategyText + , expandedQuests = SeqSet.empty + , userWantsToShowAreaDanger = False + , lastTenToBackendMsgs = [] + , adminNewWorldName = old.adminNewWorldName + , adminNewWorldFast = old.adminNewWorldFast + } + + +migrate_Data_Barter_Message : Evergreen.V104.Data.Barter.Message -> Evergreen.V105.Data.Barter.Message +migrate_Data_Barter_Message old = + case old of + Evergreen.V104.Data.Barter.BarterIsEmpty -> + Evergreen.V105.Data.Barter.BarterIsEmpty + + Evergreen.V104.Data.Barter.PlayerOfferNotValuableEnough -> + Evergreen.V105.Data.Barter.PlayerOfferNotValuableEnough + + Evergreen.V104.Data.Barter.YouGaveStuffForFree -> + Evergreen.V105.Data.Barter.YouGaveStuffForFree + + +migrate_Data_Barter_State : Evergreen.V104.Data.Barter.State -> Evergreen.V105.Data.Barter.State +migrate_Data_Barter_State old = + { playerItems = old.playerItems + , vendorItems = old.vendorItems + , playerCaps = old.playerCaps + , vendorCaps = old.vendorCaps + , lastMessage = old.lastMessage |> Maybe.map migrate_Data_Barter_Message + , transferNInputs = old.transferNInputs |> SeqDict.toList |> List.map (Tuple.mapFirst migrate_Data_Barter_TransferNPosition) |> SeqDict.fromList + , activeN = Nothing + } + + +migrate_Data_Barter_TransferNPosition : Evergreen.V104.Data.Barter.TransferNPosition -> Evergreen.V105.Data.Barter.TransferNPosition +migrate_Data_Barter_TransferNPosition old = + case old of + Evergreen.V104.Data.Barter.PlayerKeptItem p0 -> + Evergreen.V105.Data.Barter.PlayerKeptItem p0 + + Evergreen.V104.Data.Barter.VendorKeptItem p0 -> + Evergreen.V105.Data.Barter.VendorKeptItem p0 + + Evergreen.V104.Data.Barter.PlayerTradedItem p0 -> + Evergreen.V105.Data.Barter.PlayerTradedItem p0 + + Evergreen.V104.Data.Barter.VendorTradedItem p0 -> + Evergreen.V105.Data.Barter.VendorTradedItem p0 + + Evergreen.V104.Data.Barter.PlayerKeptCaps -> + Evergreen.V105.Data.Barter.PlayerKeptCaps + + Evergreen.V104.Data.Barter.VendorKeptCaps -> + Evergreen.V105.Data.Barter.VendorKeptCaps + + Evergreen.V104.Data.Barter.PlayerTradedCaps -> + Evergreen.V105.Data.Barter.PlayerTradedCaps + + Evergreen.V104.Data.Barter.VendorTradedCaps -> + Evergreen.V105.Data.Barter.VendorTradedCaps + + +migrate_Data_Enemy_Type : Evergreen.V104.Data.Enemy.Type -> Evergreen.V105.Data.Enemy.Type +migrate_Data_Enemy_Type old = + case old of + Evergreen.V104.Data.Enemy.Brahmin -> + Evergreen.V105.Data.Enemy.Brahmin + + Evergreen.V104.Data.Enemy.AngryBrahmin -> + Evergreen.V105.Data.Enemy.AngryBrahmin + + Evergreen.V104.Data.Enemy.WeakBrahmin -> + Evergreen.V105.Data.Enemy.WeakBrahmin + + Evergreen.V104.Data.Enemy.WildBrahmin -> + Evergreen.V105.Data.Enemy.WildBrahmin + + Evergreen.V104.Data.Enemy.GiantAnt -> + Evergreen.V105.Data.Enemy.GiantAnt + + Evergreen.V104.Data.Enemy.ToughGiantAnt -> + Evergreen.V105.Data.Enemy.ToughGiantAnt + + Evergreen.V104.Data.Enemy.BlackRadscorpion -> + Evergreen.V105.Data.Enemy.BlackRadscorpion + + Evergreen.V104.Data.Enemy.LesserBlackRadscorpion -> + Evergreen.V105.Data.Enemy.LesserBlackRadscorpion + + Evergreen.V104.Data.Enemy.LesserRadscorpion -> + Evergreen.V105.Data.Enemy.LesserRadscorpion + + Evergreen.V104.Data.Enemy.Radscorpion -> + Evergreen.V105.Data.Enemy.Radscorpion + + +migrate_Data_FightStrategy_Command : Evergreen.V104.Data.FightStrategy.Command -> Evergreen.V105.Data.FightStrategy.Command +migrate_Data_FightStrategy_Command old = + case old of + Evergreen.V104.Data.FightStrategy.Attack p0 -> + Evergreen.V105.Data.FightStrategy.Attack (migrateAttackStyle p0) + + Evergreen.V104.Data.FightStrategy.AttackRandomly -> + Evergreen.V105.Data.FightStrategy.AttackRandomly + + Evergreen.V104.Data.FightStrategy.Heal p0 -> + Evergreen.V105.Data.FightStrategy.Heal (p0 |> migrate_Data_Item_Kind_Kind) + + Evergreen.V104.Data.FightStrategy.MoveForward -> + Evergreen.V105.Data.FightStrategy.MoveForward + + Evergreen.V104.Data.FightStrategy.DoWhatever -> + Evergreen.V105.Data.FightStrategy.DoWhatever + + +migrate_Data_FightStrategy_Condition : Evergreen.V104.Data.FightStrategy.Condition -> Evergreen.V105.Data.FightStrategy.Condition +migrate_Data_FightStrategy_Condition old = + case old of + Evergreen.V104.Data.FightStrategy.Or p0 p1 -> + Evergreen.V105.Data.FightStrategy.Or (p0 |> migrate_Data_FightStrategy_Condition) + (p1 |> migrate_Data_FightStrategy_Condition) + + Evergreen.V104.Data.FightStrategy.And p0 p1 -> + Evergreen.V105.Data.FightStrategy.And (p0 |> migrate_Data_FightStrategy_Condition) + (p1 |> migrate_Data_FightStrategy_Condition) + + Evergreen.V104.Data.FightStrategy.Operator p0 -> + Evergreen.V105.Data.FightStrategy.Operator (p0 |> migrate_Data_FightStrategy_OperatorData) + + Evergreen.V104.Data.FightStrategy.OpponentIsPlayer -> + Evergreen.V105.Data.FightStrategy.OpponentIsPlayer + + +migrate_Data_FightStrategy_FightStrategy : Evergreen.V104.Data.FightStrategy.FightStrategy -> Evergreen.V105.Data.FightStrategy.FightStrategy +migrate_Data_FightStrategy_FightStrategy old = + case old of + Evergreen.V104.Data.FightStrategy.If p0 -> + Evergreen.V105.Data.FightStrategy.If (p0 |> migrate_Data_FightStrategy_IfData) + + Evergreen.V104.Data.FightStrategy.Command p0 -> + Evergreen.V105.Data.FightStrategy.Command (p0 |> migrate_Data_FightStrategy_Command) + + +migrate_Data_FightStrategy_Help_Reference : Evergreen.V104.Data.FightStrategy.Help.Reference -> Evergreen.V105.Data.FightStrategy.Help.Reference +migrate_Data_FightStrategy_Help_Reference old = + case old of + Evergreen.V104.Data.FightStrategy.Help.Strategy -> + Evergreen.V105.Data.FightStrategy.Help.Strategy + + Evergreen.V104.Data.FightStrategy.Help.Command -> + Evergreen.V105.Data.FightStrategy.Help.Command + + Evergreen.V104.Data.FightStrategy.Help.Condition -> + Evergreen.V105.Data.FightStrategy.Help.Condition + + Evergreen.V104.Data.FightStrategy.Help.ShotType -> + Evergreen.V105.Data.FightStrategy.Help.Attack + + Evergreen.V104.Data.FightStrategy.Help.Item -> + Evergreen.V105.Data.FightStrategy.Help.Item + + Evergreen.V104.Data.FightStrategy.Help.Value -> + Evergreen.V105.Data.FightStrategy.Help.Value + + Evergreen.V104.Data.FightStrategy.Help.Operator -> + Evergreen.V105.Data.FightStrategy.Help.Operator + + Evergreen.V104.Data.FightStrategy.Help.Number -> + Evergreen.V105.Data.FightStrategy.Help.Number + + +migrate_Data_FightStrategy_IfData : Evergreen.V104.Data.FightStrategy.IfData -> Evergreen.V105.Data.FightStrategy.IfData +migrate_Data_FightStrategy_IfData old = + { condition = old.condition |> migrate_Data_FightStrategy_Condition + , then_ = old.then_ |> migrate_Data_FightStrategy_FightStrategy + , else_ = old.else_ |> migrate_Data_FightStrategy_FightStrategy + } + + +migrate_Data_FightStrategy_Operator : Evergreen.V104.Data.FightStrategy.Operator -> Evergreen.V105.Data.FightStrategy.Operator +migrate_Data_FightStrategy_Operator old = + case old of + Evergreen.V104.Data.FightStrategy.LT_ -> + Evergreen.V105.Data.FightStrategy.LT_ + + Evergreen.V104.Data.FightStrategy.LTE -> + Evergreen.V105.Data.FightStrategy.LTE + + Evergreen.V104.Data.FightStrategy.EQ_ -> + Evergreen.V105.Data.FightStrategy.EQ_ + + Evergreen.V104.Data.FightStrategy.NE -> + Evergreen.V105.Data.FightStrategy.NE + + Evergreen.V104.Data.FightStrategy.GTE -> + Evergreen.V105.Data.FightStrategy.GTE + + Evergreen.V104.Data.FightStrategy.GT_ -> + Evergreen.V105.Data.FightStrategy.GT_ + + +migrate_Data_FightStrategy_OperatorData : Evergreen.V104.Data.FightStrategy.OperatorData -> Evergreen.V105.Data.FightStrategy.OperatorData +migrate_Data_FightStrategy_OperatorData old = + { lhs = old.value |> migrate_Data_FightStrategy_Value + , op = old.op |> migrate_Data_FightStrategy_Operator + , rhs = Evergreen.V105.Data.FightStrategy.Number old.number_ + } + + +migrate_Data_FightStrategy_Value : Evergreen.V104.Data.FightStrategy.Value -> Evergreen.V105.Data.FightStrategy.Value +migrate_Data_FightStrategy_Value old = + case old of + Evergreen.V104.Data.FightStrategy.MyHP -> + Evergreen.V105.Data.FightStrategy.MyHP + + Evergreen.V104.Data.FightStrategy.MyAP -> + Evergreen.V105.Data.FightStrategy.MyAP + + Evergreen.V104.Data.FightStrategy.MyItemCount kind -> + Evergreen.V105.Data.FightStrategy.MyItemCount (migrate_Data_Item_Kind_Kind kind) + + Evergreen.V104.Data.FightStrategy.ItemsUsed kind -> + Evergreen.V105.Data.FightStrategy.ItemsUsed (migrate_Data_Item_Kind_Kind kind) + + Evergreen.V104.Data.FightStrategy.ChanceToHit shotType -> + Evergreen.V105.Data.FightStrategy.ChanceToHit (migrateAttackStyle shotType) + + Evergreen.V104.Data.FightStrategy.Distance -> + Evergreen.V105.Data.FightStrategy.Distance + + +migrate_Data_Fight_Action : Evergreen.V104.Data.Fight.Action -> Evergreen.V105.Data.Fight.Action +migrate_Data_Fight_Action old = + case old of + Evergreen.V104.Data.Fight.Start p0 -> + Evergreen.V105.Data.Fight.Start p0 + + Evergreen.V104.Data.Fight.ComeCloser p0 -> + Evergreen.V105.Data.Fight.ComeCloser p0 + + Evergreen.V104.Data.Fight.Attack p0 -> + Evergreen.V105.Data.Fight.Attack + { damage = p0.damage + , attackStyle = migrateAttackStyle p0.shotType + , remainingHp = p0.remainingHp + , isCritical = p0.isCritical + , apCost = getApCost p0.shotType + } + + Evergreen.V104.Data.Fight.Miss p0 -> + Evergreen.V105.Data.Fight.Miss + { attackStyle = migrateAttackStyle p0.shotType + , apCost = getApCost p0.shotType + } + + Evergreen.V104.Data.Fight.Heal p0 -> + Evergreen.V105.Data.Fight.Heal + { itemKind = p0.itemKind |> migrate_Data_Item_Kind_Kind + , healedHp = p0.healedHp + , newHp = p0.newHp + } + + +migrateAttackStyle : Evergreen.V104.Data.Fight.ShotType.ShotType -> Evergreen.V105.Data.Fight.AttackStyle.AttackStyle +migrateAttackStyle oldShotType = + case oldShotType of + Evergreen.V104.Data.Fight.ShotType.NormalShot -> + Evergreen.V105.Data.Fight.AttackStyle.UnarmedUnaimed + + Evergreen.V104.Data.Fight.ShotType.AimedShot _ -> + Evergreen.V105.Data.Fight.AttackStyle.UnarmedAimed Evergreen.V105.Data.Fight.AimedShot.Head + + +getApCost : Evergreen.V104.Data.Fight.ShotType.ShotType -> Int +getApCost oldShotType = + case oldShotType of + Evergreen.V104.Data.Fight.ShotType.NormalShot -> + 3 + + Evergreen.V104.Data.Fight.ShotType.AimedShot _ -> + 5 + + +migrate_Data_Fight_Info : Evergreen.V104.Data.Fight.Info -> Evergreen.V105.Data.Fight.Info +migrate_Data_Fight_Info old = + { attacker = old.attacker |> migrate_Data_Fight_OpponentType_OpponentType + , target = old.target |> migrate_Data_Fight_OpponentType_OpponentType + , log = old.log |> List.map (Tuple.mapBoth migrate_Data_Fight_Who migrate_Data_Fight_Action) + , result = old.result |> migrate_Data_Fight_Result + } + + +migrate_Data_Fight_OpponentType_OpponentType : Evergreen.V104.Data.Fight.OpponentType -> Evergreen.V105.Data.Fight.OpponentType.OpponentType +migrate_Data_Fight_OpponentType_OpponentType old = + case old of + Evergreen.V104.Data.Fight.Npc p0 -> + Evergreen.V105.Data.Fight.OpponentType.Npc (p0 |> migrate_Data_Enemy_Type) + + Evergreen.V104.Data.Fight.Player p0 -> + Evergreen.V105.Data.Fight.OpponentType.Player (p0 |> migrate_Data_Fight_OpponentType_PlayerOpponent) + + +migrate_Data_Fight_OpponentType_PlayerOpponent : Evergreen.V104.Data.Fight.PlayerOpponent -> Evergreen.V105.Data.Fight.OpponentType.PlayerOpponent +migrate_Data_Fight_OpponentType_PlayerOpponent old = + old + + +migrate_Data_Fight_Result : Evergreen.V104.Data.Fight.Result -> Evergreen.V105.Data.Fight.Result +migrate_Data_Fight_Result old = + case old of + Evergreen.V104.Data.Fight.AttackerWon p0 -> + Evergreen.V105.Data.Fight.AttackerWon + { xpGained = p0.xpGained + , capsGained = p0.capsGained + , itemsGained = p0.itemsGained |> List.map migrate_Data_Item_Item + } + + Evergreen.V104.Data.Fight.TargetWon p0 -> + Evergreen.V105.Data.Fight.TargetWon + { xpGained = p0.xpGained + , capsGained = p0.capsGained + , itemsGained = p0.itemsGained |> List.map migrate_Data_Item_Item + } + + Evergreen.V104.Data.Fight.TargetAlreadyDead -> + Evergreen.V105.Data.Fight.TargetAlreadyDead + + Evergreen.V104.Data.Fight.BothDead -> + Evergreen.V105.Data.Fight.BothDead + + Evergreen.V104.Data.Fight.NobodyDead -> + Evergreen.V105.Data.Fight.NobodyDead + + Evergreen.V104.Data.Fight.NobodyDeadGivenUp -> + Evergreen.V105.Data.Fight.NobodyDeadGivenUp + + +migrate_Data_Fight_Who : Evergreen.V104.Data.Fight.Who -> Evergreen.V105.Data.Fight.Who +migrate_Data_Fight_Who old = + case old of + Evergreen.V104.Data.Fight.Attacker -> + Evergreen.V105.Data.Fight.Attacker + + Evergreen.V104.Data.Fight.Target -> + Evergreen.V105.Data.Fight.Target + + +migrate_Data_HealthStatus_HealthStatus : Evergreen.V104.Data.HealthStatus.HealthStatus -> Evergreen.V105.Data.HealthStatus.HealthStatus +migrate_Data_HealthStatus_HealthStatus old = + case old of + Evergreen.V104.Data.HealthStatus.ExactHp p0 -> + Evergreen.V105.Data.HealthStatus.ExactHp p0 + + Evergreen.V104.Data.HealthStatus.Unhurt -> + Evergreen.V105.Data.HealthStatus.Unhurt + + Evergreen.V104.Data.HealthStatus.SlightlyWounded -> + Evergreen.V105.Data.HealthStatus.SlightlyWounded + + Evergreen.V104.Data.HealthStatus.Wounded -> + Evergreen.V105.Data.HealthStatus.Wounded + + Evergreen.V104.Data.HealthStatus.SeverelyWounded -> + Evergreen.V105.Data.HealthStatus.SeverelyWounded + + Evergreen.V104.Data.HealthStatus.AlmostDead -> + Evergreen.V105.Data.HealthStatus.AlmostDead + + Evergreen.V104.Data.HealthStatus.Dead -> + Evergreen.V105.Data.HealthStatus.Dead + + Evergreen.V104.Data.HealthStatus.Alive -> + Evergreen.V105.Data.HealthStatus.Alive + + Evergreen.V104.Data.HealthStatus.Unknown -> + Evergreen.V105.Data.HealthStatus.Unknown + + +migrate_Data_Item_Item : Evergreen.V104.Data.Item.Item -> Evergreen.V105.Data.Item.Item +migrate_Data_Item_Item old = + { id = old.id + , kind = old.kind |> migrate_Data_Item_Kind_Kind + , count = old.count + } + + +migrate_Data_Item_Kind_Kind : Evergreen.V104.Data.Item.Kind -> Evergreen.V105.Data.Item.Kind.Kind +migrate_Data_Item_Kind_Kind old = + case old of + Evergreen.V104.Data.Item.Fruit -> + Evergreen.V105.Data.Item.Kind.Fruit + + Evergreen.V104.Data.Item.HealingPowder -> + Evergreen.V105.Data.Item.Kind.HealingPowder + + Evergreen.V104.Data.Item.Stimpak -> + Evergreen.V105.Data.Item.Kind.Stimpak + + Evergreen.V104.Data.Item.BigBookOfScience -> + Evergreen.V105.Data.Item.Kind.BigBookOfScience + + Evergreen.V104.Data.Item.DeansElectronics -> + Evergreen.V105.Data.Item.Kind.DeansElectronics + + Evergreen.V104.Data.Item.FirstAidBook -> + Evergreen.V105.Data.Item.Kind.FirstAidBook + + Evergreen.V104.Data.Item.GunsAndBullets -> + Evergreen.V105.Data.Item.Kind.GunsAndBullets + + Evergreen.V104.Data.Item.ScoutHandbook -> + Evergreen.V105.Data.Item.Kind.ScoutHandbook + + Evergreen.V104.Data.Item.Robes -> + Evergreen.V105.Data.Item.Kind.Robes + + Evergreen.V104.Data.Item.LeatherJacket -> + Evergreen.V105.Data.Item.Kind.LeatherJacket + + Evergreen.V104.Data.Item.LeatherArmor -> + Evergreen.V105.Data.Item.Kind.LeatherArmor + + Evergreen.V104.Data.Item.MetalArmor -> + Evergreen.V105.Data.Item.Kind.MetalArmor + + +migrate_Data_Message_Content : Evergreen.V104.Data.Message.Content -> Evergreen.V105.Data.Message.Content +migrate_Data_Message_Content old = + case old of + Evergreen.V104.Data.Message.Welcome -> + Evergreen.V105.Data.Message.Welcome + + Evergreen.V104.Data.Message.YouAdvancedLevel p0 -> + Evergreen.V105.Data.Message.YouAdvancedLevel p0 + + Evergreen.V104.Data.Message.YouWereAttacked p0 -> + Evergreen.V105.Data.Message.YouWereAttacked + { attacker = p0.attacker + , fightInfo = p0.fightInfo |> migrate_Data_Fight_Info + } + + Evergreen.V104.Data.Message.YouAttacked p0 -> + Evergreen.V105.Data.Message.YouAttacked + { target = p0.target + , fightInfo = p0.fightInfo |> migrate_Data_Fight_Info + } + + +migrate_Data_Message_Message : Evergreen.V104.Data.Message.Message -> Evergreen.V105.Data.Message.Message +migrate_Data_Message_Message old = + { id = old.id + , content = old.content |> migrate_Data_Message_Content + , hasBeenRead = old.hasBeenRead + , date = old.date + } + + +migrate_Data_NewChar_CreationError : Evergreen.V104.Data.NewChar.CreationError -> Evergreen.V105.Data.NewChar.CreationError +migrate_Data_NewChar_CreationError old = + case old of + Evergreen.V104.Data.NewChar.DoesNotHaveThreeTaggedSkills -> + Evergreen.V105.Data.NewChar.DoesNotHaveThreeTaggedSkills + + Evergreen.V104.Data.NewChar.HasSpecialPointsLeft -> + Evergreen.V105.Data.NewChar.HasSpecialPointsLeft + + Evergreen.V104.Data.NewChar.UsedMoreSpecialPointsThanAvailable -> + Evergreen.V105.Data.NewChar.UsedMoreSpecialPointsThanAvailable + + Evergreen.V104.Data.NewChar.HasSpecialOutOfRange -> + Evergreen.V105.Data.NewChar.HasSpecialOutOfRange + + Evergreen.V104.Data.NewChar.HasMoreThanTwoTraits -> + Evergreen.V105.Data.NewChar.HasMoreThanTwoTraits + + +migrate_Data_NewChar_NewChar : Evergreen.V104.Data.NewChar.NewChar -> Evergreen.V105.Data.NewChar.NewChar +migrate_Data_NewChar_NewChar old = + { baseSpecial = old.baseSpecial |> migrate_Data_Special_Special + , availableSpecial = old.availableSpecial + , taggedSkills = old.taggedSkills |> SeqSet.map migrate_Data_Skill_Skill + , traits = old.traits |> SeqSet.map migrate_Data_Trait_Trait + , error = old.error |> Maybe.map migrate_Data_NewChar_CreationError + } + + +migrate_Data_Perk_Perk : Evergreen.V104.Data.Perk.Perk -> Evergreen.V105.Data.Perk.Perk +migrate_Data_Perk_Perk old = + case old of + Evergreen.V104.Data.Perk.BonusHthDamage -> + Evergreen.V105.Data.Perk.BonusHthDamage + + Evergreen.V104.Data.Perk.Awareness -> + Evergreen.V105.Data.Perk.Awareness + + Evergreen.V104.Data.Perk.CautiousNature -> + Evergreen.V105.Data.Perk.CautiousNature + + Evergreen.V104.Data.Perk.Comprehension -> + Evergreen.V105.Data.Perk.Comprehension + + Evergreen.V104.Data.Perk.EarlierSequence -> + Evergreen.V105.Data.Perk.EarlierSequence + + Evergreen.V104.Data.Perk.FasterHealing -> + Evergreen.V105.Data.Perk.FasterHealing + + Evergreen.V104.Data.Perk.HereAndNow -> + Evergreen.V105.Data.Perk.HereAndNow + + Evergreen.V104.Data.Perk.Survivalist -> + Evergreen.V105.Data.Perk.Survivalist + + Evergreen.V104.Data.Perk.SwiftLearner -> + Evergreen.V105.Data.Perk.SwiftLearner + + Evergreen.V104.Data.Perk.Thief -> + Evergreen.V105.Data.Perk.Thief + + Evergreen.V104.Data.Perk.Toughness -> + Evergreen.V105.Data.Perk.Toughness + + Evergreen.V104.Data.Perk.AdrenalineRush -> + Evergreen.V105.Data.Perk.AdrenalineRush + + Evergreen.V104.Data.Perk.Educated -> + Evergreen.V105.Data.Perk.Educated + + Evergreen.V104.Data.Perk.FortuneFinder -> + Evergreen.V105.Data.Perk.FortuneFinder + + Evergreen.V104.Data.Perk.Gambler -> + Evergreen.V105.Data.Perk.Gambler + + Evergreen.V104.Data.Perk.MoreCriticals -> + Evergreen.V105.Data.Perk.MoreCriticals + + Evergreen.V104.Data.Perk.Negotiator -> + Evergreen.V105.Data.Perk.Negotiator + + Evergreen.V104.Data.Perk.Pathfinder -> + Evergreen.V105.Data.Perk.Pathfinder + + Evergreen.V104.Data.Perk.Ranger -> + Evergreen.V105.Data.Perk.Ranger + + Evergreen.V104.Data.Perk.Salesman -> + Evergreen.V105.Data.Perk.Salesman + + Evergreen.V104.Data.Perk.BetterCriticals -> + Evergreen.V105.Data.Perk.BetterCriticals + + Evergreen.V104.Data.Perk.Dodger -> + Evergreen.V105.Data.Perk.Dodger + + Evergreen.V104.Data.Perk.Speaker -> + Evergreen.V105.Data.Perk.Speaker + + Evergreen.V104.Data.Perk.ActionBoy -> + Evergreen.V105.Data.Perk.ActionBoy + + Evergreen.V104.Data.Perk.GainStrength -> + Evergreen.V105.Data.Perk.GainStrength + + Evergreen.V104.Data.Perk.GainPerception -> + Evergreen.V105.Data.Perk.GainPerception + + Evergreen.V104.Data.Perk.GainEndurance -> + Evergreen.V105.Data.Perk.GainEndurance + + Evergreen.V104.Data.Perk.GainCharisma -> + Evergreen.V105.Data.Perk.GainCharisma + + Evergreen.V104.Data.Perk.GainIntelligence -> + Evergreen.V105.Data.Perk.GainIntelligence + + Evergreen.V104.Data.Perk.GainAgility -> + Evergreen.V105.Data.Perk.GainAgility + + Evergreen.V104.Data.Perk.GainLuck -> + Evergreen.V105.Data.Perk.GainLuck + + Evergreen.V104.Data.Perk.HthEvade -> + Evergreen.V105.Data.Perk.HthEvade + + Evergreen.V104.Data.Perk.Lifegiver -> + Evergreen.V105.Data.Perk.Lifegiver + + Evergreen.V104.Data.Perk.LivingAnatomy -> + Evergreen.V105.Data.Perk.LivingAnatomy + + Evergreen.V104.Data.Perk.MasterThief -> + Evergreen.V105.Data.Perk.MasterThief + + Evergreen.V104.Data.Perk.MasterTrader -> + Evergreen.V105.Data.Perk.MasterTrader + + Evergreen.V104.Data.Perk.Medic -> + Evergreen.V105.Data.Perk.Medic + + Evergreen.V104.Data.Perk.MrFixit -> + Evergreen.V105.Data.Perk.MrFixit + + Evergreen.V104.Data.Perk.Tag -> + Evergreen.V105.Data.Perk.Tag + + Evergreen.V104.Data.Perk.BonusHthAttacks -> + Evergreen.V105.Data.Perk.BonusHthAttacks + + Evergreen.V104.Data.Perk.Slayer -> + Evergreen.V105.Data.Perk.Slayer + + +migrate_Data_Player_COtherPlayer : Evergreen.V104.Data.Player.COtherPlayer -> Evergreen.V105.Data.Player.COtherPlayer +migrate_Data_Player_COtherPlayer old = + { level = old.level + , name = old.name + , wins = old.wins + , losses = old.losses + , healthStatus = old.healthStatus |> migrate_Data_HealthStatus_HealthStatus + } + + +migrate_Data_Player_CPlayer : Evergreen.V104.Data.Player.CPlayer -> Evergreen.V105.Data.Player.CPlayer +migrate_Data_Player_CPlayer old = + { hp = old.hp + , maxHp = old.maxHp + , xp = old.xp + , name = old.name + , special = old.special |> migrate_Data_Special_Special + , caps = old.caps + , ticks = old.ticks + , wins = old.wins + , losses = old.losses + , location = old.location + , perks = old.perks |> SeqDict.toList |> List.map (Tuple.mapFirst migrate_Data_Perk_Perk) |> SeqDict.fromList + , messages = old.messages |> Dict.map (\_ -> migrate_Data_Message_Message) + , items = old.items |> Dict.map (\_ -> migrate_Data_Item_Item) + , traits = old.traits |> SeqSet.map migrate_Data_Trait_Trait + , addedSkillPercentages = old.addedSkillPercentages |> SeqDict.toList |> List.map (Tuple.mapFirst migrate_Data_Skill_Skill) |> SeqDict.fromList + , taggedSkills = old.taggedSkills |> SeqSet.map migrate_Data_Skill_Skill + , availableSkillPoints = old.availableSkillPoints + , availablePerks = old.availablePerks + , equippedArmor = old.equippedArmor |> Maybe.map migrate_Data_Item_Item + , equippedWeapon = Nothing + , preferredAmmo = Nothing + , fightStrategy = old.fightStrategy |> migrate_Data_FightStrategy_FightStrategy + , fightStrategyText = old.fightStrategyText + , questsActive = SeqSet.empty + } + + +migrate_Data_Player_Player : (a_old -> a_new) -> Evergreen.V104.Data.Player.Player a_old -> Evergreen.V105.Data.Player.Player a_new +migrate_Data_Player_Player migrate_a old = + case old of + Evergreen.V104.Data.Player.NeedsCharCreated p0 -> + Evergreen.V105.Data.Player.NeedsCharCreated { name = p0.name, worldName = p0.worldName, password = Evergreen.V105.Data.Auth.Password "" } + + Evergreen.V104.Data.Player.Player p0 -> + Evergreen.V105.Data.Player.Player (p0 |> migrate_a) + + +getPassword : Evergreen.V104.Data.Auth.Password a -> String +getPassword p = + case p of + Evergreen.V104.Data.Auth.Password s -> + s + + +migrate_Data_Player_SPlayer : Evergreen.V104.Data.Player.SPlayer -> Evergreen.V105.Data.Player.SPlayer +migrate_Data_Player_SPlayer old = + { name = old.name + , password = Evergreen.V105.Data.Auth.Password (getPassword old.password) + , worldName = old.worldName + , hp = old.hp + , maxHp = old.maxHp + , xp = old.xp + , special = old.special |> migrate_Data_Special_Special + , caps = old.caps + , ticks = old.ticks + , wins = old.wins + , losses = old.losses + , location = old.location + , perks = old.perks |> SeqDict.toList |> List.map (Tuple.mapFirst migrate_Data_Perk_Perk) |> SeqDict.fromList + , messages = old.messages |> Dict.map (\_ -> migrate_Data_Message_Message) + , items = old.items |> Dict.map (\_ -> migrate_Data_Item_Item) + , traits = old.traits |> SeqSet.map migrate_Data_Trait_Trait + , addedSkillPercentages = old.addedSkillPercentages |> SeqDict.toList |> List.map (Tuple.mapFirst migrate_Data_Skill_Skill) |> SeqDict.fromList + , taggedSkills = old.taggedSkills |> SeqSet.map migrate_Data_Skill_Skill + , availableSkillPoints = old.availableSkillPoints + , availablePerks = old.availablePerks + , equippedArmor = old.equippedArmor |> Maybe.map migrate_Data_Item_Item + , equippedWeapon = Nothing + , preferredAmmo = Nothing + , fightStrategy = old.fightStrategy |> migrate_Data_FightStrategy_FightStrategy + , fightStrategyText = old.fightStrategyText + , questsActive = SeqSet.empty + } + + +migrate_Data_Skill_Skill : Evergreen.V104.Data.Skill.Skill -> Evergreen.V105.Data.Skill.Skill +migrate_Data_Skill_Skill old = + case old of + Evergreen.V104.Data.Skill.SmallGuns -> + Evergreen.V105.Data.Skill.SmallGuns + + Evergreen.V104.Data.Skill.BigGuns -> + Evergreen.V105.Data.Skill.BigGuns + + Evergreen.V104.Data.Skill.EnergyWeapons -> + Evergreen.V105.Data.Skill.EnergyWeapons + + Evergreen.V104.Data.Skill.Unarmed -> + Evergreen.V105.Data.Skill.Unarmed + + Evergreen.V104.Data.Skill.MeleeWeapons -> + Evergreen.V105.Data.Skill.MeleeWeapons + + Evergreen.V104.Data.Skill.Throwing -> + Evergreen.V105.Data.Skill.Throwing + + Evergreen.V104.Data.Skill.FirstAid -> + Evergreen.V105.Data.Skill.FirstAid + + Evergreen.V104.Data.Skill.Doctor -> + Evergreen.V105.Data.Skill.Doctor + + Evergreen.V104.Data.Skill.Sneak -> + Evergreen.V105.Data.Skill.Sneak + + Evergreen.V104.Data.Skill.Lockpick -> + Evergreen.V105.Data.Skill.Lockpick + + Evergreen.V104.Data.Skill.Steal -> + Evergreen.V105.Data.Skill.Steal + + Evergreen.V104.Data.Skill.Traps -> + Evergreen.V105.Data.Skill.Traps + + Evergreen.V104.Data.Skill.Science -> + Evergreen.V105.Data.Skill.Science + + Evergreen.V104.Data.Skill.Repair -> + Evergreen.V105.Data.Skill.Repair + + Evergreen.V104.Data.Skill.Speech -> + Evergreen.V105.Data.Skill.Speech + + Evergreen.V104.Data.Skill.Barter -> + Evergreen.V105.Data.Skill.Barter + + Evergreen.V104.Data.Skill.Gambling -> + Evergreen.V105.Data.Skill.Gambling + + Evergreen.V104.Data.Skill.Outdoorsman -> + Evergreen.V105.Data.Skill.Outdoorsman + + +migrate_Data_Special_Special : Evergreen.V104.Data.Special.Special -> Evergreen.V105.Data.Special.Special +migrate_Data_Special_Special old = + old + + +migrate_Data_Special_Type : Evergreen.V104.Data.Special.Type -> Evergreen.V105.Data.Special.Type +migrate_Data_Special_Type old = + case old of + Evergreen.V104.Data.Special.Strength -> + Evergreen.V105.Data.Special.Strength + + Evergreen.V104.Data.Special.Perception -> + Evergreen.V105.Data.Special.Perception + + Evergreen.V104.Data.Special.Endurance -> + Evergreen.V105.Data.Special.Endurance + + Evergreen.V104.Data.Special.Charisma -> + Evergreen.V105.Data.Special.Charisma + + Evergreen.V104.Data.Special.Intelligence -> + Evergreen.V105.Data.Special.Intelligence + + Evergreen.V104.Data.Special.Agility -> + Evergreen.V105.Data.Special.Agility + + Evergreen.V104.Data.Special.Luck -> + Evergreen.V105.Data.Special.Luck + + +migrate_Data_Tick_TickPerIntervalCurve : Evergreen.V104.Data.Tick.TickPerIntervalCurve -> Evergreen.V105.Data.Tick.TickPerIntervalCurve +migrate_Data_Tick_TickPerIntervalCurve old = + case old of + Evergreen.V104.Data.Tick.QuarterAndRest p0 -> + Evergreen.V105.Data.Tick.QuarterAndRest p0 + + Evergreen.V104.Data.Tick.Linear p0 -> + Evergreen.V105.Data.Tick.Linear p0 + + +migrate_Data_Trait_Trait : Evergreen.V104.Data.Trait.Trait -> Evergreen.V105.Data.Trait.Trait +migrate_Data_Trait_Trait old = + case old of + Evergreen.V104.Data.Trait.Kamikaze -> + Evergreen.V105.Data.Trait.Kamikaze + + Evergreen.V104.Data.Trait.Bruiser -> + Evergreen.V105.Data.Trait.Bruiser + + Evergreen.V104.Data.Trait.Gifted -> + Evergreen.V105.Data.Trait.Gifted + + Evergreen.V104.Data.Trait.SmallFrame -> + Evergreen.V105.Data.Trait.SmallFrame + + Evergreen.V104.Data.Trait.Skilled -> + Evergreen.V105.Data.Trait.Skilled + + Evergreen.V104.Data.Trait.HeavyHanded -> + Evergreen.V105.Data.Trait.HeavyHanded + + Evergreen.V104.Data.Trait.Finesse -> + Evergreen.V105.Data.Trait.Finesse + + +migrate_Data_Vendor_Shop_Shop : Evergreen.V104.Data.Vendor.Name -> Evergreen.V105.Data.Vendor.Shop.Shop +migrate_Data_Vendor_Shop_Shop old = + case old of + Evergreen.V104.Data.Vendor.ArroyoHakunin -> + Evergreen.V105.Data.Vendor.Shop.ArroyoHakunin + + Evergreen.V104.Data.Vendor.KlamathMaidaBuckner -> + Evergreen.V105.Data.Vendor.Shop.KlamathMaida + + Evergreen.V104.Data.Vendor.DenFlick -> + Evergreen.V105.Data.Vendor.Shop.DenFlick + + Evergreen.V104.Data.Vendor.ModocJo -> + Evergreen.V105.Data.Vendor.Shop.ModocJo + + Evergreen.V104.Data.Vendor.VaultCityHappyHarry -> + Evergreen.V105.Data.Vendor.Shop.VaultCityHappyHarry + + +migrate_Data_WorldData_AdminData : Evergreen.V104.Data.WorldData.AdminData -> Evergreen.V105.Data.WorldData.AdminData +migrate_Data_WorldData_AdminData old = + { worlds = + old.worlds + |> Dict.map + (\_ -> + \rec -> + { players = rec.players |> Dict.map (\_ -> migrate_Data_Player_Player migrate_Data_Player_SPlayer) + , nextWantedTick = rec.nextWantedTick + , description = rec.description + , startedAt = rec.startedAt + , tickFrequency = rec.tickFrequency + , tickPerIntervalCurve = rec.tickPerIntervalCurve |> migrate_Data_Tick_TickPerIntervalCurve + , vendorRestockFrequency = rec.vendorRestockFrequency + } + ) + , loggedInPlayers = old.loggedInPlayers + } + + +migrate_Data_WorldData_PlayerData : Evergreen.V104.Data.WorldData.PlayerData -> Evergreen.V105.Data.WorldData.PlayerData +migrate_Data_WorldData_PlayerData old = + { worldName = old.worldName + , description = old.description + , startedAt = old.startedAt + , tickFrequency = old.tickFrequency + , tickPerIntervalCurve = old.tickPerIntervalCurve |> migrate_Data_Tick_TickPerIntervalCurve + , vendorRestockFrequency = old.vendorRestockFrequency + , player = old.player |> migrate_Data_Player_Player migrate_Data_Player_CPlayer + , otherPlayers = old.otherPlayers |> List.map migrate_Data_Player_COtherPlayer + , playerRank = old.playerRank + , vendors = SeqDict.empty + , questsProgress = SeqDict.empty + , questRewardShops = SeqSet.empty + } + + +migrate_Data_WorldData_WorldData : Evergreen.V104.Data.WorldData.WorldData -> Evergreen.V105.Data.WorldData.WorldData +migrate_Data_WorldData_WorldData old = + case old of + Evergreen.V104.Data.WorldData.IsAdmin p0 -> + Evergreen.V105.Data.WorldData.IsAdmin (p0 |> migrate_Data_WorldData_AdminData) + + Evergreen.V104.Data.WorldData.IsPlayer p0 -> + Evergreen.V105.Data.WorldData.IsPlayer (p0 |> migrate_Data_WorldData_PlayerData) + + Evergreen.V104.Data.WorldData.NotLoggedIn -> + Evergreen.V105.Data.WorldData.NotLoggedIn + + +migrate_Data_WorldInfo_WorldInfo : Evergreen.V104.Data.World.Info -> Evergreen.V105.Data.WorldInfo.WorldInfo +migrate_Data_WorldInfo_WorldInfo old = + { name = old.name + , description = old.description + , playersCount = old.playersCount + , startedAt = old.startedAt + , tickFrequency = old.tickFrequency + , tickPerIntervalCurve = old.tickPerIntervalCurve |> migrate_Data_Tick_TickPerIntervalCurve + , vendorRestockFrequency = old.vendorRestockFrequency + } + + +migrate_Data_World_World : Evergreen.V104.Data.World.World -> Evergreen.V105.Data.World.World +migrate_Data_World_World old = + { players = old.players |> Dict.map (\_ -> migrate_Data_Player_Player migrate_Data_Player_SPlayer) + , nextWantedTick = old.nextWantedTick + , nextVendorRestockTick = old.nextVendorRestockTick + , vendors = SeqDict.empty + , lastItemId = old.lastItemId + , description = old.description + , startedAt = old.startedAt + , tickFrequency = old.tickFrequency + , tickPerIntervalCurve = old.tickPerIntervalCurve |> migrate_Data_Tick_TickPerIntervalCurve + , vendorRestockFrequency = old.vendorRestockFrequency + , questsProgress = SeqDict.empty + , questRewardShops = SeqSet.empty + } + + +migrate_Frontend_HoveredItem_HoveredItem : Evergreen.V104.Frontend.HoveredItem.HoveredItem -> Evergreen.V105.Frontend.HoveredItem.HoveredItem +migrate_Frontend_HoveredItem_HoveredItem old = + case old of + Evergreen.V104.Frontend.HoveredItem.HoveredPerk p0 -> + Evergreen.V105.Frontend.HoveredItem.HoveredPerk (p0 |> migrate_Data_Perk_Perk) + + Evergreen.V104.Frontend.HoveredItem.HoveredTrait p0 -> + Evergreen.V105.Frontend.HoveredItem.HoveredTrait (p0 |> migrate_Data_Trait_Trait) + + Evergreen.V104.Frontend.HoveredItem.HoveredSpecial p0 -> + Evergreen.V105.Frontend.HoveredItem.HoveredSpecial (p0 |> migrate_Data_Special_Type) + + Evergreen.V104.Frontend.HoveredItem.HoveredSkill p0 -> + Evergreen.V105.Frontend.HoveredItem.HoveredSkill (p0 |> migrate_Data_Skill_Skill) + + Evergreen.V104.Frontend.HoveredItem.HoveredFightStrategyReference p0 -> + Evergreen.V105.Frontend.HoveredItem.HoveredFightStrategyReference (p0 |> migrate_Data_FightStrategy_Help_Reference) + + +migrate_Frontend_Route_AdminRoute : Evergreen.V104.Frontend.Route.AdminRoute -> Evergreen.V105.Frontend.Route.AdminRoute +migrate_Frontend_Route_AdminRoute old = + case old of + Evergreen.V104.Frontend.Route.AdminWorldsList -> + Evergreen.V105.Frontend.Route.AdminWorldsList + + Evergreen.V104.Frontend.Route.AdminWorldActivity p0 -> + Evergreen.V105.Frontend.Route.AdminWorldActivity p0 + + Evergreen.V104.Frontend.Route.AdminWorldHiscores p0 -> + Evergreen.V105.Frontend.Route.AdminWorldHiscores p0 + + +migrate_Frontend_Route_PlayerRoute : Evergreen.V104.Frontend.Route.PlayerRoute -> Evergreen.V105.Frontend.Route.PlayerRoute +migrate_Frontend_Route_PlayerRoute old = + case old of + Evergreen.V104.Frontend.Route.AboutWorld -> + Evergreen.V105.Frontend.Route.AboutWorld + + Evergreen.V104.Frontend.Route.Character -> + Evergreen.V105.Frontend.Route.Character + + Evergreen.V104.Frontend.Route.Inventory -> + Evergreen.V105.Frontend.Route.Inventory + + Evergreen.V104.Frontend.Route.Ladder -> + Evergreen.V105.Frontend.Route.Ladder + + Evergreen.V104.Frontend.Route.TownMainSquare -> + Evergreen.V105.Frontend.Route.TownMainSquare + + Evergreen.V104.Frontend.Route.TownStore -> + Evergreen.V105.Frontend.Route.TownStore + Evergreen.V105.Data.Vendor.Shop.ArroyoHakunin + + Evergreen.V104.Frontend.Route.Fight -> + Evergreen.V105.Frontend.Route.Fight + + Evergreen.V104.Frontend.Route.Messages -> + Evergreen.V105.Frontend.Route.Messages + + Evergreen.V104.Frontend.Route.Message p0 -> + Evergreen.V105.Frontend.Route.Message p0 + + Evergreen.V104.Frontend.Route.CharCreation -> + Evergreen.V105.Frontend.Route.CharCreation + + Evergreen.V104.Frontend.Route.SettingsFightStrategy -> + Evergreen.V105.Frontend.Route.SettingsFightStrategy + + Evergreen.V104.Frontend.Route.SettingsFightStrategySyntaxHelp -> + Evergreen.V105.Frontend.Route.SettingsFightStrategySyntaxHelp + + +migrate_Frontend_Route_Route : Evergreen.V104.Frontend.Route.Route -> Evergreen.V105.Frontend.Route.Route +migrate_Frontend_Route_Route old = + case old of + Evergreen.V104.Frontend.Route.About -> + Evergreen.V105.Frontend.Route.About + + Evergreen.V104.Frontend.Route.News -> + Evergreen.V105.Frontend.Route.News + + Evergreen.V104.Frontend.Route.Map -> + Evergreen.V105.Frontend.Route.Map + + Evergreen.V104.Frontend.Route.WorldsList -> + Evergreen.V105.Frontend.Route.WorldsList + + Evergreen.V104.Frontend.Route.NotFound p0 -> + Evergreen.V105.Frontend.Route.NotFound p0 + + Evergreen.V104.Frontend.Route.PlayerRoute p0 -> + Evergreen.V105.Frontend.Route.PlayerRoute (p0 |> migrate_Frontend_Route_PlayerRoute) + + Evergreen.V104.Frontend.Route.AdminRoute p0 -> + Evergreen.V105.Frontend.Route.AdminRoute (p0 |> migrate_Frontend_Route_AdminRoute) + + +migrate_Queue_Queue : (a_old -> a_new) -> Queue.Queue a_old -> Queue.Queue a_new +migrate_Queue_Queue migrate_a old = + old + |> Queue.map migrate_a + + +migrate_Types_AdminToBackend : Evergreen.V104.Types.AdminToBackend -> Evergreen.V105.Types.AdminToBackend +migrate_Types_AdminToBackend old = + case old of + Evergreen.V104.Types.ExportJson -> + Evergreen.V105.Types.ExportJson + + Evergreen.V104.Types.ImportJson p0 -> + Evergreen.V105.Types.ImportJson p0 + + Evergreen.V104.Types.CreateNewWorld p0 p1 -> + Evergreen.V105.Types.CreateNewWorld p0 p1 + + +migrate_Types_BackendMsg : Evergreen.V104.Types.BackendMsg -> Evergreen.V105.Types.BackendMsg +migrate_Types_BackendMsg old = + case old of + Evergreen.V104.Types.Connected p0 p1 -> + Evergreen.V105.Types.Connected p0 p1 + + Evergreen.V104.Types.Disconnected p0 p1 -> + Evergreen.V105.Types.Disconnected p0 p1 + + Evergreen.V104.Types.GeneratedFight _ _ _ _ -> + Evergreen.V105.Types.Tick (Time.millisToPosix 0) + + Evergreen.V104.Types.GeneratedNewVendorsStock _ _ -> + Evergreen.V105.Types.Tick (Time.millisToPosix 0) + + Evergreen.V104.Types.Tick p0 -> + Evergreen.V105.Types.Tick p0 + + Evergreen.V104.Types.CreateNewCharWithTime p0 p1 p2 -> + Evergreen.V105.Types.CreateNewCharWithTime p0 (p1 |> migrate_Data_NewChar_NewChar) p2 + + Evergreen.V104.Types.LoggedToBackendMsg -> + Evergreen.V105.Types.LoggedToBackendMsg + + +migrate_Types_BarterMsg : Evergreen.V104.Types.BarterMsg -> Evergreen.V105.Types.BarterMsg +migrate_Types_BarterMsg old = + case old of + Evergreen.V104.Types.AddPlayerItem p0 p1 -> + Evergreen.V105.Types.AddPlayerItem p0 p1 + + Evergreen.V104.Types.AddVendorItem p0 p1 -> + Evergreen.V105.Types.AddVendorItem p0 p1 + + Evergreen.V104.Types.AddPlayerCaps p0 -> + Evergreen.V105.Types.AddPlayerCaps p0 + + Evergreen.V104.Types.AddVendorCaps p0 -> + Evergreen.V105.Types.AddVendorCaps p0 + + Evergreen.V104.Types.RemovePlayerItem p0 p1 -> + Evergreen.V105.Types.RemovePlayerItem p0 p1 + + Evergreen.V104.Types.RemoveVendorItem p0 p1 -> + Evergreen.V105.Types.RemoveVendorItem p0 p1 + + Evergreen.V104.Types.RemovePlayerCaps p0 -> + Evergreen.V105.Types.RemovePlayerCaps p0 + + Evergreen.V104.Types.RemoveVendorCaps p0 -> + Evergreen.V105.Types.RemoveVendorCaps p0 + + Evergreen.V104.Types.ResetBarter -> + Evergreen.V105.Types.ResetBarter + + Evergreen.V104.Types.ConfirmBarter -> + Evergreen.V105.Types.ConfirmBarter + Evergreen.V105.Data.Vendor.Shop.ArroyoHakunin + + Evergreen.V104.Types.SetTransferNInput p0 p1 -> + Evergreen.V105.Types.SetTransferNInput (p0 |> migrate_Data_Barter_TransferNPosition) p1 + + Evergreen.V104.Types.SetTransferNHover p0 -> + Evergreen.V105.Types.SetTransferNActive + (p0 + |> migrate_Data_Barter_TransferNPosition + ) + + Evergreen.V104.Types.UnsetTransferNHover -> + Evergreen.V105.Types.UnsetTransferNActive + + +migrate_Types_FrontendMsg : Evergreen.V104.Types.FrontendMsg -> Evergreen.V105.Types.FrontendMsg +migrate_Types_FrontendMsg old = + case old of + Evergreen.V104.Types.UrlClicked p0 -> + Evergreen.V105.Types.UrlClicked p0 + + Evergreen.V104.Types.UrlChanged p0 -> + Evergreen.V105.Types.UrlChanged p0 + + Evergreen.V104.Types.GoToRoute p0 -> + Evergreen.V105.Types.GoToRoute (p0 |> migrate_Frontend_Route_Route) + + Evergreen.V104.Types.GoToTownStore -> + Evergreen.V105.Types.GoToTownStore + Evergreen.V105.Data.Vendor.Shop.ArroyoHakunin + + Evergreen.V104.Types.Logout -> + Evergreen.V105.Types.Logout + + Evergreen.V104.Types.Login -> + Evergreen.V105.Types.Login + + Evergreen.V104.Types.Register -> + Evergreen.V105.Types.Register + + Evergreen.V104.Types.GotZone p0 -> + Evergreen.V105.Types.GotZone p0 + + Evergreen.V104.Types.GotTime p0 -> + Evergreen.V105.Types.GotTime p0 + + Evergreen.V104.Types.AskToFight p0 -> + Evergreen.V105.Types.AskToFight p0 + + Evergreen.V104.Types.AskToHeal -> + Evergreen.V105.Types.AskToHeal + + Evergreen.V104.Types.AskToUseItem p0 -> + Evergreen.V105.Types.AskToUseItem p0 + + Evergreen.V104.Types.AskToWander -> + Evergreen.V105.Types.AskToWander + + Evergreen.V104.Types.AskToChoosePerk p0 -> + Evergreen.V105.Types.AskToChoosePerk (p0 |> migrate_Data_Perk_Perk) + + Evergreen.V104.Types.AskToEquipItem p0 -> + Evergreen.V105.Types.AskToEquipWeapon p0 + + Evergreen.V104.Types.AskToUnequipArmor -> + Evergreen.V105.Types.AskToUnequipArmor + + Evergreen.V104.Types.AskToSetFightStrategy p0 -> + Evergreen.V105.Types.AskToSetFightStrategy (p0 |> Tuple.mapFirst migrate_Data_FightStrategy_FightStrategy) + + Evergreen.V104.Types.AskForExport -> + Evergreen.V105.Types.AskForExport + + Evergreen.V104.Types.ImportButtonClicked -> + Evergreen.V105.Types.ImportButtonClicked + + Evergreen.V104.Types.ImportFileSelected p0 -> + Evergreen.V105.Types.ImportFileSelected p0 + + Evergreen.V104.Types.AskToImport p0 -> + Evergreen.V105.Types.AskToImport p0 + + Evergreen.V104.Types.Refresh -> + Evergreen.V105.Types.Refresh + + Evergreen.V104.Types.AskToTagSkill p0 -> + Evergreen.V105.Types.AskToTagSkill (p0 |> migrate_Data_Skill_Skill) + + Evergreen.V104.Types.AskToUseSkillPoints p0 -> + Evergreen.V105.Types.AskToUseSkillPoints (p0 |> migrate_Data_Skill_Skill) + + Evergreen.V104.Types.SetAuthName p0 -> + Evergreen.V105.Types.SetAuthName p0 + + Evergreen.V104.Types.SetAuthPassword p0 -> + Evergreen.V105.Types.SetAuthPassword p0 + + Evergreen.V104.Types.SetAuthWorld p0 -> + Evergreen.V105.Types.SetAuthWorld p0 + + Evergreen.V104.Types.CreateChar -> + Evergreen.V105.Types.CreateChar + + Evergreen.V104.Types.NewCharIncSpecial p0 -> + Evergreen.V105.Types.NewCharIncSpecial (p0 |> migrate_Data_Special_Type) + + Evergreen.V104.Types.NewCharDecSpecial p0 -> + Evergreen.V105.Types.NewCharDecSpecial (p0 |> migrate_Data_Special_Type) + + Evergreen.V104.Types.NewCharToggleTaggedSkill p0 -> + Evergreen.V105.Types.NewCharToggleTaggedSkill (p0 |> migrate_Data_Skill_Skill) + + Evergreen.V104.Types.NewCharToggleTrait p0 -> + Evergreen.V105.Types.NewCharToggleTrait (p0 |> migrate_Data_Trait_Trait) + + Evergreen.V104.Types.MapMouseAtCoords p0 -> + Evergreen.V105.Types.MapMouseAtCoords p0 + + Evergreen.V104.Types.MapMouseOut -> + Evergreen.V105.Types.MapMouseOut + + Evergreen.V104.Types.MapMouseClick -> + Evergreen.V105.Types.MapMouseClick + + Evergreen.V104.Types.OpenMessage p0 -> + Evergreen.V105.Types.OpenMessage p0 + + Evergreen.V104.Types.AskToRemoveMessage p0 -> + Evergreen.V105.Types.AskToRemoveMessage p0 + + Evergreen.V104.Types.BarterMsg p0 -> + Evergreen.V105.Types.BarterMsg (p0 |> migrate_Types_BarterMsg) + + Evergreen.V104.Types.HoverItem p0 -> + Evergreen.V105.Types.HoverItem (p0 |> migrate_Frontend_HoveredItem_HoveredItem) + + Evergreen.V104.Types.StopHoveringItem -> + Evergreen.V105.Types.StopHoveringItem + + Evergreen.V104.Types.SetFightStrategyText p0 -> + Evergreen.V105.Types.SetFightStrategyText p0 + + Evergreen.V104.Types.SetAdminNewWorldName p0 -> + Evergreen.V105.Types.SetAdminNewWorldName p0 + + Evergreen.V104.Types.ToggleAdminNewWorldFast -> + Evergreen.V105.Types.SetAdminNewWorldFast True + + Evergreen.V104.Types.AskToCreateNewWorld -> + Evergreen.V105.Types.AskToCreateNewWorld + + +migrate_Types_ToBackend : Evergreen.V104.Types.ToBackend -> Evergreen.V105.Types.ToBackend +migrate_Types_ToBackend old = + case old of + Evergreen.V104.Types.LogMeIn p0 -> + Evergreen.V105.Types.LogMeIn { name = p0.name, worldName = p0.worldName, password = Evergreen.V105.Data.Auth.Password "" } + + Evergreen.V104.Types.RegisterMe p0 -> + Evergreen.V105.Types.RegisterMe { name = p0.name, worldName = p0.worldName, password = Evergreen.V105.Data.Auth.Password "" } + + Evergreen.V104.Types.CreateNewChar p0 -> + Evergreen.V105.Types.CreateNewChar (p0 |> migrate_Data_NewChar_NewChar) + + Evergreen.V104.Types.LogMeOut -> + Evergreen.V105.Types.LogMeOut + + Evergreen.V104.Types.Fight p0 -> + Evergreen.V105.Types.Fight p0 + + Evergreen.V104.Types.HealMe -> + Evergreen.V105.Types.HealMe + + Evergreen.V104.Types.UseItem p0 -> + Evergreen.V105.Types.UseItem p0 + + Evergreen.V104.Types.Wander -> + Evergreen.V105.Types.Wander + + Evergreen.V104.Types.EquipItem p0 -> + Evergreen.V105.Types.EquipWeapon p0 + + Evergreen.V104.Types.SetFightStrategy p0 -> + Evergreen.V105.Types.SetFightStrategy (p0 |> Tuple.mapFirst migrate_Data_FightStrategy_FightStrategy) + + Evergreen.V104.Types.UnequipArmor -> + Evergreen.V105.Types.UnequipArmor + + Evergreen.V104.Types.RefreshPlease -> + Evergreen.V105.Types.RefreshPlease + + Evergreen.V104.Types.TagSkill p0 -> + Evergreen.V105.Types.TagSkill (p0 |> migrate_Data_Skill_Skill) + + Evergreen.V104.Types.UseSkillPoints p0 -> + Evergreen.V105.Types.UseSkillPoints (p0 |> migrate_Data_Skill_Skill) + + Evergreen.V104.Types.ChoosePerk p0 -> + Evergreen.V105.Types.ChoosePerk (p0 |> migrate_Data_Perk_Perk) + + Evergreen.V104.Types.MoveTo p0 p1 -> + Evergreen.V105.Types.MoveTo p0 p1 + + Evergreen.V104.Types.MessageWasRead p0 -> + Evergreen.V105.Types.MessageWasRead p0 + + Evergreen.V104.Types.RemoveMessage p0 -> + Evergreen.V105.Types.RemoveMessage p0 + + Evergreen.V104.Types.Barter p0 -> + Evergreen.V105.Types.Barter (p0 |> migrate_Data_Barter_State) + Evergreen.V105.Data.Vendor.Shop.ArroyoHakunin + + Evergreen.V104.Types.AdminToBackend p0 -> + Evergreen.V105.Types.AdminToBackend (p0 |> migrate_Types_AdminToBackend) + + +migrate_Types_ToFrontend : Evergreen.V104.Types.ToFrontend -> Evergreen.V105.Types.ToFrontend +migrate_Types_ToFrontend old = + case old of + Evergreen.V104.Types.CurrentPlayer p0 -> + Evergreen.V105.Types.CurrentPlayer (p0 |> migrate_Data_WorldData_PlayerData) + + Evergreen.V104.Types.CurrentWorlds p0 -> + Evergreen.V105.Types.CurrentWorlds (p0 |> List.map migrate_Data_WorldInfo_WorldInfo) + + Evergreen.V104.Types.CurrentAdmin p0 -> + Evergreen.V105.Types.CurrentAdmin (p0 |> migrate_Data_WorldData_AdminData) + + Evergreen.V104.Types.CurrentAdminLoggedInPlayers p0 -> + Evergreen.V105.Types.CurrentAdminLoggedInPlayers p0 + + Evergreen.V104.Types.CurrentAdminLastTenToBackendMsgs _ -> + Evergreen.V105.Types.CurrentAdminLastTenToBackendMsgs [] + + Evergreen.V104.Types.YoureLoggedOut p0 -> + Evergreen.V105.Types.YoureLoggedOut (p0 |> List.map migrate_Data_WorldInfo_WorldInfo) + + Evergreen.V104.Types.YourFightResult p0 -> + Evergreen.V105.Types.YourFightResult (p0 |> Tuple.mapBoth migrate_Data_Fight_Info migrate_Data_WorldData_PlayerData) + + Evergreen.V104.Types.YoureLoggedIn p0 -> + Evergreen.V105.Types.YoureLoggedIn (p0 |> migrate_Data_WorldData_PlayerData) + + Evergreen.V104.Types.YoureRegistered p0 -> + Evergreen.V105.Types.YoureRegistered (p0 |> migrate_Data_WorldData_PlayerData) + + Evergreen.V104.Types.CharCreationError p0 -> + Evergreen.V105.Types.CharCreationError (p0 |> migrate_Data_NewChar_CreationError) + + Evergreen.V104.Types.YouHaveCreatedChar p0 p1 -> + Evergreen.V105.Types.YouHaveCreatedChar (p0 |> migrate_Data_Player_CPlayer) + (p1 |> migrate_Data_WorldData_PlayerData) + + Evergreen.V104.Types.AlertMessage p0 -> + Evergreen.V105.Types.AlertMessage p0 + + Evergreen.V104.Types.YoureLoggedInAsAdmin p0 -> + Evergreen.V105.Types.YoureLoggedInAsAdmin (p0 |> migrate_Data_WorldData_AdminData) + + Evergreen.V104.Types.JsonExportDone p0 -> + Evergreen.V105.Types.JsonExportDone p0 + + Evergreen.V104.Types.BarterDone p0 -> + Evergreen.V105.Types.BarterDone (p0 |> Tuple.mapBoth migrate_Data_WorldData_PlayerData (Maybe.map migrate_Data_Barter_Message)) + + Evergreen.V104.Types.BarterMessage p0 -> + Evergreen.V105.Types.BarterMessage (p0 |> migrate_Data_Barter_Message) diff --git a/src/Evergreen/V105/Data/Auth.elm b/src/Evergreen/V105/Data/Auth.elm new file mode 100644 index 0000000..40912a7 --- /dev/null +++ b/src/Evergreen/V105/Data/Auth.elm @@ -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 diff --git a/src/Evergreen/V105/Data/Barter.elm b/src/Evergreen/V105/Data/Barter.elm new file mode 100644 index 0000000..ba31f46 --- /dev/null +++ b/src/Evergreen/V105/Data/Barter.elm @@ -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 + } diff --git a/src/Evergreen/V105/Data/Enemy.elm b/src/Evergreen/V105/Data/Enemy.elm new file mode 100644 index 0000000..9a48a3d --- /dev/null +++ b/src/Evergreen/V105/Data/Enemy.elm @@ -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 diff --git a/src/Evergreen/V105/Data/Fight.elm b/src/Evergreen/V105/Data/Fight.elm new file mode 100644 index 0000000..5563172 --- /dev/null +++ b/src/Evergreen/V105/Data/Fight.elm @@ -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 + } diff --git a/src/Evergreen/V105/Data/Fight/AimedShot.elm b/src/Evergreen/V105/Data/Fight/AimedShot.elm new file mode 100644 index 0000000..0d7e4a0 --- /dev/null +++ b/src/Evergreen/V105/Data/Fight/AimedShot.elm @@ -0,0 +1,12 @@ +module Evergreen.V105.Data.Fight.AimedShot exposing (..) + + +type AimedShot + = Head + | Torso + | Eyes + | Groin + | LeftArm + | RightArm + | LeftLeg + | RightLeg diff --git a/src/Evergreen/V105/Data/Fight/AttackStyle.elm b/src/Evergreen/V105/Data/Fight/AttackStyle.elm new file mode 100644 index 0000000..1d26f8c --- /dev/null +++ b/src/Evergreen/V105/Data/Fight/AttackStyle.elm @@ -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 diff --git a/src/Evergreen/V105/Data/Fight/OpponentType.elm b/src/Evergreen/V105/Data/Fight/OpponentType.elm new file mode 100644 index 0000000..537d9f1 --- /dev/null +++ b/src/Evergreen/V105/Data/Fight/OpponentType.elm @@ -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 diff --git a/src/Evergreen/V105/Data/FightStrategy.elm b/src/Evergreen/V105/Data/FightStrategy.elm new file mode 100644 index 0000000..ae95f28 --- /dev/null +++ b/src/Evergreen/V105/Data/FightStrategy.elm @@ -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 diff --git a/src/Evergreen/V105/Data/FightStrategy/Help.elm b/src/Evergreen/V105/Data/FightStrategy/Help.elm new file mode 100644 index 0000000..a8e966e --- /dev/null +++ b/src/Evergreen/V105/Data/FightStrategy/Help.elm @@ -0,0 +1,13 @@ +module Evergreen.V105.Data.FightStrategy.Help exposing (..) + + +type Reference + = Strategy + | Command + | Condition + | Attack + | Aim + | Item + | Value + | Operator + | Number diff --git a/src/Evergreen/V105/Data/HealthStatus.elm b/src/Evergreen/V105/Data/HealthStatus.elm new file mode 100644 index 0000000..b92d6f8 --- /dev/null +++ b/src/Evergreen/V105/Data/HealthStatus.elm @@ -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 diff --git a/src/Evergreen/V105/Data/Item.elm b/src/Evergreen/V105/Data/Item.elm new file mode 100644 index 0000000..02bfdc0 --- /dev/null +++ b/src/Evergreen/V105/Data/Item.elm @@ -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 + } diff --git a/src/Evergreen/V105/Data/Item/Kind.elm b/src/Evergreen/V105/Data/Item/Kind.elm new file mode 100644 index 0000000..6b31b66 --- /dev/null +++ b/src/Evergreen/V105/Data/Item/Kind.elm @@ -0,0 +1,93 @@ +module Evergreen.V105.Data.Item.Kind exposing (..) + + +type Kind + = Beer + | Fruit + | HealingPowder + | Stimpak + | SuperStimpak + | BigBookOfScience + | DeansElectronics + | FirstAidBook + | GunsAndBullets + | ScoutHandbook + | Robes + | LeatherJacket + | LeatherArmor + | MetalArmor + | TeslaArmor + | CombatArmor + | CombatArmorMk2 + | PowerArmor + | PowerFist + | MegaPowerFist + | CattleProd + | SuperCattleProd + | Knife + | Wakizashi + | LittleJesus + | Ripper + | SuperSledge + | Pistol223 + | Mauser9mm + | Pistol14mm + | NeedlerPistol + | GaussPistol + | Smg10mm + | HkP90c + | AssaultRifle + | ExpandedAssaultRifle + | HuntingRifle + | ScopedHuntingRifle + | RedRyderLEBBGun + | SniperRifle + | GaussRifle + | CombatShotgun + | HkCaws + | PancorJackhammer + | Shotgun + | SawedOffShotgun + | Minigun + | Bozar + | RocketLauncher + | LaserPistol + | MagnetoLaserPistol + | PulsePistol + | GatlingLaser + | LaserRifle + | LaserRifleExtCap + | PlasmaRifle + | TurboPlasmaRifle + | PulseRifle + | Flare + | FragGrenade + | BBAmmo + | SmallEnergyCell + | Fmj223 + | Ap5mm + | Mm9 + | Ball9mm + | Ap10mm + | Ap14mm + | ExplosiveRocket + | RocketAp + | HnNeedlerCartridge + | HnApNeedlerCartridge + | ShotgunShell + | Jhp10mm + | Jhp5mm + | MicrofusionCell + | Ec2mm + | Tool + | LockPicks + | ElectronicLockpick + | AbnormalBrain + | ChimpanzeeBrain + | HumanBrain + | CyberneticBrain + | GECK + | SkynetAim + | MotionSensor + | K9 + | MeatJerky diff --git a/src/Evergreen/V105/Data/Map.elm b/src/Evergreen/V105/Data/Map.elm new file mode 100644 index 0000000..ae11af8 --- /dev/null +++ b/src/Evergreen/V105/Data/Map.elm @@ -0,0 +1,9 @@ +module Evergreen.V105.Data.Map exposing (..) + + +type alias TileNum = + Int + + +type alias TileCoords = + ( Int, Int ) diff --git a/src/Evergreen/V105/Data/Message.elm b/src/Evergreen/V105/Data/Message.elm new file mode 100644 index 0000000..2826e8f --- /dev/null +++ b/src/Evergreen/V105/Data/Message.elm @@ -0,0 +1,32 @@ +module Evergreen.V105.Data.Message exposing (..) + +import Evergreen.V105.Data.Fight +import Evergreen.V105.Data.Player.PlayerName +import Time + + +type alias Id = + Int + + +type Content + = Welcome + | YouAdvancedLevel + { newLevel : Int + } + | YouWereAttacked + { attacker : Evergreen.V105.Data.Player.PlayerName.PlayerName + , fightInfo : Evergreen.V105.Data.Fight.Info + } + | YouAttacked + { target : Evergreen.V105.Data.Player.PlayerName.PlayerName + , fightInfo : Evergreen.V105.Data.Fight.Info + } + + +type alias Message = + { id : Id + , content : Content + , hasBeenRead : Bool + , date : Time.Posix + } diff --git a/src/Evergreen/V105/Data/NewChar.elm b/src/Evergreen/V105/Data/NewChar.elm new file mode 100644 index 0000000..7d2114a --- /dev/null +++ b/src/Evergreen/V105/Data/NewChar.elm @@ -0,0 +1,23 @@ +module Evergreen.V105.Data.NewChar exposing (..) + +import Evergreen.V105.Data.Skill +import Evergreen.V105.Data.Special +import Evergreen.V105.Data.Trait +import SeqSet + + +type CreationError + = DoesNotHaveThreeTaggedSkills + | HasSpecialPointsLeft + | UsedMoreSpecialPointsThanAvailable + | HasSpecialOutOfRange + | HasMoreThanTwoTraits + + +type alias NewChar = + { baseSpecial : Evergreen.V105.Data.Special.Special + , availableSpecial : Int + , taggedSkills : SeqSet.SeqSet Evergreen.V105.Data.Skill.Skill + , traits : SeqSet.SeqSet Evergreen.V105.Data.Trait.Trait + , error : Maybe CreationError + } diff --git a/src/Evergreen/V105/Data/Perk.elm b/src/Evergreen/V105/Data/Perk.elm new file mode 100644 index 0000000..5b21468 --- /dev/null +++ b/src/Evergreen/V105/Data/Perk.elm @@ -0,0 +1,50 @@ +module Evergreen.V105.Data.Perk exposing (..) + + +type Perk + = BonusHthDamage + | Awareness + | CautiousNature + | Comprehension + | EarlierSequence + | FasterHealing + | HereAndNow + | NightVision + | Survivalist + | SwiftLearner + | Thief + | Toughness + | AdrenalineRush + | BonusRangedDamage + | Educated + | FortuneFinder + | Gambler + | MoreCriticals + | Negotiator + | Pathfinder + | Ranger + | Salesman + | BetterCriticals + | Dodger + | Speaker + | ActionBoy + | GainStrength + | GainPerception + | GainEndurance + | GainCharisma + | GainIntelligence + | GainAgility + | GainLuck + | HthEvade + | Lifegiver + | LivingAnatomy + | MasterThief + | MasterTrader + | Medic + | MrFixit + | Tag + | BonusHthAttacks + | BonusRateOfFire + | Sniper + | Slayer + | GeckoSkinning diff --git a/src/Evergreen/V105/Data/Player.elm b/src/Evergreen/V105/Data/Player.elm new file mode 100644 index 0000000..69b0e15 --- /dev/null +++ b/src/Evergreen/V105/Data/Player.elm @@ -0,0 +1,91 @@ +module Evergreen.V105.Data.Player exposing (..) + +import Dict +import Evergreen.V105.Data.Auth +import Evergreen.V105.Data.FightStrategy +import Evergreen.V105.Data.HealthStatus +import Evergreen.V105.Data.Item +import Evergreen.V105.Data.Item.Kind +import Evergreen.V105.Data.Map +import Evergreen.V105.Data.Message +import Evergreen.V105.Data.Perk +import Evergreen.V105.Data.Player.PlayerName +import Evergreen.V105.Data.Quest +import Evergreen.V105.Data.Skill +import Evergreen.V105.Data.Special +import Evergreen.V105.Data.Trait +import Evergreen.V105.Data.Xp +import SeqDict +import SeqSet + + +type alias SPlayer = + { name : Evergreen.V105.Data.Player.PlayerName.PlayerName + , password : Evergreen.V105.Data.Auth.Password Evergreen.V105.Data.Auth.Verified + , worldName : String + , hp : Int + , maxHp : Int + , xp : Int + , special : Evergreen.V105.Data.Special.Special + , caps : Int + , ticks : Int + , wins : Int + , losses : Int + , location : Evergreen.V105.Data.Map.TileNum + , perks : SeqDict.SeqDict Evergreen.V105.Data.Perk.Perk Int + , messages : Dict.Dict Evergreen.V105.Data.Message.Id Evergreen.V105.Data.Message.Message + , items : Dict.Dict Evergreen.V105.Data.Item.Id Evergreen.V105.Data.Item.Item + , traits : SeqSet.SeqSet Evergreen.V105.Data.Trait.Trait + , addedSkillPercentages : SeqDict.SeqDict Evergreen.V105.Data.Skill.Skill Int + , taggedSkills : SeqSet.SeqSet Evergreen.V105.Data.Skill.Skill + , availableSkillPoints : Int + , availablePerks : Int + , equippedArmor : Maybe Evergreen.V105.Data.Item.Item + , equippedWeapon : Maybe Evergreen.V105.Data.Item.Item + , preferredAmmo : Maybe Evergreen.V105.Data.Item.Kind.Kind + , fightStrategy : Evergreen.V105.Data.FightStrategy.FightStrategy + , fightStrategyText : String + , questsActive : SeqSet.SeqSet Evergreen.V105.Data.Quest.Name + } + + +type Player a + = NeedsCharCreated (Evergreen.V105.Data.Auth.Auth Evergreen.V105.Data.Auth.Verified) + | Player a + + +type alias CPlayer = + { hp : Int + , maxHp : Int + , xp : Evergreen.V105.Data.Xp.Xp + , name : Evergreen.V105.Data.Player.PlayerName.PlayerName + , special : Evergreen.V105.Data.Special.Special + , caps : Int + , ticks : Int + , wins : Int + , losses : Int + , location : Evergreen.V105.Data.Map.TileNum + , perks : SeqDict.SeqDict Evergreen.V105.Data.Perk.Perk Int + , messages : Dict.Dict Evergreen.V105.Data.Message.Id Evergreen.V105.Data.Message.Message + , items : Dict.Dict Evergreen.V105.Data.Item.Id Evergreen.V105.Data.Item.Item + , traits : SeqSet.SeqSet Evergreen.V105.Data.Trait.Trait + , addedSkillPercentages : SeqDict.SeqDict Evergreen.V105.Data.Skill.Skill Int + , taggedSkills : SeqSet.SeqSet Evergreen.V105.Data.Skill.Skill + , availableSkillPoints : Int + , availablePerks : Int + , equippedArmor : Maybe Evergreen.V105.Data.Item.Item + , equippedWeapon : Maybe Evergreen.V105.Data.Item.Item + , preferredAmmo : Maybe Evergreen.V105.Data.Item.Kind.Kind + , fightStrategy : Evergreen.V105.Data.FightStrategy.FightStrategy + , fightStrategyText : String + , questsActive : SeqSet.SeqSet Evergreen.V105.Data.Quest.Name + } + + +type alias COtherPlayer = + { level : Evergreen.V105.Data.Xp.Level + , name : Evergreen.V105.Data.Player.PlayerName.PlayerName + , wins : Int + , losses : Int + , healthStatus : Evergreen.V105.Data.HealthStatus.HealthStatus + } diff --git a/src/Evergreen/V105/Data/Player/PlayerName.elm b/src/Evergreen/V105/Data/Player/PlayerName.elm new file mode 100644 index 0000000..d3a3811 --- /dev/null +++ b/src/Evergreen/V105/Data/Player/PlayerName.elm @@ -0,0 +1,5 @@ +module Evergreen.V105.Data.Player.PlayerName exposing (..) + + +type alias PlayerName = + String diff --git a/src/Evergreen/V105/Data/Quest.elm b/src/Evergreen/V105/Data/Quest.elm new file mode 100644 index 0000000..b5be4b1 --- /dev/null +++ b/src/Evergreen/V105/Data/Quest.elm @@ -0,0 +1,86 @@ +module Evergreen.V105.Data.Quest exposing (..) + + +type Name + = ArroyoKillEvilPlants + | ArroyoFixWellForFeargus + | ArroyoRescueNagorsDog + | KlamathRefuelStill + | KlamathGuardTheBrahmin + | KlamathRustleTheBrahmin + | KlamathKillRatGod + | KlamathRescueTorr + | KlamathSearchForSmileyTrapper + | ToxicCavesRescueSmileyTrapper + | ToxicCavesRepairTheGenerator + | ToxicCavesLootTheBunker + | DenFreeVicByPayingMetzger + | DenFreeVicByKillingOffSlaversGuild + | DenDeliverMealToSmitty + | DenFindCarParts + | DenFixTheCar + | ModocInvestigateGhostFarm + | ModocRemoveInfestationInFarrelsGarden + | ModocMediateBetweenSlagsAndJo + | ModocFindGoldWatchForCornelius + | ModocFindGoldWatchForFarrel + | VaultCityGetPlowForMrSmith + | VaultCityRescueAmandasHusband + | GeckoOptimizePowerPlant + | ReddingClearWanamingoMine + | ReddingFindExcavatorChip + | NewRenoTrackDownPrettyBoyLloyd + | NewRenoHelpGuardSecretTransaction + | NewRenoCollectTributeFromCorsicanBrothers + | NewRenoWinBoxingTournament + | NewRenoAcquireElectronicLockpick + | NCRGuardBrahminCaravan + | NCRTestMutagenicSerum + | NCRRetrieveComputerParts + | NCRFreeSlaves + | NCRInvestigateBrahminRaids + | V15RescueChrissy + | V15CompleteDealWithNCR + | V13FixVaultComputer + | V13FindTheGeck + | BrokenHillsFixMineAirPurifier + | BrokenHillsBlowUpMineAirPurifier + | BrokenHillsFindMissingPeople + | BrokenHillsBeatFrancisAtArmwrestling + | RaidersFindEvidenceOfBishopTampering + | RaidersKillEverybody + | SierraArmyDepotFindAbnormalBrainForSkynet + | SierraArmyDepotFindChimpanzeeBrainForSkynet + | SierraArmyDepotFindHumanBrainForSkynet + | SierraArmyDepotFindCyberneticBrainForSkynet + | SierraArmyDepotAssembleBodyForSkynet + | MilitaryBaseExcavateTheEntrance + | MilitaryBaseKillMelchior + | SanFranciscoFindFuelForTanker + | SanFranciscoFindLocationOfFobForTanker + | SanFranciscoFindNavCompPartForTanker + | SanFranciscoFindVertibirdPlansForHubologists + | SanFranciscoFindVertibirdPlansForShi + | SanFranciscoFindVertibirdPlansForBrotherhoodOfSteel + | SanFranciscoFindBadgersGirlfriendInsideShip + | SanFranciscoDefeatLoPanInRingForDragon + | SanFranciscoDefeatDragonInRingForLoPan + | SanFranciscoEmbarkForEnclave + | NavarroFixK9 + | NavarroRetrieveFobForTanker + | EnclavePersuadeControlCompanySquadToDesert + | EnclaveKillThePresidentStealthily + | EnclaveKillThePresidentTheUsualWay + | EnclaveFindTheGeck + | EnclaveRigTurretsToTargetFrankHorrigan + | EnclaveForceScientistToInitiateSelfDestruct + | EnclaveKillFrankHorrigan + | EnclaveReturnToMainland + + +type alias Progress = + { playersActive : Int + , ticksPerHour : Int + , ticksGiven : Int + , ticksGivenByPlayer : Int + } diff --git a/src/Evergreen/V105/Data/Skill.elm b/src/Evergreen/V105/Data/Skill.elm new file mode 100644 index 0000000..ba1df27 --- /dev/null +++ b/src/Evergreen/V105/Data/Skill.elm @@ -0,0 +1,22 @@ +module Evergreen.V105.Data.Skill exposing (..) + + +type Skill + = SmallGuns + | BigGuns + | EnergyWeapons + | Unarmed + | MeleeWeapons + | Throwing + | FirstAid + | Doctor + | Sneak + | Lockpick + | Steal + | Traps + | Science + | Repair + | Speech + | Barter + | Gambling + | Outdoorsman diff --git a/src/Evergreen/V105/Data/Special.elm b/src/Evergreen/V105/Data/Special.elm new file mode 100644 index 0000000..f4fb9fc --- /dev/null +++ b/src/Evergreen/V105/Data/Special.elm @@ -0,0 +1,22 @@ +module Evergreen.V105.Data.Special exposing (..) + + +type alias Special = + { strength : Int + , perception : Int + , endurance : Int + , charisma : Int + , intelligence : Int + , agility : Int + , luck : Int + } + + +type Type + = Strength + | Perception + | Endurance + | Charisma + | Intelligence + | Agility + | Luck diff --git a/src/Evergreen/V105/Data/Special/Perception.elm b/src/Evergreen/V105/Data/Special/Perception.elm new file mode 100644 index 0000000..0794e9d --- /dev/null +++ b/src/Evergreen/V105/Data/Special/Perception.elm @@ -0,0 +1,9 @@ +module Evergreen.V105.Data.Special.Perception exposing (..) + + +type PerceptionLevel + = Perfect + | Great + | Good + | Bad + | Atrocious diff --git a/src/Evergreen/V105/Data/Tick.elm b/src/Evergreen/V105/Data/Tick.elm new file mode 100644 index 0000000..2869855 --- /dev/null +++ b/src/Evergreen/V105/Data/Tick.elm @@ -0,0 +1,9 @@ +module Evergreen.V105.Data.Tick exposing (..) + + +type TickPerIntervalCurve + = QuarterAndRest + { quarter : Int + , rest : Int + } + | Linear Int diff --git a/src/Evergreen/V105/Data/Trait.elm b/src/Evergreen/V105/Data/Trait.elm new file mode 100644 index 0000000..442163b --- /dev/null +++ b/src/Evergreen/V105/Data/Trait.elm @@ -0,0 +1,12 @@ +module Evergreen.V105.Data.Trait exposing (..) + + +type Trait + = Bruiser + | FastShot + | Finesse + | Gifted + | HeavyHanded + | Kamikaze + | Skilled + | SmallFrame diff --git a/src/Evergreen/V105/Data/Vendor.elm b/src/Evergreen/V105/Data/Vendor.elm new file mode 100644 index 0000000..5cd1585 --- /dev/null +++ b/src/Evergreen/V105/Data/Vendor.elm @@ -0,0 +1,14 @@ +module Evergreen.V105.Data.Vendor exposing (..) + +import Dict +import Evergreen.V105.Data.Item +import Evergreen.V105.Data.Vendor.Shop + + +type alias Vendor = + { shop : Evergreen.V105.Data.Vendor.Shop.Shop + , currentSpec : Evergreen.V105.Data.Vendor.Shop.ShopSpec + , items : Dict.Dict Evergreen.V105.Data.Item.Id Evergreen.V105.Data.Item.Item + , caps : Int + , discountPct : Int + } diff --git a/src/Evergreen/V105/Data/Vendor/Shop.elm b/src/Evergreen/V105/Data/Vendor/Shop.elm new file mode 100644 index 0000000..53a4759 --- /dev/null +++ b/src/Evergreen/V105/Data/Vendor/Shop.elm @@ -0,0 +1,36 @@ +module Evergreen.V105.Data.Vendor.Shop exposing (..) + +import Evergreen.V105.Data.Item +import Evergreen.V105.Random.FloatExtra + + +type Shop + = ArroyoHakunin + | KlamathMaida + | KlamathVic + | DenFlick + | ModocJo + | VaultCityRandal + | VaultCityHappyHarry + | GeckoSurvivalGearPercy + | ReddingAscorti + | BrokenHillsGeneralStoreLiz + | BrokenHillsChemistJacob + | NewRenoArmsEldridge + | NewRenoRenescoPharmacy + | NCRBuster + | NCRDuppo + | SanFranciscoFlyingDragon8LaoChou + | SanFranciscoRed888GunsMaiDaChiang + | SanFranciscoPunksCal + | SanFranciscoPunksJenna + + +type alias ShopSpec = + { caps : Evergreen.V105.Random.FloatExtra.NormalIntSpec + , stock : + List + { uniqueKey : Evergreen.V105.Data.Item.UniqueKey + , maxCount : Int + } + } diff --git a/src/Evergreen/V105/Data/World.elm b/src/Evergreen/V105/Data/World.elm new file mode 100644 index 0000000..94085c1 --- /dev/null +++ b/src/Evergreen/V105/Data/World.elm @@ -0,0 +1,33 @@ +module Evergreen.V105.Data.World exposing (..) + +import Dict +import Evergreen.V105.Data.Player +import Evergreen.V105.Data.Player.PlayerName +import Evergreen.V105.Data.Quest +import Evergreen.V105.Data.Tick +import Evergreen.V105.Data.Vendor +import Evergreen.V105.Data.Vendor.Shop +import SeqDict +import SeqSet +import Time +import Time.Extra + + +type alias Name = + String + + +type alias World = + { players : Dict.Dict Evergreen.V105.Data.Player.PlayerName.PlayerName (Evergreen.V105.Data.Player.Player Evergreen.V105.Data.Player.SPlayer) + , nextWantedTick : Maybe Time.Posix + , nextVendorRestockTick : Maybe Time.Posix + , vendors : SeqDict.SeqDict Evergreen.V105.Data.Vendor.Shop.Shop Evergreen.V105.Data.Vendor.Vendor + , lastItemId : Int + , description : String + , startedAt : Time.Posix + , tickFrequency : Time.Extra.Interval + , tickPerIntervalCurve : Evergreen.V105.Data.Tick.TickPerIntervalCurve + , vendorRestockFrequency : Time.Extra.Interval + , questsProgress : SeqDict.SeqDict Evergreen.V105.Data.Quest.Name (Dict.Dict Evergreen.V105.Data.Player.PlayerName.PlayerName Int) + , questRewardShops : SeqSet.SeqSet Evergreen.V105.Data.Vendor.Shop.Shop + } diff --git a/src/Evergreen/V105/Data/WorldData.elm b/src/Evergreen/V105/Data/WorldData.elm new file mode 100644 index 0000000..1b462e6 --- /dev/null +++ b/src/Evergreen/V105/Data/WorldData.elm @@ -0,0 +1,52 @@ +module Evergreen.V105.Data.WorldData exposing (..) + +import Dict +import Evergreen.V105.Data.Player +import Evergreen.V105.Data.Player.PlayerName +import Evergreen.V105.Data.Quest +import Evergreen.V105.Data.Tick +import Evergreen.V105.Data.Vendor +import Evergreen.V105.Data.Vendor.Shop +import Evergreen.V105.Data.World +import SeqDict +import SeqSet +import Time +import Time.Extra + + +type alias AdminData = + { worlds : + Dict.Dict + Evergreen.V105.Data.World.Name + { players : Dict.Dict Evergreen.V105.Data.Player.PlayerName.PlayerName (Evergreen.V105.Data.Player.Player Evergreen.V105.Data.Player.SPlayer) + , nextWantedTick : Maybe Time.Posix + , description : String + , startedAt : Time.Posix + , tickFrequency : Time.Extra.Interval + , tickPerIntervalCurve : Evergreen.V105.Data.Tick.TickPerIntervalCurve + , vendorRestockFrequency : Time.Extra.Interval + } + , loggedInPlayers : Dict.Dict Evergreen.V105.Data.World.Name (List Evergreen.V105.Data.Player.PlayerName.PlayerName) + } + + +type alias PlayerData = + { worldName : Evergreen.V105.Data.World.Name + , description : String + , startedAt : Time.Posix + , tickFrequency : Time.Extra.Interval + , tickPerIntervalCurve : Evergreen.V105.Data.Tick.TickPerIntervalCurve + , vendorRestockFrequency : Time.Extra.Interval + , player : Evergreen.V105.Data.Player.Player Evergreen.V105.Data.Player.CPlayer + , otherPlayers : List Evergreen.V105.Data.Player.COtherPlayer + , playerRank : Int + , vendors : SeqDict.SeqDict Evergreen.V105.Data.Vendor.Shop.Shop Evergreen.V105.Data.Vendor.Vendor + , questsProgress : SeqDict.SeqDict Evergreen.V105.Data.Quest.Name Evergreen.V105.Data.Quest.Progress + , questRewardShops : SeqSet.SeqSet Evergreen.V105.Data.Vendor.Shop.Shop + } + + +type WorldData + = IsAdmin AdminData + | IsPlayer PlayerData + | NotLoggedIn diff --git a/src/Evergreen/V105/Data/WorldInfo.elm b/src/Evergreen/V105/Data/WorldInfo.elm new file mode 100644 index 0000000..2a783f2 --- /dev/null +++ b/src/Evergreen/V105/Data/WorldInfo.elm @@ -0,0 +1,16 @@ +module Evergreen.V105.Data.WorldInfo exposing (..) + +import Evergreen.V105.Data.Tick +import Time +import Time.Extra + + +type alias WorldInfo = + { name : String + , description : String + , playersCount : Int + , startedAt : Time.Posix + , tickFrequency : Time.Extra.Interval + , tickPerIntervalCurve : Evergreen.V105.Data.Tick.TickPerIntervalCurve + , vendorRestockFrequency : Time.Extra.Interval + } diff --git a/src/Evergreen/V105/Data/Xp.elm b/src/Evergreen/V105/Data/Xp.elm new file mode 100644 index 0000000..74f81f8 --- /dev/null +++ b/src/Evergreen/V105/Data/Xp.elm @@ -0,0 +1,9 @@ +module Evergreen.V105.Data.Xp exposing (..) + + +type alias Xp = + Int + + +type alias Level = + Int diff --git a/src/Evergreen/V105/Frontend/HoveredItem.elm b/src/Evergreen/V105/Frontend/HoveredItem.elm new file mode 100644 index 0000000..8e97103 --- /dev/null +++ b/src/Evergreen/V105/Frontend/HoveredItem.elm @@ -0,0 +1,17 @@ +module Evergreen.V105.Frontend.HoveredItem exposing (..) + +import Evergreen.V105.Data.FightStrategy.Help +import Evergreen.V105.Data.Perk +import Evergreen.V105.Data.Skill +import Evergreen.V105.Data.Special +import Evergreen.V105.Data.Special.Perception +import Evergreen.V105.Data.Trait + + +type HoveredItem + = HoveredPerk Evergreen.V105.Data.Perk.Perk + | HoveredTrait Evergreen.V105.Data.Trait.Trait + | HoveredSpecial Evergreen.V105.Data.Special.Type + | HoveredSkill Evergreen.V105.Data.Skill.Skill + | HoveredFightStrategyReference Evergreen.V105.Data.FightStrategy.Help.Reference + | HoveredPerceptionLevel Evergreen.V105.Data.Special.Perception.PerceptionLevel diff --git a/src/Evergreen/V105/Frontend/Route.elm b/src/Evergreen/V105/Frontend/Route.elm new file mode 100644 index 0000000..c5f3594 --- /dev/null +++ b/src/Evergreen/V105/Frontend/Route.elm @@ -0,0 +1,37 @@ +module Evergreen.V105.Frontend.Route exposing (..) + +import Evergreen.V105.Data.Message +import Evergreen.V105.Data.Vendor.Shop +import Evergreen.V105.Data.World +import Url + + +type PlayerRoute + = AboutWorld + | Character + | Inventory + | Ladder + | TownMainSquare + | TownStore Evergreen.V105.Data.Vendor.Shop.Shop + | Fight + | Messages + | Message Evergreen.V105.Data.Message.Id + | CharCreation + | SettingsFightStrategy + | SettingsFightStrategySyntaxHelp + + +type AdminRoute + = AdminWorldsList + | AdminWorldActivity Evergreen.V105.Data.World.Name + | AdminWorldHiscores Evergreen.V105.Data.World.Name + + +type Route + = About + | News + | Map + | WorldsList + | NotFound Url.Url + | PlayerRoute PlayerRoute + | AdminRoute AdminRoute diff --git a/src/Evergreen/V105/Random/FloatExtra.elm b/src/Evergreen/V105/Random/FloatExtra.elm new file mode 100644 index 0000000..34e3a68 --- /dev/null +++ b/src/Evergreen/V105/Random/FloatExtra.elm @@ -0,0 +1,7 @@ +module Evergreen.V105.Random.FloatExtra exposing (..) + + +type alias NormalIntSpec = + { average : Int + , maxDeviation : Int + } diff --git a/src/Evergreen/V105/Types.elm b/src/Evergreen/V105/Types.elm new file mode 100644 index 0000000..57295fb --- /dev/null +++ b/src/Evergreen/V105/Types.elm @@ -0,0 +1,210 @@ +module Evergreen.V105.Types exposing (..) + +import BiDict +import Browser +import Browser.Navigation +import Dict +import Evergreen.V105.Data.Auth +import Evergreen.V105.Data.Barter +import Evergreen.V105.Data.Fight +import Evergreen.V105.Data.FightStrategy +import Evergreen.V105.Data.Item +import Evergreen.V105.Data.Item.Kind +import Evergreen.V105.Data.Map +import Evergreen.V105.Data.Message +import Evergreen.V105.Data.NewChar +import Evergreen.V105.Data.Perk +import Evergreen.V105.Data.Player +import Evergreen.V105.Data.Player.PlayerName +import Evergreen.V105.Data.Quest +import Evergreen.V105.Data.Skill +import Evergreen.V105.Data.Special +import Evergreen.V105.Data.Trait +import Evergreen.V105.Data.Vendor.Shop +import Evergreen.V105.Data.World +import Evergreen.V105.Data.WorldData +import Evergreen.V105.Data.WorldInfo +import Evergreen.V105.Frontend.HoveredItem +import Evergreen.V105.Frontend.Route +import File +import Lamdera +import Queue +import Random +import SeqSet +import Set +import Time +import Url + + +type AdminToBackend + = ExportJson + | ImportJson String + | CreateNewWorld String Bool + + +type ToBackend + = LogMeIn (Evergreen.V105.Data.Auth.Auth Evergreen.V105.Data.Auth.Hashed) + | RegisterMe (Evergreen.V105.Data.Auth.Auth Evergreen.V105.Data.Auth.Hashed) + | CreateNewChar Evergreen.V105.Data.NewChar.NewChar + | LogMeOut + | Fight Evergreen.V105.Data.Player.PlayerName.PlayerName + | HealMe + | UseItem Evergreen.V105.Data.Item.Id + | Wander + | EquipArmor Evergreen.V105.Data.Item.Id + | EquipWeapon Evergreen.V105.Data.Item.Id + | PreferAmmo Evergreen.V105.Data.Item.Kind.Kind + | SetFightStrategy ( Evergreen.V105.Data.FightStrategy.FightStrategy, String ) + | UnequipArmor + | UnequipWeapon + | ClearPreferredAmmo + | RefreshPlease + | TagSkill Evergreen.V105.Data.Skill.Skill + | UseSkillPoints Evergreen.V105.Data.Skill.Skill + | ChoosePerk Evergreen.V105.Data.Perk.Perk + | MoveTo Evergreen.V105.Data.Map.TileCoords (Set.Set Evergreen.V105.Data.Map.TileCoords) + | MessageWasRead Evergreen.V105.Data.Message.Id + | RemoveMessage Evergreen.V105.Data.Message.Id + | RemoveFightMessages + | RemoveAllMessages + | Barter Evergreen.V105.Data.Barter.State Evergreen.V105.Data.Vendor.Shop.Shop + | AdminToBackend AdminToBackend + | StopProgressing Evergreen.V105.Data.Quest.Name + | StartProgressing Evergreen.V105.Data.Quest.Name + + +type alias FrontendModel = + { key : Browser.Navigation.Key + , route : Evergreen.V105.Frontend.Route.Route + , time : Time.Posix + , zone : Time.Zone + , loginForm : Evergreen.V105.Data.Auth.Auth Evergreen.V105.Data.Auth.Plaintext + , worlds : Maybe (List Evergreen.V105.Data.WorldInfo.WorldInfo) + , worldData : Evergreen.V105.Data.WorldData.WorldData + , alertMessage : Maybe String + , newChar : Evergreen.V105.Data.NewChar.NewChar + , mapMouseCoords : Maybe ( Evergreen.V105.Data.Map.TileCoords, Set.Set Evergreen.V105.Data.Map.TileCoords ) + , hoveredItem : Maybe Evergreen.V105.Frontend.HoveredItem.HoveredItem + , fightInfo : Maybe Evergreen.V105.Data.Fight.Info + , barter : Evergreen.V105.Data.Barter.State + , fightStrategyText : String + , expandedQuests : SeqSet.SeqSet Evergreen.V105.Data.Quest.Name + , userWantsToShowAreaDanger : Bool + , lastTenToBackendMsgs : List ( Evergreen.V105.Data.Player.PlayerName.PlayerName, Evergreen.V105.Data.World.Name, ToBackend ) + , adminNewWorldName : String + , adminNewWorldFast : Bool + } + + +type alias BackendModel = + { worlds : Dict.Dict Evergreen.V105.Data.World.Name Evergreen.V105.Data.World.World + , time : Time.Posix + , loggedInPlayers : BiDict.BiDict Lamdera.ClientId ( Evergreen.V105.Data.World.Name, Evergreen.V105.Data.Player.PlayerName.PlayerName ) + , adminLoggedIn : Maybe ( Lamdera.ClientId, Lamdera.SessionId ) + , lastTenToBackendMsgs : Queue.Queue ( Evergreen.V105.Data.Player.PlayerName.PlayerName, Evergreen.V105.Data.World.Name, ToBackend ) + , randomSeed : Random.Seed + , playerDataCache : Dict.Dict Lamdera.ClientId Int + } + + +type BarterMsg + = AddPlayerItem Evergreen.V105.Data.Item.Id Int + | AddVendorItem Evergreen.V105.Data.Item.Id Int + | AddPlayerCaps Int + | AddVendorCaps Int + | RemovePlayerItem Evergreen.V105.Data.Item.Id Int + | RemoveVendorItem Evergreen.V105.Data.Item.Id Int + | RemovePlayerCaps Int + | RemoveVendorCaps Int + | ResetBarter + | ConfirmBarter Evergreen.V105.Data.Vendor.Shop.Shop + | SetTransferNInput Evergreen.V105.Data.Barter.TransferNPosition String + | SetTransferNActive Evergreen.V105.Data.Barter.TransferNPosition + | UnsetTransferNActive + + +type FrontendMsg + = UrlClicked Browser.UrlRequest + | UrlChanged Url.Url + | GoToRoute Evergreen.V105.Frontend.Route.Route + | GoToTownStore Evergreen.V105.Data.Vendor.Shop.Shop + | Logout + | Login + | Register + | GotZone Time.Zone + | GotTime Time.Posix + | AskToFight Evergreen.V105.Data.Player.PlayerName.PlayerName + | AskToHeal + | AskToUseItem Evergreen.V105.Data.Item.Id + | AskToWander + | AskToChoosePerk Evergreen.V105.Data.Perk.Perk + | AskToEquipArmor Evergreen.V105.Data.Item.Id + | AskToEquipWeapon Evergreen.V105.Data.Item.Id + | AskToPreferAmmo Evergreen.V105.Data.Item.Kind.Kind + | AskToUnequipArmor + | AskToUnequipWeapon + | AskToClearPreferredAmmo + | AskToSetFightStrategy ( Evergreen.V105.Data.FightStrategy.FightStrategy, String ) + | AskForExport + | ImportButtonClicked + | ImportFileSelected File.File + | AskToImport String + | Refresh + | AskToTagSkill Evergreen.V105.Data.Skill.Skill + | AskToUseSkillPoints Evergreen.V105.Data.Skill.Skill + | SetAuthName String + | SetAuthPassword String + | SetAuthWorld String + | CreateChar + | NewCharIncSpecial Evergreen.V105.Data.Special.Type + | NewCharDecSpecial Evergreen.V105.Data.Special.Type + | NewCharToggleTaggedSkill Evergreen.V105.Data.Skill.Skill + | NewCharToggleTrait Evergreen.V105.Data.Trait.Trait + | MapMouseAtCoords Evergreen.V105.Data.Map.TileCoords + | MapMouseOut + | MapMouseClick + | SetShowAreaDanger Bool + | OpenMessage Evergreen.V105.Data.Message.Id + | AskToRemoveMessage Evergreen.V105.Data.Message.Id + | AskToRemoveFightMessages + | AskToRemoveAllMessages + | BarterMsg BarterMsg + | HoverItem Evergreen.V105.Frontend.HoveredItem.HoveredItem + | StopHoveringItem + | SetFightStrategyText String + | SetAdminNewWorldName String + | SetAdminNewWorldFast Bool + | AskToCreateNewWorld + | ExpandQuestItem Evergreen.V105.Data.Quest.Name + | CollapseQuestItem Evergreen.V105.Data.Quest.Name + | AskToStopProgressing Evergreen.V105.Data.Quest.Name + | AskToStartProgressing Evergreen.V105.Data.Quest.Name + + +type BackendMsg + = Connected Lamdera.SessionId Lamdera.ClientId + | Disconnected Lamdera.SessionId Lamdera.ClientId + | FirstTick Time.Posix + | Tick Time.Posix + | CreateNewCharWithTime Lamdera.ClientId Evergreen.V105.Data.NewChar.NewChar Time.Posix + | LoggedToBackendMsg + + +type ToFrontend + = CurrentPlayer Evergreen.V105.Data.WorldData.PlayerData + | CurrentWorlds (List Evergreen.V105.Data.WorldInfo.WorldInfo) + | CurrentAdmin Evergreen.V105.Data.WorldData.AdminData + | CurrentAdminLoggedInPlayers (Dict.Dict Evergreen.V105.Data.World.Name (List Evergreen.V105.Data.Player.PlayerName.PlayerName)) + | CurrentAdminLastTenToBackendMsgs (List ( Evergreen.V105.Data.Player.PlayerName.PlayerName, Evergreen.V105.Data.World.Name, ToBackend )) + | YoureLoggedOut (List Evergreen.V105.Data.WorldInfo.WorldInfo) + | YourFightResult ( Evergreen.V105.Data.Fight.Info, Evergreen.V105.Data.WorldData.PlayerData ) + | YoureLoggedIn Evergreen.V105.Data.WorldData.PlayerData + | YoureRegistered Evergreen.V105.Data.WorldData.PlayerData + | CharCreationError Evergreen.V105.Data.NewChar.CreationError + | YouHaveCreatedChar Evergreen.V105.Data.Player.CPlayer Evergreen.V105.Data.WorldData.PlayerData + | AlertMessage String + | YoureLoggedInAsAdmin Evergreen.V105.Data.WorldData.AdminData + | JsonExportDone String + | BarterDone ( Evergreen.V105.Data.WorldData.PlayerData, Maybe Evergreen.V105.Data.Barter.Message ) + | BarterMessage Evergreen.V105.Data.Barter.Message + | YourMessages (Dict.Dict Evergreen.V105.Data.Message.Id Evergreen.V105.Data.Message.Message)