attribute-details.component.html 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <div>
  2. <div class="title">{{ "attributes." + attribute.name | translate }}</div>
  3. <div class="content">
  4. {{ "attributeDetails." + attribute.name | translate }}
  5. </div>
  6. </div>
  7. <div class="attribute-container">
  8. <value-box [value]="attribute.value" [label]="'attributes.value'"></value-box>
  9. <value-box [value]="modifier" [label]="'general.modifier'"></value-box>
  10. </div>
  11. @if (attribute.name !== "constitution") {
  12. <div class="subheading left">
  13. {{ "attributeDetails.affectedSkills" | translate }}
  14. </div>
  15. <div class="skills">
  16. @for (skill of skillsTable[attribute.name]; track skill) {
  17. <div class="skill-item">{{ "skills." + skill | translate }}</div>
  18. }
  19. </div>
  20. }
  21. <mat-expansion-panel>
  22. <mat-expansion-panel-header>
  23. <mat-panel-title>{{ "general.modifiers" | translate }}</mat-panel-title>
  24. </mat-expansion-panel-header>
  25. <table class="table table-striped">
  26. <thead>
  27. <tr>
  28. <th scope="col">{{ "general.attributeValue" | translate }}</th>
  29. <th scope="col">{{ "general.modifier" | translate }}</th>
  30. </tr>
  31. </thead>
  32. <tbody>
  33. <tr>
  34. <td>6-7</td>
  35. <td>-3</td>
  36. </tr>
  37. <tr>
  38. <td>7-8</td>
  39. <td>-2</td>
  40. </tr>
  41. <tr>
  42. <td>9-10</td>
  43. <td>-1</td>
  44. </tr>
  45. <tr>
  46. <td>11-12</td>
  47. <td>0</td>
  48. </tr>
  49. <tr>
  50. <td>13-14</td>
  51. <td>+1</td>
  52. </tr>
  53. <tr>
  54. <td>15-16</td>
  55. <td>+2</td>
  56. </tr>
  57. <tr>
  58. <td>17-18</td>
  59. <td>+3</td>
  60. </tr>
  61. <tr>
  62. <td>19-20</td>
  63. <td>+4</td>
  64. </tr>
  65. <tr>
  66. <td>21-22</td>
  67. <td>+5</td>
  68. </tr>
  69. <tr>
  70. <td>22-23</td>
  71. <td>+6</td>
  72. </tr>
  73. <tr>
  74. <td>24-25</td>
  75. <td>+7</td>
  76. </tr>
  77. </tbody>
  78. </table>
  79. </mat-expansion-panel>
  80. @if (attribute.name === "constitution") {
  81. <!-- Resistances etc. -->
  82. <div class="heading-row t-2">
  83. <h4>{{ "attributeDetails.strengths" | translate }}</h4>
  84. <icon-button
  85. [icon]="isEdit ? 'cross' : 'edit'"
  86. (click)="toggleEdit()"
  87. ></icon-button>
  88. </div>
  89. <!-- Resistance -->
  90. <div class="resistance-box">
  91. <div class="input-label">{{ "resistances.resistances" | translate }}</div>
  92. @if (isEdit) {
  93. <mat-form-field appearance="outline">
  94. <mat-select
  95. [(ngModel)]="resistances"
  96. (selectionChange)="showButtons()"
  97. multiple
  98. >
  99. @for (type of list.damageTypes; track type) {
  100. <mat-option [value]="type">
  101. {{ "damageTypes." + type | translate }}
  102. </mat-option>
  103. }
  104. </mat-select>
  105. </mat-form-field>
  106. } @else {
  107. <div class="resistance-container">
  108. @for (type of resistances; track type) {
  109. <icon [size]="'s'" [type]="'damage'" [icon]="type"></icon>
  110. } @empty {
  111. -
  112. }
  113. </div>
  114. }
  115. </div>
  116. <!-- Immunity -->
  117. <div class="resistance-box">
  118. <div class="input-label">{{ "resistances.immunities" | translate }}</div>
  119. @if (isEdit) {
  120. <mat-form-field appearance="outline">
  121. <mat-select
  122. [(ngModel)]="immunities"
  123. (selectionChange)="showButtons()"
  124. multiple
  125. >
  126. @for (type of list.damageTypes; track type) {
  127. <mat-option [value]="type">
  128. {{ "damageTypes." + type | translate }}
  129. </mat-option>
  130. }
  131. </mat-select>
  132. </mat-form-field>
  133. } @else {
  134. <div class="resistance-container">
  135. @for (type of immunities; track type) {
  136. <icon [size]="'s'" [type]="'damage'" [icon]="type"></icon>
  137. } @empty {
  138. -
  139. }
  140. </div>
  141. }
  142. </div>
  143. <!-- Vulnerabilities -->
  144. <div class="resistance-box">
  145. <div class="input-label">
  146. {{ "resistances.vulnerabilities" | translate }}
  147. </div>
  148. @if (isEdit) {
  149. <mat-form-field appearance="outline">
  150. <mat-select
  151. [(ngModel)]="vulnerabilities"
  152. (change)="showButtons()"
  153. multiple
  154. >
  155. @for (type of list.damageTypes; track type) {
  156. <mat-option [value]="type">
  157. {{ "damageTypes." + type | translate }}
  158. </mat-option>
  159. }
  160. </mat-select>
  161. </mat-form-field>
  162. } @else {
  163. <div class="resistance-container">
  164. @for (type of vulnerabilities; track type) {
  165. <icon [size]="'s'" [type]="'damage'" [icon]="type"></icon>
  166. } @empty {
  167. -
  168. }
  169. </div>
  170. }
  171. </div>
  172. @if (showButtonsContainer) {
  173. <div class="vertical-buttons t-2">
  174. <ui-button
  175. [color]="'green'"
  176. [type]="'save'"
  177. [width]="'w20'"
  178. (click)="close()"
  179. >
  180. </ui-button>
  181. <ui-button
  182. [color]="'red'"
  183. [type]="'discard'"
  184. [width]="'w20'"
  185. (click)="close()"
  186. >
  187. </ui-button>
  188. </div>
  189. }
  190. }