diff --git a/public/main.js b/public/main.js index 037adbf6a465c472829fd2fea89b8bbb80d1a738..e52c1204d5d2c112b6767f615cc9e41db36da36d 100644 --- a/public/main.js +++ b/public/main.js @@ -5167,6 +5167,7 @@ var $author$project$Sphere$dots = function (value) { return A3($author$project$BoundedInt$new, value, 0, 5); }; var $author$project$Character$new = { + arete: A3($author$project$BoundedInt$new, 1, 0, 10), creationPoints: {freebie: 15, spheres: 6}, name: 'Default Name', spheres: _List_fromArray( @@ -5180,6 +5181,41 @@ var $author$project$Character$new = { affinity: false, dots: $author$project$Sphere$dots(0), name: 'Entropy' + }, + { + affinity: false, + dots: $author$project$Sphere$dots(0), + name: 'Forces' + }, + { + affinity: false, + dots: $author$project$Sphere$dots(0), + name: 'Life' + }, + { + affinity: false, + dots: $author$project$Sphere$dots(0), + name: 'Matter' + }, + { + affinity: false, + dots: $author$project$Sphere$dots(0), + name: 'Mind' + }, + { + affinity: false, + dots: $author$project$Sphere$dots(0), + name: 'Prime' + }, + { + affinity: false, + dots: $author$project$Sphere$dots(0), + name: 'Spirit' + }, + { + affinity: false, + dots: $author$project$Sphere$dots(0), + name: 'Time' } ]) }; @@ -5277,7 +5313,7 @@ var $author$project$Character$changeSphere = F2( return 0; } else { var oldDots = maybeOldDots.a; - return sphere.dots.value - oldDots.value; + return (_Utils_cmp(sphere.dots.value, character.arete.value) > 0) ? character.arete.value : (sphere.dots.value - oldDots.value); } }(); if (maybeOldDots.$ === 'Nothing') { diff --git a/src/Character.elm b/src/Character.elm index 9ad4726d97320bbec2bb7e792301ce0bbc3cf4db..849a3db5cbdd99672c6f903c81b1dbbb9757f299 100644 --- a/src/Character.elm +++ b/src/Character.elm @@ -1,15 +1,14 @@ module Character exposing (..) import Sphere exposing (Sphere) -import Json.Decode exposing (int) import Sphere exposing (getDotsOfSphereInList) -import BoundedInt -import Html exposing (s) +import BoundedInt exposing (BoundedInt) type alias Character = { name : String , creationPoints : CreationPoints , spheres : List Sphere + , arete : BoundedInt } type alias CreationPoints = @@ -32,7 +31,9 @@ changeSphere character sphere = difference = case maybeOldDots of Nothing -> 0 Just oldDots -> - sphere.dots.value - oldDots.value + if sphere.dots.value > character.arete.value + then character.arete.value + else sphere.dots.value - oldDots.value in case maybeOldDots of Nothing -> character @@ -70,7 +71,6 @@ changeSphere character sphere = , spheres = character.creationPoints.spheres - difference } } - -- this currently works incorrectly new : Character new = @@ -88,5 +88,34 @@ new = , dots = Sphere.dots 0 , affinity = False } + , { name = "Forces" + , dots = Sphere.dots 0 + , affinity = False + } + , { name = "Life" + , dots = Sphere.dots 0 + , affinity = False + } + , { name = "Matter" + , dots = Sphere.dots 0 + , affinity = False + } + , { name = "Mind" + , dots = Sphere.dots 0 + , affinity = False + } + , { name = "Prime" + , dots = Sphere.dots 0 + , affinity = False + } + , { name = "Spirit" + , dots = Sphere.dots 0 + , affinity = False + } + , { name = "Time" + , dots = Sphere.dots 0 + , affinity = False + } ] + , arete = BoundedInt.new 1 0 10 } \ No newline at end of file