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,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;;
}