Commit Graph

541 Commits

Author SHA1 Message Date
Deukhoofd 2ea928e67b
Adds OnFaint script hook.
continuous-integration/drone/push Build is passing Details
2021-11-19 12:12:46 +01:00
Deukhoofd 59313e6da8
Breaking change: rework of talents.
continuous-integration/drone/push Build is passing Details
2021-11-15 12:04:58 +01:00
Deukhoofd 33d384c464
Support for failing an AttackTurnChoice.
continuous-integration/drone/push Build is passing Details
This is handled before the actual ExecutingAttack is created, so allows for failing a move a lot earlier than before.
2021-11-12 12:54:34 +01:00
Deukhoofd 1a3b7fe50a
Fixes build.
continuous-integration/drone/push Build is passing Details
2021-10-30 17:54:37 +02:00
Deukhoofd 2bd73bd4ef
Reset weight/height when variant changes, when a creature is moved out of the battle.
continuous-integration/drone/push Build is failing Details
2021-10-30 17:50:26 +02:00
Deukhoofd a12972472b
Adds Creature specific weight and height, which can be modified dynamically during battles.
continuous-integration/drone/push Build is passing Details
2021-10-30 17:07:13 +02:00
Deukhoofd 2e2abfe122
Reference Arbutils/Enum in ScriptCategory.hpp
continuous-integration/drone/push Build is passing Details
2021-10-30 14:31:43 +02:00
Deukhoofd e1d8348b2f
Fixes project being completely dirty every build requiring constant full rebuilds and slowing down tooling.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-10-30 14:24:38 +02:00
Deukhoofd d55b40f3d0
Adds newline for GCC.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-10-29 23:55:41 +02:00
Deukhoofd cb6725ab5e
Adds support for script owner to clone command.
continuous-integration/drone/push Build is failing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-10-29 21:55:49 +02:00
Deukhoofd be7a5fe6bd
More work on setting owner of a script.
continuous-integration/drone/push Build is failing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-10-29 21:40:10 +02:00
Deukhoofd 949fc67831
Add support for saving and getting the owner of a script in script.
continuous-integration/drone/push Build is failing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-10-29 21:31:01 +02:00
Deukhoofd 5fd8abb3a8
Reworks ScriptSources so we can get individual scripts on a source. Fixed OnEndTurn making no sense.
continuous-integration/drone/push Build is failing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-10-29 19:31:08 +02:00
Deukhoofd 316ac12a01
Adds script hook for overriding incoming damage.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-10-29 18:24:46 +02:00
Deukhoofd 0b9028ea97
Fixes BattleSide AddVolatile using the wrong script category.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-10-29 18:12:35 +02:00
Deukhoofd b4ef1ea98e
Adds getter for Battle on BattleSide.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-10-28 15:01:31 +02:00
Deukhoofd 19375c2f87
Adds functions to add, remove, and get volatile scripts from a BattleSide.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-10-28 14:49:24 +02:00
Deukhoofd 47c3429295
Adds optional optimization to history helper functions to limit the max amount of turns searched through.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-10-24 11:10:30 +02:00
Deukhoofd 7354c835e6
Fixes memory leak.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-10-23 18:38:12 +02:00
Deukhoofd 51897e42da
Make HistoryHolder a pointer instead of value.
continuous-integration/drone/push Build is failing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-10-23 17:17:34 +02:00
Deukhoofd ff67ab9e00
Adds helper function to get last damage event on a creature.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-10-23 17:08:54 +02:00
Deukhoofd 20b53833c4
Cleans up HistoryHolder to be a lot less complicated (although possibly a bit slower), adds DamageHistory.
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-10-23 16:57:58 +02:00
Deukhoofd a361716233
Made Creature::GetStatusName const.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-09-21 22:19:26 +02:00
Deukhoofd ce30077a5d
Change Creature::Nickname to be an optional.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-09-19 11:40:18 +02:00
Deukhoofd 152ac7e407
Don't throw an exception when teaching an attack when we don't have the max amount of attacks yet.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-08-29 17:16:36 +02:00
Deukhoofd 512a39e158
Deal with Creatures being deleted before a battle they're part of.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-08-28 19:05:52 +02:00
Deukhoofd d89e0b0d77
Adds function on battleside to get a creature at an index.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-08-23 21:38:47 +02:00
Deukhoofd 08120d5433
Adds status handling functions
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-07-09 15:33:30 +02:00
Deukhoofd 4274a44fa5
Fixes for GCC warnings
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-06-26 11:26:20 +02:00
Deukhoofd 762915b1f7
Add new Creature::IsUsable function, which replaces IsFainted functionality in several places.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-06-19 12:33:31 +02:00
Deukhoofd 8241a2d7b1
Check if target of attack is a valid target for that attack.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-05-24 10:57:17 +02:00
Deukhoofd 69dab061da
Further cleanup of TargetResolver.
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-05-24 10:34:42 +02:00
Deukhoofd b036efaf18
Clean up TargetResolver.
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-05-24 10:31:15 +02:00
Deukhoofd b48353822c
Change script when ChangeAttack script hook changes the used attack.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-05-14 10:42:05 +02:00
Deukhoofd 13153b3119
Support overriding attacks through script hooks.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-05-13 13:16:52 +02:00
Deukhoofd 188e88ab80
Store CreatureIndex on Creature, includes helper function to get a creatures party from a battle.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-05-08 11:53:32 +02:00
Deukhoofd 305eb5efb2
Cleanup for Creature class battle data.
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-05-08 11:26:35 +02:00
Deukhoofd be10b3515c
Reworks script aggregator. Cleans up API and code, and now handles scripts being removed from a set while we're iterating.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-04-18 12:50:48 +02:00
Deukhoofd 13df99a6cc
Try and catch more edge cases where setIndex would be invalid.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-04-17 16:31:03 +02:00
Deukhoofd 8f9f2b2b8d
Fixes issue with iterating over two script sets.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-04-17 16:23:29 +02:00
Deukhoofd 9f091308b0
Reset on initialization in ScriptAggregator, fixes segfault when calling Reset on an empty Aggregator.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-04-17 15:08:26 +02:00
Deukhoofd 33f796eff8
Minor fixes for ScriptAggregator
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-04-17 14:44:33 +02:00
Deukhoofd 96cbd594a0
Better handling of clearning scripts.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-04-14 19:29:42 +02:00
Deukhoofd b42bf21315
Fixes segfault in ScriptSet::Clear
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-04-14 19:20:43 +02:00
Deukhoofd 8a9a6af0af
Pass battle pointer along with clone for battleside.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-04-13 22:45:48 +02:00
Deukhoofd ba5e937dbd
Remove copying historyholder for now, as it causes issues.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-04-11 23:29:00 +02:00
Deukhoofd e2cc20d1c5
Fixes HistoryHolder CopyOnto not actually copying memory.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-04-11 23:10:36 +02:00
Deukhoofd 2b1a1792bf
Make Clone functions const.
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-04-11 16:01:18 +02:00
Deukhoofd 84a14cff2b
Support for cloning battles for AI purposes.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-04-11 15:20:50 +02:00
Deukhoofd a3b7002cd4
Adds script hook to modify number of hits
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-03-28 19:43:26 +02:00
Deukhoofd 374a4d10a8
Pass creature along with OnEndTurn.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-03-28 18:37:10 +02:00
Deukhoofd 21231761ef
Adds OnEndTurn script hook.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-03-28 18:24:49 +02:00
Deukhoofd 23bd0da646
Adds swap event when two creatures swap positions.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-03-28 11:58:26 +02:00
Deukhoofd acacd02ef9
Adds script hook for preventing the opponent from switching out.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-03-27 22:54:51 +01:00
Deukhoofd 1ddbfd2357
Fixes for ScriptSet throwing when adding a not yet found volatile script.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-03-27 20:20:49 +01:00
Deukhoofd bfe83ef271
When adding volatile script, return the script object.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-03-27 16:36:20 +01:00
Deukhoofd d6858c2d44
Adds choice pointer to flee prevention script.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-03-27 15:10:56 +01:00
Deukhoofd 4dd3700352
Adds script hooks for preventing runaway.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-03-27 14:49:17 +01:00
Deukhoofd 46307fe71f
Initial work on attack fail handling.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-03-27 12:30:12 +01:00
Deukhoofd 9b7c271a20
Support for swapping two creatures on a side.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-03-26 12:01:18 +01:00
Deukhoofd cd3d665687
Adds OnInitialize function on Item Use Script.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-03-07 19:49:06 +01:00
Deukhoofd 14ebf20f23
Adds getter for pointer to script resolver on battle library.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-03-07 19:04:15 +01:00
Deukhoofd 715da74320
Make Effect field in Item OptionalUniquePtr.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-03-07 12:39:15 +01:00
Deukhoofd 26c36f8ece
Adds effect field to Items.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-03-07 11:56:07 +01:00
Deukhoofd 3a4171f565
Use Item pointer for Script resolving for item use script.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-03-07 11:24:45 +01:00
Deukhoofd d908efff9d
Adds support for scripts for item use handling.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-03-07 10:54:42 +01:00
Deukhoofd 5178d5dcc0
Renamed Script --> BattleScript, some cleanup on it.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-03-07 10:26:41 +01:00
Deukhoofd d70c6a224a
Fixes for growth rates, forces shared library to be dll on Windows.
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-03-07 09:43:52 +01:00
Deukhoofd 7aa31a838d
Several fixes for attack effects not triggering.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-01-22 13:38:05 +01:00
Deukhoofd abccc23851
Trigger event when stat boost changes.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-01-16 21:16:47 +01:00
Deukhoofd 987f60ee85
Clear scripts from creature when a battle is cleared from it.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-01-15 16:31:47 +01:00
Deukhoofd 66b95a6e4d
Reset seen opponents on ClearBattle.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-01-15 15:46:48 +01:00
Deukhoofd 3742e07b03
Rework clearing battle from creatures.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2020-12-28 15:10:49 +01:00
Deukhoofd a284641b5a
Fixes invalid pointers to a battle dangling when a battle is removed.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2020-12-28 13:40:39 +01:00
Deukhoofd 69476b6f9d
Adds setter for nickname.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2020-12-22 16:11:23 +01:00
Deukhoofd 87bbae678a
Style Fixes
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2020-12-13 12:26:54 +01:00
Deukhoofd e642f374b9
Update to latest Arbutils.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2020-12-13 12:15:40 +01:00
Deukhoofd 2055837980
Make learned attacks on Creature be optional.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2020-12-12 15:10:18 +01:00
Deukhoofd 29d6632472
Makes TryGetVariant use an std::optional
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2020-12-12 14:12:50 +01:00
Deukhoofd 4367d1f5cf
Make HeldItem OptionalBorrowedPtr.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2020-12-12 13:40:30 +01:00
Deukhoofd a01e22ad89
Fixes BaseLibrary function calling itself.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2020-12-12 13:20:21 +01:00
Deukhoofd 3bd39cc035
Update to latest Arbutils.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2020-12-12 12:59:56 +01:00
Deukhoofd 185ec40ba5
Use std::optional for BaseLibrary TryGet.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2020-12-12 12:42:28 +01:00
Deukhoofd 5c39694f19
Overhaul memory model to new Arbutils memory.
continuous-integration/drone/push Build is failing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2020-12-12 12:22:48 +01:00
Deukhoofd 1dc3aafd33
Use vector instead of set for types.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2020-10-23 16:51:15 +02:00
Deukhoofd de8b5de7b4
Mark several classes as final for devirtualization performance benefits.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2020-10-15 18:21:50 +02:00
Deukhoofd b006344d83
Make Item follow PIMPL idiom.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2020-09-30 20:32:41 +02:00
Deukhoofd 926a3c5dd8
Document StatisticSet, add constraint that its generic type must be an integer type.
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2020-09-30 18:53:18 +02:00
Deukhoofd 539a278114
Make LibrarySettings follow PIMPL, adds documentation.
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2020-09-30 18:49:39 +02:00
Deukhoofd dd8847a441
Re-add different level sizes in Defines.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2020-09-27 11:25:32 +02:00
Deukhoofd 4f972bcb28
Include precompiled header in conan.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2020-09-27 11:19:10 +02:00
Deukhoofd e14f747d48
Documents LearnableAttacks
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2020-09-27 11:17:13 +02:00
Deukhoofd 4006d63872
Make LearnableAttacks follow PIMPL idiom.
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2020-09-27 10:49:26 +02:00
Deukhoofd 15deae1504
Adds some documentation, add .clang-tidy file.
continuous-integration/drone/push Build is failing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2020-09-26 12:46:48 +02:00
Deukhoofd 94d1d68832
Fully document SpeciesVariant.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2020-09-25 19:27:27 +02:00
Deukhoofd fbdeaf9e9c
Made SpeciesVariant follow PIMPL idiom.
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2020-09-25 19:11:56 +02:00
Deukhoofd 6189919496
Fully documents CreatureSpecies.
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2020-09-25 18:52:47 +02:00
Deukhoofd 4bf591c649
Start working on documentation.
continuous-integration/drone/push Build encountered an error Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2020-09-25 18:24:28 +02:00
Deukhoofd d4505f4293
Make CreatureSpecies follow PIMPL idiom.
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2020-09-25 13:33:57 +02:00
Deukhoofd 3a4eb9264e
Actually include the Precompiled header file.
continuous-integration/drone/push Build is passing Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2020-09-25 13:06:32 +02:00