add select button to cryp list for mobile"

This commit is contained in:
ntr 2018-12-14 11:12:30 +11:00
parent b43fc44303
commit bfb721b5ee
3 changed files with 18 additions and 4 deletions

View File

@ -37,10 +37,12 @@ class CrypRows extends Phaser.GameObjects.Group {
list.displaySkills(cryp);
});
const selectFn = () => {
list.game.events.emit('CRYP_ACTIVE', cryp);
};
if (KEY_MAP[i]) {
this.keyboard.on(KEY_MAP[i], () => {
list.game.events.emit('CRYP_ACTIVE', cryp);
}, this);
this.keyboard.on(KEY_MAP[i], selectFn, this);
}
row.cryp = cryp;
@ -57,6 +59,15 @@ class CrypRows extends Phaser.GameObjects.Group {
const CRYP_STATS = [cryp.stamina, cryp.phys_dmg, cryp.spell_dmg];
CRYP_STATS.forEach(crypStat);
const selectBtn = list.add
.rectangle(ROW_WIDTH - 50, ROW_Y, 50, ROW_HEIGHT, FILL, 0.5)
.setInteractive()
.setOrigin(0);
selectBtn.on('pointerdown', selectFn);
this.add(selectBtn);
this.add(list.add.text(ROW_WIDTH - 20, ROW_Y, i + 1, TEXT.HEADER));
this.add(list.add.text(ROW_X, ROW_Y + (TEXT_MARGIN * 0), cryp.name, TEXT.HEADER));
});

View File

@ -11,6 +11,9 @@
* notifications
* cryp speed
* modifies skill base speed
* rejoin in progress games
* lock account to 1 open game at a time
@ -23,6 +26,7 @@
* Cryp Generation
* Items
* pve granted stat reroll items
* Colour scheme
* Missions

View File

@ -1081,7 +1081,6 @@ fn drain(cryp: &mut Cryp, target: &mut Cryp, mut resolution: Resolution) -> Reso
return resolution;;
}
// TODO is fukt
fn drain_tick(cryp: &mut Cryp, target: &mut Cryp, mut resolution: Resolution) -> Resolution {
let amount = cryp.spell_dmg().wrapping_div(2);
let immunity = target.immune(Skill::DrainTick);