int currentMP;
int maxMP;
int attack;
- float agility; // to determine move order
+ int defense;
+ int agility; // to determine move order
float moveDist;
// animation stuff?
player.agility = 10.0f;
player.moveDist = 3.0f;
player.texture = player_forward_texture;
- player.position = { arenaCenter.x, arenaCenter.y + 2 };
+ player.position = { arenaCenter.x + 0.5f, arenaCenter.y + 2 };
player.attack = 5;
-
-
+ player.defense = 5;
+
Character monica;
monica.allied = true;
monica.name = "Monica";
monica.agility = 8.0f;
monica.moveDist = 6.0f;
monica.texture = monica_texture;
- monica.position = { player.position.x - 2, player.position.y };
+ monica.position = { arenaCenter.x - 0.5f, arenaCenter.y + 2 };
monica.attack = 6;
monica.basicAttackType = SLASH;
+ monica.defense = 5;
Character enemy;
enemy.allied = false;
enemy.texture = bird;
enemy.position = { arenaCenter.x, arenaCenter.y - 2 };
enemy.attack = 2;
+ enemy.defense = 2;
Character frog;
frog.allied = false;
frog.texture = frog_texture;
frog.position = { arenaCenter.x - 1, arenaCenter.y - 2 };
frog.attack = 2;
+ frog.defense = 2;
combatants.push_back(player);
combatants.push_back(monica);
animFrame += 1;
if (animFrame > 4) animFrame = 0;
}
-
-
-
+
SDL_RenderClear(renderer);
renderCombat();
renderUIFull();
if (inputState.down) {
newY += cursorSpeed;
}
+
+ if (inputState.escape) {
+ inputState.escape = false;
+ currentCombatState = ACTION_SELECT;
+ }
if (inputState.rtrn) {
inputState.rtrn = false;
if (animFrame > anim.numFrames) {
// anim is complete, apply damage and move on.
// reset timers etc.
- target->currentHP -= activeCombatant->attack;
+
+ // minimum attack of 1
+ // ((base attack stat + weapon bonus + attack type bonus) / (Def + 100 / 100)) + 1;
+ int damage = (activeCombatant->attack - (target->defense / 2) / 2);
+ target->currentHP -= damage;
if (target->currentHP <= 0) {
target->alive = false;