diff --git a/README.md b/README.md index f36db35ebf5..c28fad5d46c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ fheroes2 ====== -[![Github Downloads (monthly)](https://img.shields.io/github/downloads/ihhub/fheroes2/total.svg)](https://github.com/ihhub/fheroes2/releases) [![Discord](https://img.shields.io/discord/733093692860137523.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/xF85vbZ) [![Facebook](https://img.shields.io/badge/Facebook-blue.svg)](https://www.facebook.com/groups/fheroes2) [![VK](https://img.shields.io/badge/VK-blue.svg)](https://vk.com/fheroes2) [![Donate](https://img.shields.io/badge/Donate-Patreon-green.svg)](https://www.patreon.com/fheroes2) +[![Github Downloads](https://img.shields.io/github/downloads/ihhub/fheroes2/total.svg)](https://github.com/ihhub/fheroes2/releases) [![Discord](https://img.shields.io/discord/733093692860137523.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/xF85vbZ) [![Facebook](https://img.shields.io/badge/Facebook-blue.svg)](https://www.facebook.com/groups/fheroes2) [![VK](https://img.shields.io/badge/VK-blue.svg)](https://vk.com/fheroes2) [![Donate](https://img.shields.io/badge/Donate-Patreon-green.svg)](https://www.patreon.com/fheroes2) Free implementation of **Heroes of Might and Magic II** game engine. diff --git a/appveyor.yml b/appveyor.yml index b27b4f35ea0..c0759de7168 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,7 +10,7 @@ skip_commits: skip_tags: true # version format -version: 0.9.1.{build} +version: 0.9.2.{build} # Build worker image (VM template) image: Visual Studio 2015 diff --git a/changelog.txt b/changelog.txt index 565ff8cfb89..a5ae5ced33e 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,91 @@ +version 0.9.2 (04 April 2021) +- fix full artifact bag message +- add missing dot to sentences in few windows +- display Lighthouse count in Kingdom Overview +- add proper large obstacle generation for battlefields +- fast AI units should try to get the first strike +- fix Sphinx missing rewards +- reset paralyze state when receiving spell damage +- randomize attack position of AI monsters +- fix missing hero paths after loading a save +- fix incorrect window resolution in fullscreen mode for SDL 2 +- fix Choose Your Lord video sound +- improve castle garrison estimation for AI +- remove the mobility index sprite info from the hero Quick Info dialog +- prohibit the guardian hero from casting adventure spells +- fix merging of the castle guardian army +- fix AI defensive unit behavior +- add AI estimation of hero spell strength +- force units into empty slots first during merge +- do not always offer recruitment of heroes from the player's initial class, make recruitment more random +- allow player to control the hero during the turn of a hypnotized enemy unit +- archers should not lose shots when attacking in melee +- check that the hero is able to move before focusing him and starting his movement +- respect initial order of units (from top to bottom) when determining the order of unit moves in battle +- add PlayStation Vita support +- fix creature recruit window UI +- fix rendering of Arm of the Martyr +- fix blind spell logic +- do not give additional 500 experience to the hero who won the battle if the opposing hero surrenders or flees +- fix hypnotize spell behavior and the spell description +- update positions of monster sprites and numbers on army status panel +- fix possibly incorrect arrow direction from shooters +- fix scrollbar position in multiple places +- standartize icon position in town's dialog +- fix Max/Min button position in monster recruit dialog +- show the surrender dialog even if there is not enough gold to surrender +- do not apply morale penalty to a hero if he wins a battle in a Graveyard, Shipwreck or Derelict Ship +- add cross army drag split +- reset player focus if focused hero or castle was removed +- allow to switch players for multiplayer map selection +- allow to use mouse wheel anywhere for split troop dialog +- fix logic of placing monsters for a New Month +- fix Kingdom Overview selection drawings +- dix boat drawing issues +- do not hide mouse cursor if the Skill Info dialog called from the Level Up dialog contains OK button +- fix incorrect drawings for battle OKAY button +- fix rendering of the Castle Captain's spell points bar +- fix missing sounds within System dialog +- fix interaction with the castle bridge for flying units +- use rule of 9 for Ultimate Artifact placement +- fix last focus option +- fix incorrect cursor icon over ally's castle +- add initial implementation of View spells +- show normal monster names in Visions spell +- show full 1-pixel black border for Show Interface option +- show more detailed morale and luck description +- AI predicts double cell attacks in combat +- reset blind spell upon taking any damage +- allow to place units in moat in front of the bridge +- align spells in the magic book +- add manual replay of battle if instant battle outcome is negative +- sounds off when minimizing game window +- fix playing background music during video playback on SDL1 +- change damage description log message for some mass spells +- add executable file description and icon on Windows +- fix pathfinding backwards move and penalty in battle +- fix City of the dead incorrect monster info +- update no data error message +- do not allow to manage monsters in unhired hero dialog +- AI supports additional harmful combat spells +- do not open the hero screen in readonly mode if it was opened from the meeting screen, just disable the DISMISS button instead +- do not show external music option with an absent folder +- wait for user input at the end of winning video +- fix double exit dialog appearence +- fix missing cursor in Army Bar for SDL 1 +- ranged AI troops should move when blocked by a strong unit +- if the unit attacks twice, apply the second attack to the same cell as the first attack +- fix double hex attack target for AI troops +- show the build window with the OKAY button disabled if there is not enough resources to build this building +- AI uses mass damage spells in combat +- improvements for AI wide unit pathfinding +- fix the pathfinding near monsters: do not allow the hero to pass through the monster +- fix MIN and MAX button drawings +- do not give an extra day of life to a player without castles +- preserve unit direction in battle if it moves strictly vertically +- do not allow the visiting hero to learn Library spells if the Library hasn't been built yet +- fix inability to reorganize troops in Kingdom View dialog + version 0.9.1 (04 March 2021) - add "Artifacts" category in Oracle Screen - add barrier fading animation diff --git a/doc/README.txt b/doc/README.txt index e26d6a0e553..25711eb7cf0 100644 --- a/doc/README.txt +++ b/doc/README.txt @@ -22,6 +22,6 @@ This project is under GNU General Public License v2.0. Please refer to file LICENSE for more details. --- Donation --- -Currently we accept donations via PayPal. All donations will be used only for -the future project development as we do not consider this project as a source -of income by any means. +Currently we accept donations via Patreon at https://www.patreon.com/fheroes2. +All donations will be used only for the future project development as we do not +consider this project as a source of income by any means. diff --git a/sonar-project.properties b/sonar-project.properties index e9fd8d528ab..40c3af32ce9 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -3,7 +3,7 @@ sonar.organization=ihhub # This is the name and version displayed in the SonarCloud UI. sonar.projectName=fheroes2 -sonar.projectVersion=0.9.1 +sonar.projectVersion=0.9.2 # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. sonar.sources=. diff --git a/src/fheroes2/agg/agg_image.cpp b/src/fheroes2/agg/agg_image.cpp index beaaa066881..dd91044cf0e 100644 --- a/src/fheroes2/agg/agg_image.cpp +++ b/src/fheroes2/agg/agg_image.cpp @@ -686,6 +686,19 @@ namespace fheroes2 return true; } + case ICN::WHITE_LARGE_FONT: { + LoadModifiedICN( ICN::FONT ); + const std::vector & original = _icnVsSprite[ICN::FONT]; + _icnVsSprite[id].resize( original.size() ); + for ( size_t i = 0; i < _icnVsSprite[id].size(); ++i ) { + const Sprite & in = original[i]; + Sprite & out = _icnVsSprite[id][i]; + out.resize( in.width() * 2, in.height() * 2 ); + Resize( in, out, true ); + out.setPosition( in.x() * 2, in.y() * 2 ); + } + return true; + } default: break; } @@ -847,6 +860,8 @@ namespace fheroes2 return GetICN( ICN::FONT, character - 0x20 ); case Font::SMALL: return GetICN( ICN::SMALFONT, character - 0x20 ); + case Font::WHITE_LARGE: + return GetICN( ICN::WHITE_LARGE_FONT, character - 0x20 ); default: break; } diff --git a/src/fheroes2/agg/icn.h b/src/fheroes2/agg/icn.h index 631d09a7fe2..9db7dd437f2 100644 --- a/src/fheroes2/agg/icn.h +++ b/src/fheroes2/agg/icn.h @@ -925,6 +925,8 @@ namespace ICN UNIFORM_EVIL_MAX_BUTTON, UNIFORM_EVIL_MIN_BUTTON, + WHITE_LARGE_FONT, + // IMPORTANT! Put any new entry just above this one. LASTICN }; diff --git a/src/fheroes2/game/fheroes2.cpp b/src/fheroes2/game/fheroes2.cpp index 6762165589d..771ce8d56b3 100644 --- a/src/fheroes2/game/fheroes2.cpp +++ b/src/fheroes2/game/fheroes2.cpp @@ -40,9 +40,41 @@ #include "logging.h" #include "screen.h" #include "system.h" +#include "text.h" #include "translations.h" #include "zzlib.h" +namespace +{ + void showTeamInfo() + { + fheroes2::Display & display = fheroes2::Display::instance(); + + fheroes2::Image image( display.width(), display.height() ); + image.fill( 0 ); + + TextBox text( "fheroes2 Resurrection Team presents", Font::WHITE_LARGE, 500 ); + text.Blit( ( image.width() - text.w() ) / 2, ( image.height() - text.h() ) / 2, image ); + + LocalEvent & le = LocalEvent::Get(); + + uint8_t alpha = 250; + + while ( le.HandleEvents() && alpha > 20 ) { + if ( le.KeyPress() || le.MouseClickLeft() || le.MouseClickMiddle() || le.MouseClickRight() ) + break; + + if ( Game::AnimateCustomDelay( 40 ) ) { + fheroes2::Copy( image, display ); + fheroes2::ApplyAlpha( display, alpha ); + display.render(); + + alpha -= 5; + } + } + } +} + void SetVideoDriver( const std::string & ); void SetTimidityEnvPath(); void SetLangEnvPath( const Settings & ); @@ -184,6 +216,8 @@ int main( int argc, char ** argv ) // init game data Game::Init(); + showTeamInfo(); + Video::ShowVideo( "H2XINTRO.SMK", Video::VideoAction::DO_NOTHING ); for ( int rs = Game::MAINMENU; rs != Game::QUITGAME; ) { diff --git a/src/fheroes2/game/game_credits.cpp b/src/fheroes2/game/game_credits.cpp index 11752fed1c6..e4fab0a3459 100644 --- a/src/fheroes2/game/game_credits.cpp +++ b/src/fheroes2/game/game_credits.cpp @@ -80,7 +80,19 @@ void Game::ShowCredits() fheroes2::Blit( crusader, display, screenOffset.x + ( columnStep - crusader.width() ) / 2, offsetY ); offsetY += crusader.height(); - offsetY += 10; + const int32_t bottomOffset = offsetY; + + const fheroes2::Sprite & mage = fheroes2::AGG::GetICN( ICN::MAGE1, 24 ); + offsetY -= crusader.height(); + fheroes2::Blit( mage, display, screenOffset.x + columnStep + ( columnStep - mage.width() ) / 2, offsetY ); + + name.Set( "Oleg Derevenetz", Font::BIG, textWidth ); + offsetY -= 10 + name.h(); + name.Blit( screenOffset.x + columnStep + ( columnStep - name.w() ) / 2, offsetY ); + offsetY -= title.h(); + title.Blit( screenOffset.x + columnStep + ( columnStep - title.w() ) / 2, offsetY ); + + offsetY = bottomOffset + 10; const Text websiteInto( "Visit us at ", Font::BIG ); const Text website( "https://github.com/ihhub/fheroes2", Font::YELLOW_BIG ); diff --git a/src/fheroes2/gui/text.cpp b/src/fheroes2/gui/text.cpp index 6cb2bf35506..0ace5b353d0 100644 --- a/src/fheroes2/gui/text.cpp +++ b/src/fheroes2/gui/text.cpp @@ -35,6 +35,11 @@ namespace { return font == Font::SMALL || font == Font::YELLOW_SMALL || font == Font::GRAY_SMALL; } + + bool isLargeFont( int font ) + { + return font == Font::WHITE_LARGE; + } } TextInterface::TextInterface( int ft ) @@ -68,7 +73,17 @@ size_t TextAscii::Size( void ) const int TextAscii::CharWidth( int c, int f ) { - return ( c < 0x21 ? ( isSmallFont( f ) ? 4 : 6 ) : fheroes2::AGG::GetLetter( c, f ).width() ); + if ( c < 0x21 ) { + if ( isSmallFont( f ) ) + return 4; + else if ( isLargeFont( f ) ) + return 12; + else + return 6; + } + else { + return fheroes2::AGG::GetLetter( c, f ).width(); + } } int TextAscii::CharHeight( int f ) @@ -78,12 +93,22 @@ int TextAscii::CharHeight( int f ) int TextAscii::CharAscent( int f ) { - return isSmallFont( f ) ? 8 : 13; + if ( isSmallFont( f ) ) + return 8; + else if ( isLargeFont( f ) ) + return 26; + else + return 13; } int TextAscii::CharDescent( int f ) { - return isSmallFont( f ) ? 2 : 3; + if ( isSmallFont( f ) ) + return 2; + else if ( isLargeFont( f ) ) + return 6; + else + return 3; } int TextAscii::w( u32 s, u32 c ) const @@ -229,7 +254,17 @@ size_t TextUnicode::Size( void ) const int TextUnicode::CharWidth( int c, int f ) { - return ( c < 0x0021 ? ( isSmallFont( f ) ? 4 : 6 ) : fheroes2::AGG::GetUnicodeLetter( c, f ).width() ); + if ( c < 0x0021 ) { + if ( isSmallFont( f ) ) + return 4; + else if ( isLargeFont( f ) ) + return 12; + else + return 6; + } + else { + return fheroes2::AGG::GetUnicodeLetter( c, f ).width(); + } } int TextUnicode::CharHeight( int f ) diff --git a/src/fheroes2/gui/text.h b/src/fheroes2/gui/text.h index 87e91d703d0..d4b2019b3a2 100644 --- a/src/fheroes2/gui/text.h +++ b/src/fheroes2/gui/text.h @@ -40,7 +40,8 @@ namespace Font YELLOW_BIG = 0x04, YELLOW_SMALL = 0x08, GRAY_BIG = 0x10, - GRAY_SMALL = 0x20 + GRAY_SMALL = 0x20, + WHITE_LARGE = 0x40 }; } enum diff --git a/src/fheroes2/system/version.h b/src/fheroes2/system/version.h index f3579087f82..ac8f2f3da1f 100644 --- a/src/fheroes2/system/version.h +++ b/src/fheroes2/system/version.h @@ -22,4 +22,4 @@ #define MAJOR_VERSION 0 #define MINOR_VERSION 9 -#define INTERMEDIATE_VERSION 1 +#define INTERMEDIATE_VERSION 2