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 b4765ba..009ae66 100644 --- a/src/app/games/massive-darkness2/massive-darkness2.model.boss.ts +++ b/src/app/games/massive-darkness2/massive-darkness2.model.boss.ts @@ -15,6 +15,7 @@ export enum MobSkillType { Combat, Passive, ConditionalSkill, + OtherWiseSkill, ActiveSkill, MeleeAttack = 15, RangeAttack, diff --git a/src/app/games/massive-darkness2/md2-mob-info-maintenance/md2-mob-info-detail/md2-mob-info-detail.component.ts b/src/app/games/massive-darkness2/md2-mob-info-maintenance/md2-mob-info-detail/md2-mob-info-detail.component.ts index 328800f..038d914 100644 --- a/src/app/games/massive-darkness2/md2-mob-info-maintenance/md2-mob-info-detail/md2-mob-info-detail.component.ts +++ b/src/app/games/massive-darkness2/md2-mob-info-maintenance/md2-mob-info-detail/md2-mob-info-detail.component.ts @@ -57,7 +57,6 @@ export class MD2MobInfoDetailComponent extends DialogContentBase implements OnIn private msgBoxService: MsgBoxService ) { super(dialog); - this.initializeEnums(); } ngOnInit(): void { @@ -68,6 +67,7 @@ export class MD2MobInfoDetailComponent extends DialogContentBase implements OnIn } this.loadSkills(); } + this.initializeEnums(); } private initializeEnums(): void { @@ -140,6 +140,9 @@ export class MD2MobInfoDetailComponent extends DialogContentBase implements OnIn attackInfo: lastLevel.attackInfo ? { ...lastLevel.attackInfo } : { type: MobSkillType.Attack, yellow: null, orange: null, red: null, blue: null, green: null, black: null }, + alterAttackInfo: lastLevel.alterAttackInfo + ? { ...lastLevel.alterAttackInfo } + : null, defenceInfo: lastLevel.defenceInfo ? { ...lastLevel.defenceInfo } : { type: MobSkillType.Defense, yellow: null, orange: null, red: null, blue: null, green: null, black: null } @@ -158,6 +161,7 @@ export class MD2MobInfoDetailComponent extends DialogContentBase implements OnIn hpPerHero: 0, actions: actions, attackInfo: { type: MobSkillType.Attack, yellow: null, orange: null, red: null, blue: null, green: null, black: null }, + alterAttackInfo: { type: MobSkillType.Attack, yellow: null, orange: null, red: null, blue: null, green: null, black: null }, defenceInfo: { type: MobSkillType.Defense, yellow: null, orange: null, red: null, blue: null, green: null, black: null } }; } @@ -186,14 +190,20 @@ export class MD2MobInfoDetailComponent extends DialogContentBase implements OnIn case 1: newLevel.rewardTokens = 2; newLevel.fixedRareTreasure = 1; + newLevel.fixedEpicTreasure = 0; + newLevel.fixedLegendTreasure = 0; break; case 3: newLevel.rewardTokens = 2; + newLevel.fixedRareTreasure = 0; newLevel.fixedEpicTreasure = 1; + newLevel.fixedLegendTreasure = 0; break; case 5: newLevel.rewardTokens = 0; + newLevel.fixedRareTreasure = 0; newLevel.fixedEpicTreasure = 3; + newLevel.fixedLegendTreasure = 0; break; } break; @@ -309,11 +319,11 @@ export class MD2MobInfoDetailComponent extends DialogContentBase implements OnIn level: level, mobInfoId: this.mobInfo.id, type: type, - skillTarget: MobSkillTarget.Random, - clawRoll: 0, - skillRoll: 1, - name: 'Basic Skill', - skillCondition: '', + skillTarget: lastLevel?.skillTarget || MobSkillTarget.Random, + clawRoll: lastLevel?.clawRoll || 0, + skillRoll: lastLevel?.skillRoll || 1, + name: lastLevel?.name || 'Combat Skill', + skillCondition: lastLevel?.skillCondition || '', description: lastLevel?.description || '' }; diff --git a/src/app/games/massive-darkness2/md2-mob-info-maintenance/md2-mob-info-maintenance.component.html b/src/app/games/massive-darkness2/md2-mob-info-maintenance/md2-mob-info-maintenance.component.html index 7867ee2..7ad9c05 100644 --- a/src/app/games/massive-darkness2/md2-mob-info-maintenance/md2-mob-info-maintenance.component.html +++ b/src/app/games/massive-darkness2/md2-mob-info-maintenance/md2-mob-info-maintenance.component.html @@ -20,9 +20,14 @@ - + - {{ getMobTypeName(dataItem.type) }} + + {{ getMobTypeName(dataItem.type) }} + + + {{ getMobTypeName(value) }} + diff --git a/src/app/games/massive-darkness2/md2-mob-info-maintenance/md2-mob-level-editor/md2-mob-level-editor.component.html b/src/app/games/massive-darkness2/md2-mob-info-maintenance/md2-mob-level-editor/md2-mob-level-editor.component.html index 4d008f0..f5074ae 100644 --- a/src/app/games/massive-darkness2/md2-mob-info-maintenance/md2-mob-level-editor/md2-mob-level-editor.component.html +++ b/src/app/games/massive-darkness2/md2-mob-info-maintenance/md2-mob-level-editor/md2-mob-level-editor.component.html @@ -119,6 +119,22 @@ Attack Info + + + + Attack Type + + + + + + + + + + + @@ -157,6 +173,63 @@ + + + Alter Attack Info + + + + + Alter Attack Type + + + + + + + + + + + + + + + Yellow Dice + + + + + + + + Orange Dice + + + + + + + + Red Dice + + + + + + + + Black Dice + + + + + diff --git a/src/app/games/massive-darkness2/md2-mob-info-maintenance/md2-mob-level-editor/md2-mob-level-editor.component.ts b/src/app/games/massive-darkness2/md2-mob-info-maintenance/md2-mob-level-editor/md2-mob-level-editor.component.ts index 674ae4d..842353c 100644 --- a/src/app/games/massive-darkness2/md2-mob-info-maintenance/md2-mob-level-editor/md2-mob-level-editor.component.ts +++ b/src/app/games/massive-darkness2/md2-mob-info-maintenance/md2-mob-level-editor/md2-mob-level-editor.component.ts @@ -5,6 +5,7 @@ import { MD2MobLevelInfo } from '../../massive-darkness2.db.model'; import { MobSkillType } from '../../massive-darkness2.model.boss'; import { MD2MobLevelInfoService } from '../../service/massive-darkness2.service'; import { MD2Icon, MobType } from '../../massive-darkness2.model'; +import { MD2StateService } from '../../../../services/MD2/md2-state.service'; @Component({ selector: 'ngx-md2-mob-level-editor', @@ -20,21 +21,35 @@ export class MD2MobLevelEditorComponent extends DialogContentBase implements OnI @Input() public mobInfoId: string; @Input() public isAdding: boolean = false; + public selectedAttackType: { value: MobSkillType; text: string } | null = null; public model: MD2MobLevelInfo; public processing: boolean = false; - + public attackTypes: Array<{ value: MobSkillType; text: string }> = []; + public selectedAlterAttackType: { value: MobSkillType; text: string } | null = null; constructor( public dialog: DialogRef, private mobLevelInfoService: MD2MobLevelInfoService, - private cdr: ChangeDetectorRef + private cdr: ChangeDetectorRef, + private md2StateService: MD2StateService ) { super(dialog); } ngOnInit(): void { this.initializeModel(); + this.initializeEnums(); } + public initializeEnums(): void { + this.attackTypes = [ + { value: MobSkillType.Attack, text: 'None' }, + { value: MobSkillType.MeleeAttack, text: this.md2StateService.iconHtml(MD2Icon.Melee) + ' Melee Attack' }, + { value: MobSkillType.RangeAttack, text: this.md2StateService.iconHtml(MD2Icon.Range) + ' Range Attack' }, + { value: MobSkillType.MagicAttack, text: this.md2StateService.iconHtml(MD2Icon.Magic) + ' Magic Attack' }, + ]; + this.selectedAttackType = this.attackTypes.find(t => t.value === this.model.attackInfo.type) || this.attackTypes[0] || null; + this.selectedAlterAttackType = this.attackTypes.find(t => t.value === this.model.alterAttackInfo?.type) || this.attackTypes[0] || null; + } public initializeModel(): void { this.model = { id: this.data?.id || '', @@ -50,6 +65,9 @@ export class MD2MobLevelEditorComponent extends DialogContentBase implements OnI attackInfo: this.data?.attackInfo ? { ...this.data.attackInfo } : { type: MobSkillType.Attack, yellow: null, orange: null, red: null, blue: null, green: null, black: null }, + alterAttackInfo: this.data?.alterAttackInfo + ? { ...this.data.alterAttackInfo } + : { type: MobSkillType.Attack, yellow: null, orange: null, red: null, blue: null, green: null, black: null }, defenceInfo: this.data?.defenceInfo ? { ...this.data.defenceInfo } : { type: MobSkillType.Defense, yellow: null, orange: null, red: null, blue: null, green: null, black: null } @@ -73,7 +91,10 @@ export class MD2MobLevelEditorComponent extends DialogContentBase implements OnI if (!this.model.defenceInfo) { this.model.defenceInfo = { type: MobSkillType.Defense, yellow: null, orange: null, red: null, blue: null, green: null, black: null }; } - + this.model.attackInfo.type = this.selectedAttackType?.value ?? MobSkillType.Attack; + if (this.model.alterAttackInfo) { + this.model.alterAttackInfo.type = this.selectedAlterAttackType?.value ?? MobSkillType.Attack; + } this.mobLevelInfoService.createOrUpdate(this.model).pipe(first()).subscribe(result => { this.processing = false; this.dialog.close(result); diff --git a/src/app/services/MD2/md2-state.service.ts b/src/app/services/MD2/md2-state.service.ts index 2dddb4d..5e3e1f7 100644 --- a/src/app/services/MD2/md2-state.service.ts +++ b/src/app/services/MD2/md2-state.service.ts @@ -83,3 +83,4 @@ export class MD2StateService { return this.imgHtml(`TreasureToken/${TreasureType[type]}.png`, 'g-height-40 mr-1'); } } +