From c8a43107d98512e8f6376f0bbca2d2143d895170 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sun, 24 Oct 2021 12:40:32 +0200 Subject: [PATCH] Map out test functions in astypedef, adds settings --- .vscode/settings.json | 15 +++++++++++++++ Scripts/Interfaces/TestFunctions.astypedef | 17 +++++++++++++++++ Scripts/Moves/Assurance.as | 1 - 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 .vscode/settings.json create mode 100644 Scripts/Interfaces/TestFunctions.astypedef diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..8fecb16 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,15 @@ +{ + "angelscript-languageserver.defines": [ + "TESTS" + ], + "angelscript-languageserver.engine-settings": { + "asEP_DISALLOW_EMPTY_LIST_ELEMENTS": true, + "asEP_DISALLOW_VALUE_ASSIGN_FOR_REF_TYPE": false, + "asEP_ALLOW_UNSAFE_REFERENCES": true, + "asEP_ALWAYS_IMPL_DEFAULT_CONSTRUCT": true, + "asEP_AUTO_GARBAGE_COLLECT": false, + "asEP_REQUIRE_ENUM_SCOPE": true, + "asEP_PROPERTY_ACCESSOR_MODE": 2, + "asEP_COMPILER_WARNINGS": 2 + } +} \ No newline at end of file diff --git a/Scripts/Interfaces/TestFunctions.astypedef b/Scripts/Interfaces/TestFunctions.astypedef new file mode 100644 index 0000000..568e006 --- /dev/null +++ b/Scripts/Interfaces/TestFunctions.astypedef @@ -0,0 +1,17 @@ +func bool Require(bool expression); +func bool RequireEquals(int expected, int actual); +func bool RequireEquals(const string &in expected, const string &in actual); + +func Party@ CreateSimpleParty(const array&in species, uint8 level); +func Battle@ CreateSimpleBattle(uint seed, const constString&in species1, const constString&in species2, uint8 level); +func Battle@ CreateSimpleBattle(uint seed, Party@ p1, Party@ p2); + +func ref@ CreateMoveScript(const constString&in name); +func ExecutingMove@ CreateExecutingMove(const constString&in moveName, Pokemon@ user, Pokemon@ target); +func MoveTurnChoice@ CreateMoveTurnChoice(const constString&in moveName, Pokemon@ user, uint8 targetSide, uint8 target); + +type Pokemon { + bool UseMove(const constString&in move, uint8 side, uint8 index); + bool PassTurn(); + bool LearnMove(const constString&in move); +} \ No newline at end of file diff --git a/Scripts/Moves/Assurance.as b/Scripts/Moves/Assurance.as index 3560058..f1bc595 100644 --- a/Scripts/Moves/Assurance.as +++ b/Scripts/Moves/Assurance.as @@ -62,5 +62,4 @@ void Assurance_DamageWithEventOnDifferentTurn(){ script.OverrideDamage(executingMove, mon2, 0x0, damage); RequireEquals(100, damage); } - #endif \ No newline at end of file