feat: multiplayer flee marks player as out for current combat
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -34,6 +34,7 @@ type Player struct {
|
||||
Inventory []Item
|
||||
Relics []Relic
|
||||
Dead bool
|
||||
Fled bool
|
||||
}
|
||||
|
||||
func NewPlayer(name string, class Class) *Player {
|
||||
@@ -67,6 +68,10 @@ func (p *Player) IsDead() bool {
|
||||
return p.Dead
|
||||
}
|
||||
|
||||
func (p *Player) IsOut() bool {
|
||||
return p.Dead || p.Fled
|
||||
}
|
||||
|
||||
func (p *Player) Revive(hpPercent float64) {
|
||||
p.Dead = false
|
||||
p.HP = int(float64(p.MaxHP) * hpPercent)
|
||||
|
||||
Reference in New Issue
Block a user