From 071f48831ef571e2956f93d8480be56ba3347fee Mon Sep 17 00:00:00 2001 From: Thaum Date: Thu, 6 Nov 2014 11:58:46 +0000 Subject: [PATCH] Implemented skill list Proficiency icons (dis)advantage icons asterisks for conditionals "auto fail" notification better looking border art --- rpg-docs/Model/Character/Characters.js | 29 +++++++--- rpg-docs/client/views/character/character.css | 5 ++ .../client/views/character/character.html | 2 +- .../views/character/healthBar/healthBar.css | 2 +- .../views/character/savesAndSkills.html | 52 ----------------- .../client/views/character/skills/skills.css | 38 +++++++++++++ .../client/views/character/skills/skills.html | 30 ++++++++++ .../client/views/character/skills/skills.js | 53 ++++++++++++++++++ rpg-docs/client/views/general.css | 2 +- rpg-docs/public/png/advantage/greenUp.png | Bin 0 -> 1234 bytes rpg-docs/public/png/advantage/redDown.png | Bin 0 -> 1355 bytes rpg-docs/public/png/profIcons/profDouble.png | Bin 0 -> 1107 bytes rpg-docs/public/png/profIcons/profHalf.png | Bin 0 -> 525 bytes rpg-docs/public/png/profIcons/profNone.png | Bin 0 -> 281 bytes rpg-docs/public/png/profIcons/profSingle.png | Bin 0 -> 759 bytes 15 files changed, 149 insertions(+), 64 deletions(-) delete mode 100644 rpg-docs/client/views/character/savesAndSkills.html create mode 100644 rpg-docs/client/views/character/skills/skills.css create mode 100644 rpg-docs/client/views/character/skills/skills.html create mode 100644 rpg-docs/client/views/character/skills/skills.js create mode 100644 rpg-docs/public/png/advantage/greenUp.png create mode 100644 rpg-docs/public/png/advantage/redDown.png create mode 100644 rpg-docs/public/png/profIcons/profDouble.png create mode 100644 rpg-docs/public/png/profIcons/profHalf.png create mode 100644 rpg-docs/public/png/profIcons/profNone.png create mode 100644 rpg-docs/public/png/profIcons/profSingle.png diff --git a/rpg-docs/Model/Character/Characters.js b/rpg-docs/Model/Character/Characters.js index b914b8de..1bbab29f 100644 --- a/rpg-docs/Model/Character/Characters.js +++ b/rpg-docs/Model/Character/Characters.js @@ -185,15 +185,9 @@ Characters.helpers({ return value; }, - - skillMod: function(skill){ - //get the final value of the ability score - var ability = this.attributeValue(this.attributes[skill.ability]); - - //base modifier - var mod = +getMod(ability) - - //multiply proficiency bonus by largest value in proficiency array + + proficiency: function(skill){ + //return largest value in proficiency array var prof = 0; for(var i = 0, l = skill.proficiency.length; i < l; i++){ var newProf = pop(skill.proficiency[i].value, this); @@ -201,6 +195,23 @@ Characters.helpers({ prof = newProf; } } + return prof; + }, + + skillMod: function(skill){ + if(skill === undefined){ + console.log("Cannot get skillMod of undefined"); + return; + } + //get the final value of the ability score + var ability = this.attributeValue(this.attributes[skill.ability]); + + //base modifier + var mod = +getMod(ability) + + //multiply proficiency bonus by largest value in proficiency array + var prof = this.proficiency(skill); + //add multiplied proficiency bonus to modifier mod += prof * this.attributeValue(this.attributes.proficiencyBonus); diff --git a/rpg-docs/client/views/character/character.css b/rpg-docs/client/views/character/character.css index badd6eb3..7fd04e6c 100644 --- a/rpg-docs/client/views/character/character.css +++ b/rpg-docs/client/views/character/character.css @@ -1,6 +1,7 @@ .flexContainer { display: flex; flex-wrap: wrap; + justify-content: space-around; } #abilityScores { @@ -14,12 +15,16 @@ .floatBox{ color: #301d02; + /*Fancy image border*/ border-image-width: 92px 60px 57px 60px; border-image-outset: 15px; border-image-source: url('/png/big-border.png'); border-image-slice: 275 179 171 179; border-image-repeat: stretch; + /*Shadow*/ + box-shadow: 0px 5px 20px rgba(0, 0, 0, 1); + padding: 0px 5px 5px 5px; margin: 15px; background: #f0e3d1; diff --git a/rpg-docs/client/views/character/character.html b/rpg-docs/client/views/character/character.html index b4a4f054..483c59f3 100644 --- a/rpg-docs/client/views/character/character.html +++ b/rpg-docs/client/views/character/character.html @@ -11,7 +11,7 @@ Proficiency Bonus {{proficiencyBonus}}
- {{> savesAndSkills}} + {{> skills}}
diff --git a/rpg-docs/client/views/character/healthBar/healthBar.css b/rpg-docs/client/views/character/healthBar/healthBar.css index eadb9c61..9b3330d1 100644 --- a/rpg-docs/client/views/character/healthBar/healthBar.css +++ b/rpg-docs/client/views/character/healthBar/healthBar.css @@ -34,7 +34,7 @@ top: 2px; height: 26px; border-radius: 15px; - background-color: #AF6700; + background-color: #CA9548; } .healthBarBorder{ diff --git a/rpg-docs/client/views/character/savesAndSkills.html b/rpg-docs/client/views/character/savesAndSkills.html deleted file mode 100644 index b78886c9..00000000 --- a/rpg-docs/client/views/character/savesAndSkills.html +++ /dev/null @@ -1,52 +0,0 @@ - \ No newline at end of file diff --git a/rpg-docs/client/views/character/skills/skills.css b/rpg-docs/client/views/character/skills/skills.css new file mode 100644 index 00000000..98fe850d --- /dev/null +++ b/rpg-docs/client/views/character/skills/skills.css @@ -0,0 +1,38 @@ +.profIcon{ + display: inline-block; + width: 23px; + height: 14px; + background-size: contain; + background-repeat: no-repeat; + + position: relative; + top: 1px; +} + +table.skillTable td:nth-of-type(2) { + text-align: right; +} + +table.skillTable td:nth-of-type(3) { + padding-left: 8px; +} + +td.fail { + color: #AF0000; +} + +.advantage{ + background-image: url(/png/advantage/greenUp.png); + background-size: contain; + background-repeat: no-repeat; +} + +.disadvantage{ + background-image: url(/png/advantage/redDown.png); + background-size: contain; + background-repeat: no-repeat; +} + +td.conditionals::after{ + content: "*"; +} \ No newline at end of file diff --git a/rpg-docs/client/views/character/skills/skills.html b/rpg-docs/client/views/character/skills/skills.html new file mode 100644 index 00000000..0fccfb2b --- /dev/null +++ b/rpg-docs/client/views/character/skills/skills.html @@ -0,0 +1,30 @@ + \ No newline at end of file diff --git a/rpg-docs/client/views/character/skills/skills.js b/rpg-docs/client/views/character/skills/skills.js new file mode 100644 index 00000000..20b759d4 --- /dev/null +++ b/rpg-docs/client/views/character/skills/skills.js @@ -0,0 +1,53 @@ +Template.skills.helpers({ + saveList: function(){ + return [ + {name: "Strength", skill: this.skills.strengthSave}, + {name: "Dexterity", skill: this.skills.dexteritySave}, + {name: "Constitution", skill: this.skills.constitutionSave}, + {name: "Intelligence", skill: this.skills.intelligenceSave}, + {name: "Wisdom", skill: this.skills.wisdomSave}, + {name: "Charisma", skill: this.skills.charismaSave} + ]; + }, + skillList: function(){ + return [ + {name: "Acrobatics", skill: this.skills.acrobatics}, + {name: "Animal Handling", skill: this.skills.animalHandling}, + {name: "Arcana", skill: this.skills.arcana}, + {name: "Athletics", skill: this.skills.athletics}, + {name: "Deception", skill: this.skills.deception}, + {name: "History", skill: this.skills.history}, + {name: "Insight", skill: this.skills.insight}, + {name: "Intimidation", skill: this.skills.intimidation}, + {name: "Investigation", skill: this.skills.investigation}, + {name: "Medicine", skill: this.skills.medicine}, + {name: "Nature", skill: this.skills.nature}, + {name: "Perception", skill: this.skills.perception}, + {name: "Performance", skill: this.skills.performance}, + {name: "Persuasion", skill: this.skills.persuasion}, + {name: "Religion", skill: this.skills.religion}, + {name: "Sleight of Hand", skill: this.skills.sleightOfHand}, + {name: "Stealth", skill: this.skills.stealth}, + {name: "Survival", skill: this.skills.survival} + ]; + }, + profIcon: function(skill){ + var prof = Template.parentData(1).proficiency(skill); + if(prof > 0 && prof < 1) return "profHalf.png"; + if(prof === 1) return "profSingle.png"; + if(prof > 1) return "profDouble.png"; + return "profNone.png"; + }, + failSkill: function(){ + return this.skill.fail.length > 0; + }, + advantage: function(){ + var adv = this.skill.advantage.length; + var disadv = this.skill.disadvantage.length; + if(adv > 0 && disadv === 0) return "advantage"; + if(disadv > 0 && adv === 0) return "disadvantage"; + }, + conditionals: function(){ + if(this.skill.conditional.length > 0) return "conditionals"; + } +}); \ No newline at end of file diff --git a/rpg-docs/client/views/general.css b/rpg-docs/client/views/general.css index 296e3835..b956d8f7 100644 --- a/rpg-docs/client/views/general.css +++ b/rpg-docs/client/views/general.css @@ -4,5 +4,5 @@ root { body { font-family: sans-serif; - background-color: #333; + background: #201500; } \ No newline at end of file diff --git a/rpg-docs/public/png/advantage/greenUp.png b/rpg-docs/public/png/advantage/greenUp.png new file mode 100644 index 0000000000000000000000000000000000000000..47c56696f5356be74ee7db870090c1aa11ad8796 GIT binary patch literal 1234 zcmeAS@N?(olHy`uVBq!ia0vp^Js`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{7za>(se~ru}j{7xdi~g_> z`}o?oapiG8_Xc*`_U1RytM*SReOrHU%HmJkeyN_=czJ_${C=0%NO2$AGAp*6?=_Mi z*sr?ovYeTnX&CP#owE{u2Y9o?B Pg%pFQtDnm{r-UW|H-RN^ literal 0 HcmV?d00001 diff --git a/rpg-docs/public/png/advantage/redDown.png b/rpg-docs/public/png/advantage/redDown.png new file mode 100644 index 0000000000000000000000000000000000000000..2825d652c2b029e57ed85c81574801d423aaca86 GIT binary patch literal 1355 zcmeAS@N?(olHy`uVBq!ia0vp^Js`}%1|-)VaI^zbY)RhkE)4%caKYZ?lYt_f1s;*b z3=De8Ak0{?)V>TT$X?><>&kwQn~hsZ>}AH%MGOoqH#}V&Ln>~)oqNAqG*sq*{c)Ey zx=S4n8Z`45U05W~f7RRWN^|Y++?2nqsVV#YS-%G8i%v<@Oqt*)rKh42d2Lfpb=3^R z>#?QZ@6Fv={%-F1=f2TAB(gcMydT6iSWAPH9j|>}jJ3rqddgJ9Kh7Z~w+}qDRzvA{lVuNhOk*_ahtgXMC z{VZCb6ZfXI!#0UQ=*8^LmEu7XD0sIQPsevitqt^vtL5 zDIK#Lr#D*9Ssz!-R-yd#&vjApz2ViVojVvSxGFAGzE-`@B)@FV|JcImC40-KcCduH=KA3Al+V|%?^zp{+agq${#USc@@LDde`4!d{ub>OU%Is?L}?pSdxPw`*C9sS zGJclpcRinc%_^z$28Rv%o6@@FUBU-;Yd&w?y2paos;aYsry^;_cdz9d2bOC-*JrD| z9MB!7^p1^>Y4+Ujohf|4$oiLg!JO~!dY8@}y;+mo57fzIVbl%{%c~@03>wNIJ`D@E39Mg;OKC<_~=L2fjmj$0; ze!pZ+eMZs-xA!GpN51{q^(^fAO5r){*N4|-XB{|}-|Ky(_kj0-*mc(Yu7Gb z<9tBu`sPr*09$^m+s_=`Htmg9O3TXZ*>vlnkM8NC+xSg3J$EdfQp!+q;%n}d#RuHO zyXUG!%}{+Lk!pH4N%xfbVw)Ec^DL%!#D)Z3>v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XsolY2chM+s0^iCI$hf38qvz)xJdR2Fy`>wwXO9=*WIWD_~?0C3a^$d|>POXSxXF4$8I+Pi@CCyZghdlC38 zQL@LwOlKvZj!-6%s@ARDeTfOo1D*vw5C1~7>bc>EZBMrb~A-&0%Xl7S2K9;^MEvQAIT#_v+F`Ra{)$9JVRLlFn*saq-dARoMS~ Z{R<_kREfl>ef0h&of zK~!ko?b^R9MPVGr@%M9_qFDSYi)64^ScH^W{s0z=q?-|CU|^F`ib;x9CP`Uj@dt=3 zR>{iX7Cwf1OUGln_uSh#Pv7@naL%jm_vzGmAOlHimefc_it7CGk)$C>tCG$nJxVG9 z@4#GEP~tjabO8lm9_S(C#Wlug1Ga!gpoyFm*AQeH*aJGrS#b?8nt@$lft(iCU|r6E zQF2_I@`PLf!{oduC6ET-Gz5?|zf(4W2?8lfVM<1U4FW1kVQu#7{bii>Ntpr$39M>S z)(Ehuiq#njaZ0M4lo z#Zden4aM&+TtD1JMJ;!n#3aAhcdOTdSrB&X#G zSTPhI<^VV}6u$y+W+=&N`2wbaBST5Td{VlsvkrV3$}fzZbKAf;@L(uOoLfqN5SM{x ztYnfJCCy5@mh`RvD`e$)>vE6QIadTufD=jW<<%Mk`YHWXYXyonJ{j%@wa}2;wD-5M P00000NkvXXu0mjfI04$1 literal 0 HcmV?d00001 diff --git a/rpg-docs/public/png/profIcons/profNone.png b/rpg-docs/public/png/profIcons/profNone.png new file mode 100644 index 0000000000000000000000000000000000000000..d0bbf8722df0794743e78bdbdd6216bbc4a6842e GIT binary patch literal 281 zcmeAS@N?(olHy`uVBq!ia0vp^u0X8A!3HFa%Sv|xDYhhUcNZWH1V5d3*8?fe0*}aI zppNSx%;=;sy8pkayl7`v_AYFwX2~? z_yyCt2TYH6_{$3z)C)NTy$czltGT6h*X%LV`%obu^ke@&fg-0orb#NEAQa-l!qSFk>hE6+;tBGC{Ygtxp0Qbk)V(lIkQ97xxA0;EYdP|BPw2l&kyW46!cE;x!941JLmV?_k7Rtu5)qf^zHOI@ALV7KMz3$Qd@w<#qCH$Smpaf z1pt-;dw{*bHefxl;;+X(0Iz|kz(e3+M2s@qq#jUjsFVJ?#?>oo*KC2&tvPOu>8tRz<{AN~d&Z z41}T_u|4(gv!@1W*uK{A|`;F8N1|K*+zY%MW#-so8Y;erJt|Q_(a3Ld?oN5F}Q=IbKPV|`SYb+0d{bfp!O@~r|X#*aWP1l>C zw@kN9hZT>EL zb*_4Ph6Z>>)e~w^N2wj^b@h7_U`(o))z!=fscq_cb+81C0rg}m7*z}xw=g|N^80Y{ pN`6gTf9B8O;s+7&ivOxsKLA9DxQqPp5ZC|!002ovPDHLkV1mh{RRI71 literal 0 HcmV?d00001