forum-ch-17
Advanced tools
Comparing version 0.0.31 to 0.0.32
{ | ||
"name": "forum-ch-17", | ||
"version": "0.0.31", | ||
"version": "0.0.32", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "vueComponents.js", |
@@ -183,2 +183,84 @@ Vue.component('elemento-raza', { | ||
}, | ||
characterExtraAttributes() { | ||
return this.extraAttributes.split(',').map((item, index) => { | ||
let name; | ||
let short; | ||
switch (index) { | ||
case 1: | ||
name = 'Destreza'; | ||
short = 'DES'; | ||
break; | ||
case 2: | ||
name = 'Constitución'; | ||
short = 'CON'; | ||
break; | ||
case 3: | ||
name = 'Inteligencia'; | ||
short = 'INT'; | ||
break; | ||
case 4: | ||
name = 'Sabiduría'; | ||
short = 'SAB'; | ||
break; | ||
case 5: | ||
name = 'Carisma'; | ||
short = 'CAR'; | ||
break; | ||
default: | ||
name = 'Fuerza'; | ||
short = 'FUE'; | ||
break; | ||
} | ||
return { | ||
name, | ||
short, | ||
value: parseInt(item), | ||
} | ||
}); | ||
}, | ||
characterExtraEfforts() { | ||
return this.extraEfforts.split(',').map((item, index) => { | ||
let name; | ||
let base; | ||
switch (index) { | ||
case 1: | ||
name = 'Avanzado'; | ||
base = 4; | ||
break; | ||
case 2: | ||
name = 'Tecnológico'; | ||
base = 6; | ||
break; | ||
case 3: | ||
name = 'Biótico'; | ||
base = 6; | ||
break; | ||
case 4: | ||
name = 'Crítico'; | ||
base = 8; | ||
break; | ||
default: | ||
name = 'Básico'; | ||
base = 2; | ||
break; | ||
} | ||
return { | ||
name, | ||
value: base + parseInt(item), | ||
} | ||
}); | ||
}, | ||
characterEfforts() { | ||
@@ -305,2 +387,5 @@ return this.efforts.split(',').map((item, index) => { | ||
</ul> | ||
<ul class="character-extra-attributes"> | ||
<li v-for="attribute in characterExtraAttributes"><template v-if="attribute.value > -1">+</template>{{ attribute.value }} {{ attribute.name }}</li> | ||
</ul> | ||
<div class="character-proficiencies"> | ||
@@ -328,2 +413,5 @@ <ul class="character-proficiencies-attributes"> | ||
</ul> | ||
<ul class="character-extra-efforts"> | ||
<li v-for="effort in characterExtraEfforts"><template v-if="effort.value > -1">+</template>{{ effort.value }} Esfuerzo {{ effort.name }}</li> | ||
</ul> | ||
<ul class="character-powers"> | ||
@@ -330,0 +418,0 @@ <li v-for="power in characterPowers"> |
@@ -1,1 +0,1 @@ | ||
Vue.component("elemento-raza",{props:["name","comodin"],data(){return{item:Object.values(forumRaces).find(e=>e.id.toLowerCase()===this.name.toLowerCase())}},template:'\n <div class="character-race">\n <strong>{{ item.name }}:</strong> \n <template v-for="message in item.content">\n <span v-html="message"></span>. \n </template>\n <template v-if="comodin"><br><small v-html="comodin"></small></template>\n </div>\n '}),Vue.component("elemento-grupo",{props:["name","comodin"],data(){return{item:Object.values(forumGroups).find(e=>e.id.toLowerCase()===this.name.toLowerCase())}},template:'\n <div class="character-group">\n <strong>{{ item.name }}:</strong> \n <template v-for="message in item.content">\n <span v-html="message"></span>. \n </template>\n <template v-if="comodin"><br><small v-html="comodin"></small></template>\n </div>\n '}),Vue.component("elemento-poderes",{props:["name"],data(){return{item:Object.values(forumPowers).flat().find(e=>e.name.toLowerCase()===this.name.toLowerCase())}},template:'\n <div class="character-power">\n <strong>{{ item.name }}</strong><br>\n <template v-for="message in item.content">\n <span v-html="message"></span>. \n </template>\n </div>\n '}),Vue.component("elemento-tienda",{props:["name"],data(){return{item:Object.values(forumItems).flat().find(e=>e.name.toLowerCase()===this.name.toLowerCase())}},template:'\n <div class="character-item">\n <strong>{{ item.name }}</strong><br>\n <span v-html="item.description"></span>. \n <template v-for="message in item.content">\n <span v-html="message"></span>. \n </template>\n </div>\n '}),Vue.component("listado-poderes",{props:["type"],data(){return{list:forumPowers[this.type].filter(e=>!1===e.hidden)}},template:'\n <ul>\n <li v-for="item in list" :key="item.name">\n <strong>{{ item.name }}</strong><br>\n <template v-for="message in item.content">\n <span v-html="message"></span>. \n </template>\n </li>\n </ul>\n '}),Vue.component("listado-tienda",{props:["type"],data(){return{list:forumItems[this.type].filter(e=>!1===e.hidden)}},template:'\n <ul>\n <li v-for="item in list" :key="item.name">\n <strong>{{ item.name }} (<em>{{ item.price }}</em>)</strong><br>\n <span v-html="item.description"></span>. \n <template v-for="message in item.content">\n <span v-html="message"></span>. \n </template>\n </li>\n </ul>\n '}),Vue.component("cuerpo-expediente",{props:["race","group","rank","attributes","efforts","proficiencies","powers","equipment","comodinRace","comodinGroup","extraHearts","extraAttributes","extraEfforts","extraProficiencies"],computed:{characterBonus(){const e=parseInt(this.rank);return e<1?0:e<4?2:e<7?4:6},characterHearts(){const e=parseInt(this.rank),t=parseInt(this.extraHearts);return e<5?1+t:e<10?5+t:7+t},characterAttributes(){return this.attributes.split(",").map((e,t)=>{let a,n;switch(t){case 1:a="Destreza",n="DES";break;case 2:a="Constitución",n="CON";break;case 3:a="Inteligencia",n="INT";break;case 4:a="Sabiduría",n="SAB";break;case 5:a="Carisma",n="CAR";break;default:a="Fuerza",n="FUE"}return{name:a,short:n,value:parseInt(e)}})},characterEfforts(){return this.efforts.split(",").map((e,t)=>{let a,n;switch(t){case 1:a="Avanzado",n=4;break;case 2:a="Tecnológico",n=6;break;case 3:a="Biótico",n=6;break;case 4:a="Crítico",n=8;break;default:a="Básico",n=2}return{name:a,value:n+parseInt(e)}})},characterAttributeSkills(){const e=this.proficiencies.split(",").map(e=>e.trim());return this.characterAttributes.map(t=>{const{name:a,short:n,value:r}=t;return{name:a,short:n,value:r+(e.indexOf(a)>-1?this.characterBonus:0)}})},characterGeneralSkills(){const e={FUE:["Atletismo"],DES:["Juego de Manos","Manejo de Vehículos","Sigilo"],CON:[],INT:["Ciencia","Electrónica","Historia"],SAB:["Perspicacia","Supervivencia","Trato con Animales"],CAR:["Engaño","Intimidación","Persuasión"]},t=this.proficiencies.split(",").map(e=>e.trim());return Object.entries(e).map(e=>{const a=this.characterAttributes.find(t=>t.short===e[0]).value;return e[1].map(n=>({name:n,attribute:e[0],value:a+(t.indexOf(n)>-1?this.characterBonus:0)}))})},characterCombatSkills(){const e={FUE:["Armas contundentes","Escopetas","Pesadas"],DES:["Armas de filo","Fusiles","Granadas","Pistolas","Rifles","Subfusiles"],CON:[],INT:["Poderes Tecnológicos"],SAB:["Poderes Bióticos"],CAR:[]},t=this.proficiencies.split(",").map(e=>e.trim());return Object.entries(e).map(e=>{const a=this.characterAttributes.find(t=>t.short===e[0]).value;return e[1].map(n=>({name:n,attribute:e[0],value:a+(t.indexOf(n)>-1?this.characterBonus:0)}))})},characterPowers(){return this.powers.split(",").sort().map(e=>e.trim())},characterEquipment(){return this.equipment.split(",").sort().map(e=>e.trim())}},template:'\n <cuerpo-interior title="Características">\n <div class="character-race">\n <elemento-raza :name="race" :comodin="comodinRace"></elemento-raza>\n </div>\n <div class="character-group">\n <elemento-grupo :name="group" :comodin="comodinGroup"></elemento-grupo>\n </div>\n <div class="character-hearts">\n <i class="fa-solid fa-heart"></i> x{{ characterHearts }}\n </div>\n <div class="character-bonus">\n +{{ characterBonus }}\n </div>\n <ul class="character-attributes">\n <li v-for="attribute in characterAttributes"><template v-if="attribute.value > -1">+</template>{{ attribute.value }} {{ attribute.name }}</li>\n </ul>\n <div class="character-proficiencies">\n <ul class="character-proficiencies-attributes">\n <li v-for="attribute in characterAttributeSkills"><template v-if="attribute.value > -1">+</template>{{ attribute.value }} en las Tiradas de Salvación de {{ attribute.name }}</li>\n </ul>\n <ul class="character-proficiencies-general">\n <li v-for="attribute in characterGeneralSkills">\n <ul class="proficency-list">\n <li v-for="proficency in attribute"><template v-if="proficency.value > -1">+</template>{{ proficency.value }} {{ proficency.name }} {{ proficency.attribute }}</li>\n </ul>\n </li>\n </ul>\n <ul class="character-proficiencies-combat">\n <li v-for="attribute in characterCombatSkills">\n <ul class="proficency-list">\n <li v-for="proficency in attribute"><template v-if="proficency.value > -1">+</template>{{ proficency.value }} {{ proficency.name }} {{ proficency.attribute }}</li>\n </ul>\n </li>\n </ul>\n </div>\n <ul class="character-efforts">\n <li v-for="effort in characterEfforts"><template v-if="effort.value > -1">+</template>{{ effort.value }} Esfuerzo {{ effort.name }}</li>\n </ul>\n <ul class="character-powers">\n <li v-for="power in characterPowers">\n <elemento-poderes :name="power"></elemento-poderes>\n </li>\n </ul>\n <ul class="character-equipment">\n <li v-for="item in characterEquipment">\n <elemento-tienda :name="item"></elemento-tienda>\n </li>\n </ul>\n </cuerpo-interior>\n '}); | ||
Vue.component("elemento-raza",{props:["name","comodin"],data(){return{item:Object.values(forumRaces).find(e=>e.id.toLowerCase()===this.name.toLowerCase())}},template:'\n <div class="character-race">\n <strong>{{ item.name }}:</strong> \n <template v-for="message in item.content">\n <span v-html="message"></span>. \n </template>\n <template v-if="comodin"><br><small v-html="comodin"></small></template>\n </div>\n '}),Vue.component("elemento-grupo",{props:["name","comodin"],data(){return{item:Object.values(forumGroups).find(e=>e.id.toLowerCase()===this.name.toLowerCase())}},template:'\n <div class="character-group">\n <strong>{{ item.name }}:</strong> \n <template v-for="message in item.content">\n <span v-html="message"></span>. \n </template>\n <template v-if="comodin"><br><small v-html="comodin"></small></template>\n </div>\n '}),Vue.component("elemento-poderes",{props:["name"],data(){return{item:Object.values(forumPowers).flat().find(e=>e.name.toLowerCase()===this.name.toLowerCase())}},template:'\n <div class="character-power">\n <strong>{{ item.name }}</strong><br>\n <template v-for="message in item.content">\n <span v-html="message"></span>. \n </template>\n </div>\n '}),Vue.component("elemento-tienda",{props:["name"],data(){return{item:Object.values(forumItems).flat().find(e=>e.name.toLowerCase()===this.name.toLowerCase())}},template:'\n <div class="character-item">\n <strong>{{ item.name }}</strong><br>\n <span v-html="item.description"></span>. \n <template v-for="message in item.content">\n <span v-html="message"></span>. \n </template>\n </div>\n '}),Vue.component("listado-poderes",{props:["type"],data(){return{list:forumPowers[this.type].filter(e=>!1===e.hidden)}},template:'\n <ul>\n <li v-for="item in list" :key="item.name">\n <strong>{{ item.name }}</strong><br>\n <template v-for="message in item.content">\n <span v-html="message"></span>. \n </template>\n </li>\n </ul>\n '}),Vue.component("listado-tienda",{props:["type"],data(){return{list:forumItems[this.type].filter(e=>!1===e.hidden)}},template:'\n <ul>\n <li v-for="item in list" :key="item.name">\n <strong>{{ item.name }} (<em>{{ item.price }}</em>)</strong><br>\n <span v-html="item.description"></span>. \n <template v-for="message in item.content">\n <span v-html="message"></span>. \n </template>\n </li>\n </ul>\n '}),Vue.component("cuerpo-expediente",{props:["race","group","rank","attributes","efforts","proficiencies","powers","equipment","comodinRace","comodinGroup","extraHearts","extraAttributes","extraEfforts","extraProficiencies"],computed:{characterBonus(){const e=parseInt(this.rank);return e<1?0:e<4?2:e<7?4:6},characterHearts(){const e=parseInt(this.rank),t=parseInt(this.extraHearts);return e<5?1+t:e<10?5+t:7+t},characterAttributes(){return this.attributes.split(",").map((e,t)=>{let a,r;switch(t){case 1:a="Destreza",r="DES";break;case 2:a="Constitución",r="CON";break;case 3:a="Inteligencia",r="INT";break;case 4:a="Sabiduría",r="SAB";break;case 5:a="Carisma",r="CAR";break;default:a="Fuerza",r="FUE"}return{name:a,short:r,value:parseInt(e)}})},characterExtraAttributes(){return this.extraAttributes.split(",").map((e,t)=>{let a,r;switch(t){case 1:a="Destreza",r="DES";break;case 2:a="Constitución",r="CON";break;case 3:a="Inteligencia",r="INT";break;case 4:a="Sabiduría",r="SAB";break;case 5:a="Carisma",r="CAR";break;default:a="Fuerza",r="FUE"}return{name:a,short:r,value:parseInt(e)}})},characterExtraEfforts(){return this.extraEfforts.split(",").map((e,t)=>{let a,r;switch(t){case 1:a="Avanzado",r=4;break;case 2:a="Tecnológico",r=6;break;case 3:a="Biótico",r=6;break;case 4:a="Crítico",r=8;break;default:a="Básico",r=2}return{name:a,value:r+parseInt(e)}})},characterEfforts(){return this.efforts.split(",").map((e,t)=>{let a,r;switch(t){case 1:a="Avanzado",r=4;break;case 2:a="Tecnológico",r=6;break;case 3:a="Biótico",r=6;break;case 4:a="Crítico",r=8;break;default:a="Básico",r=2}return{name:a,value:r+parseInt(e)}})},characterAttributeSkills(){const e=this.proficiencies.split(",").map(e=>e.trim());return this.characterAttributes.map(t=>{const{name:a,short:r,value:n}=t;return{name:a,short:r,value:n+(e.indexOf(a)>-1?this.characterBonus:0)}})},characterGeneralSkills(){const e={FUE:["Atletismo"],DES:["Juego de Manos","Manejo de Vehículos","Sigilo"],CON:[],INT:["Ciencia","Electrónica","Historia"],SAB:["Perspicacia","Supervivencia","Trato con Animales"],CAR:["Engaño","Intimidación","Persuasión"]},t=this.proficiencies.split(",").map(e=>e.trim());return Object.entries(e).map(e=>{const a=this.characterAttributes.find(t=>t.short===e[0]).value;return e[1].map(r=>({name:r,attribute:e[0],value:a+(t.indexOf(r)>-1?this.characterBonus:0)}))})},characterCombatSkills(){const e={FUE:["Armas contundentes","Escopetas","Pesadas"],DES:["Armas de filo","Fusiles","Granadas","Pistolas","Rifles","Subfusiles"],CON:[],INT:["Poderes Tecnológicos"],SAB:["Poderes Bióticos"],CAR:[]},t=this.proficiencies.split(",").map(e=>e.trim());return Object.entries(e).map(e=>{const a=this.characterAttributes.find(t=>t.short===e[0]).value;return e[1].map(r=>({name:r,attribute:e[0],value:a+(t.indexOf(r)>-1?this.characterBonus:0)}))})},characterPowers(){return this.powers.split(",").sort().map(e=>e.trim())},characterEquipment(){return this.equipment.split(",").sort().map(e=>e.trim())}},template:'\n <cuerpo-interior title="Características">\n <div class="character-race">\n <elemento-raza :name="race" :comodin="comodinRace"></elemento-raza>\n </div>\n <div class="character-group">\n <elemento-grupo :name="group" :comodin="comodinGroup"></elemento-grupo>\n </div>\n <div class="character-hearts">\n <i class="fa-solid fa-heart"></i> x{{ characterHearts }}\n </div>\n <div class="character-bonus">\n +{{ characterBonus }}\n </div>\n <ul class="character-attributes">\n <li v-for="attribute in characterAttributes"><template v-if="attribute.value > -1">+</template>{{ attribute.value }} {{ attribute.name }}</li>\n </ul>\n <ul class="character-extra-attributes">\n <li v-for="attribute in characterExtraAttributes"><template v-if="attribute.value > -1">+</template>{{ attribute.value }} {{ attribute.name }}</li>\n </ul>\n <div class="character-proficiencies">\n <ul class="character-proficiencies-attributes">\n <li v-for="attribute in characterAttributeSkills"><template v-if="attribute.value > -1">+</template>{{ attribute.value }} en las Tiradas de Salvación de {{ attribute.name }}</li>\n </ul>\n <ul class="character-proficiencies-general">\n <li v-for="attribute in characterGeneralSkills">\n <ul class="proficency-list">\n <li v-for="proficency in attribute"><template v-if="proficency.value > -1">+</template>{{ proficency.value }} {{ proficency.name }} {{ proficency.attribute }}</li>\n </ul>\n </li>\n </ul>\n <ul class="character-proficiencies-combat">\n <li v-for="attribute in characterCombatSkills">\n <ul class="proficency-list">\n <li v-for="proficency in attribute"><template v-if="proficency.value > -1">+</template>{{ proficency.value }} {{ proficency.name }} {{ proficency.attribute }}</li>\n </ul>\n </li>\n </ul>\n </div>\n <ul class="character-efforts">\n <li v-for="effort in characterEfforts"><template v-if="effort.value > -1">+</template>{{ effort.value }} Esfuerzo {{ effort.name }}</li>\n </ul>\n <ul class="character-extra-efforts">\n <li v-for="effort in characterExtraEfforts"><template v-if="effort.value > -1">+</template>{{ effort.value }} Esfuerzo {{ effort.name }}</li>\n </ul>\n <ul class="character-powers">\n <li v-for="power in characterPowers">\n <elemento-poderes :name="power"></elemento-poderes>\n </li>\n </ul>\n <ul class="character-equipment">\n <li v-for="item in characterEquipment">\n <elemento-tienda :name="item"></elemento-tienda>\n </li>\n </ul>\n </cuerpo-interior>\n '}); |
23598
385