Added new format dmg numbers don't work

This commit is contained in:
Mashy 2019-03-25 14:26:48 +10:00
parent 171367ab06
commit f406b2251d
5 changed files with 40 additions and 44 deletions

View File

@ -87,7 +87,7 @@ class CrypImage extends Phaser.GameObjects.Image {
this.health = scene.add.existing(new StatBar(scene, this, 'HP')); this.health = scene.add.existing(new StatBar(scene, this, 'HP'));
this.red_shield = scene.add.existing(new StatBar(scene, this, 'Red Shield')); this.red_shield = scene.add.existing(new StatBar(scene, this, 'Red Shield'));
this.blue_shield = scene.add.existing(new StatBar(scene, this, 'Blue Shield')); this.blue_shield = scene.add.existing(new StatBar(scene, this, 'Blue Shield'));
this.evasion = scene.add.existing(new StatBar(scene, this, 'Evasion')); // this.evasion = scene.add.existing(new StatBar(scene, this, 'Evasion'));
this.effects = scene.add.existing(new Effects(scene, team, iter)); this.effects = scene.add.existing(new Effects(scene, team, iter));
this.statusText = scene.add.text(statusX, statusY, '', TEXT.NORMAL); this.statusText = scene.add.text(statusX, statusY, '', TEXT.NORMAL);

View File

@ -46,9 +46,8 @@ function calculateTweenParams(sourceSpawn, targetSpawn, account) {
function animatePhase(scene, game, resolution, cb) { function animatePhase(scene, game, resolution, cb) {
// return early for disabled skills // return early for disabled skills
const { resolution: { results } } = resolution; if (resolution.resolutions.length === 0) return cb();
if (results.length === 0) return cb(); // if (events[0] === 'Disable') return cb();
if (results[0][0] === 'Disable') return cb();
const group = scene.scene.get('CombatCryps').cryps; const group = scene.scene.get('CombatCryps').cryps;
const animations = new CombatAnimations(scene); const animations = new CombatAnimations(scene);
@ -77,51 +76,48 @@ function animatePhase(scene, game, resolution, cb) {
// animate animation // animate animation
animations.getSkill(resolution.skill, isAlly, castLocation); animations.getSkill(resolution.skill, isAlly, castLocation);
// Target cryp takes damage // Target cryp takes damage
scene.time.delayedCall(ANIMATION_DURATION, () => { scene.time.delayedCall(ANIMATION_DURATION, () => {
eachSeries(results, console.log(resolution.resolutions);
(result, tickCb) => { eachSeries(resolution.resolutions, (events, tickCb) => {
// touch // touch
if (!results.length) return tickCb(); if (!resolution.resolutions.length) return tickCb();
if (events.event[0] === 'Damage') {
targetSpawn.takeDamage(events.event[1].amount);
scene.registry.set('gameLog', scene.registry.get('gameLog') + 1);
return setTimeout(tickCb, DAMAGE_TICK);
}
if (events.event[0] === 'Healing') {
targetSpawn.takeHealing(events.event[1].amount);
scene.registry.set('gameLog', scene.registry.get('gameLog') + 1);
return setTimeout(tickCb, DAMAGE_TICK);
}
if (events.event[0] === 'Effect') {
targetSpawn.effects.addEffect(events.event[0]);
console.log('target has new effect', events.event[1].effect);
return setTimeout(tickCb, DAMAGE_TICK);
}
const [resultType, values] = result; if (events.event[0] === 'Removal') {
if (resultType === 'Damage') { targetSpawn.effects.removeEffect(events.event[1].effect);
targetSpawn.takeDamage(values); console.log('target effect removed', events.event[1].effect);
scene.registry.set('gameLog', scene.registry.get('gameLog') + 1); return setTimeout(tickCb, DAMAGE_TICK);
return setTimeout(tickCb, DAMAGE_TICK); }
}
if (resultType === 'Healing') {
targetSpawn.takeHealing(values.amount);
scene.registry.set('gameLog', scene.registry.get('gameLog') + 1);
return setTimeout(tickCb, DAMAGE_TICK);
}
if (resultType === 'Effect') {
targetSpawn.effects.addEffect(values);
console.log('target has new effect', values.effect);
return setTimeout(tickCb, DAMAGE_TICK);
}
if (resultType === 'Removal') { // unhandled result type
targetSpawn.effects.removeEffect(values.effect); return tickCb();
console.log('target effect removed', values.effect); },
return setTimeout(tickCb, DAMAGE_TICK); (err) => {
} // Move cryps back
if (moveSourceOrig) scene.tweens.add(moveSourceOrig);
scene.tweens.add(moveTargetOrig);
// unhandled result type // all done
return tickCb(); scene.time.delayedCall(MOVE_CREEP, () => {
}, animations.destroy(true);
(err) => { return cb();
// Move cryps back
if (moveSourceOrig) scene.tweens.add(moveSourceOrig);
scene.tweens.add(moveTargetOrig);
// all done
scene.time.delayedCall(MOVE_CREEP, () => {
animations.destroy(true);
return cb();
});
}); });
});
}); });
}); });
} }

View File

@ -24,7 +24,6 @@ class StatBar extends Phaser.GameObjects.Graphics {
super(scene); super(scene);
this.crypObj = cryp; this.crypObj = cryp;
this.type = type; this.type = type;
console.log(type);
if (type === 'HP') { if (type === 'HP') {
this.val = this.crypObj.cryp.hp.value; this.val = this.crypObj.cryp.hp.value;

0
server/COMBOS.md Executable file → Normal file
View File

View File

@ -37,6 +37,7 @@ constants
change to ownership pattern change to ownership pattern
## SOON ## SOON
* Remove debuffs on KO
* Descriptions * Descriptions
* Stats - How they work * Stats - How they work
* Items - What they give * Items - What they give