favorite-spells-modal.component.html 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <div class="dimensions">
  2. <div class="shadow-box">
  3. <div class="title t-0">{{ "spells.favorite" | translate }}</div>
  4. <hr style="margin-bottom: 0; margin: 1.5rem 2rem 0 2rem" />
  5. <div class="heading-list">
  6. <div>{{ "spells.header.cost" | translate }}</div>
  7. <div>{{ "spells.header.name" | translate }}</div>
  8. <div>{{ "spells.header.level" | translate }}</div>
  9. <div>{{ "spells.header.bonus" | translate }}</div>
  10. <div>{{ "spells.header.effect" | translate }}</div>
  11. <div>{{ "spells.header.range" | translate }}</div>
  12. </div>
  13. </div>
  14. <div id="spells-table" class="item-list table-content">
  15. @for (spell of preparedSpells; let index = $index; track spell) {
  16. <div
  17. matRipple
  18. class="spell-item"
  19. [ngClass]="{ selected: checkedSpells[index] }"
  20. (click)="checkedSpells[index] = !checkedSpells[index]"
  21. >
  22. <!-- Range Icon -->
  23. <ng-container
  24. [ngTemplateOutlet]="costTemplate"
  25. [ngTemplateOutletContext]="{ spell: spell }"
  26. ></ng-container>
  27. <div class="vertical-line"></div>
  28. <!-- Name -->
  29. <ng-container
  30. [ngTemplateOutlet]="spellNameTemplate"
  31. [ngTemplateOutletContext]="{ spell: spell }"
  32. ></ng-container>
  33. <div class="vertical-line"></div>
  34. <!-- Level -->
  35. <ng-container
  36. [ngTemplateOutlet]="spellLevelTemplate"
  37. [ngTemplateOutletContext]="{ spell: spell }"
  38. ></ng-container>
  39. <div class="vertical-line"></div>
  40. <!-- Attack -->
  41. <ng-container
  42. [ngTemplateOutlet]="spellAttackTemplate"
  43. [ngTemplateOutletContext]="{ spell: spell }"
  44. ></ng-container>
  45. <div class="vertical-line"></div>
  46. <!-- Damage/Heal -->
  47. <ng-container
  48. [ngTemplateOutlet]="spellDamageTemplate"
  49. [ngTemplateOutletContext]="{ spell: spell }"
  50. ></ng-container>
  51. <div class="vertical-line"></div>
  52. <!-- Range -->
  53. <ng-container
  54. [ngTemplateOutlet]="spellRangeTemplate"
  55. [ngTemplateOutletContext]="{ spell: spell }"
  56. ></ng-container>
  57. </div>
  58. } @empty {
  59. <div
  60. style="
  61. text-align: center;
  62. margin-top: 3rem;
  63. font-size: 1.25rem;
  64. font-weight: 500;
  65. "
  66. [innerHTML]="'spells.emptyFavorites' | translate"
  67. ></div>
  68. }
  69. </div>
  70. <div class="horizontal-buttons">
  71. <ui-button
  72. [color]="'green'"
  73. [type]="'confirm'"
  74. style="width: 40%"
  75. (click)="update()"
  76. >
  77. </ui-button>
  78. <ui-button
  79. [color]="'red'"
  80. [type]="'cancel'"
  81. style="width: 40%"
  82. (click)="cancel()"
  83. >
  84. </ui-button>
  85. </div>
  86. </div>
  87. <!-- Templates -->
  88. <!-- COST -->
  89. <ng-template #costTemplate let-spell="spell">
  90. <div class="bold">
  91. @if (spell.cost === "action") {
  92. <span>A</span>
  93. }
  94. @if (spell.cost === "bonus") {
  95. <span>B</span>
  96. }
  97. @if (spell.cost === "reaction") {
  98. <span>R</span>
  99. }
  100. </div>
  101. </ng-template>
  102. <!-- NAME -->
  103. <ng-template #spellNameTemplate let-spell="spell">
  104. <div>
  105. <div class="bold">
  106. @if (translate.getDefaultLang() == "de") {
  107. {{ spell.german }}
  108. } @else {
  109. {{ spell.english }}
  110. }
  111. </div>
  112. <div class="bold small">
  113. @if (spell.needsConcentration) {
  114. <span>{{ "spells.concentrationAbbr" | translate }} | </span>
  115. }
  116. @if (spell.needsVerbal) {
  117. <span>{{ "spells.components.verbal" | translate }} </span>
  118. }
  119. @if (spell.needsSomatic) {
  120. <span>{{ "spells.components.somatic" | translate }} </span>
  121. }
  122. @if (spell.needsMaterial) {
  123. <span>{{ "spells.components.material" | translate }} </span>
  124. }
  125. <div></div>
  126. </div>
  127. </div>
  128. </ng-template>
  129. <!-- Level -->
  130. <ng-template #spellLevelTemplate let-spell="spell">
  131. @if (spell.level !== 0) {
  132. <div class="bold">{{ spell.level }}</div>
  133. }
  134. @if (spell.level === 0) {
  135. <div class="bold">
  136. {{ "spells.cantrip" | translate }}
  137. </div>
  138. }
  139. </ng-template>
  140. <!-- Attack -->
  141. <ng-template #spellAttackTemplate let-spell="spell">
  142. <div>
  143. @if (spell.needsSavingThrow) {
  144. <div>
  145. <div>
  146. {{
  147. "attributesAbbreviations." + spell.savingThrowAttribute | translate
  148. }}
  149. </div>
  150. <div>{{ utils.spellSaveDC }}</div>
  151. </div>
  152. } @else if (spell.needsAttackRoll) {
  153. <div>
  154. <div>{{ utils.spellAttackModifier }}</div>
  155. </div>
  156. } @else {
  157. <div>-</div>
  158. }
  159. </div>
  160. </ng-template>
  161. <!-- Damage/Heal -->
  162. <ng-template #spellDamageTemplate let-spell="spell">
  163. <div>
  164. @if (spell.doesDamage) {
  165. @for (damage of spell.damage; track damage; let index = $index) {
  166. <div>
  167. <span>
  168. {{ damage.diceNumber }}
  169. {{ "general.dice" | translate }}{{ damage.diceType }}
  170. </span>
  171. <span>
  172. <icon
  173. [size]="'xs'"
  174. [type]="'damage'"
  175. [icon]="damage.damageType"
  176. ></icon>
  177. </span>
  178. </div>
  179. }
  180. } @else if (spell.doesHeal) {
  181. <div class="heal">
  182. <span
  183. >{{ spell.heal.diceNumber }} {{ "general.dice" | translate
  184. }}{{ spell.heal.diceType }}
  185. </span>
  186. @if (spell.heal.additionalHeal) {
  187. <span>+{{ spell.heal.additionalHeal }} </span>
  188. }
  189. <span>
  190. <icon [size]="'xs'" [type]="'damage'" [icon]="'heal'"></icon>
  191. </span>
  192. </div>
  193. } @else {
  194. <div>-</div>
  195. }
  196. </div>
  197. </ng-template>
  198. <!-- Range -->
  199. <ng-template #spellRangeTemplate let-spell="spell">
  200. <div class="spell-range">
  201. @if (spell.isRanged) {
  202. <div>{{ spell.range }} ft.</div>
  203. }
  204. @if (!spell.isRanged && spell.range !== 0) {
  205. <div>
  206. {{ "spells.touch" | translate }}
  207. </div>
  208. }
  209. @if (spell.hasAreaOfEffect) {
  210. <div>
  211. <span
  212. >{{ spell.length }} ft.
  213. <img
  214. style="width: 1rem; height: 1rem; margin-left: 0.125rem"
  215. [src]="
  216. 'assets/icons/spellIcons/' + spell.areaOfEffectType + '.svg'
  217. "
  218. /></span>
  219. </div>
  220. }
  221. </div>
  222. </ng-template>