spell-table.component.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <div class="spell-box">
  2. <div class="heading-list">
  3. <div>Kosten</div>
  4. <div>Name</div>
  5. <div>Stufe</div>
  6. <div>Bonus</div>
  7. <div>Effekt</div>
  8. <div>Reichweite</div>
  9. </div>
  10. <div
  11. id="spells-table"
  12. cdkDropList
  13. class="item-list table-content"
  14. (cdkDropListDropped)="dropSpells($event)"
  15. >
  16. @for (spell of spells; let index = $index; track spell) {
  17. <div class="item" cdkDrag (click)="showFullSpellcard(index)">
  18. <!-- Range Icon -->
  19. <ng-container
  20. [ngTemplateOutlet]="costTemplate"
  21. [ngTemplateOutletContext]="{ spell: spell }"
  22. ></ng-container>
  23. <div class="vertical-line"></div>
  24. <!-- Name -->
  25. <ng-container
  26. [ngTemplateOutlet]="spellNameTemplate"
  27. [ngTemplateOutletContext]="{ spell: spell }"
  28. ></ng-container>
  29. <div class="vertical-line"></div>
  30. <!-- Level -->
  31. <ng-container
  32. [ngTemplateOutlet]="spellLevelTemplate"
  33. [ngTemplateOutletContext]="{ spell: spell }"
  34. ></ng-container>
  35. <div class="vertical-line"></div>
  36. <!-- Attack -->
  37. <ng-container
  38. [ngTemplateOutlet]="spellAttackTemplate"
  39. [ngTemplateOutletContext]="{ spell: spell }"
  40. ></ng-container>
  41. <div class="vertical-line"></div>
  42. <!-- Damage/Heal -->
  43. <ng-container
  44. [ngTemplateOutlet]="spellDamageTemplate"
  45. [ngTemplateOutletContext]="{ spell: spell }"
  46. ></ng-container>
  47. <div class="vertical-line"></div>
  48. <!-- Range -->
  49. <ng-container
  50. [ngTemplateOutlet]="spellRangeTemplate"
  51. [ngTemplateOutletContext]="{ spell: spell }"
  52. ></ng-container>
  53. </div>
  54. } @empty {
  55. <div
  56. style="
  57. text-align: center;
  58. margin-top: 3rem;
  59. font-size: 1.25rem;
  60. font-weight: 500;
  61. "
  62. >
  63. Noch keine Zauber hinzugefügt
  64. </div>
  65. }
  66. </div>
  67. <div class="footer">
  68. <ui-button [color]="'green'" style="width: 80%" (click)="openModal()">
  69. Bearbeiten
  70. </ui-button>
  71. </div>
  72. <!-- Templates -->
  73. <!-- COST -->
  74. <ng-template #costTemplate let-spell="spell">
  75. <div class="bold">
  76. <span *ngIf="spell.cost === 'action'">A</span>
  77. <span *ngIf="spell.cost === 'bonus action'">B</span>
  78. <span *ngIf="spell.cost === 'reaction'">R</span>
  79. </div>
  80. </ng-template>
  81. <!-- NAME -->
  82. <ng-template #spellNameTemplate let-spell="spell">
  83. <div>
  84. <div class="bold">{{ spell.german }}</div>
  85. <div class="bold small">
  86. <span *ngIf="spell.needsConcentration">C | </span>
  87. <span *ngIf="spell.needsVerbal">V </span>
  88. <span *ngIf="spell.needsSomatic">G </span>
  89. <span *ngIf="spell.needsMaterial">M </span>
  90. <div></div>
  91. </div>
  92. </div>
  93. </ng-template>
  94. <!-- Level -->
  95. <ng-template #spellLevelTemplate let-spell="spell">
  96. <div *ngIf="spell.level !== 0" class="bold">{{ spell.level }}</div>
  97. <div *ngIf="spell.level === 0" class="bold">Trick</div>
  98. </ng-template>
  99. <!-- Attack -->
  100. <ng-template #spellAttackTemplate let-spell="spell">
  101. <div>
  102. <div *ngIf="spell.needsSavingThrow">
  103. <div>
  104. {{ attributes[spell.savingThrowAttribute!] }}
  105. </div>
  106. <div>{{ spellSaveDC }}</div>
  107. </div>
  108. <div *ngIf="spell.needsAttackRoll">
  109. <div>{{ spellAttackBonus }}</div>
  110. </div>
  111. <div *ngIf="!spell.needsSavingThrow && !spell.needsAttackRoll">-</div>
  112. </div>
  113. </ng-template>
  114. <!-- Damage/Heal -->
  115. <ng-template #spellDamageTemplate let-spell="spell">
  116. <div>
  117. @if (spell.doesDamage) {
  118. <div *ngFor="let damage of spell.damage; let index = index">
  119. <span>{{ damage.diceNumber }} {{ damage.diceType }} </span>
  120. <span>
  121. <icon
  122. [size]="'xs'"
  123. [type]="'damage'"
  124. [icon]="damage.damageType"
  125. ></icon>
  126. </span>
  127. </div>
  128. }
  129. @if (spell.doesHeal) {
  130. <div class="heal">
  131. <span>{{ spell.heal.diceNumber }} {{ spell.heal.diceType }} </span>
  132. <span *ngIf="spell.heal.additionalHeal"
  133. >+{{ spell.heal.additionalHeal }}
  134. </span>
  135. <span>
  136. <icon [size]="'xs'" [type]="'damage'" [icon]="'heal'"></icon>
  137. </span>
  138. </div>
  139. }
  140. </div>
  141. </ng-template>
  142. <!-- Range -->
  143. <ng-template #spellRangeTemplate let-spell="spell">
  144. <div class="spell-range">
  145. <div *ngIf="spell.isRanged">{{ spell.range }} ft.</div>
  146. <div *ngIf="!spell.isRanged">Berührung</div>
  147. <div *ngIf="spell.hasAreaOfEffect">
  148. <span>{{ spell.radius }} ft. {{ areas[spell.areaOfEffectType] }} </span>
  149. </div>
  150. </div>
  151. </ng-template>
  152. </div>