forum-ch-17
Advanced tools
Comparing version 0.0.25 to 0.0.26
{ | ||
"name": "forum-ch-17", | ||
"version": "0.0.25", | ||
"version": "0.0.26", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "vueComponents.js", |
@@ -5,3 +5,3 @@ Vue.component('elemento-raza', { | ||
return { | ||
item: Object.values(forumRaces).find(race => race.race === this.name) | ||
item: Object.values(forumRaces).find(race => race.race.toLowerCase() === this.name.toLowerCase()) | ||
} | ||
@@ -23,3 +23,3 @@ }, | ||
return { | ||
item: Object.values(forumPowers).flat().find(power => power.name === this.name) | ||
item: Object.values(forumPowers).flat().find(power => power.name.toLowerCase() === this.name.toLowerCase()) | ||
} | ||
@@ -41,3 +41,3 @@ }, | ||
return { | ||
item: Object.values(forumItems).flat().find(power => power.name === this.name) | ||
item: Object.values(forumItems).flat().find(power => power.name.toLowerCase() === this.name.toLowerCase()) | ||
} | ||
@@ -272,2 +272,5 @@ }, | ||
<cuerpo-interior title="Características"> | ||
<div class="character-race"> | ||
<elemento-raza :name="race"></elemento-raza> | ||
</div> | ||
<div class="character-hearts"> | ||
@@ -274,0 +277,0 @@ <i class="fa-solid fa-heart"></i> x{{ characterHearts }} |
@@ -1,1 +0,1 @@ | ||
Vue.component("elemento-raza",{props:["name"],data(){return{item:Object.values(forumRaces).find(e=>e.race===this.name)}},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 </div>\n '}),Vue.component("elemento-poderes",{props:["name"],data(){return{item:Object.values(forumPowers).flat().find(e=>e.name===this.name)}},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===this.name)}},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","attributeProficiencies","generalProficiencies","combatProficiencies","powers","equipment"],computed:{characterBonus(){const e=parseInt(this.rank);return e<1?0:e<4?2:e<7?4:6},characterHearts(){const e=parseInt(this.rank);return e<5?1:e<10?5:7},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)}})},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.attributeProficiencies.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.generalProficiencies.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.combatProficiencies.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"></elemento-raza>\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"],data(){return{item:Object.values(forumRaces).find(e=>e.race.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 </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","attributeProficiencies","generalProficiencies","combatProficiencies","powers","equipment"],computed:{characterBonus(){const e=parseInt(this.rank);return e<1?0:e<4?2:e<7?4:6},characterHearts(){const e=parseInt(this.rank);return e<5?1:e<10?5:7},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)}})},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.attributeProficiencies.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.generalProficiencies.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.combatProficiencies.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"></elemento-raza>\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 '}); |
18034
288