From b41c01e6f795f6afdaf4435d4fca4ab717402261 Mon Sep 17 00:00:00 2001 From: Chris Chen Date: Wed, 5 Nov 2025 17:42:32 -0800 Subject: [PATCH] WIP --- .../massive-darkness2.model.boss.ts | 2 +- .../massive-darkness2/mobs/mobs.component.ts | 37 ++++++++++++------- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/src/app/games/massive-darkness2/massive-darkness2.model.boss.ts b/src/app/games/massive-darkness2/massive-darkness2.model.boss.ts index a9fed04..b4765ba 100644 --- a/src/app/games/massive-darkness2/massive-darkness2.model.boss.ts +++ b/src/app/games/massive-darkness2/massive-darkness2.model.boss.ts @@ -250,7 +250,7 @@ export class BossReaper extends BossFight { this.info.skills = []; } this.info.skills.push({ - description: `If the Hero has no ${this.md2Service.stateService.iconHtml(MD2Icon.Mana)}, they take 1 ${this.md2Service.stateService.iconHtml(MD2Icon.Frost)}`, + description: `If the Hero has no ${this.md2Service.stateService.iconHtml(MD2Icon.Mana_Color)}, they take 1 ${this.md2Service.stateService.iconHtml(MD2Icon.FrozenToken)}`, type: MobSkillType.Attack, skillRoll: 1 } as MD2MobSkill); diff --git a/src/app/games/massive-darkness2/mobs/mobs.component.ts b/src/app/games/massive-darkness2/mobs/mobs.component.ts index 3dd0b0d..6abb577 100644 --- a/src/app/games/massive-darkness2/mobs/mobs.component.ts +++ b/src/app/games/massive-darkness2/mobs/mobs.component.ts @@ -8,7 +8,7 @@ import { MD2MobService } from '../../../services/MD2/md2-mob.service'; import { MD2Service } from '../../../services/MD2/md2.service'; import { MsgBoxService } from '../../../services/msg-box.service'; import { StateService } from '../../../services/state.service'; -import { ADIcon } from '../../../ui/alert-dlg/alert-dlg.model'; +import { ADButtons, ADIcon } from '../../../ui/alert-dlg/alert-dlg.model'; import { NumberUtils } from '../../../utilities/number-utils'; import { StringUtils } from '../../../utilities/string-utils'; import { CoreGameRMFactories } from '../factorys/roamingMonsters/CoreGame'; @@ -90,21 +90,30 @@ export class MobsComponent extends MD2ComponentBase implements OnInit { spawnSpecificMob() { let mobOptions = this.isRoamingMonster ? CoreGameRMFactories.map(f => new DropDownOption(f.mobName, f.mobName)) : this.md2Service.allMobInfos.map(f => new DropDownOption(f.name, f.name)); - this.msgBoxService.showInputbox('Spawn', '', { inputType: 'dropdown', dropDownOptions: mobOptions }).pipe(first()).subscribe(mobName => { - if (mobName) { + this.msgBoxService.showInputbox('Spawn', '', + { + inputType: 'dropdown', dropDownOptions: mobOptions, + buttons: ADButtons.YesNoCancel, + confirmButtonText: 'Spawn', + cancelButtonText: 'Random' + }).pipe(first()).subscribe(mobName => { - let result = this.md2Service.spawnMob(this.isRoamingMonster, mobName); - let titleText = result.exitingMob == null ? `${result.mob.description} Shows Up` : `${result.mob.description} Activate One Action Now!`; - let actType = result.exitingMob == null ? MobDlgType.Spawn : MobDlgType.Activating; - let mob = result.exitingMob == null ? result.mob : result.exitingMob; - this.dlgService.open(SpawnMobDlgComponent, { context: { title: titleText, mode: actType, mob: mob } }) - .onClose.pipe(first()).subscribe(result => { - this.afterSpawn(); - }); - this.cdRef.detectChanges(); - } - }); + if (mobName || mobName === false) { + + if (!mobName) { mobName = null; } + let result = this.md2Service.spawnMob(this.isRoamingMonster, mobName); + let titleText = result.exitingMob == null ? `${result.mob.description} Shows Up` : `${result.mob.description} Activate One Action Now!`; + let actType = result.exitingMob == null ? MobDlgType.Spawn : MobDlgType.Activating; + let mob = result.exitingMob == null ? result.mob : result.exitingMob; + + this.dlgService.open(SpawnMobDlgComponent, { context: { title: titleText, mode: actType, mob: mob } }) + .onClose.pipe(first()).subscribe(result => { + this.afterSpawn(); + }); + this.cdRef.detectChanges(); + } + }); }