Refactor: unified combat engine for PvE/PvP
- Create api/services/combat_engine.py with all shared combat logic - Rewrite combat.py from 2820 to ~600 lines (thin orchestration) - Fix buff consumption: fortify, berserker_rage, evade, foresight, iron_skin now actually work - Fix stun: PvE skills now write stun to npc_status_effects - Fix skill damage: now uses stats.attack_power consistently (includes perks) - Fix PvPCombatActionRequest: add skill_id field for proper PvP skill support - Remove dead code: PvP skill/item blocks copy-pasted into PvE endpoint - Update game_logic.npc_attack to check buff modifiers (dodge, damage reduction, etc.)
This commit is contained in:
1213
api/services/combat_engine.py
Normal file
1213
api/services/combat_engine.py
Normal file
File diff suppressed because it is too large
Load Diff
@@ -89,12 +89,13 @@ class PvPCombatInitiateRequest(BaseModel):
|
||||
|
||||
|
||||
class PvPAcknowledgeRequest(BaseModel):
|
||||
pass # No body needed
|
||||
combat_id: int
|
||||
|
||||
|
||||
class PvPCombatActionRequest(BaseModel):
|
||||
action: str # 'attack', 'defend', 'flee', 'use_item'
|
||||
action: str # 'attack', 'skill', 'flee', 'use_item'
|
||||
item_id: Optional[str] = None # For use_item action
|
||||
skill_id: Optional[str] = None # For skill action
|
||||
|
||||
|
||||
# ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user