aboutsummaryrefslogtreecommitdiff
path: root/internal/world/mob.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/world/mob.go')
-rw-r--r--internal/world/mob.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/internal/world/mob.go b/internal/world/mob.go
index 4c6becb..f11d6fe 100644
--- a/internal/world/mob.go
+++ b/internal/world/mob.go
@@ -78,6 +78,7 @@ type MobInstance struct {
InstanceID string
DefID string
Name string
+ Description string
HP int
MaxHP int
Attack int
@@ -133,12 +134,17 @@ func (m *MobInstance) IsTalkable() bool { return m.TalkConfig != nil }
func (m *MobInstance) IsTask() bool { return m.Kind == "task" }
func NewMobInstance(def *MobDef, instanceID string, roomID int, wanderRooms []int, wanderInterval float64) *MobInstance {
+ hp := def.HP
+ if def.Protected && hp <= 0 {
+ hp = 1
+ }
return &MobInstance{
InstanceID: instanceID,
DefID: def.ID,
Name: def.Name,
- HP: def.HP,
- MaxHP: def.HP,
+ Description: def.Description,
+ HP: hp,
+ MaxHP: hp,
Attack: def.Attack,
Strength: def.Strength,
Defense: def.Defense,