Commit Graph

360 Commits

Author SHA1 Message Date
Charles Peyrat e21d4d230c Add missing termination condition 2021-01-08 07:04:24 +01:00
Charles Peyrat b0ac580677 Fix place_walls, that placed floors instead ... 2021-01-08 07:03:49 +01:00
Charles Peyrat d362bdc949 Fix place_room and add missing argument 2021-01-08 06:58:02 +01:00
Charles Peyrat 9c252a2bbc Correct out of bounds errors and add missing arguments to range call 2021-01-08 06:54:01 +01:00
Charles Peyrat c959a9d865 Update tests because Map.neighbourhood became a static method 2021-01-08 05:42:12 +01:00
Charles Peyrat 8475e5228e Large neighbourhood shouldn't return the central cell 2021-01-08 05:41:16 +01:00
Charles Peyrat 20cbf546f9 Correct formulas for random enumeration of a grid 2021-01-08 05:21:31 +01:00
Charles Peyrat 49e261557c Fix typos 2021-01-08 05:14:46 +01:00
Charles Peyrat abbad0f352 Fix formulas in place_room and room_fits 2021-01-08 05:14:32 +01:00
Charles Peyrat 05ccd0e339 Circular rooms should not try to generate any holes if their radius isn't large enough 2021-01-08 04:51:20 +01:00
Charles Peyrat c6f66d95f2 Fix typos 2021-01-08 04:48:32 +01:00
Charles Peyrat 6fbc757f1e Implement method place_walls 2021-01-08 04:43:10 +01:00
Charles Peyrat ffa7641b21 Made Map.neighbourhood a static method 2021-01-08 04:36:57 +01:00
Charles Peyrat 3229eb8ea7 Implement place_room method 2021-01-08 03:45:26 +01:00
Charles Peyrat 42f0c195aa Add prototype for create_random_room; change return value of attach_doors and create_circular_room so we have info on door direction; minor syntax change 2021-01-08 03:43:20 +01:00
Charles Peyrat ddbd0299a0 Implement method room_fits 2021-01-08 03:38:37 +01:00
Charles Peyrat 5cbf15bef5 Return value of Generator.run should be a Map 2021-01-08 03:37:10 +01:00
Charles Peyrat bb3422f7d8 Add main generation loop 2021-01-08 03:19:59 +01:00
Yohann D'ANELLO affc1bae59
Fix merge 2021-01-08 02:15:13 +01:00
ynerant 451dd9cba7 Merge branch 'master' into 'equipment'
# Conflicts:
#   squirrelbattle/display/statsdisplay.py
#   squirrelbattle/entities/items.py
#   squirrelbattle/entities/player.py
#   squirrelbattle/interfaces.py
#   squirrelbattle/locale/de/LC_MESSAGES/squirrelbattle.po
#   squirrelbattle/locale/es/LC_MESSAGES/squirrelbattle.po
#   squirrelbattle/locale/fr/LC_MESSAGES/squirrelbattle.po
#   squirrelbattle/tests/game_test.py
2021-01-08 02:11:40 +01:00
Yohann D'ANELLO 7aeb659cf5
Fix french translation 2021-01-08 02:00:22 +01:00
Yohann D'ANELLO 6c6a44fb18
More tests 2021-01-08 01:56:54 +01:00
Yohann D'ANELLO 478a655751
Fix fg/bg custom colors 2021-01-07 16:49:40 +01:00
ynerant 4acf6804d4 Merge branch 'master' into 'lighting'
# Conflicts:
#   squirrelbattle/display/mapdisplay.py
#   squirrelbattle/interfaces.py
2021-01-07 16:36:54 +01:00
Yohann D'ANELLO c36e68d6e4
Reduce player vision 2021-01-07 16:34:12 +01:00
Yohann D'ANELLO e9c8f43e7e
Use ternary conditions to add coverage 2021-01-07 16:31:39 +01:00
Charles Peyrat 5579f5d791 Room now can now generate with a corridor; implemenent door placement finding 2021-01-07 07:06:08 +01:00
Charles Peyrat 9fb366aaab Make name follow style convention 2021-01-07 05:02:49 +01:00
Yohann D'ANELLO 1a78ad584c
Move equip functions for items 2021-01-06 18:31:28 +01:00
Yohann D'ANELLO a8c0c197ed
Linting 2021-01-06 18:02:58 +01:00
Eichhornchen 5ef12bef3d Changed the prices of armor 2021-01-06 17:57:23 +01:00
Yohann D'ANELLO 093c105120
The broken test is mysteriously working now 2021-01-06 17:54:43 +01:00
Yohann D'ANELLO ae505166b7
Disable critical hits during tests 2021-01-06 17:39:13 +01:00
ynerant d49c138257 Merge branch 'master' into 'ladders'
# Conflicts:
#   squirrelbattle/game.py
#   squirrelbattle/interfaces.py
#   squirrelbattle/tests/game_test.py
2021-01-06 17:29:26 +01:00
Yohann D'ANELLO 0c2b10b031
Use ternary conditions to gain coverage 2021-01-06 17:21:17 +01:00
Yohann D'ANELLO 887a190f11
Less complexity on the handle key function 2021-01-06 17:00:43 +01:00
Yohann D'ANELLO 41548504de
Test ladders 2021-01-06 16:09:53 +01:00
Yohann D'ANELLO a48e6325fe
Add log message when the player switches floor 2021-01-06 15:55:44 +01:00
Eichhornchen 15ef6af998 Put the texturepack in alphabetical order again. 2021-01-06 15:49:54 +01:00
Yohann D'ANELLO 4cd4bc9005
Display the current floor in the StatsDisplay 2021-01-06 15:17:02 +01:00
Yohann D'ANELLO d06a405120
Use a key to use ladders 2021-01-06 14:55:16 +01:00
Eichhornchen 2dc178d67c Merge branch 'equipment' into doc 2021-01-06 14:49:09 +01:00
Eichhornchen 77d501c389 Merge branch 'master' into doc 2021-01-06 14:39:23 +01:00
eichhornchen 4ad7d6c37c Added rings that can augment the player's statistics. Also added a new statistic : xp_buff, which helps the player level up sooner. 2021-01-06 11:44:52 +01:00
eichhornchen a9aeb9ca3a Repaired the use functionnality of the main item, as well as the load system for Armor items. 2021-01-06 11:13:17 +01:00
eichhornchen f3fe04e13a The player now has two hands and a slot for a helmet and a chestplate. Accordingly, new classes of items have been added. 2021-01-06 10:46:36 +01:00
eichhornchen 601062237d Repairing part of the tests. 2021-01-05 19:50:25 +01:00
eichhornchen 424044a5e4 Added an overpowered eagle boss. To avoid seing it too often, entities now have a certain chance of being spawned. Closes #19. 2021-01-05 19:40:11 +01:00
eichhornchen 3ace133037 Critical hit chance is now displayed along with the other stats. 2021-01-05 19:23:25 +01:00
eichhornchen 4bddf076ea Fighting now takes into account the constitution. Closes #51 2021-01-05 19:18:25 +01:00
eichhornchen 9b8dfb00da Added critical hit system: the player and rabbit entities have a chance of making x4 damage! Closes #52 2021-01-05 19:08:29 +01:00
eichhornchen 9cb5c9157f Linting 2021-01-05 10:59:17 +01:00
eichhornchen bb77dab628 Fixed a error induced by the merge: creditsdisplay did not have an update function 2021-01-05 10:49:04 +01:00
eichhornchen 7f63ab2357 Merge branch 'master' into 'familiars'
# Conflicts:
#   squirrelbattle/display/display_manager.py
#   squirrelbattle/display/logsdisplay.py
#   squirrelbattle/display/mapdisplay.py
#   squirrelbattle/display/menudisplay.py
#   squirrelbattle/menus.py
2021-01-05 10:27:39 +01:00
eichhornchen 6341f39fb0 Linting 2021-01-05 10:20:55 +01:00
eichhornchen c378eead74 Fixed the game loading tests : removed trumpets from the test. 2021-01-05 10:11:55 +01:00
eichhornchen f821fef430 added tests 2021-01-05 09:38:49 +01:00
eichhornchen c329150aac Linting again 2020-12-31 17:15:24 +01:00
eichhornchen 73952a42f3 Added tests for familiars 2020-12-31 15:43:38 +01:00
eichhornchen 8e0b8d4fee Added a test for lines 106-107 of game.py 2020-12-31 15:16:40 +01:00
eichhornchen 7cd4721daa linting 2020-12-31 15:00:20 +01:00
eichhornchen de3aba396d Re-changed familiar's inheritance from friendlyEntity to FightingEntity (just a leftover from debug) 2020-12-31 14:51:17 +01:00
Yohann D'ANELLO 663fc0eecd
Better teleport 2020-12-26 21:13:17 +01:00
Yohann D'ANELLO 6b7f8867fa
Tile colors can be overwritten 2020-12-26 14:02:35 +01:00
Yohann D'ANELLO 9a56b4d7e9
Navigate through different maps while climbing ladders 2020-12-26 01:08:43 +01:00
Yohann D'ANELLO 8636d571b5
Add ladders in the map 2020-12-26 00:52:47 +01:00
Yohann D'ANELLO ad5ae22e5f
Manage multiple maps in one game 2020-12-26 00:45:17 +01:00
eichhornchen 505e0a4efb Fixes issue #54, repaired the attribution of the familiars' target 2020-12-21 14:23:58 +01:00
Yohann D'ANELLO 8afa082708 Add Python 3.6 and 3.10 support, fixes #53 2020-12-20 18:02:39 +01:00
Yohann D'ANELLO ed6457e94d Test credits menu 2020-12-18 23:39:56 +01:00
Yohann D'ANELLO 4b174f26e4 Better colors 2020-12-18 23:36:08 +01:00
Yohann D'ANELLO 411744bf10 Add credits menu, see #42 2020-12-18 22:24:41 +01:00
eichhornchen ea5f5c1428 Added an original text art to serve as the project's logo. 2020-12-18 21:30:16 +01:00
Nicolas Margulies 762bed888a Working visibility (at least relatively good), but a few lines untested 2020-12-18 21:21:00 +01:00
Charles Peyrat f5e5e365d4 Starting the implementation of the new map generator 2020-12-18 20:02:37 +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
Charles Peyrat ba3d979f9c Fix syntax error 2020-12-18 18:10:52 +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
Charles Peyrat 5fbb918132 Add walls even to map borders 2020-12-18 17:05:50 +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
Yohann D'ANELLO fb926f8c84 Always use predefined map in game unit tests 2020-12-11 19:27:57 +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 209bde5b5c Fix sunflowers and merchants since the position of the player is no longer fixed 2020-12-11 19:21:02 +01:00
Yohann D'ANELLO 895abe88ad Ensure that the neighboorhood is walkable in movement tests 2020-12-11 19:18:48 +01:00
Charles Peyrat 3d7667573e Add testing for the no_lone_walls option 2020-12-11 19:14:28 +01:00
Charles Peyrat fe9dfdf242 Syntax change in randomwalk.Generator.__init__ 2020-12-11 19:13:15 +01:00
Charles Peyrat deb52d7350 Adding a missing parenthesis 2020-12-11 19:05:26 +01:00
Yohann D'ANELLO e91deccb6f Merge branch 'master' into map_generation
# Conflicts:
#	squirrelbattle/interfaces.py
2020-12-11 19:02:45 +01:00
Charles Peyrat 18ca083ba2 Added a connexity test 2020-12-11 18:59:07 +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
Charles Peyrat 7667079aa3 Changed Map.large_neighbourhood so we can also request only immediate neighbours, ignoring diagonals 2020-12-11 18:33:16 +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
Charles Peyrat d3c14a48ee Add docstring for Map.large_neighbourhood 2020-12-11 17:46:49 +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
Charles Peyrat c8b07b3bf5 Only empty tiles should be changed to walls, obviously... 2020-12-11 17:17:11 +01:00
Charles Peyrat 757a460a44 Fix typo 2020-12-11 17:13:12 +01:00
Charles Peyrat 6a4d13c726 Walls now generate around the floor 2020-12-11 17:09:59 +01:00
Charles Peyrat 3a8549cfcc Added a method to interfaces.Map to get the neighbours of a given tile 2020-12-11 17:09:27 +01:00
Yohann D'ANELLO 98b5dd64a8 Linting 2020-12-11 17:06:30 +01:00
Charles Peyrat 7fb743eb72 Switching up start_x and start_y so the player spawn is correctly set 2020-12-11 17:02:22 +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
Yohann D'ANELLO 3c614dcca9 Linting 2020-12-11 02:19:59 +01:00
Yohann D'ANELLO 8751120fe1 Merge master into map_generation, there were some commit behind 2020-12-11 02:17:00 +01:00
Yohann D'ANELLO 7db2dd2b46 Merge branch 'master' into map_generation
# Conflicts:
#	dungeonbattle/game.py
#	squirrelbattle/mapgeneration/__init__.py
#	squirrelbattle/mapgeneration/randomwalk.py
2020-12-11 02:14:47 +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