summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-01-09use a new field which contains the playing characterOlivier Gayot
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-08move some functions and headers so that the compilation is quickerOlivier Gayot
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-08deactivate the display of the mapOlivier Gayot
since the map is not used now, no need to display it Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-08blit the background only once (no need for a weird function)Olivier Gayot
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-08add new pointers to screen and backgroundOlivier Gayot
make the old ones (Pfondjeu and Pecran) deprecated but keep them so the code continues working properly. Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-08handle the two teams the same wayOlivier Gayot
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-08create the red surface for the warrior gobelinsOlivier Gayot
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-08mark non public functions as staticOlivier Gayot
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-08fixed infinite loop when some enemy is deadOlivier Gayot
Because the function Fjouer still relies on some of the deprecated features, some bugs arise. fixed by replacing by the new features. Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-08initialize the items (aka objects) of the teamsOlivier Gayot
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-08removed unused deprecated constantsOlivier Gayot
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-08fix invalid write in new_enemy_team and in FjouerOlivier Gayot
in the function `new_enemy_team()', we used to loop through the enemies while the incrementer is less or equal to the count. However, since there are `count' elements, we need to stop the loop when the incrementer gets equal to `count' the same bug is present in `Fjouer()' when checking if the player wins. Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-08do not free the pointer returned by SDL_SetVideoModeOlivier Gayot
The pointer is automatically freed by the SDL library Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-08handle the selection of a target in a generic way.Olivier Gayot
we do not split the code of the selection of a target anymore. Each action now does a very simple thing and as much efficiently as possible. every old function that are not used anymore have been removed. Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-08add callback functions associated to a leaf actionOlivier Gayot
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-08fix: the game stopped when we cancelled a root actinOlivier Gayot
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-08remove old functions to select an entryOlivier Gayot
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-08use a generic way to navigate through entriesOlivier Gayot
entries are actually any action or subaction that can be performed. Attack, White Magic and so on are root actions. Fire, Ice X are subactions of Black Magic. Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-08use the objects assigned to the teams instead of a common arrayOlivier Gayot
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-08improve code and fix numerous bugsOlivier Gayot
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-08fix buggy behaviour in compute_damagesOlivier Gayot
we forgot to remove the old version of the computation regarding the affinities (aka. using the affinity as a coefficient). fixed by removing the old version. Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-08fix invalid display of the affinitiesOlivier Gayot
we used to loop through the elements in our outer loop and the affinities in the inner one. However since, the display is done line by line, we have to do the contrary. Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-08fix affinity handlingOlivier Gayot
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-08update the damages handlingOlivier Gayot
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-08added the cursor and its position to a characterOlivier Gayot
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-08use the new enemy team instead of the old array of ENEMIESOlivier Gayot
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-08fix invalid field set to NULLOlivier Gayot
the wrong surface was set to NULL after being freed. It could result in an crash if it is not fixed. Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-07added the current user to the team structureOlivier Gayot
the current character is generated randomly at the initialization of the team. Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-07generate a team of CPU controlled playersOlivier Gayot
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-07make team blitting and characters highlighting genericOlivier Gayot
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-07the generation of the team is now genericOlivier Gayot
we can now pass any team and it will be generated. Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-07generate the affinities during the creation of the charactersOlivier Gayot
do not differenciate between the players and the enemies as well Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-07add the warrior gobelin as a real classOlivier Gayot
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-07Fix invalid blit positionOlivier Gayot
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-07use a team / character model instead of an array of personnagesOlivier Gayot
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-07clean the code and fix bugsOlivier Gayot
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-07do not pass a pointer to standard type when a copy is possibleOlivier Gayot
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-07do not duplicate surfaces but make them point to each otherOlivier Gayot
There is no need to reopen the bitmap files each time we need a new paladin or priest or whatever. Instead, just load them at startup and them make them point to the good destination. Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-07store red surfacesOlivier Gayot
at the initialization, red surfaces are generated Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-07simplify the code of menuchoixpersosOlivier Gayot
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-07Fix use of uninitialized variable in FmenuchoixpersosOlivier Gayot
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-07replaced deprecated use of backticksOlivier Gayot
The $(...) notation is meant to be used as a replacement for backticks `...` Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-07fixed invalid usage of = instead of ==Olivier Gayot
thanks to compiler, we wre able to detect an usage of operator= instead of operator== which leads to undefined behaviour in the program. fixed ty replacing it by operator== Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-07fixed some compilation warningsOlivier Gayot
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-07replaced function inverse() by macroOlivier Gayot
There was multiple problems with this function: void inverse(int *bool); First, we use "bool", which is actually a standard type, as the identifier. Then, we cannot pass different types to the function without cast. Then, inverse is not a meaninful name. At last, we have to pass the address of the variable we want to inverse. Fixed all these points by replacing the function by a macro : #define inverse_boolean(_b) /* impl */ Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-07Fix segmentation fault when the game startsOlivier Gayot
Since no prototype for Fchangercurseurpersos was given, a nasty exception was raised when we passed an invalid data to this function. By providing its prototype, the compiler gives us a clue about the usage of an invalid pointer type that we can fix. Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-07handle default cases in switchesOlivier Gayot
since gcc produces warnings when default cases are not handled, make it happy. Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-07removed the copyright noticeOlivier Gayot
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-07game: added vim key bindings to UP/DOWN/LEFT/RIGHTOlivier Gayot
h/j/k/l are mapped to behave like arrow keys so that the navigation is easier in the menus. F and A are respectiverly used to validate and cancel as well. Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
2015-01-07game: converted source files from iso-8859 to UTF-8Olivier Gayot
Accents in the content of certain files made them react as binary files. Fixed by converting them to Unicode. Signed-off-by: Olivier Gayot <duskcoder@gmail.com>