-
Notifications
You must be signed in to change notification settings - Fork 2
/
SpiritWeapon.zh
90 lines (79 loc) · 3.66 KB
/
SpiritWeapon.zh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
//Spirit Weapon ZH
//This header handles spirited (or ghosted) behavior for weapons
#option SHORT_CIRCUIT on
#option BINARY_32BIT off
#option TRUE_INT_SIZE on
#option HEADER_GUARD on
#include "std.zh" //Required for header
//Required header subfiles. Set the include paths so they work with your script setup.
#include "Spirit_zh/spirit_zh/Common.zh"
#include "Spirit_zh/spirit_zh/Move.zh"
#include "Spirit_zh/spirit_zh/Animate.zh"
#include "Spirit_zh/spirit_zh/Hit.zh"
#include "Spirit_zh/spirit_zh/Death.zh"
#include "Spirit_zh/spirit_zh/Status.zh"
#include "Spirit_zh/spirit_zh/Misc.zh"
#include "Spirit_zh/spirit_zh/Internal.zh"
#include "Spirit_zh/spirit_zh/Scripts.zh"
typedef const int DEFINE; //Don't change DEFINE constants!
typedef const int CONFIG;
typedef const bool CONFIGB;
namespace Spirit
{
CONFIG SP_BLANK = 44; //Used for several functions like creating invisible "hitting" weapons. Set this the number of a blank sprite in the Sprite Editor. The blank sprite must use the top left tile of a 4x4 block of empty tiles.
//Large (2x2) shadow settings
// If SPIRITLW_LARGE_SHADOW_TILE is 0, large shadows will be disabled
CONFIG LARGE_SHADOW_TILE = 631; // Top-left corner
CONFIG LARGE_SHADOW_CSET = 8;
CONFIG LARGE_SHADOW_FRAMES = 4;
CONFIG LARGE_SHADOW_ANIM_SPEED = 8;
CONFIG LARGE_SHADOW_MIN_WIDTH = 3; // Weapons must draw at least this wide
CONFIG LARGE_SHADOW_MIN_HEIGHT = 3; // and this high to use large shadows
//This feature will be put off for now.
/*
CONFIG WEAPON_VARS = 49; //The number of internal variables a weapon has. This is currently outdated and will be updated soon
CONFIG BUFFER_SIZE = 16; //The number of LWeapons that can be stored in the GhostWeaponBuffer
enum weaponvars
{
WEAPON_VAR_BEHIND,
WEAPON_VAR_ID,
WEAPON_VAR_DRAWSTYLE,
WEAPON_VAR_ORIGINALTILE,
WEAPON_VAR_,
WEAPON_VAR_END
};
int WeaponBuffer[WEAPON_VARS*BUFFER_SIZE];
*/
//Settings
enum LogSettings
{
LOGGING_NONE,
LOGGING_ERROR,
LOGGING_FULL
};
CONFIG SETTING_LOGGING = LOGGING_FULL; //Wherever the header will log messages to the console or enable debug stuff.
//0 - No logging.
//1 - Log on error.
//2 - Full logging. This will slow your game right down, so only use it when debugging
CONFIGB SETTING_FAKE_Z = false; //If enabled, movement functions do not modify the weapon's Z position and instead adjust its Y position. This does not affect how the weapon's Z position is manipulated by the engine and you must set this up in your own movement functions in order to for them use it.
CONFIG SETTING_ACCURATE_SOLIDITY = 0; //If enabled the header's solidity checks will use a (generally) slower, more accurate solidity checking function if the weapon's collision rectangle is this size, in pixels, on either the x or y axis. Set this to 0 to enable this for weapons of all sizes, set this to a higher number than any size weapon you plan to use in order to disable (eg. 256).
//Weapon properties
//LWeapon Misc[] entries. Set so they don't conflict with existing scripts
CONFIG LWMISC_FLAGS = 30; //The weapon's spirited flags, so it can receive special spirited effects from the header.
CONFIG LWMISC_FLAGS_INT = 31; //The weapon's internal spirited flags, which are set by the script. All Misc[] variables except this one can be used by non-spirited weapons.
//Set up namespaces in main files
namespace Animate{}
using namespace Spirit::Animate;
namespace Move{}
using namespace Spirit::Move;
namespace Hit{}
using namespace Spirit::Hit;
namespace Death{}
using namespace Spirit::Death;
namespace Status{}
using namespace Spirit::Status;
namespace Misc{}
using namespace Spirit::Misc;
namespace Internal{}
using namespace Spirit::Internal;
}