helapordo 1.4.20
Loading...
Searching...
No Matches
game_fight.h
Go to the documentation of this file.
1// jgabaut @ github.com/jgabaut
2// SPDX-License-Identifier: GPL-3.0-only
3/*
4 Copyright (C) 2022-2026 jgabaut
5
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, version 3 of the License.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <https://www.gnu.org/licenses/>.
17*/
18
19#ifndef GAME_FIGHT_H_
20#define GAME_FIGHT_H_
21
22#include "../core/game_log.h"
23#include "../core/game_rng.h"
24#include "../notifications/game_notifications.h"
25//#include "game_utils.h"
26
27void setCounter(Turncounter * c, int turns);
28int getBoost(int lvl, int luck);
29int getBossBoost(int lvl, bossClass bclass);
30int getEnemyBoost(int lvl, enemyClass eclass);
31void statReset(Fighter * player, int force);
32void statResetBoss(Boss * b, int force);
33void statResetEnemy(Enemy * e, int force);
34
35void printStatusText(fighterStatus status, char *subject, int color, RingaBuf* rb_notifications);
36void applyStatus(Fighter * f, RingaBuf* rb_notifications);
37void applyEStatus(Enemy * e, RingaBuf* rb_notifications);
38void applyBStatus(Boss * b, RingaBuf* rb_notifications);
39
40int defer_fight_enemy(Fighter * player, Enemy * e, foeTurnOption_OP foe_op,
41 Koliseo * kls, RingaBuf* rb_notifications);
42int defer_skill_enemy(Fighter *player, Enemy *e, skillType picked_skill, foeTurnOption_OP foe_op,
43 Koliseo * kls, RingaBuf* rb_notifications);
44
45int fight(Fighter * player, Enemy * e, Koliseo * kls, RingaBuf* rb_notifications);
46
47int enemy_attack(Enemy * e, Fighter * target,
48 Koliseo * kls, RingaBuf* rb_notifications);
49
50int defer_fight_boss(Fighter * player, Boss * b, Path * p,
51 foeTurnOption_OP foe_op,
52 Koliseo * kls, RingaBuf* rb_notifications);
53
54int defer_skill_boss(Fighter *player, Boss *b, skillType picked_skill, Path *p, foeTurnOption_OP foe_op,
55 Koliseo *kls, RingaBuf* rb_notifications);
56
57int boss_fight(Fighter * player, Boss * b, Path * p,
58 Koliseo * kls, RingaBuf* rb_notifications);
59
60int boss_attack(Boss * b, Fighter * target, Path * p,
61 Koliseo * kls, RingaBuf* rb_notifications);
64fightResult do_Skill(Fighter * player, Enemy * e, skillType picked_skill, Koliseo * kls);
65fightResult do_Skill_boss(Fighter * player, Boss * b, skillType picked_skill, Path * path, Koliseo * kls);
66
67#endif // GAME_FIGHT_H_
enemyClass
The different kinds of Enemy.
Definition game_core.h:668
foeTurnOption
The different kinds of foeTurnOption.
Definition game_core.h:2019
fighterStatus
The different kinds of fighterStatus.
Definition game_core.h:578
foeTurnOption_OP
The different kinds of foeTurnOption_OP.
Definition game_core.h:2030
bossClass
The different kinds of Boss.
Definition game_core.h:727
skillType
Definition game_core.h:859
fightResult
The different kinds of fightResult.
Definition game_core.h:2173
foeTurnOption enemyTurnPick(Enemy *e, Fighter *f)
Returns a randomised pick as foeTurnOption.
Definition game_fight.c:2242
foeTurnOption bossTurnPick(Boss *b, Fighter *f)
Returns a randomised pick as foeTurnOption.
Definition game_fight.c:2291
void applyBStatus(Boss *b, RingaBuf *rb_notifications)
Takes a RingaBuf pointer to queue notifications to, a Boss pointer value and applies the effect perta...
Definition game_fight.c:376
void printStatusText(fighterStatus status, char *subject, int color, RingaBuf *rb_notifications)
Takes a RingaBuf pointer to queue notifications to, a fighterStatus value and a string of who's the e...
Definition game_fight.c:434
int defer_skill_enemy(Fighter *player, Enemy *e, skillType picked_skill, foeTurnOption_OP foe_op, Koliseo *kls, RingaBuf *rb_notifications)
Takes a Fighter and a Enemy pointers and calls do_Skill().
Definition game_fight.c:1197
int getEnemyBoost(int lvl, enemyClass eclass)
Takes one integer and an enemyClass and returns the boost relative to the level delta with base enemy...
Definition game_fight.c:93
int boss_attack(Boss *b, Fighter *target, Path *p, Koliseo *kls, RingaBuf *rb_notifications)
Definition game_fight.c:1645
int fight(Fighter *player, Enemy *e, Koliseo *kls, RingaBuf *rb_notifications)
Takes a Fighter and a Enemy pointers and compares their stats to determine who gets damaged and retur...
Definition game_fight.c:478
void statResetBoss(Boss *b, int force)
Takes a Boss pointer and an integer used to force execution.
Definition game_fight.c:163
void statReset(Fighter *player, int force)
Takes a Fighter pointer and an integer used to force execution.
Definition game_fight.c:120
int defer_fight_boss(Fighter *player, Boss *b, Path *p, foeTurnOption_OP foe_op, Koliseo *kls, RingaBuf *rb_notifications)
Takes a Fighter and a Boss pointers and calls boss_fight().
Definition game_fight.c:1923
fightResult do_Skill_boss(Fighter *player, Boss *b, skillType picked_skill, Path *path, Koliseo *kls)
Definition game_fight.c:2338
void statResetEnemy(Enemy *e, int force)
Takes an Enemy pointer and an integer used to force execution.
Definition game_fight.c:217
fightResult do_Skill(Fighter *player, Enemy *e, skillType picked_skill, Koliseo *kls)
Definition game_fight.c:2332
int defer_fight_enemy(Fighter *player, Enemy *e, foeTurnOption_OP foe_op, Koliseo *kls, RingaBuf *rb_notifications)
Takes a Fighter and a Enemy pointers and calls fight().
Definition game_fight.c:1012
void setCounter(Turncounter *c, int turns)
Takes a Turncounter pointer and an integer.
Definition game_fight.c:29
int getBossBoost(int lvl, bossClass bclass)
Takes one integer and a bossClass and returns the boost relative to the level delta with base boss st...
Definition game_fight.c:69
int defer_skill_boss(Fighter *player, Boss *b, skillType picked_skill, Path *p, foeTurnOption_OP foe_op, Koliseo *kls, RingaBuf *rb_notifications)
Takes a Fighter and a Boss pointers and calls do_Skill_boss().
Definition game_fight.c:2086
int enemy_attack(Enemy *e, Fighter *target, Koliseo *kls, RingaBuf *rb_notifications)
Takes an Enemy and a Fighter pointer and compares their stats to determine who gets damaged and retur...
Definition game_fight.c:737
void applyEStatus(Enemy *e, RingaBuf *rb_notifications)
Takes a RingaBuf pointer to queue notifications to, a Enemy pointer value and applies the effect pert...
Definition game_fight.c:317
int getBoost(int lvl, int luck)
Takes two integers for level to calc against and luck, and returns the boost relative to the level wi...
Definition game_fight.c:46
int boss_fight(Fighter *player, Boss *b, Path *p, Koliseo *kls, RingaBuf *rb_notifications)
Takes a Fighter, a Boss and a Path pointers and compares fighters stats to determine who gets damaged...
Definition game_fight.c:1385
void applyStatus(Fighter *f, RingaBuf *rb_notifications)
Takes a RingaBuf pointer to queue notifications to, a Fighter pointer value and applies the effect pe...
Definition game_fight.c:265
Represents the entity initialised from a bossClass.
Definition game_core.h:1204
Represents the entity initialised from a enemyClass.
Definition game_core.h:1163
Represents the entity initialised from a fighterClass.
Definition game_core.h:1093
Holds the state of game progression.
Definition game_core.h:1357
Represents the entity initialised from a CounterType.
Definition game_core.h:1303