Skip to content

Commit

Permalink
* attack_wait for sprite 1 is now preserved across saves to match fun…
Browse files Browse the repository at this point in the history
…ctionality of other dink versions (Random431)
  • Loading branch information
SethRobinson committed Oct 16, 2023
1 parent 163cc82 commit 7134750
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
13 changes: 9 additions & 4 deletions source/dink/dink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,7 @@ void save_game(int num)
g_dglos.g_playerInfo.base_idle = g_sprite[1].base_idle;
g_dglos.g_playerInfo.base_walk = g_sprite[1].base_walk;
g_dglos.g_playerInfo.base_hit = g_sprite[1].base_hit;
g_dglos.g_playerInfo.attack_wait = g_sprite[1].attack_wait;

//redink1 - save game things for storing new map, palette, and tile information
strncpy(g_dglos.g_playerInfo.mapdat, g_dglos.current_map, 50);
Expand Down Expand Up @@ -1377,7 +1378,7 @@ bool load_game(int num)
g_sprite[1].strength = g_dglos.g_playerInfo.strength;
g_sprite[1].defense = g_dglos.g_playerInfo.defense;
g_sprite[1].que = g_dglos.g_playerInfo.que;

if (g_dglos.g_playerInfo.m_gameTime != 0)
{
GetApp()->SetGameTick(g_dglos.g_playerInfo.m_gameTime);
Expand All @@ -1392,6 +1393,7 @@ bool load_game(int num)
g_sprite[1].base_idle = g_dglos.g_playerInfo.base_idle;
g_sprite[1].base_walk = g_dglos.g_playerInfo.base_walk;
g_sprite[1].base_hit = g_dglos.g_playerInfo.base_hit;
g_sprite[1].attack_wait = g_dglos.g_playerInfo.attack_wait;

int script = load_script("main", 0, true);

Expand Down Expand Up @@ -11859,23 +11861,26 @@ void text_draw(int h)

uint32 rgbColor = MAKE_RGBA(g_dglos.font_colors[color].red, g_dglos.font_colors[color].green, g_dglos.font_colors[color].blue, 255);

uint32 bgColor = MAKE_RGBA(0,0,0,100);
uint32 bgColor = MAKE_RGBA(0,0,0,150);

rtRect rTemp(rcRect);

// SetTextColor(hdc,RGB(8,14,21));
if (g_sprite[h].owner == 1200)
{
GetApp()->GetFont(FONT_SMALL)->DrawWrapped(rTemp, cr, false, false, rgbColor, g_dglo.m_fontSize, false, bgColor);
} else
g_globalBatcher.Flush();
} else
{

if (StripWhiteSpace(cr) == "")
{
//skip it, it's just blank, otherwise it will draw the bg which looks dumb
} else
{
GetApp()->GetFont(FONT_SMALL)->DrawWrapped(rTemp, cr, true, false, rgbColor, g_dglo.m_fontSize, false , bgColor);
GetApp()->GetFont(FONT_SMALL)->DrawWrapped(rTemp, cr, true, false, rgbColor, g_dglo.m_fontSize, false , bgColor);

g_globalBatcher.Flush();
}
}

Expand Down
3 changes: 2 additions & 1 deletion source/dink/dink.h
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,8 @@ struct player_info
player_info_tile tile[42];
global_function func[100];
uint32 m_gameTime;
char cbuff[746];
int32 attack_wait;
char cbuff[742];
};

struct attackinfo_struct
Expand Down

0 comments on commit 7134750

Please sign in to comment.