combat: rewrite in Zig; add basic damage types and weapon archetypes
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Ic8055a1cf6bdad1aca13673ea171b4b46a6a6964
This commit is contained in:
parent
7af642612b
commit
22ab6fc6eb
15 changed files with 802 additions and 158 deletions
26
src/combat.h
26
src/combat.h
|
|
@ -15,6 +15,18 @@ int combat_was_player_damage(void);
|
|||
// Was it a critical hit?
|
||||
int combat_was_critical(void);
|
||||
|
||||
// Was the attack dodged?
|
||||
int combat_was_dodged(void);
|
||||
|
||||
// Was the attack blocked?
|
||||
int combat_was_blocked(void);
|
||||
|
||||
// Get block amount from last event
|
||||
int combat_get_block_amount(void);
|
||||
|
||||
// Get the status effect applied in last event
|
||||
StatusEffectType combat_get_applied_effect(void);
|
||||
|
||||
// Reset combat event
|
||||
void combat_reset_event(void);
|
||||
|
||||
|
|
@ -24,4 +36,18 @@ void combat_player_attack(Player *p, Enemy *e);
|
|||
// Enemy attacks player
|
||||
void combat_enemy_attack(Enemy *e, Player *p);
|
||||
|
||||
// Tick status effects on the player (call at start of turn)
|
||||
// Returns total damage dealt by effects this tick
|
||||
int combat_tick_effects(Player *p);
|
||||
|
||||
// Tick status effects on an enemy (call at start of turn)
|
||||
// Returns total damage dealt by effects this tick
|
||||
int combat_tick_enemy_effects(Enemy *e);
|
||||
|
||||
// Apply a status effect to an effect array, stacking/refreshing if already present
|
||||
void combat_apply_effect(StatusEffect effects[], int *count, StatusEffectType type, int duration, int intensity);
|
||||
|
||||
// Check if an entity has a specific effect active
|
||||
int combat_has_effect(const StatusEffect effects[], int count, StatusEffectType type);
|
||||
|
||||
#endif // COMBAT_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue