Dead participants don't get block
This commit is contained in:
parent
11df4f1164
commit
956b8f5c82
2 changed files with 22 additions and 2 deletions
|
|
@ -44,6 +44,10 @@ public class BattleParticipant
|
|||
}
|
||||
|
||||
public int DealDamage(int damage) {
|
||||
if (!IsAlive()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int blockedDamage = Math.Min(damage, this.block);
|
||||
if (blockedDamage > 0) {
|
||||
this.block -= blockedDamage;
|
||||
|
|
@ -56,6 +60,10 @@ public class BattleParticipant
|
|||
}
|
||||
|
||||
public void CheckState() {
|
||||
if (!IsAlive()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.hp <= 0) {
|
||||
this.dead = true;
|
||||
WipeStatus();
|
||||
|
|
@ -74,10 +82,18 @@ public class BattleParticipant
|
|||
}
|
||||
|
||||
public void AddBlock(int block) {
|
||||
if (!IsAlive()) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.block += block;
|
||||
}
|
||||
|
||||
public void ResetBlock() {
|
||||
if (!IsAlive()) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.block = 0;
|
||||
}
|
||||
|
||||
|
|
@ -90,6 +106,10 @@ public class BattleParticipant
|
|||
}
|
||||
|
||||
public void IncreaseMaxHP(int amount) {
|
||||
if (!IsAlive()) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.maxHP += amount;
|
||||
if (this.hp > 0) {
|
||||
this.hp += amount;
|
||||
|
|
|
|||
2
TODO.txt
2
TODO.txt
|
|
@ -5,5 +5,5 @@
|
|||
- Show on who enemies will use the cards
|
||||
- Extend BattleState to be more than hero turn true/false
|
||||
- Remove UI from dead participants
|
||||
- Dead participants do not get block
|
||||
- GolemCharge art
|
||||
- Create BattleInput
|
||||
Loading…
Add table
Add a link
Reference in a new issue