OpenEnroth 73e68f7
Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
Arcomage.cpp File Reference
#include "Arcomage.h"
#include <string>
#include "Engine/EngineGlobals.h"
#include "Engine/Data/AwardEnums.h"
#include "Engine/Data/HouseEnumFunctions.h"
#include "Engine/Graphics/Renderer/Renderer.h"
#include "Engine/Graphics/Image.h"
#include "Engine/Localization.h"
#include "Engine/Party.h"
#include "Engine/Random/Random.h"
#include "Engine/AssetsManager.h"
#include "GUI/GUIWindow.h"
#include "GUI/UI/UIHouses.h"
#include "Media/Audio/AudioPlayer.h"
#include "Media/MediaPlayer.h"
#include "Utility/IndexedArray.h"

Classes

struct  ArcomageStartConditions
 
struct  am_ai_cardpowerstruct
 
struct  arcomage_mouse
 

Macros

#define APPLY_TO_PLAYER(PLAYER, ENEMY, FIELD, VAL, RES)
 
#define APPLY_TO_ENEMY(PLAYER, ENEMY, FIELD, VAL, RES)    APPLY_TO_PLAYER(ENEMY, PLAYER, FIELD, VAL, RES)
 
#define APPLY_TO_BOTH(PLAYER, ENEMY, FIELD, VAL, RES_P, RES_E)
 

Functions

void SetStartConditions ()
 
void SetStartGameData ()
 
void FillPlayerDeck ()
 
void InitalHandsFill ()
 
void GetNextCardFromDeck (int player_num)
 
int GetEmptyCardSlotIndex (int player_num)
 
void IncreaseResourcesInTurn (int player_num)
 
void TurnChange ()
 
bool IsGameOver ()
 
int CalculateCardPower (ArcomagePlayer *player, ArcomagePlayer *enemy, ArcomageCard *pCard, int mastery)
 
char PlayerTurn (int player_num)
 
void DrawGameUI (int animation_stage)
 
void DrawSparks ()
 
void DrawRectanglesForText ()
 
void DrawPlayersText ()
 
void DrawPlayerLevels (std::string_view str, Pointi *pXY)
 
void DrawBricksCount (std::string_view str, Pointi *pXY)
 
void DrawGemsCount (std::string_view str, Pointi *pXY)
 
void DrawBeastsCount (std::string_view str, Pointi *pXY)
 
void DrawPlayersTowers ()
 
void DrawPlayersWall ()
 
void DrawCards ()
 
void DrawCardAnimation (int animation_stage)
 
int GetPlayerHandCardCount (int player_num)
 
int DrawCardsRectangles (int player_num)
 
bool DiscardCard (int player_num, int card_slot_index)
 
bool PlayCard (int player_num, int card_slot_num)
 
bool CanCardBePlayed (int player_num, int hand_card_indx)
 
void ApplyCardToPlayer (int player_num, int uCardID)
 
int new_explosion_effect (Pointi *startXY, int effect_value)
 
int ApplyDamageToBuildings (int player_num, int damage)
 
void GameResultsApply ()
 
void am_DrawText (std::string_view str, Pointi *pXY)
 
void DrawRect (Recti *pRect, Color uColor, char bSolidFill)
 
bool OpponentsAITurn (int player_num)
 
void set_stru1_field_8_InArcomage (int inValue)
 

Variables

IndexedArray< ArcomageStartConditions, HOUSE_FIRST_ARCOMAGE_TAVERN, HOUSE_LAST_ARCOMAGE_TAVERNstart_conditions
 
constexpr auto SIG_MEMALOC = 0x67707274
 
constexpr auto SIG_MEMFREE = 0x78787878
 
ArcomageGamepArcomageGame = new ArcomageGame
 
ArcomagePlayer am_Players [2]
 
AcromageCardOnTable shown_cards [10]
 
am_effects_struct am_effects_array [10]
 
ArcomageDeck playDeck
 
ArcomageDeck deckMaster
 
char Player2Name [] = "Enemy"
 
char Player1Name [] = "Player"
 
am_ai_cardpowerstruct cards_power [10]
 
bool Player_Gets_First_Turn = true
 
bool Player_Cards_Shift = true
 
char use_start_bonus = 1
 
int start_tower_height
 
int start_wall_height
 
int start_quarry_level
 
int start_magic_level
 
int start_zoo_level
 
int start_bricks_amount
 
int start_gems_amount
 
int start_beasts_amount
 
int minimum_cards_at_hand = 5
 
int quarry_bonus = 1
 
int magic_bonus = 1
 
int zoo_bonus = 1
 
int max_tower_height = 50
 
int max_resources_amount = 100
 
int opponent_mastery = 1
 
char opponents_turn
 
char See_Opponents_Cards = 0
 
int current_player_num
 
char need_to_discard_card
 
int current_card_slot_index
 
int played_card_id
 
int discarded_card_id
 
int deck_walk_index
 
int Card_Hover_Index
 
int num_cards_to_discard
 
int num_actions_left
 
Pointi anim_card_spd_drawncard
 
Pointi anim_card_pos_drawncard
 
Pointi anim_card_spd_playdiscard
 
Pointi anim_card_pos_playdiscard
 
char drawn_card_anim_start
 
int drawn_card_anim_cnt
 
int drawn_card_slot_index
 
char playdiscard_anim_start
 
char hide_card_anim_start
 
char hide_card_anim_runnning
 
int hide_card_anim_count
 

Macro Definition Documentation

◆ APPLY_TO_BOTH

#define APPLY_TO_BOTH (   PLAYER,
  ENEMY,
  FIELD,
  VAL,
  RES_P,
  RES_E 
)
Value:
if (VAL != 0) { \
if (VAL == 99) { \
if (PLAYER->FIELD != ENEMY->FIELD) { \
if (PLAYER->FIELD <= ENEMY->FIELD) { \
PLAYER->FIELD = ENEMY->FIELD; \
RES_P = ENEMY->FIELD - PLAYER->FIELD; \
} else { \
ENEMY->FIELD = PLAYER->FIELD; \
RES_E = PLAYER->FIELD - ENEMY->FIELD; \
} \
} \
} else { \
PLAYER->FIELD += (signed int)(VAL); \
ENEMY->FIELD += (signed int)(VAL); \
if (PLAYER->FIELD < 0) { \
PLAYER->FIELD = 0; \
} \
if (ENEMY->FIELD < 0) { \
ENEMY->FIELD = 0; \
} \
RES_P = (signed int)(VAL); \
RES_E = (signed int)(VAL); \
} \
}

◆ APPLY_TO_ENEMY

#define APPLY_TO_ENEMY (   PLAYER,
  ENEMY,
  FIELD,
  VAL,
  RES 
)     APPLY_TO_PLAYER(ENEMY, PLAYER, FIELD, VAL, RES)

◆ APPLY_TO_PLAYER

#define APPLY_TO_PLAYER (   PLAYER,
  ENEMY,
  FIELD,
  VAL,
  RES 
)
Value:
if (VAL != 0) { \
if (VAL == 99) { \
if (PLAYER->FIELD < ENEMY->FIELD) { \
PLAYER->FIELD = ENEMY->FIELD; \
RES = ENEMY->FIELD - PLAYER->FIELD; \
} \
} else { \
PLAYER->FIELD += (signed int)(VAL); \
if (PLAYER->FIELD < 0) PLAYER->FIELD = 0; \
RES = (signed int)(VAL); \
} \
}

Function Documentation

◆ am_DrawText()

void am_DrawText ( std::string_view  str,
Pointi pXY 
)

◆ ApplyCardToPlayer()

void ApplyCardToPlayer ( int  player_num,
int  uCardID 
)

◆ ApplyDamageToBuildings()

int ApplyDamageToBuildings ( int  player_num,
int  damage 
)

◆ CalculateCardPower()

int CalculateCardPower ( ArcomagePlayer player,
ArcomagePlayer enemy,
ArcomageCard pCard,
int  mastery 
)

◆ CanCardBePlayed()

bool CanCardBePlayed ( int  player_num,
int  hand_card_indx 
)

◆ DiscardCard()

bool DiscardCard ( int  player_num,
int  card_slot_index 
)

◆ DrawBeastsCount()

void DrawBeastsCount ( std::string_view  str,
Pointi pXY 
)

◆ DrawBricksCount()

void DrawBricksCount ( std::string_view  str,
Pointi pXY 
)

◆ DrawCardAnimation()

void DrawCardAnimation ( int  animation_stage)

◆ DrawCards()

void DrawCards ( )

◆ DrawCardsRectangles()

signed int DrawCardsRectangles ( int  player_num)

◆ DrawGameUI()

void DrawGameUI ( int  animation_stage)

◆ DrawGemsCount()

void DrawGemsCount ( std::string_view  str,
Pointi pXY 
)

◆ DrawPlayerLevels()

void DrawPlayerLevels ( std::string_view  str,
Pointi pXY 
)

◆ DrawPlayersText()

void DrawPlayersText ( )

◆ DrawPlayersTowers()

void DrawPlayersTowers ( )

◆ DrawPlayersWall()

void DrawPlayersWall ( )

◆ DrawRect()

void DrawRect ( Recti pRect,
Color  uColor,
char  bSolidFill 
)

◆ DrawRectanglesForText()

void DrawRectanglesForText ( )

◆ DrawSparks()

void DrawSparks ( )

◆ FillPlayerDeck()

void FillPlayerDeck ( )

◆ GameResultsApply()

void GameResultsApply ( )

◆ GetEmptyCardSlotIndex()

int GetEmptyCardSlotIndex ( int  player_num)

◆ GetNextCardFromDeck()

void GetNextCardFromDeck ( int  player_num)

◆ GetPlayerHandCardCount()

int GetPlayerHandCardCount ( int  player_num)

◆ IncreaseResourcesInTurn()

void IncreaseResourcesInTurn ( int  player_num)

◆ InitalHandsFill()

void InitalHandsFill ( )

◆ IsGameOver()

bool IsGameOver ( )

◆ new_explosion_effect()

int new_explosion_effect ( Pointi startXY,
int  effect_value 
)

◆ OpponentsAITurn()

bool OpponentsAITurn ( int  player_num)

◆ PlayCard()

bool PlayCard ( int  player_num,
int  card_slot_num 
)

◆ PlayerTurn()

char PlayerTurn ( int  player_num)

◆ set_stru1_field_8_InArcomage()

void set_stru1_field_8_InArcomage ( int  inValue)

◆ SetStartConditions()

void SetStartConditions ( )

◆ SetStartGameData()

void SetStartGameData ( )

◆ TurnChange()

void TurnChange ( )

Variable Documentation

◆ am_effects_array

am_effects_struct am_effects_array[10]

◆ am_Players

ArcomagePlayer am_Players[2]

◆ anim_card_pos_drawncard

Pointi anim_card_pos_drawncard

◆ anim_card_pos_playdiscard

Pointi anim_card_pos_playdiscard

◆ anim_card_spd_drawncard

Pointi anim_card_spd_drawncard

◆ anim_card_spd_playdiscard

Pointi anim_card_spd_playdiscard

◆ Card_Hover_Index

int Card_Hover_Index

◆ cards_power

am_ai_cardpowerstruct cards_power[10]

◆ current_card_slot_index

int current_card_slot_index

◆ current_player_num

int current_player_num

◆ deck_walk_index

int deck_walk_index

◆ deckMaster

ArcomageDeck deckMaster

◆ discarded_card_id

int discarded_card_id

◆ drawn_card_anim_cnt

int drawn_card_anim_cnt

◆ drawn_card_anim_start

char drawn_card_anim_start

◆ drawn_card_slot_index

int drawn_card_slot_index

◆ hide_card_anim_count

int hide_card_anim_count

◆ hide_card_anim_runnning

char hide_card_anim_runnning

◆ hide_card_anim_start

char hide_card_anim_start

◆ magic_bonus

int magic_bonus = 1

◆ max_resources_amount

int max_resources_amount = 100

◆ max_tower_height

int max_tower_height = 50

◆ minimum_cards_at_hand

int minimum_cards_at_hand = 5

◆ need_to_discard_card

char need_to_discard_card

◆ num_actions_left

int num_actions_left

◆ num_cards_to_discard

int num_cards_to_discard

◆ opponent_mastery

int opponent_mastery = 1

◆ opponents_turn

char opponents_turn

◆ pArcomageGame

ArcomageGame* pArcomageGame = new ArcomageGame

◆ playDeck

ArcomageDeck playDeck

◆ playdiscard_anim_start

char playdiscard_anim_start

◆ played_card_id

int played_card_id

◆ Player1Name

char Player1Name[] = "Player"

◆ Player2Name

char Player2Name[] = "Enemy"

◆ Player_Cards_Shift

bool Player_Cards_Shift = true

◆ Player_Gets_First_Turn

bool Player_Gets_First_Turn = true

◆ quarry_bonus

int quarry_bonus = 1

◆ See_Opponents_Cards

char See_Opponents_Cards = 0

◆ shown_cards

AcromageCardOnTable shown_cards[10]

◆ SIG_MEMALOC

constexpr auto SIG_MEMALOC = 0x67707274
constexpr

◆ SIG_MEMFREE

constexpr auto SIG_MEMFREE = 0x78787878
constexpr

◆ start_beasts_amount

int start_beasts_amount

◆ start_bricks_amount

int start_bricks_amount

◆ start_conditions

Initial value:
= {
{HOUSE_TAVERN_HARMONDALE, {30, 100, 15, 5, 2, 2, 2, 10, 10, 10, 0}},
{HOUSE_TAVERN_ERATHIA, {50, 150, 20, 5, 2, 2, 2, 5, 5, 5, 1}},
{HOUSE_TAVERN_TULAREAN_FOREST, {50, 150, 20, 5, 2, 2, 2, 5, 5, 5, 2}},
{HOUSE_TAVERN_DEYJA, {75, 200, 25, 10, 3, 3, 3, 5, 5, 5, 2}},
{HOUSE_TAVERN_BRACADA_DESERT, {75, 200, 20, 10, 3, 3, 3, 5, 5, 5, 1}},
{HOUSE_TAVERN_CELESTE, {100, 300, 30, 15, 4, 4, 4, 10, 10, 10, 1}},
{HOUSE_TAVERN_PIT, {100, 300, 30, 15, 4, 4, 4, 10, 10, 10, 2}},
{HOUSE_TAVERN_EVENMORN_ISLAND, {150, 400, 20, 10, 5, 5, 5, 25, 25, 25, 0}},
{HOUSE_TAVERN_MOUNT_NIGHON, {200, 500, 20, 10, 1, 1, 1, 15, 15, 15, 2}},
{HOUSE_TAVERN_BARROW_DOWNS, {100, 300, 20, 50, 1, 1, 5, 5, 5, 25, 0}},
{HOUSE_TAVERN_TATALIA, {125, 350, 10, 20, 3, 1, 2, 15, 5, 10, 2}},
{HOUSE_TAVERN_AVLEE, {125, 350, 10, 20, 3, 1, 2, 15, 5, 10, 1}},
{HOUSE_TAVERN_STONE_CITY, {100, 300, 50, 50, 5, 3, 5, 20, 10, 20, 0}}
}
@ HOUSE_TAVERN_BARROW_DOWNS
@ HOUSE_TAVERN_DEYJA
@ HOUSE_TAVERN_TATALIA
@ HOUSE_TAVERN_MOUNT_NIGHON
@ HOUSE_TAVERN_PIT
@ HOUSE_TAVERN_STONE_CITY
@ HOUSE_TAVERN_CELESTE
@ HOUSE_TAVERN_HARMONDALE
@ HOUSE_TAVERN_BRACADA_DESERT
@ HOUSE_TAVERN_ERATHIA
@ HOUSE_TAVERN_EVENMORN_ISLAND
@ HOUSE_TAVERN_TULAREAN_FOREST
@ HOUSE_TAVERN_AVLEE

◆ start_gems_amount

int start_gems_amount

◆ start_magic_level

int start_magic_level

◆ start_quarry_level

int start_quarry_level

◆ start_tower_height

int start_tower_height

◆ start_wall_height

int start_wall_height

◆ start_zoo_level

int start_zoo_level

◆ use_start_bonus

char use_start_bonus = 1

◆ zoo_bonus

int zoo_bonus = 1