This commit is contained in:
Chris Chen
2024-03-22 11:06:42 -07:00
parent b46392bc41
commit 6a031ca478
38 changed files with 993 additions and 376 deletions
@@ -1 +1,5 @@
<p>mob-combat-info works!</p>
<div class='form-group row' *ngIf="showSkill">
<label class='label col-sm-3 form-control-label MD2text g-font-size-30'
[innerHtml]="mob.combatSkill.skillName"></label>
<div class='col-sm' [innerHtml]="mob.combatSkill.skillDescription"></div>
</div>
@@ -0,0 +1,19 @@
.diceAmount {
color: white;
z-index: 2;
position: absolute;
left: 25px;
font-size: 30px;
}
.dice {
&::before {
position: absolute;
}
}
.blackDiceAmount {
color: white;
z-index: 2;
position: absolute;
left: 26px;
font-size: 30px;
}
@@ -1,15 +1,47 @@
import { Component, OnInit } from '@angular/core';
import { Component, Input, OnInit } from '@angular/core';
import { MD2Icon, MobDlgType, MobInfo } from '../../../massive-darkness2.model';
import { MobSkillType } from '../../../massive-darkness2.model.boss';
@Component({
selector: 'ngx-mob-combat-info',
selector: 'md2-mob-combat-info',
templateUrl: './mob-combat-info.component.html',
styleUrls: ['./mob-combat-info.component.scss']
})
export class MobCombatInfoComponent implements OnInit {
MD2Icon = MD2Icon;
private _mob: MobInfo;
public get mob(): MobInfo {
return this._mob;
}
@Input() public set mob(v: MobInfo) {
if (this._mob != v) {
this._mob = v;
}
}
@Input() mode: MobDlgType = MobDlgType.PreView;
constructor() { }
ngOnInit(): void {
}
if (this.mob.combatSkill) {
switch (this.mode) {
case MobDlgType.Activating:
this.showSkill = [MobSkillType.Combat, MobSkillType.Attack].includes(this.mob.combatSkill.type);
break;
case MobDlgType.BeenAttacked:
this.showSkill = [MobSkillType.Combat, MobSkillType.Defense].includes(this.mob.combatSkill.type);
break;
case MobDlgType.PreView:
case MobDlgType.Spawn:
default:
this.showSkill = true;
break;
}
}
}
showSkill: boolean = false;;
}