recovery stuff

This commit is contained in:
ntr 2019-01-07 20:36:52 +11:00
parent 23aafe1e80
commit f704b80dfb
2 changed files with 6 additions and 28 deletions

View File

@ -41,7 +41,6 @@ class StatSheet extends Phaser.Scene {
this.addStats(cryp);
this.addKnownSkills(cryp);
this.addLearnableSkills(cryp);
this.addControls();
}
updateData(parent, key, data) {
@ -67,19 +66,6 @@ class StatSheet extends Phaser.Scene {
CRYP_STATS.forEach(crypStat);
}
addControls() {
const infoCback = () => {
this.forget = false;
this.addKnownSkills(this.cryp);
};
const forgetCback = () => {
this.forget = true;
this.addKnownSkills(this.cryp);
};
addButton(this, menuX, menuY, infoCback, 'Skill\nInfo');
addButton(this, menuX + menuWidth * 1.1, menuY, forgetCback, 'Forget\nSkills');
}
addKnownSkills(cryp) {
if (this.knownSkills) this.knownSkills.destroy(true);
this.knownSkills = this.add.group();
@ -94,18 +80,7 @@ class StatSheet extends Phaser.Scene {
this.knownSkills.add(this.add.text(menuX, SKILL_Y, skill.skill, style)
.setInteractive()
.on('pointerdown', () => {
if (this.forget) {
this.registry.get('ws').sendCrypForget(cryp.id, skill.skill);
}
})
.on('pointerover', (pointer) => {
if (!this.forget) {
const { description } = SKILLS.LEARNABLE.find(s => s.name === skill.skill);
this.displaySkillText(SKILL_X, SKILL_Y, description, pointer);
}
})
.on('pointerout', () => {
if (this.skillText) this.skillText.destroy();
this.registry.get('ws').sendCrypForget(cryp.id, skill.skill);
}));
};
cryp.skills.forEach(knownSkill);

View File

@ -175,7 +175,10 @@ impl Cryp {
let stam_max = match self.lvl == 64 {
true => u64::max_value(),
false => 2_u64.pow(self.lvl.into()),
false => match self.lvl == 1 {
true => 4_u64,
false => 2_u64.pow(self.lvl.into()),
},
};
let stam_min = match self.lvl == 1 {
@ -184,7 +187,7 @@ impl Cryp {
};
let other_max = match self.lvl == 1 {
true => 2_u64,
true => 4_u64,
false => 2_u64.pow(self.lvl.saturating_sub(1).into()),
};