favorite-spells-modal.component.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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. <span *ngIf="spell.cost === 'action'">A</span>
  92. <span *ngIf="spell.cost === 'bonus'">B</span>
  93. <span *ngIf="spell.cost === 'reaction'">R</span>
  94. </div>
  95. </ng-template>
  96. <!-- NAME -->
  97. <ng-template #spellNameTemplate let-spell="spell">
  98. <div>
  99. <div class="bold">
  100. @if (translate.getDefaultLang() == "de") {
  101. {{ spell.german }}
  102. } @else {
  103. {{ spell.english }}
  104. }
  105. </div>
  106. <div class="bold small">
  107. <span *ngIf="spell.needsConcentration"
  108. >{{ "spells.concentrationAbbr" | translate }} |
  109. </span>
  110. <span *ngIf="spell.needsVerbal"
  111. >{{ "spells.components.verbal" | translate }}
  112. </span>
  113. <span *ngIf="spell.needsSomatic"
  114. >{{ "spells.components.somatic" | translate }}
  115. </span>
  116. <span *ngIf="spell.needsMaterial"
  117. >{{ "spells.components.material" | translate }}
  118. </span>
  119. <div></div>
  120. </div>
  121. </div>
  122. </ng-template>
  123. <!-- Level -->
  124. <ng-template #spellLevelTemplate let-spell="spell">
  125. <div *ngIf="spell.level !== 0" class="bold">{{ spell.level }}</div>
  126. <div *ngIf="spell.level === 0" class="bold">
  127. {{ "spells.cantrip" | translate }}
  128. </div>
  129. </ng-template>
  130. <!-- Attack -->
  131. <ng-template #spellAttackTemplate let-spell="spell">
  132. <div>
  133. <div *ngIf="spell.needsSavingThrow">
  134. <div>
  135. {{
  136. "attributesAbbreviations." + spell.savingThrowAttribute | translate
  137. }}
  138. </div>
  139. <div>{{ spellSaveDC }}</div>
  140. </div>
  141. <div *ngIf="spell.needsAttackRoll">
  142. <div>{{ spellAttackBonus }}</div>
  143. </div>
  144. <div *ngIf="!spell.needsSavingThrow && !spell.needsAttackRoll">-</div>
  145. </div>
  146. </ng-template>
  147. <!-- Damage/Heal -->
  148. <ng-template #spellDamageTemplate let-spell="spell">
  149. <div>
  150. @if (spell.doesDamage) {
  151. <div *ngFor="let damage of spell.damage; let index = index">
  152. <span>
  153. {{ damage.diceNumber }}
  154. {{ "general.dice" | translate }}{{ damage.diceType }}
  155. </span>
  156. <span>
  157. <icon
  158. [size]="'m'"
  159. [type]="'damage'"
  160. [icon]="damage.damageType"
  161. ></icon>
  162. </span>
  163. </div>
  164. }
  165. @if (spell.doesHeal) {
  166. <div class="heal">
  167. <span
  168. >{{ spell.heal.diceNumber }} {{ "general.dice" | translate
  169. }}{{ spell.heal.diceType }}
  170. </span>
  171. <span *ngIf="spell.heal.additionalHeal"
  172. >+{{ spell.heal.additionalHeal }}
  173. </span>
  174. <span>
  175. <icon [size]="'xs'" [type]="'damage'" [icon]="'heal'"></icon>
  176. </span>
  177. </div>
  178. }
  179. </div>
  180. </ng-template>
  181. <!-- Range -->
  182. <ng-template #spellRangeTemplate let-spell="spell">
  183. <div class="spell-range">
  184. <div *ngIf="spell.isRanged">{{ spell.range }} ft.</div>
  185. <div *ngIf="!spell.isRanged">{{ "spells.touch" | translate }}</div>
  186. <div *ngIf="spell.hasAreaOfEffect">
  187. <span
  188. >{{ spell.radius }} ft.
  189. {{ "areaTypes." + spell.areaOfEffectType | translate }}</span
  190. >
  191. </div>
  192. </div>
  193. </ng-template>