Warning, /rolisteam/rolisteam-community-data/charactersheets/fr/starwars_dice_panel_edge/starwars.rcs is written in an unsupported language. File is not indexed.

0001 {
0002     "additionnalCode": "",
0003     "additionnalCodeTop": true,
0004     "additionnalImport": "",
0005     "background": [],
0006     "characterCount": 6,
0007     "characters": [
0008         {
0009             "idSheet": "{c9db2936-3d71-432c-8560-359d15edd84d}",
0010             "name": "Character 1",
0011             "values": {
0012                 "id_1": {
0013                     "formula": "",
0014                     "id": "id_1",
0015                     "label": "value",
0016                     "readonly": false,
0017                     "type": "field",
0018                     "typefield": 0,
0019                     "value": ""
0020                 }
0021             }
0022         },
0023         {
0024             "idSheet": "{b6e20186-c6a7-48fc-836a-b8e3eff77961}",
0025             "name": "Character 2",
0026             "values": {
0027                 "id_1": {
0028                     "formula": "",
0029                     "id": "id_1",
0030                     "label": "value",
0031                     "readonly": false,
0032                     "type": "field",
0033                     "typefield": 0,
0034                     "value": ""
0035                 }
0036             }
0037         },
0038         {
0039             "idSheet": "{8f89cb3d-13a5-4333-9733-f3d5a84880d2}",
0040             "name": "Character 3",
0041             "values": {
0042                 "id_1": {
0043                     "formula": "",
0044                     "id": "id_1",
0045                     "label": "value",
0046                     "readonly": false,
0047                     "type": "field",
0048                     "typefield": 0,
0049                     "value": ""
0050                 }
0051             }
0052         },
0053         {
0054             "idSheet": "{9dbe086e-7119-416c-8d0f-b19c60a556f8}",
0055             "name": "Character 4",
0056             "values": {
0057                 "id_1": {
0058                     "formula": "",
0059                     "id": "id_1",
0060                     "label": "value",
0061                     "readonly": false,
0062                     "type": "field",
0063                     "typefield": 0,
0064                     "value": ""
0065                 }
0066             }
0067         },
0068         {
0069             "idSheet": "{5dbeee1e-3229-4694-93af-5eaacac54612}",
0070             "name": "Character 5",
0071             "values": {
0072                 "id_1": {
0073                     "formula": "",
0074                     "id": "id_1",
0075                     "label": "value",
0076                     "readonly": false,
0077                     "type": "field",
0078                     "typefield": 0,
0079                     "value": ""
0080                 }
0081             }
0082         },
0083         {
0084             "idSheet": "{25c5bc22-29f8-4f32-934b-bd404bc22d52}",
0085             "name": "Character 6",
0086             "values": {
0087                 "id_1": {
0088                     "formula": "",
0089                     "id": "id_1",
0090                     "label": "value",
0091                     "readonly": false,
0092                     "type": "field",
0093                     "typefield": 0,
0094                     "value": ""
0095                 }
0096             }
0097         }
0098     ],
0099     "data": {
0100         "items": [
0101             {
0102                 "bgcolor": {
0103                     "a": 0,
0104                     "b": 0,
0105                     "g": 0,
0106                     "r": 0
0107                 },
0108                 "border": 16,
0109                 "clippedText": false,
0110                 "font": "Ubuntu,11,-1,5,50,0,0,0,0,0",
0111                 "formula": "",
0112                 "height": 51,
0113                 "id": "id_1",
0114                 "label": "value",
0115                 "page": 0,
0116                 "textalign": 2,
0117                 "textcolor": {
0118                     "a": 255,
0119                     "b": 0,
0120                     "g": 0,
0121                     "r": 0
0122                 },
0123                 "type": "field",
0124                 "typefield": 0,
0125                 "value": "yellow5.png,yellow4.png,yellow0.png,green4.png,green2.png,green2.png,green5.png",
0126                 "values": [],
0127                 "width": 138,
0128                 "x": 67,
0129                 "y": 54
0130             }
0131         ],
0132         "name": "",
0133         "type": "Section"
0134     },
0135     "fixedScale": 1,
0136     "flickable": false,
0137     "fonts": [],
0138     "qml": "import QtQuick 2.0\nimport QtQuick.Layouts 1.3\nimport QtQuick.Controls 1.4\n\nRectangle {\n    id: swDice\n    color: \"gray\"\n    height: 400\n    width: 900\n\n    property var model: []\n\n    signal rollDiceCmd(string cmd)\n\n    property alias yellowCount: yellow.value\n    property alias whiteCount:  white.value\n    property alias blackCount:  black.value\n    property alias blueCount:  blue.value\n    property alias greenCount:  green.value\n    property alias violetCount:  violet.value\n    property alias redCount:  red.value\n    property int success : 0\n    property int fail: 0\n    property int advantage: 0\n    property int desavantage: 0\n    property int triomphe: 0\n    property int disaster: 0\n    readonly property string path: \"http://blog.rolisteam.org/file/starwars/\"\n    property string resultData: id_1.value\n    onResultDataChanged: {\n        if(repeat.model.join() !== resultData)\n            repeat.model = resultData.split(\",\");\n    }\n\n    function imageToValue(img)\n    {\n        if(img === \"yellow5.png\")\n        { //Succes, Avantage\n\tswDice.success +=1\n\tswDice.advantage += 1\n        }\n        else if(img === \"yellow4.png\")\n\tswDice.thiomphe += 1\n        else if(img === \"yellow3.png\")\n\tswDice.advantage += 1\n        else if(img === \"yellow2.png\")\n\tswDice.success +=2\n        else if(img === \"yellow1.png\")\n\tswDice.success +=1\n        else if(img === \"yellow0.png\")\n\tswDice.advantage += 2\n        else if(img === \"violet5.png\")\n            \tswDice.desavantage += 2\n        else if(img === \"violet4.png\")\n            \tswDice.fail += 1\n        else if(img === \"violet3.png\")\n            \tswDice.fail +=2\n        else if(img === \"violet2.png\")\n        {\n\tswDice.fail += 1\n\tswDice.desavantage += 1\n        }\n        else if(img === \"violet0.png\")\n            \tswDice.desavantage += 1\n        else if(img === \"red5.png\")\n            \tswDice.desavantage += 1\n        else if(img === \"red4.png\")\n\tswDice.disaster +=1\n        else if(img === \"red3.png\")\n                        swDice.fail += 1\n        else if(img === \"red2.png\")\n            swDice.fail += 2\n        else if(img === \"red1.png\")\n{\n            swDice.fail += 1\n             swDice.desavantage += 1\n}\n        else if(img === \"red0.png\")\n                       swDice.desavantage += 2\n        else if(img === \"green4.png\")\n\tswDice.success +=2\n        else if(img === \"green3.png\")\n            \tswDice.advantage += 2\n        else if(img === \"green2.png\")\n            \tswDice.advantage += 1\n        else if(img === \"green1.png\")\n{\n\tswDice.success +=1\n            \tswDice.advantage += 1\n}\n        else if(img === \"green0.png\")\n\tswDice.success +=1\n        else if(img === \"black1.png\")\n                        swDice.desavantage += 1\n        else if(img === \"black0.png\")\n            \tswDice.fail += 1\n        else if(img === \"blue3.png\")\n            \tswDice.advantage += 1\n        else if(img === \"blue2.png\")\n{\n\tswDice.success +=1\n\tswDice.advantage += 1\n}\n        else if(img === \"blue1.png\")\n           \tswDice.advantage += 2\n        else if(img === \"blue0.png\")\n\tswDice.success +=1\n        /*else if(img === \"white3.png\")\n            return \"Obscur, Obscur\"\n        else if(img === \"white2.png\")\n            return \"Lumineux\"\n        else if(img === \"white1.png\")\n            return \"Lumineux, Lumineux\"\n        else if(img === \"white0.png\")\n            return \"Obscur\"\n        else\n            return \"\"*/\n    }\n\n    function computeResult()\n    {\n        swDice.model = []\n\tswDice.success = 0\n\tswDice.fail= 0\n\tswDice.advantage= 0\n\tswDice.desavantage= 0\n\tswDice.triomphe= 0\n    \tswDice.disaster= 0\n        //white\n        for(var i = 0; i < whiteCount; ++i )\n        {\n            swDice.model.push(whiteToImage(rollDice(12)));\n        }\n        //red\n        for( i = 0; i < redCount; ++i )\n        {\n            swDice.model.push(redToImage(rollDice(12)));\n        }\n        //yellow\n        for( i = 0; i < yellowCount; ++i )\n        {\n            swDice.model.push(yellowToImage(rollDice(12)));\n        }\n\n        //violet\n        for( i = 0; i < violetCount; ++i )\n        {\n            swDice.model.push(violetToImage(rollDice(8)));\n        }\n        //green\n        for( i = 0; i < greenCount; ++i )\n        {\n            swDice.model.push(greenToImage(rollDice(8)));\n        }\n\n        //black\n        for( i = 0; i < blackCount; ++i )\n        {\n            swDice.model.push(blackToImage(rollDice(6)));\n        }\n        //blue\n        for( i = 0; i < blueCount; ++i )\n        {\n            swDice.model.push(blueToImage(rollDice(6)));\n        }\n        repeat.model = swDice.model\n\n        id_1.value = swDice.model.join();\n\n        \n        for(var x in swDice.model)\n        {\n            imageToValue(swDice.model[x])\n        }\n\n        var resultStr=\"\";\n        var jetR = swDice.success-swDice.fail\n         if(jetR>0)\n         {\n                 resultStr+=jetR+\" succ\u00e8s\"\n         }\n         else if(jetR<0)\n         {\n                 resultStr+=Math.abs(jetR)+\" echecs\"\t\n         }\n        else\n                 resultStr+=\"\u00c9chec du jet (\u00e9galit\u00e9)\"\n        resultStr+=\" \"\n\n         var jetAge = swDice.advantage - swDice.desavantage\n         if(jetAge>0)\n         {\n                 resultStr+=jetAge+\" avantage\"\n         }\n         else if(Math.abs( jetAge)>0)\n         {\n                 resultStr+=Math.abs(jetAge)+\" d\u00e9savantage\"\t\n         }\n        if(Math.abs( jetAge)>1)\n\tresultStr+=\"s\"\n        resultStr+=\" \"\n\n        if(swDice.disaster>0)\n                resultStr+=swDice.disaster+\" d\u00e9sastre\"\n        if(swDice.disaster>1)\n                resultStr+=\"s\"\n        resultStr+=\" \"\n\n        if(swDice.triomphe>0)\n                resultStr+=swDice.triomphe+\" triomphe\"\n        if(swDice.triomphe>1)\n                resultStr+=\"s\"\n        resultStr+=\" \"\n         var cmd = \"d1i[=1]{\\\"\"\n        cmd += resultStr\n        cmd += \"\\\"}\"\n\n        rollDiceCmd(cmd)\n    }\n\n\n    function redToImage(value)\n    {//challenge die\n        switch(value)\n        {\n            case 1:\n                return \"red6.png\"\n            case 2:\n            case 3:\n                return \"red3.png\"\n            case 4:\n            case 5:\n                return \"red2.png\"\n            case 6:\n            case 7:\n                return \"red5.png\"\n            case 8:\n            case 9:\n                return \"red1.png\"\n            case 10:\n            case 11:\n                return \"red0.png\"\n            case 12:\n                return \"red4.png\"\n        }\n    }\n    function whiteToImage(value)\n    {//force die\n        switch(value)\n        {\n            case 1:\n            case 2:\n            case 3:\n            case 4:\n            case 5:\n            case 6:\n                return \"white0.png\"\n            case 7:\n                return \"white3.png\"\n            case 8:\n            case 9:\n                return \"white2.png\"\n            case 10:\n            case 11:\n            case 12:\n                return \"white1.png\"\n        }\n    }\n\n    function yellowToImage(value)\n    {//Proficiency die\n        switch(value)\n        {\n            case 1:\n                return \"yellow6.png\"\n            case 2:\n            case 3:\n                return \"yellow1.png\"\n            case 4:\n            case 5:\n                return \"yellow2.png\"\n            case 6:\n                return \"yellow3.png\"\n            case 7:\n            case 8:\n            case 9:\n                return \"yellow5.png\"\n            case 10:\n            case 11:\n                return \"yellow0.png\"\n            case 12:\n                return \"yellow4.png\"\n        }\n    }\n\n    function violetToImage(value)\n    {//difficulty die\n        switch(value)\n        {\n            case 1:\n                return \"violet1.png\"\n            case 2:\n                return \"violet4.png\"\n            case 3:\n                return \"violet3.png\"\n            case 4:\n            case 5:\n            case 6:\n                return \"violet0.png\"\n            case 7:\n                return \"violet5.png\"\n            case 8:\n                return \"violet2.png\"\n        }\n    }\n\n    function greenToImage(value)\n    {//ability die\n        switch(value)\n        {\n            case 1:\n                return \"green5.png\"\n            case 2:\n            case 3:\n                return \"green0.png\"\n            case 4:\n                return \"green4.png\"\n            case 5:\n            case 6:\n                return \"green2.png\"\n            case 7:\n                return \"green1.png\"\n            case 8:\n                return \"green3.png\"\n        }\n    }\n\n    function blackToImage(value)\n    {//setback die\n        switch(value)\n        {\n            case 1:\n            case 2:\n                return \"black2.png\"\n            case 3:\n            case 4:\n                return \"black0.png\"\n            case 5:\n            case 6:\n                return \"black1.png\"\n\n        }\n    }\n\n\n    function blueToImage(value)\n    {//boost die\n        switch(value)\n        {\n            case 1:\n            case 2:\n                return \"blue4.png\"\n            case 3:\n                return \"blue1.png\"\n            case 4:\n                return \"blue3.png\"\n            case 5:\n                return \"blue2.png\"\n            case 6:\n                return \"blue0.png\"\n\n        }\n    }\n\n    function rollDice(faces)\n    {\n       return Math.floor((Math.random() * faces) + 1);\n    }\n\n    RowLayout {\n        id: buttons\n        anchors.left: parent.left\n        anchors.right: parent.right\n        anchors.top: parent.top\n        anchors.leftMargin: 50\n        GridLayout {\n            columns: 7\n        //white\n            Text {\n                text: \"Force Die\"\n            }\n            Text {\n                text: \"Challenge Die\"\n            }\n            Text {\n                text: \"Proficiency Die\"\n            }\n            Text {\n                text: \"Ability Die\"\n            }\n            Text {\n                text: \"Difficulty Die\"\n            }\n            Text {\n                text: \"Setback Die\"\n            }\n            Text {\n                text: \"Boost Die\"\n            }\n            Image {\n                source: path+\"white0.png\"\n            }\n            Image {\n                source: path+\"red6.png\"\n            }\n            Image {\n                source: path+\"yellow6.png\"\n            }\n            Image {\n                source: path+\"green5.png\"\n            }\n            Image {\n                source: path+\"violet1.png\"\n            }\n            Image {\n                source: path+\"black2.png\"\n            }\n            Image {\n                source: path+\"blue4.png\"\n            }\n            SpinBox {\n                id: white\n                minimumValue: 0\n                maximumValue: 100\n                value: 0\n            }\n            SpinBox {\n                id: red\n                minimumValue: 0\n                maximumValue: 100\n                value: 0\n            }\n            SpinBox {\n                id: yellow\n                minimumValue: 0\n                maximumValue: 100\n                value: 0\n            }\n            SpinBox {\n                id: green\n                minimumValue: 0\n                maximumValue: 100\n                value: 0\n            }\n            SpinBox {\n                id: violet\n                minimumValue: 0\n                maximumValue: 100\n                value: 0\n            }\n            SpinBox {\n                id: black\n                minimumValue: 0\n                maximumValue: 100\n                value: 0\n            }\n            SpinBox {\n                id: blue\n                minimumValue: 0\n                maximumValue: 100\n                value: 0\n            }\n        }\n        Rectangle {\n            id: roll\n            color: \"red\"\n            radius: width/4\n            Layout.fillHeight: true\n            Layout.fillWidth: true\n            Text {\n                text: \"Roll\"\n                font.pixelSize: 28\n                anchors.fill: parent\n                verticalAlignment: Text.AlignVCenter\n                horizontalAlignment: Text.AlignHCenter\n            }\n\n            MouseArea {\n                anchors.fill: parent\n                onClicked: computeResult()\n                onPressed: {\n                    roll.scale = 0.8\n                }\n                onReleased: {\n                    roll.scale = 1.0\n                }\n            }\n        }\n    }\n    Text {\n        id: result\n        text: \"Resultat\"\n        anchors.top: buttons.bottom\n    }\n    Grid {\n        anchors.top: result.bottom\n        anchors.left: parent.left\n        anchors.right: parent.right\n        anchors.bottom: parent.bottom\n        columns: 10\n        Repeater {\n            id: repeat\n            model: swDice.model\n            Image {\n                height: 60\n                source: swDice.path+modelData\n                fillMode: Image.PreserveAspectFit\n            }\n        }\n    }\n\n\n}",
0139     "uuid": "",
0140     "pageCount": 0
0141 }