Update boss fight
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
<nb-card *ngIf="!md2Service.playerHero">
|
||||
<nb-card *ngIf="!hero">
|
||||
<nb-card-body>
|
||||
<button nbButton hero status="primary" fullWidth (click)="initHero()">Choose Hero</button>
|
||||
</nb-card-body>
|
||||
</nb-card>
|
||||
<div *ngIf="md2Service.playerHero">
|
||||
<div *ngIf="hero">
|
||||
<div class="row no-gutters">
|
||||
<div class="col-12 col-sm-7">
|
||||
<div class="tp-wrapper mb-2">
|
||||
@@ -11,24 +11,26 @@
|
||||
[@flipState]="flip">
|
||||
<div class="tp-box__side tp-box__front ">
|
||||
|
||||
<img class="MD2HeroCard " src="{{md2Service.playerHero.imgUrl}}">
|
||||
<img class="MD2HeroCard " src="{{hero.imgUrl}}">
|
||||
</div>
|
||||
<div class="tp-box__side tp-box__back">
|
||||
|
||||
|
||||
<img class="MD2HeroCard " src="{{imgUrl('Heros/Guide/'+className+'.jpg')}}">
|
||||
|
||||
<img class="MD2HeroCard " src="{{imgUrl('Sets/Shadowbane/'+className+'.png')}}">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="g-max-height-80vh mb-2">
|
||||
<img class="MD2HeroCard" src="{{md2Service.playerHero.imgUrl}}">
|
||||
<img class="MD2HeroCard" src="{{hero.imgUrl}}">
|
||||
<div class="MD2HeroCard">
|
||||
<span class="MD2text MD2Name">{{md2Service.playerHero.name}}</span>
|
||||
<span class="MD2text MD2Hp">{{md2Service.playerHero.hpMaximum}}</span>
|
||||
<span class="MD2text MD2Mp">{{md2Service.playerHero.mpMaximum}}</span>
|
||||
<span class="MD2text MD2Name">{{hero.name}}</span>
|
||||
<span class="MD2text MD2Hp">{{hero.hpMaximum}}</span>
|
||||
<span class="MD2text MD2Mp">{{hero.mpMaximum}}</span>
|
||||
</div>
|
||||
<img class="MD2HeroCard" src="{{md2Service.playerHero.imgUrl}}">
|
||||
<img class="MD2HeroCard" src="{{hero.imgUrl}}">
|
||||
<img class="MD2HeroCard HpMpBar" src="{{imgUrl('/Heros/Template/Border.png')}}">
|
||||
</div> -->
|
||||
</div>
|
||||
@@ -39,63 +41,57 @@
|
||||
<div class="row no-gutters">
|
||||
<div class="col-6">
|
||||
|
||||
<!-- <adj-number-input name="heroHP" [(ngModel)]="md2Service.playerHero.hp"
|
||||
[maximum]="md2Service.playerHero.hpMaximum" minimum="0"
|
||||
<!-- <adj-number-input name="heroHP" [(ngModel)]="hero.hp"
|
||||
[maximum]="hero.hpMaximum" minimum="0"
|
||||
title="{{iconHtml(MD2Icon.HP,'g-color-google-plus mr-1 g-font-size-18')}}HP" showMaximum
|
||||
(blur)="heroUpdateDebounceTimer.resetTimer()" (hitDecreasing)="increaseRage()">
|
||||
</adj-number-input> -->
|
||||
|
||||
|
||||
<adj-number-input name="heroHP" [(ngModel)]="md2Service.playerHero.hp"
|
||||
[maximum]="md2Service.playerHero.hpMaximum" minimum="0"
|
||||
<adj-number-input name="heroHP" [(ngModel)]="hero.hp" [maximum]="hero.hpMaximum" minimum="0"
|
||||
title="{{imgHtml('HpIcon.png','g-height-25 mr-1')}}HP" showMaximum
|
||||
(blur)="heroUpdateDebounceTimer.resetTimer()" (hitDecreasing)="increaseRage()">
|
||||
</adj-number-input>
|
||||
<adj-number-input name="heroMana" [(ngModel)]="md2Service.playerHero.mp"
|
||||
[maximum]="md2Service.playerHero.mpMaximum" minimum="0"
|
||||
title="{{imgHtml('HeroIcon.png','g-height-25 mr-1')}}Mana" showMaximum
|
||||
<adj-number-input name="heroMana" [(ngModel)]="hero.mp" [maximum]="hero.mpMaximum"
|
||||
minimum="0" title="{{imgHtml('HeroIcon.png','g-height-25 mr-1')}}Mana" showMaximum
|
||||
(blur)="heroUpdateDebounceTimer.resetTimer()">
|
||||
</adj-number-input>
|
||||
|
||||
<adj-number-input name="heroFire" [(ngModel)]="md2Service.playerHero.fireToken" minimum="0"
|
||||
<adj-number-input name="heroFire" [(ngModel)]="hero.fireToken" minimum="0"
|
||||
title="{{iconHtml(MD2Icon.Fire,'g-color-google-plus mr-1 g-font-size-18')}}Fire Token"
|
||||
(blur)="heroUpdateDebounceTimer.resetTimer()">
|
||||
</adj-number-input>
|
||||
<adj-number-input name="heroFire" [(ngModel)]="md2Service.playerHero.frozenToken"
|
||||
minimum="0"
|
||||
<adj-number-input name="heroFire" [(ngModel)]="hero.frozenToken" minimum="0"
|
||||
title="{{iconHtml(MD2Icon.Frost,'g-color-aqua mr-1 g-font-size-18')}}Frozen Token"
|
||||
(blur)="heroUpdateDebounceTimer.resetTimer()">
|
||||
</adj-number-input>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
|
||||
<adj-number-input name="remainActions" [(ngModel)]="md2Service.playerHero.remainActions"
|
||||
minimum="0" title="Remain Actions" (blur)="heroUpdateDebounceTimer.resetTimer()"
|
||||
hideIncreaseBtn>
|
||||
<adj-number-input name="remainActions" [(ngModel)]="hero.remainActions" minimum="0"
|
||||
title="Remain Actions" (blur)="heroUpdateDebounceTimer.resetTimer()" hideIncreaseBtn
|
||||
*ngIf="hero.uiActivating">
|
||||
</adj-number-input>
|
||||
<adj-number-input name="heroLevel" [(ngModel)]="md2Service.playerHero.level" minimum="1"
|
||||
maximum="5" title="Level" (blur)="heroUpdateDebounceTimer.resetTimer()">
|
||||
<adj-number-input name="heroLevel" [(ngModel)]="hero.level" minimum="1" maximum="5"
|
||||
title="Level" (blur)="heroUpdateDebounceTimer.resetTimer()">
|
||||
</adj-number-input>
|
||||
<adj-number-input name="heroExp" [(ngModel)]="md2Service.playerHero.exp" minimum="0"
|
||||
title="Exp" (blur)="heroUpdateDebounceTimer.resetTimer()">
|
||||
<adj-number-input name="heroExp" [(ngModel)]="hero.exp" minimum="0" title="Exp"
|
||||
(blur)="heroUpdateDebounceTimer.resetTimer()">
|
||||
</adj-number-input>
|
||||
<adj-number-input name="heroRage" [(ngModel)]="md2Service.playerHero.rage" minimum="0"
|
||||
maximum="7"
|
||||
<adj-number-input name="heroRage" [(ngModel)]="hero.rage" minimum="0" maximum="7"
|
||||
title="{{iconHtml(MD2Icon.Rage,'g-color-google-plus mr-1 g-font-size-18')}}Rage"
|
||||
(blur)="heroUpdateDebounceTimer.resetTimer()"
|
||||
*ngIf="md2Service.playerHero.class==HeroClass.Berserker">
|
||||
(blur)="heroUpdateDebounceTimer.resetTimer()" *ngIf="hero.class==HeroClass.Berserker">
|
||||
</adj-number-input>
|
||||
<adj-number-input name="heroCorruption" [(ngModel)]="md2Service.playerHero.corruptionToken"
|
||||
minimum="0" title="{{imgHtml('Tokens/CorruptToken.png','g-height-18')}} Corruption"
|
||||
(blur)="heroUpdateDebounceTimer.resetTimer()"
|
||||
*ngIf="md2Service.playerHero.corruptionToken>0">
|
||||
<adj-number-input name="heroCorruption" [(ngModel)]="hero.corruptionToken" minimum="0"
|
||||
title="{{imgHtml('Tokens/CorruptToken.png','g-height-18')}} Corruption"
|
||||
(blur)="heroUpdateDebounceTimer.resetTimer()" *ngIf="hero.uiShowCorruptionToken">
|
||||
</adj-number-input>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div *ngIf="md2Service.info.isBossFight"></div>
|
||||
<div *ngIf="md2Service.playerHero.remainActions>0">
|
||||
<div *ngIf="hero.uiActivating&&hero.remainActions>0">
|
||||
<button nbButton hero class="mr-2" status="info" (click)="moveAction()"
|
||||
*ngIf="!showMoveAction">Move</button>
|
||||
<button nbButton hero class="mr-2" status="info" (click)="moveActionEnd()"
|
||||
@@ -109,8 +105,14 @@
|
||||
|
||||
</div>
|
||||
|
||||
<button nbButton hero fullWidth status="info" *ngIf="allowStartAction"
|
||||
(click)="startActivation()">Start Activation</button>
|
||||
|
||||
<button nbButton hero status="info" class="mt-2" (click)="openDoor()" *ngIf="showMoveAction">Open
|
||||
Door</button>
|
||||
<button nbButton hero fullWidth status="warning" class="mt-3" *ngIf="hero.uiActivating"
|
||||
(click)="endActivation()">End
|
||||
Activation</button>
|
||||
|
||||
</nb-card-body>
|
||||
</nb-card>
|
||||
@@ -121,7 +123,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- <nb-flip-card *ngIf="md2Service.playerHero">
|
||||
<!-- <nb-flip-card *ngIf="hero">
|
||||
<nb-card-front>
|
||||
<nb-card>
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import { MD2Service } from '../../../services/MD2/md2.service';
|
||||
import { MsgBoxService } from '../../../services/msg-box.service';
|
||||
import { StateService } from '../../../services/state.service';
|
||||
import { ADButtonColor, ADButtons } from '../../../ui/alert-dlg/alert-dlg.model';
|
||||
import { ArrayUtils } from '../../../utilities/array-utils';
|
||||
import { StringUtils } from '../../../utilities/string-utils';
|
||||
import { DebounceTimer } from '../../../utilities/timer-utils';
|
||||
import { HeroClass, MD2HeroInfo } from '../massive-darkness2.model';
|
||||
@@ -51,6 +52,7 @@ export class HeroDashboardComponent extends MD2Base implements OnInit {
|
||||
new DropDownOption(HeroClass.Rogue, 'Rogue'),
|
||||
new DropDownOption(HeroClass.Wizard, 'Wizard'),
|
||||
new DropDownOption(HeroClass.Shaman, 'Shaman'),
|
||||
new DropDownOption(HeroClass.Druid, 'Druid'),
|
||||
];
|
||||
heros = [] as MD2HeroInfo[];
|
||||
wizards: MD2HeroInfo[] = [
|
||||
@@ -76,7 +78,7 @@ export class HeroDashboardComponent extends MD2Base implements OnInit {
|
||||
}
|
||||
|
||||
public get allowAttack(): boolean {
|
||||
return (!!this.md2Service.mobs && this.md2Service.mobs.length > 0) || (!!this.md2Service.roamingMonsters && this.md2Service.roamingMonsters.length > 0);
|
||||
return this.md2Service.playerHero.uiBossFight || (!!this.md2Service.mobs && this.md2Service.mobs.length > 0) || (!!this.md2Service.roamingMonsters && this.md2Service.roamingMonsters.length > 0);
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
@@ -130,7 +132,7 @@ export class HeroDashboardComponent extends MD2Base implements OnInit {
|
||||
class: heroClass
|
||||
}))
|
||||
}
|
||||
this.heros = this.heros.sort((a, b) => StringUtils.compareSemVer(a.name, b.name));
|
||||
this.heros = ArrayUtils.Shuffle(this.heros);//.sort((a, b) => StringUtils.compareSemVer(a.name, b.name));
|
||||
this.showHeroList(heroClass, 0);
|
||||
});
|
||||
}
|
||||
@@ -157,16 +159,16 @@ export class HeroDashboardComponent extends MD2Base implements OnInit {
|
||||
}
|
||||
|
||||
broadcastHeroInfo() {
|
||||
this.md2Service.broadcastMyHeroInfo();
|
||||
this.md2Service.broadcastService.broadcastMyHeroInfo();
|
||||
this.heroUpdateDebounceTimer.clearOut();
|
||||
}
|
||||
increaseRage() {
|
||||
if (this.md2Service.playerHero.rage < 7) {
|
||||
this.md2Service.playerHero.rage++;
|
||||
if (this.hero.rage < 7) {
|
||||
this.hero.rage++;
|
||||
}
|
||||
}
|
||||
openDoor() {
|
||||
this.md2Service.broadcastHeroAction('openDoor');
|
||||
this.md2Service.broadcastService.broadcastHeroAction('openDoor');
|
||||
this.showMoveAction = false;
|
||||
this.detectChanges();
|
||||
}
|
||||
@@ -183,17 +185,19 @@ export class HeroDashboardComponent extends MD2Base implements OnInit {
|
||||
this.showMoveAction = false;
|
||||
switch (action) {
|
||||
case 'recoveryAction':
|
||||
this.msgBoxService.show('Recovery', { text: 'takes the Recover action may gain up to 2 Health or Mana in any combination (either 2 Health, 2 Mana, or 1 of each).' })
|
||||
this.msgBoxService.show('Recovery', { text: 'takes the Recover action may gain up to 2 Health or Mana in any combination (either 2 Health, 2 Mana, or 1 of each).' });
|
||||
break;
|
||||
case 'attackAction':
|
||||
this.msgBoxService.show('Attacking', { text: 'Please process attacking action in Dashboard.' });
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
this.md2Service.broadcastHeroAction(action);
|
||||
this.md2Service.broadcastService.broadcastHeroAction(action);
|
||||
this.reduceAction();
|
||||
}
|
||||
reduceAction() {
|
||||
this.md2Service.playerHero.remainActions -= 1;
|
||||
this.hero.remainActions -= 1;
|
||||
this.detectChanges();
|
||||
this.broadcastHeroInfo();
|
||||
}
|
||||
@@ -202,4 +206,30 @@ export class HeroDashboardComponent extends MD2Base implements OnInit {
|
||||
toggleFlip() {
|
||||
this.flip = (this.flip == 'inactive') ? 'active' : 'inactive';
|
||||
}
|
||||
|
||||
get allowStartAction() {
|
||||
return !this.md2Service.heros.some(h => h.uiActivating) && !this.hero.uiActivating && this.hero.remainActions > 0;
|
||||
}
|
||||
|
||||
public get hero() {
|
||||
return this.md2Service.playerHero;
|
||||
}
|
||||
startActivation() {
|
||||
this.hero.uiActivating = true;
|
||||
this.broadcastHeroInfo();
|
||||
}
|
||||
endActivation() {
|
||||
if (this.hero.remainActions > 0) {
|
||||
this.msgBoxService.show('Are you sure?', { text: `End Activation will lose ${this.hero.remainActions} remaining actions.`, buttons: ADButtons.YesNo }).pipe(first()).subscribe(result => {
|
||||
if (result) {
|
||||
this.hero.remainActions = 0;
|
||||
this.endActivation();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.hero.uiActivating = false;
|
||||
this.broadcastHeroInfo();
|
||||
this.detectChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user