Skip to content

Castle Siege Life Stones #728

@sven-n

Description

@sven-n

Summary

Implement Life Stones — guild-summoned NPCs that heal nearby allies during Castle Siege battle. Each guild can place one Life Stone, which goes through a creation phase before becoming active.

Prerequisites

Requirements

1. Life Stone NPC — GameLogic/CastleSiege/NPC/CastleSiegeLifeStone.cs (created in Phase 6)

Extends AttackableNpcBase. Characteristics:

  • Attackable (enemies can destroy it).
  • No movement, no attack ability.
  • Immune to pushback and Radiance effects.
  • Does not drop loot on death.
  • Tracks: owning guild ID, join side, creation phase progress.

2. Life Stone Intelligence — GameLogic/CastleSiege/Intelligence/CastleSiegeLifeStoneIntelligence.cs (created in Phase 6)

Creation Phase (60 seconds, 5 stages):

  • On spawn, the Life Stone is in "creating" state.
  • Every 12 seconds, advance to the next visual stage (0→1→2→3→4).
  • Send CastleSiegeLifeStoneState packet to nearby players at each stage.
  • After 60 seconds (stage 4 complete), transition to "active" state.

Active Phase:

  • Every AI tick: find all players within 3 tiles.
  • Filter to same-side players only.
  • Heal each player: +1% of MaxHP for HP, MP, AG (not shield).
  • Use existing IAttackable attribute system for healing.

Death/Destruction:

  • Remove from CastleSiegeContext tracking.
  • No loot drops (override drop generator behavior or check in AttackableNpcBase).

3. Summon Life Stone Action — New file: GameLogic/CastleSiege/Actions/CastleSiegeSummonLifeStoneAction.cs

Validation:

  • Current state is Start.
  • Player has a guild and a join side ≠ None.
  • Player's guild does not already have an active Life Stone (check CastleSiegeContext).
  • Player is in the Castle Siege map.

Effect:

  • Create a CastleSiegeLifeStone at the player's position.
  • Spawn it on the map.
  • Track in CastleSiegeContext (guild → Life Stone mapping).

4. Life Stone Forced Destruction

Life Stones are forcefully killed when:

  • SetPlayerJoinSideAsync(killLifeStones: true) is called (on castle capture/side swap).
  • Castle Siege state changes away from Start.
  • The Life Stone leaves the CS map (shouldn't happen normally).

Implement in CastleSiegeContext.KillAllLifeStonesAsync():

  • Iterate all tracked Life Stones.
  • Call kill/die on each.
  • Remove from tracking.

5. View Interface & Remote View

  • ICastleSiegeLifeStoneStatePlugIn — sends creation phase progress.
  • CastleSiegeLifeStoneStatePlugIn — remote view implementation.

Files to Create

File Description
GameLogic/CastleSiege/Actions/CastleSiegeSummonLifeStoneAction.cs Summon logic
GameLogic/Views/CastleSiege/ICastleSiegeLifeStoneStatePlugIn.cs View interface
GameServer/RemoteView/CastleSiege/CastleSiegeLifeStoneStatePlugIn.cs Remote view

(NPC class and intelligence created in Phase 6.)

Acceptance Criteria

  • Each guild can place exactly one Life Stone during battle.
  • Life Stone goes through a 60-second creation phase with 5 visual stages.
  • Active Life Stones heal nearby (≤3 tiles) same-side players at 1% max HP per tick.
  • Life Stones do not drop loot on death.
  • Life Stones are immune to pushback.
  • All Life Stones are destroyed on castle capture (side swap).
  • All Life Stones are destroyed when battle ends.
  • Life Stone creation state is broadcast to nearby players.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions