Commit Graph

266 Commits

Author SHA1 Message Date
Nicolas Margulies 762bed888a Working visibility (at least relatively good), but a few lines untested 2020-12-18 21:21:00 +01:00
Yohann D'ANELLO c01307202a Add shields to be more protected, see #48 2020-12-18 20:01:52 +01:00
Yohann D'ANELLO b876dab156 Register Trumpet as savable entity 2020-12-18 18:13:39 +01:00
Yohann D'ANELLO 9aa684fb77 Use directly equipped items outside the inventory 2020-12-18 17:57:42 +01:00
Yohann D'ANELLO 9475725228 Save equipped item and armor 2020-12-18 17:50:26 +01:00
Yohann D'ANELLO 0394c5d15d Linting 2020-12-18 17:46:38 +01:00
Yohann D'ANELLO e1918ab066 tick function takes the player as argument 2020-12-18 17:40:52 +01:00
Yohann D'ANELLO 1b4612afd0 Swords add strength 2020-12-18 17:39:11 +01:00
Yohann D'ANELLO fe769c4488 We can equip items 2020-12-18 17:30:03 +01:00
eichhornchen dadafc84eb Added a familiar class that follows the player around and hits monsters when it sees one. Added a trumpet, an instance of familiar. Closes #46. 2020-12-18 17:29:59 +01:00
Nicolas Margulies 86628fdea6 Working visibility and displaying it, still need to hide things that aren't visible 2020-12-18 17:04:45 +01:00
Yohann D'ANELLO 77f52b6276 Screen is refreshed only when pads are all refreshed, fixes #50 2020-12-18 16:40:52 +01:00
Yohann D'ANELLO 5ae49e71ff Display the amount of hazels in the store menu, closes #49 2020-12-18 15:36:25 +01:00
eichhornchen 8ecbf13eae Being able to calculate paths is now a property of fighting entities. 2020-12-18 15:31:23 +01:00
Yohann D'ANELLO 46ce7c33bf Merchant menu is updated through its update function, and does not access globally to the Game instance 2020-12-18 15:15:47 +01:00
Yohann D'ANELLO 85870494a0 More generic display update 2020-12-18 15:07:09 +01:00
Yohann D'ANELLO b8d32b29c8 Test selling items 2020-12-18 02:17:06 +01:00
Yohann D'ANELLO c55a7451e7 Display more precisely where we are in the store menu 2020-12-18 01:50:11 +01:00
Yohann D'ANELLO 9a556ba669 We can now buy items to merchants, closes #47 2020-12-18 01:05:50 +01:00
Yohann D'ANELLO a5890a341d Display inventory menu next to the merchant menu 2020-12-17 23:46:20 +01:00
Nicolas Margulies 62ce2b5c71 Merge remote-tracking branch 'origin/master' into lighting 2020-12-17 21:24:32 +01:00
Yohann D'ANELLO a3e059a97b Some required code mysteriously disappeared 2020-12-15 17:37:23 +01:00
eichhornchen 646e0063be Fixed grammar, unified the docstring's format and added documentation to some classes that did not have any. Closes #32. 2020-12-13 21:29:25 +01:00
Yohann D'ANELLO 599f75b676 Erase pad before resizing, fixes #45 2020-12-12 21:19:55 +01:00
Yohann D'ANELLO 7971a1f70e Add waiting key, fixes #16 2020-12-12 18:12:37 +01:00
Yohann D'ANELLO 288a6ac2c9 Some translations were missing concerning sunflowers, fixes #44 2020-12-12 17:39:12 +01:00
Yohann D'ANELLO 73e1fac89a Add title to boxes to have pretty boxes, fixes #28 2020-12-12 17:15:08 +01:00
Yohann D'ANELLO 8608ce346f Add a small bomb exploding animation, fixes #31 2020-12-12 16:50:01 +01:00
Yohann D'ANELLO 04ae56e451 Higher abstraction level on addmsg, fixes #43 2020-12-12 13:46:45 +01:00
Yohann D'ANELLO 48318a91fe Give more hazels to the player when testing the interaction with merchants 2020-12-11 21:19:25 +01:00
Yohann D'ANELLO 777668848e Clicking on the main image changes its color 2020-12-11 21:17:21 +01:00
Nicolas Margulies 1cf5e7bd8b First implementation of visibility, not tested, nor used for now 2020-12-11 19:23:21 +01:00
Yohann D'ANELLO a4a10e340d Test clicking on the merchant pad 2020-12-11 18:44:05 +01:00
ynerant 53d090a9c8 Merge branch 'master' into 'mouse_interaction'
# Conflicts:
#   squirrelbattle/display/display_manager.py
#   squirrelbattle/display/menudisplay.py
#   squirrelbattle/entities/items.py
2020-12-11 18:38:13 +01:00
Yohann D'ANELLO f453b82a58 Test clicking on the screen 2020-12-11 18:33:47 +01:00
eichhornchen 9d3e8a9822 Merge branch 'village' into 'master'
Village

Closes #41, #38, #37, #36, and #18

See merge request ynerant/squirrel-battle!44
2020-12-11 18:23:10 +01:00
Yohann D'ANELLO d9912cacad Listen to mouse clicks in the main loop 2020-12-11 18:17:59 +01:00
Yohann D'ANELLO 45f420aaef Linting 2020-12-11 18:17:08 +01:00
eichhornchen e7f24c2371 The store menu now displays the price of objects, fixes #41 2020-12-11 18:08:10 +01:00
Yohann D'ANELLO 1afa397fec Better interaction with inventory menu 2020-12-11 18:07:39 +01:00
Yohann D'ANELLO 089a247b2f Maybe mouse clicks may use the game 2020-12-11 17:43:46 +01:00
Yohann D'ANELLO d50f6701f4 Open a menu with the mouse 2020-12-11 17:40:56 +01:00
Yohann D'ANELLO 99352bc1d5 Test buying an item when we don't have enough of money 2020-12-11 17:28:16 +01:00
Yohann D'ANELLO 7179346e2b Add a InventoryHolder superclass for player and merchants 2020-12-11 17:20:50 +01:00
Yohann D'ANELLO 98b5dd64a8 Linting 2020-12-11 17:06:30 +01:00
Yohann D'ANELLO bbe37eab97 Listen for clicks, detect which display was clicked 2020-12-11 16:56:22 +01:00
eichhornchen b9b776b7ad Player now pays for what he buys and buying a heart does not put it in the inventory. Solves #38 and #36 2020-12-11 16:49:17 +01:00
eichhornchen 7ba49277a9 Added a symbol for hazels in the ascii texturepack 2020-12-11 15:52:36 +01:00
Nicolas Margulies 01cc77e146 Fixed a bug when trying to pathfind when player is surrounded by inaccessible tiles 2020-12-10 22:28:12 +01:00
Nicolas Margulies cc6033e8e4 New pathfinding that avoids most of the mobs getting stuck, closes #35 2020-12-10 22:21:09 +01:00
Yohann D'ANELLO 6d4c0b2ca3 Testing the merchant must handle two cases: the bought item is a heart or not 2020-12-09 17:04:29 +01:00
Yohann D'ANELLO 4dbd4f7912 Don't buy hearts, use them instant instead. Fixes #38 2020-12-09 16:57:46 +01:00
Yohann D'ANELLO 2d5a2e4c87 Display hazels in the StatsDisplay 2020-12-09 16:54:53 +01:00
Yohann D'ANELLO 56627f3e84 Reorder texture pack entries 2020-12-09 16:50:47 +01:00
Yohann D'ANELLO 05e79c14e3 Translate the settings entry that change the chat key 2020-12-09 15:45:50 +01:00
Yohann D'ANELLO 405ee895d8 When an item is bought, remove it from the merchant inventory. Fixes #37 2020-12-09 15:35:53 +01:00
Yohann D'ANELLO 19b82ff71a Test merchants 2020-12-09 15:32:37 +01:00
Yohann D'ANELLO 657f4e5209 Remove dead code: friendly entities are fighting entities 2020-12-09 15:10:28 +01:00
Yohann D'ANELLO cea015d015 In load&save test, force to have a merchant 2020-12-09 15:09:07 +01:00
Yohann D'ANELLO 39787861dc Test sunflowers interaction 2020-12-09 15:05:19 +01:00
Nicolas Margulies 50d806cdcf Working Dijkstra 2020-12-08 22:22:20 +01:00
Nicolas Margulies 7823a422b9 Start f new pathfinding, not working 2020-12-08 00:59:19 +01:00
Yohann D'ANELLO 7ab4213273 Fix french translation file 2020-12-07 22:03:48 +01:00
Yohann D'ANELLO e3ae7bcacf Resolve merge conflicts on german translation file 2020-12-07 22:00:27 +01:00
Yohann D'ANELLO ca17bf424a Inventory displays were not updated when the texture pack changed 2020-12-07 21:51:51 +01:00
Yohann D'ANELLO 2bb99a707e Merchant inventory is well-saved 2020-12-07 21:48:56 +01:00
Yohann D'ANELLO 099508d4c0 Don't call screen.getkey() at a wrong place 2020-12-07 21:29:57 +01:00
Yohann D'ANELLO 57fab7db51 Linting 2020-12-07 21:22:06 +01:00
Yohann D'ANELLO b24cc1877f Merchant inventory is working! 2020-12-07 21:13:55 +01:00
eichhornchen 8540a8f354 Work in progress on printing a store menu. Its buggy though 2020-12-07 20:54:53 +01:00
Yohann D'ANELLO fdc2bcab8d Add spanish translation 2020-12-07 01:01:39 +01:00
eichhornchen d39427f978 Merge branch 'master' into village 2020-12-06 11:50:11 +01:00
eichhornchen 866af98fe4 Merging master into village, conflicts were solved 2020-12-06 11:43:48 +01:00
eichhornchen 38842cee68 There was a import error 2020-12-05 21:50:02 +01:00
eichhornchen ba68e68584 Added a Gamemode for selling interfaces, as well as the base of the player/merchant interaction, related to issue #18 2020-12-05 21:43:13 +01:00
Yohann D'ANELLO f8ca5b2cc5 Recalculate the path finder when the player exchanges its body 2020-12-05 14:48:43 +01:00
Yohann D'ANELLO 7ad2cad77c Add a message in the logs when a body-snap potion is used 2020-12-05 14:47:54 +01:00
Yohann D'ANELLO f39113fd0b Test body snatch potion, fixes #34 2020-12-05 14:42:13 +01:00
Yohann D'ANELLO c38f8cdc53 Save the inventory of the player when saving the game, fixes #33 2020-12-05 14:35:59 +01:00
Yohann D'ANELLO f887a1f0aa Entity name is a parameter since it can be changed through body snatch potion 2020-12-05 14:25:22 +01:00
Yohann D'ANELLO ea672272f5 Add body snatch potion 2020-12-05 14:20:58 +01:00
Yohann D'ANELLO ca2ae15117 Stack items in the inventory, closes #29 2020-12-05 13:42:33 +01:00
Yohann D'ANELLO fb8b2aff01 The player must be alive to interact with the inventory 2020-12-05 13:20:52 +01:00
Yohann D'ANELLO bc40f8d0e6 Some translations were missing in the settings menu 2020-12-05 13:19:04 +01:00
Yohann D'ANELLO 013e81b3c0 Better sort in translation files, remove unwanted headers 2020-12-05 13:13:04 +01:00
Yohann D'ANELLO 25c42ea9e8 Don't translate in english since it is the main language 2020-12-05 13:07:37 +01:00
Yohann D'ANELLO 4b9399c687 Test inventory 2020-12-04 18:16:46 +01:00
Yohann D'ANELLO 91a4514649 'D' is not an intelligent key to drop an item 2020-12-04 17:19:06 +01:00
Yohann D'ANELLO 5b4dc601bc Fix broken tests 2020-12-04 17:15:41 +01:00
Yohann D'ANELLO 27fd73c96b Add log messages when a bomb is exploding 2020-12-04 17:10:23 +01:00
Yohann D'ANELLO 056ca5cca8 Ensure that the inventory is not empty before interacting with an item 2020-12-04 17:01:00 +01:00
Yohann D'ANELLO c7545e53f7 Items can be dropped/equipped/used 2020-12-04 16:53:27 +01:00
Yohann D'ANELLO 0da7486750 Navigate through inventory menu 2020-12-04 16:31:15 +01:00
Yohann D'ANELLO a68b3a6d08 Display full inventory 2020-12-04 16:28:37 +01:00
Yohann D'ANELLO fbfcd5dae0 Inventory title 2020-12-04 16:02:03 +01:00
Yohann D'ANELLO cdd527a7fd Close the inventory using the same key 2020-12-04 14:57:53 +01:00
Yohann D'ANELLO 067570fd1a The inventory is a popup 2020-12-04 14:51:41 +01:00
Yohann D'ANELLO 39af791012 We can open an empty inventory! 2020-12-04 14:45:18 +01:00
eichhornchen 3886bee1ba Friendly entities are now a subclass of fighting entities, and can die. The T key is now used to talk to friendly entities 2020-12-04 00:27:25 +01:00
Yohann D'ANELLO da0d7e7055 Fix lag when monsters try to move in a random direction 2020-12-02 16:04:43 +01:00
Yohann D'ANELLO 654bab7c1d Translate sun flower messages 2020-12-01 17:12:22 +01:00
Yohann D'ANELLO 29142cd91c Merge remote-tracking branch 'origin/master' into village
# Conflicts:
#	squirrelbattle/display/texturepack.py
#	squirrelbattle/interfaces.py
2020-12-01 17:07:40 +01:00
Yohann D'ANELLO 9f0a29302d Add german translation 2020-11-28 16:22:06 +01:00
Yohann D'ANELLO f78c73a703 Tests and the CI are compiling messages 2020-11-28 14:02:23 +01:00
Yohann D'ANELLO a34dae2ad0 Compile messages on setup 2020-11-28 13:49:28 +01:00
Yohann D'ANELLO 7c0cf3e029 CLI to manage messages 2020-11-28 03:21:20 +01:00
Yohann D'ANELLO 8aad15f07b Move translation files in the module 2020-11-28 03:04:28 +01:00
Yohann D'ANELLO ffc8b90441 Create functions that call xgettext or msgfmt 2020-11-28 02:54:04 +01:00
Yohann D'ANELLO 7d02604407 Clean the translation module 2020-11-28 02:00:09 +01:00
Yohann D'ANELLO 138b2c6d54 Logs are capitalized 2020-11-28 01:25:35 +01:00
Yohann D'ANELLO 70ae60b9a4 Translate entities 2020-11-27 22:33:58 +01:00
Yohann D'ANELLO 8f85093eb8 One string was missing 2020-11-27 22:21:52 +01:00
Yohann D'ANELLO d2d74c97a4 Settings menu was not translated 2020-11-27 22:19:41 +01:00
Yohann D'ANELLO f07324662a Cover the language change 2020-11-27 21:56:25 +01:00
Yohann D'ANELLO 31b7ece449 Main menu width must be updated when the language got changed 2020-11-27 21:51:54 +01:00
Yohann D'ANELLO c151e0f656 Menu items are translated 2020-11-27 21:44:17 +01:00
Yohann D'ANELLO 4287b4f045 Add possibility to change the language 2020-11-27 20:53:24 +01:00
Yohann D'ANELLO 2498fd2a61 Translate strings 2020-11-27 20:42:19 +01:00
Yohann D'ANELLO e3be4b4f3f First setup for translation 2020-11-27 20:32:40 +01:00
eichhornchen fbd9f0045b Friendly entities can now talk to the player, a sunflower entity was added to test this new feature. Related to issue #22 2020-11-27 18:38:48 +01:00
Yohann D'ANELLO b0e352444b Test loading wrong saves 2020-11-27 18:16:54 +01:00
Yohann D'ANELLO 5faebfe556 Test message display 2020-11-27 18:12:27 +01:00
Yohann D'ANELLO 25ba94b9ac Game displays an error message when a save file could not be loaded. 2020-11-27 18:09:08 +01:00
eichhornchen d987e60006 Added some documentation for menudisplay 2020-11-27 18:00:54 +01:00
eichhornchen ca86572677 Added a weapon class and a sword subclass 2020-11-27 17:56:01 +01:00
eichhornchen 3f301423fb Added a menudisplay class for menus with a value such as the menu of the merchants 2020-11-27 17:54:55 +01:00
Yohann D'ANELLO be9c726fa0 Display message in bold format 2020-11-27 17:54:31 +01:00
eichhornchen bad56ba442 Added the merchants in the texturepack 2020-11-27 17:54:03 +01:00
Yohann D'ANELLO fb8d8f033b Popup border color is red 2020-11-27 17:52:26 +01:00
Yohann D'ANELLO b7f61d9485 Close popup if there is a message 2020-11-27 17:35:51 +01:00
Yohann D'ANELLO 5cdb12e8a8 Display a message on a popup 2020-11-27 17:32:26 +01:00
eichhornchen 4fdf08cab9 Added a currency : the hazel (for hazelnuts). The player and the merchants possess a certain quantity of hazel 2020-11-27 17:11:59 +01:00
eichhornchen 76bbee7e6d Added a merchant class and a talk_to method to interact with friendly entities 2020-11-27 16:56:22 +01:00
Yohann D'ANELLO 0d3e33d960 Declare the license, we use GNU GPL 2020-11-27 16:33:17 +01:00
Yohann D'ANELLO 0c25dd4ffe Display got broken 2020-11-27 14:04:51 +01:00
Yohann D'ANELLO 2690eb8760 Update FakePad to fix tests 2020-11-26 22:32:25 +01:00
Yohann D'ANELLO 0726a8db9e A print instruction remains. It was rendered on the screen. Awkward... 2020-11-26 22:29:10 +01:00
Yohann D'ANELLO 1e48bd16b3 Erase pads instead of clearing them, fixes #21 2020-11-26 22:20:14 +01:00
Yohann D'ANELLO 3e7dabc94e Wrap perfectly the map on the screen, bricks won't teleport randomly anymore 2020-11-26 21:59:48 +01:00
Yohann D'ANELLO f2f34bfbc6 Don't refresh pads with invalid coordinates. The window should be fully resizable, closes #20 2020-11-26 20:58:46 +01:00
Yohann D'ANELLO ca03caf3ba Don't render message on negative indexes 2020-11-26 20:35:10 +01:00
Yohann D'ANELLO f2318ed308 Truncate messages if they are too large 2020-11-26 20:04:54 +01:00
Yohann D'ANELLO 8b187ec2b3 Use custom function to render a string message onto a pad 2020-11-26 12:35:52 +01:00
nicomarg b6f5fe9364 Merge branch 'display-fixes' into 'master'
Display fixes see #15

Closes #15

See merge request ynerant/squirrel-battle!21
2020-11-20 18:27:50 +01:00
ynerant 23a2b4c0cf Merge branch 'beaver-is-a-tiger' into 'master'
Beaver is a tiger

See merge request ynerant/squirrel-battle!24
2020-11-20 18:16:56 +01:00
Nicolas Margulies b3df257103 Removed useless code 2020-11-20 18:12:30 +01:00
Nicolas Margulies 223c20e792 Linting 2020-11-20 18:09:39 +01:00
Nicolas Margulies ca57fae19d Reshaped the game layout using new lines and boxes 2020-11-20 18:07:09 +01:00
Nicolas Margulies 9ca6561bc3 Added a box element 2020-11-20 18:06:43 +01:00
Yohann D'ANELLO fb3f3ee5e8 Beaver is a tiger 2020-11-20 18:02:08 +01:00