Comparing version 0.1.46 to 0.1.47
@@ -71,8 +71,8 @@ 'use strict'; | ||
// if (this.skill.type === 'shield' && this.use > 0 && this.undead != this.amount) { | ||
// currentlog += `[${this.name.substring(0, 1).toUpperCase()}] ${this.key} (${this.i}) used his (${this.use}) shield. `; | ||
// this.use -= 1; | ||
// this.grouphealth = this.grouphealth + (this.skill.effect * this.undead); | ||
// healthAfterDamage = this.grouphealth ; | ||
// } | ||
if (this.skill.type === 'shield' && this.use > 0 && this.undead != this.amount && this.grouphealth + this.skill.effect * this.undead < this.amount * this.max_health) { | ||
currentlog += '[' + this.name.substring(0, 1).toUpperCase() + '] ' + this.key + ' (' + this.i + ') used his (' + this.use + ') shield. '; | ||
this.use -= 1; | ||
this.grouphealth = this.grouphealth + this.skill.effect * this.undead; | ||
healthAfterDamage = this.grouphealth; | ||
} | ||
@@ -101,2 +101,3 @@ if (this.skill.type === 'bulletproof' && this.grouphealth / this.undead < damages && this.use > 0) { | ||
this.dead = this.amount; | ||
if (this.dead < 0) this.dead = 0; | ||
this.undead = 0; | ||
@@ -107,3 +108,2 @@ this.kill(); | ||
if (undead !== this.undead || undead !== this.amount) { | ||
console.log(this.undead, undead, this.amount); | ||
currentlog += '<br/> [' + this.name.substring(0, 1).toUpperCase() + '] (' + this.i + ') ' + undead + ' x ' + this.key + ' are left.'; | ||
@@ -110,0 +110,0 @@ this.dead += Number(this.undead - undead); |
@@ -656,3 +656,3 @@ { | ||
"move_cost":50, | ||
"drugs_cost": 4000, | ||
"drugs_cost": 6000, | ||
"weapons_cost": 10000, | ||
@@ -689,3 +689,3 @@ "alcohols_cost": 10000, | ||
"move_cost":50, | ||
"drugs_cost": 5000, | ||
"drugs_cost": 8000, | ||
"weapons_cost": 15000, | ||
@@ -722,3 +722,3 @@ "alcohols_cost": 10000, | ||
"move_cost":50, | ||
"drugs_cost": 6000, | ||
"drugs_cost": 8000, | ||
"weapons_cost": 12000, | ||
@@ -755,3 +755,3 @@ "alcohols_cost": 15000, | ||
"move_cost":50, | ||
"drugs_cost": 8000, | ||
"drugs_cost": 10000, | ||
"weapons_cost": 15000, | ||
@@ -758,0 +758,0 @@ "alcohols_cost": 15000, |
{ | ||
"name": "drugwars", | ||
"version": "0.1.46", | ||
"version": "0.1.47", | ||
"description": "A lightweight JavaScript library for DrugWars", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -54,9 +54,10 @@ import units from './units.json'; | ||
// if (this.skill.type === 'shield' && this.use > 0 && this.undead != this.amount) { | ||
// currentlog += `[${this.name.substring(0, 1).toUpperCase()}] ${this.key} (${this.i}) used his (${this.use}) shield. `; | ||
// this.use -= 1; | ||
// this.grouphealth = this.grouphealth + (this.skill.effect * this.undead); | ||
// healthAfterDamage = this.grouphealth ; | ||
// } | ||
if (this.skill.type === 'shield' && this.use > 0 && this.undead != this.amount && (this.grouphealth + (this.skill.effect * this.undead)) < this.amount * this.max_health ) { | ||
currentlog += `[${this.name.substring(0, 1).toUpperCase()}] ${this.key} (${this.i}) used his (${this.use}) shield. `; | ||
this.use -= 1; | ||
this.grouphealth = this.grouphealth + (this.skill.effect * this.undead); | ||
healthAfterDamage = this.grouphealth ; | ||
} | ||
if(this.skill.type === 'bulletproof' && (this.grouphealth/this.undead) < damages && this.use > 0){ | ||
@@ -93,2 +94,4 @@ currentlog += `[${this.name.substring(0,1).toUpperCase()}] (${this.i}) with ${this.undead} x ${this.key} with <span style="color:green">${parseFloat(this.grouphealth).toFixed(0)}</span> HP take <span style="color:red">${parseFloat(damages).toFixed(0)} DMG</span> from [${current}] (${num}) with ${sender_amount} x ${name} <span style="color:blueviolet"> "${sender_skill}"</span>.` | ||
this.dead = this.amount; | ||
if(this.dead <0) | ||
this.dead = 0; | ||
this.undead = 0; | ||
@@ -100,3 +103,2 @@ this.kill(); | ||
if (undead !== this.undead || undead !== this.amount) { | ||
console.log(this.undead,undead,this.amount) | ||
currentlog+= `<br/> [${this.name.substring(0,1).toUpperCase()}] (${this.i}) ${undead} x ${this.key} are left.`; | ||
@@ -103,0 +105,0 @@ this.dead += Number(this.undead - undead); |
@@ -656,3 +656,3 @@ { | ||
"move_cost":50, | ||
"drugs_cost": 4000, | ||
"drugs_cost": 6000, | ||
"weapons_cost": 10000, | ||
@@ -689,3 +689,3 @@ "alcohols_cost": 10000, | ||
"move_cost":50, | ||
"drugs_cost": 5000, | ||
"drugs_cost": 8000, | ||
"weapons_cost": 15000, | ||
@@ -722,3 +722,3 @@ "alcohols_cost": 10000, | ||
"move_cost":50, | ||
"drugs_cost": 6000, | ||
"drugs_cost": 8000, | ||
"weapons_cost": 12000, | ||
@@ -755,3 +755,3 @@ "alcohols_cost": 15000, | ||
"move_cost":50, | ||
"drugs_cost": 8000, | ||
"drugs_cost": 10000, | ||
"weapons_cost": 15000, | ||
@@ -758,0 +758,0 @@ "alcohols_cost": 15000, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
3436806
26492