I need help Combining Global Scripts for a quest i'm making. Here's the scripts.
Difficulty Settings
const int NPC_MISC_DIFF = 0; //When set, enemy difficulty has been adjusted
const int DIFF_EASY = 1;
const int DIFF_MED = 2;
const int DIFF_HARD = 3;
const int DIFF_INSANE = 4;
int difficulty = DIFF_MED;
global script active {
void run() {
while(true) {
//Difficulty adjustment
if ( difficulty != DIFF_MED ){ //If not medium (default)
//Check each enemy
for ( int i = Screen->NumNPCs(); i > 0; i-- ){
npc enem = Screen->LoadNPC(i);
//If difficulty not adjusted
if ( enem->Misc[NPC_MISC_DIFF] == 0 ){
if ( difficulty == DIFF_EASY ){ //Easy
//Can't set health or damage lower than 1
enem->Damage = Max(enem->Damage * .5, 1); //Damage = 50%
enem->WeaponDamage = Max(enem->WeaponDamage * .5, 1); //WeaponDamage = 50%
enem->Step *= .85; //Step speed = 85%
}
else if ( difficulty == DIFF_HARD){ //Normal
enem->Damage *= 1; //Damage = 100%
enem->WeaponDamage *= 2;
enem->Step *= 1; //Step speed = 100%
}
else{ //Hard
enem->Damage *= 2; //Damage = 200%
enem->WeaponDamage *= 2; //WeaponDamage = 200%
enem->Step *= 1.5; //Step speed = 150%
}
enem->Misc[NPC_MISC_DIFF] = 1; //Mark as adjusted
}
}
}
Waitframe();
}
}
}
const int DIFF_EASY = 1;
const int DIFF_MED = 2;
const int DIFF_HARD = 3;
const int DIFF_INSANE = 4;
int difficulty = DIFF_MED;
global script active {
void run() {
while(true) {
//Difficulty adjustment
if ( difficulty != DIFF_MED ){ //If not medium (default)
//Check each enemy
for ( int i = Screen->NumNPCs(); i > 0; i-- ){
npc enem = Screen->LoadNPC(i);
//If difficulty not adjusted
if ( enem->Misc[NPC_MISC_DIFF] == 0 ){
if ( difficulty == DIFF_EASY ){ //Easy
//Can't set health or damage lower than 1
enem->Damage = Max(enem->Damage * .5, 1); //Damage = 50%
enem->WeaponDamage = Max(enem->WeaponDamage * .5, 1); //WeaponDamage = 50%
enem->Step *= .85; //Step speed = 85%
}
else if ( difficulty == DIFF_HARD){ //Normal
enem->Damage *= 1; //Damage = 100%
enem->WeaponDamage *= 2;
enem->Step *= 1; //Step speed = 100%
}
else{ //Hard
enem->Damage *= 2; //Damage = 200%
enem->WeaponDamage *= 2; //WeaponDamage = 200%
enem->Step *= 1.5; //Step speed = 150%
}
enem->Misc[NPC_MISC_DIFF] = 1; //Mark as adjusted
}
}
}
Waitframe();
}
}
}
Link's Awakening
//Pieces of Power, Guardian Acorns, and Secret Shells v0.4.1
//Set-up: Make a new item (Green Ring), set it up/ as follows:
//Item Class Rings
//Level: 1
//Power: 1
//CSet Modifier : None
//Assign this ring to Link's starting equipment in Quest->Init Data->Items
//Change the blue ring to L2, red to L3, and any higher above these.
int Z4_ItemsAndTimers[7]; //Array to hold the values for the Z4 items.
//Item Numbers : These are here for later expansion, and are unused at present.
const int I_GREEN_RING = 143; //Item number of Green Ring
const int I_PIECE_POWER = 144; //Item number of Piece of Power
const int I_ACORN = 145; //Item number of Acorn
const int I_SHELL = 146; //Item number of Secret Shell
//Settings
const int NEEDED_PIECES_OF_POWER = 3; / Number of Pieces of power needed for temporary boost.
const int NEEDED_ACORNS = 3; //Number of Acorns needed for temporary boost.
const int BUFF_TIME = 900; //Duration of boost, in frames. Default is 15 seconds.
//Array Indices
const int POWER_TIMER = 0;
const int DEF_TIMER = 1;
const int NUM PIECES_POWER = 2;
const int NUM_ACORNS = 3;
const int POWER_BOOSTED = 4;
const int DEF_BOOSTED = 5;
const int NUM_SHELLS = 6;
//Sound effects constants.
const int SFX_POWER_BOOSTED = 65; //Sound to play when Attack Buffed
const int SFX_SECRET_SHELL = 66; //Sound to play when unlocking shell secret.
const int SFX_GUARDIAN_DEF = 68; //Sound to play when Defence buffed.
const int SFX_NERF_POWER = 72; //Sound to play when Piece of Power buff expires.
const int SFX_NERF_DEF = 73; //Sound to play when Guardian Acorn buff expires.
//int NerfedAttack[]="Attack power nerfed."; //String for TraceS()
//////////////////////
/// MAIN FUNCTIONS ///
//////////////////////
//Run every frame **BEFORE** both Waitdraw() **AND** LinksAwakeningItems();
void ReduceBuffTimers(){
if ( Z4_ItemsAndTimers[POWER_TIMER] > 0 ) {
Z4_ItemsAndTimers[POWER_TIMER]--;
}
if ( Z4_ItemsAndTimers[DEF_TIMER] > 0 ) {
Z4_ItemsAndTimers[DEF_TIMER]--;
}
}
//Run every frame, before Waitdraw();
void LinksAwakeningItems(){
PiecesOfPower();
Acorns();
}
///Functions called by MAIN functions:
/ Runs every frame from LinksAwakeningItems();
void PiecesOfPower(){
if ( Z4_ItemsAndTimers[NUM_PIECES_POWER] >= NEEDED_PIECES_OF_POWER ) {
Z4_ItemsAndTimers[NUM_PIECES_POWER] = 0;
Z4_ItemsAndTimers[POWER_TIMER] = BUFF_TIME;
BoostAttack();
}
NerfAttack();
}
//Runs every frame from LinksAwakeningItems();
void Acorns(){
if ( Z4_ItemsAndTimers[NUM_ACORNS] >= NEEDED_ACORNS ) {
Z4_ItemsAndTimers[NUM_ACORNS] = 0;
Z4_ItemsAndTimers[DEF_TIMER] = BUFF_TIME;
BoostDefence();
}
NerfDefence();
}
//Runs from PiecesOfPower()();
void BoostAttack(){
if ( Z4_ItemsAndTimers[POWER_TIMER] && !Z4_ItemsAndTimers[POWER_BOOSTED] ) {
BuffSwords();
}
}
//Runs from PiecesOfPower()
void NerfAttack(){
if ( Z4_ItemsAndTimers[POWER_BOOSTED] && Z4_ItemsAndTimers[POWER_TIMER] < 1 ) {
Z4_ItemsAndTimers[POWER_BOOSTED] = 0;
NerfSwords();
Z4_ItemsAndTimers[POWER_TIMER] = 0;
}
}
//Runs from Acorns();
void BoostDefence(){
if ( Z4_ItemsAndTimers[DEF_TIMER] && !Z4_ItemsAndTimers[DEF_BOOSTED] ) {
BuffRings();
}
}
//Runs from Acorns()
void NerfDefence(){
if ( Z4_ItemsAndTimers[DEF_BOOSTED] && Z4_ItemsAndTimers[DEF_TIMER] < 1 ) {
Z4_ItemsAndTimers[DEF_BOOSTED] = 0;
NerfRings();
Z4_ItemsAndTimers[DEF_TIMER] = 0;
}
}
//Runs from BoostDefence();
void BuffSwords(){
float presentPower;
for ( int q = 0; q <= 255; q++ ) {
itemdata id = Game->LoadItemData(q);
if ( id->Family == IC_SWORD ) {
presentPower = id->Power;
id->Power = presentPower * 2;
}
}
Game->PlaySound(SFX_POWER_BOOSTED);
Z4_ItemsAndTimers[POWER_BOOSTED] = 1;
}
//Runs from BoostDefence();
void BuffRings(){
float presentPower;
for ( int q = 0; q <= 255; q++ ) {
itemdata id = Game->LoadItemData(q);
if ( id->Family == IC_RING ) {
presentPower = id->Power;
id->Power = presentPower * 2;
}
}
Game->PlaySound(SFX_GUARDIAN_DEF);
Z4_ItemsAndTimers[DEF_BOOSTED] = 1;
}
//Runs from BoostDefence();
void NerfSwords(){
float presentPower;
for ( int q = 0; q <= 255; q++ ) {
itemdata id = Game->LoadItemData(q);
if ( id->Family == IC_SWORD ) {
presentPower = id->Power;
id->Power = presentPower * 0.5;
}
}
Game->PlaySound(SFX_NERF_POWER);
}
//Runs from BoostDefence();
void NerfRings(){
float presentPower;
for ( int q = 0; q <= 255; q++ ) {
itemdata id = Game->LoadItemData(q);
if ( id->Family == IC_RING ) {
presentPower = id->Power;
id->Power = presentPower * 0.5;
}
}
Game->PlaySound(SFX_NERF_DEF);
}
/////////////////////////
/// Utility Functions ///
/////////////////////////
//Returns number of Secret Shells collected.
int NumShells(){
return Z4_ItemsAndTimers[NUM_SHELLS];
}
////////////////////
/// Item Scripts ///
////////////////////
//Piece of Power item PICKUP script.
item script PieceOfPower{
void run(){
Z4_ItemsAndTimers[NUM_PIECES_POWER]++;
}
}
//Acorn item PICKUP script.
item script GuardianAcorn{
void run(){
Z4_ItemsAndTimers[NUM_ACORNS]++;
}
}
//Shell item PICKUP script.
item script SecretShell{
void run(){
Z4_ItemsAndTimers[NUM_SHELLS]++;
}
}
/////////////////////////////
/// Sample Global Scripts ///
/////////////////////////////
global script LA_Active{
void run(){
while(true){
ReduceBuffTimers();
LinksAwakeningItems();
Waitdraw();
Waitframe();
}
}
}
global script LA_OnContinue{
void run(){
Z4_ItemsAndTimers[DEF_TIMER] = 0;
Z4_ItemsAndTimers[POWER_TIMER] = 0;
//Set timers back to 0, disabling the boost.
}
}
global script LA_OnExit{
void run(){
Z4_ItemsAndTimers[DEF_TIMER] = 0;
Z4_ItemsAndTimers[POWER_TIMER] = 0;
//Set timers back to 0, disabling the boost.
}
}
//void LinksAwakeningItems(int swords, int rings){
//}
//int TempBoostItems[6];
//int TempBoostTimers[2];
//int SwordItems[4]={1};
//int DefItems[4]={64};
//Set-up: Make a new item (Green Ring), set it up/ as follows:
//Item Class Rings
//Level: 1
//Power: 1
//CSet Modifier : None
//Assign this ring to Link's starting equipment in Quest->Init Data->Items
//Change the blue ring to L2, red to L3, and any higher above these.
int Z4_ItemsAndTimers[7]; //Array to hold the values for the Z4 items.
//Item Numbers : These are here for later expansion, and are unused at present.
const int I_GREEN_RING = 143; //Item number of Green Ring
const int I_PIECE_POWER = 144; //Item number of Piece of Power
const int I_ACORN = 145; //Item number of Acorn
const int I_SHELL = 146; //Item number of Secret Shell
//Settings
const int NEEDED_PIECES_OF_POWER = 3; / Number of Pieces of power needed for temporary boost.
const int NEEDED_ACORNS = 3; //Number of Acorns needed for temporary boost.
const int BUFF_TIME = 900; //Duration of boost, in frames. Default is 15 seconds.
//Array Indices
const int POWER_TIMER = 0;
const int DEF_TIMER = 1;
const int NUM PIECES_POWER = 2;
const int NUM_ACORNS = 3;
const int POWER_BOOSTED = 4;
const int DEF_BOOSTED = 5;
const int NUM_SHELLS = 6;
//Sound effects constants.
const int SFX_POWER_BOOSTED = 65; //Sound to play when Attack Buffed
const int SFX_SECRET_SHELL = 66; //Sound to play when unlocking shell secret.
const int SFX_GUARDIAN_DEF = 68; //Sound to play when Defence buffed.
const int SFX_NERF_POWER = 72; //Sound to play when Piece of Power buff expires.
const int SFX_NERF_DEF = 73; //Sound to play when Guardian Acorn buff expires.
//int NerfedAttack[]="Attack power nerfed."; //String for TraceS()
//////////////////////
/// MAIN FUNCTIONS ///
//////////////////////
//Run every frame **BEFORE** both Waitdraw() **AND** LinksAwakeningItems();
void ReduceBuffTimers(){
if ( Z4_ItemsAndTimers[POWER_TIMER] > 0 ) {
Z4_ItemsAndTimers[POWER_TIMER]--;
}
if ( Z4_ItemsAndTimers[DEF_TIMER] > 0 ) {
Z4_ItemsAndTimers[DEF_TIMER]--;
}
}
//Run every frame, before Waitdraw();
void LinksAwakeningItems(){
PiecesOfPower();
Acorns();
}
///Functions called by MAIN functions:
/ Runs every frame from LinksAwakeningItems();
void PiecesOfPower(){
if ( Z4_ItemsAndTimers[NUM_PIECES_POWER] >= NEEDED_PIECES_OF_POWER ) {
Z4_ItemsAndTimers[NUM_PIECES_POWER] = 0;
Z4_ItemsAndTimers[POWER_TIMER] = BUFF_TIME;
BoostAttack();
}
NerfAttack();
}
//Runs every frame from LinksAwakeningItems();
void Acorns(){
if ( Z4_ItemsAndTimers[NUM_ACORNS] >= NEEDED_ACORNS ) {
Z4_ItemsAndTimers[NUM_ACORNS] = 0;
Z4_ItemsAndTimers[DEF_TIMER] = BUFF_TIME;
BoostDefence();
}
NerfDefence();
}
//Runs from PiecesOfPower()();
void BoostAttack(){
if ( Z4_ItemsAndTimers[POWER_TIMER] && !Z4_ItemsAndTimers[POWER_BOOSTED] ) {
BuffSwords();
}
}
//Runs from PiecesOfPower()
void NerfAttack(){
if ( Z4_ItemsAndTimers[POWER_BOOSTED] && Z4_ItemsAndTimers[POWER_TIMER] < 1 ) {
Z4_ItemsAndTimers[POWER_BOOSTED] = 0;
NerfSwords();
Z4_ItemsAndTimers[POWER_TIMER] = 0;
}
}
//Runs from Acorns();
void BoostDefence(){
if ( Z4_ItemsAndTimers[DEF_TIMER] && !Z4_ItemsAndTimers[DEF_BOOSTED] ) {
BuffRings();
}
}
//Runs from Acorns()
void NerfDefence(){
if ( Z4_ItemsAndTimers[DEF_BOOSTED] && Z4_ItemsAndTimers[DEF_TIMER] < 1 ) {
Z4_ItemsAndTimers[DEF_BOOSTED] = 0;
NerfRings();
Z4_ItemsAndTimers[DEF_TIMER] = 0;
}
}
//Runs from BoostDefence();
void BuffSwords(){
float presentPower;
for ( int q = 0; q <= 255; q++ ) {
itemdata id = Game->LoadItemData(q);
if ( id->Family == IC_SWORD ) {
presentPower = id->Power;
id->Power = presentPower * 2;
}
}
Game->PlaySound(SFX_POWER_BOOSTED);
Z4_ItemsAndTimers[POWER_BOOSTED] = 1;
}
//Runs from BoostDefence();
void BuffRings(){
float presentPower;
for ( int q = 0; q <= 255; q++ ) {
itemdata id = Game->LoadItemData(q);
if ( id->Family == IC_RING ) {
presentPower = id->Power;
id->Power = presentPower * 2;
}
}
Game->PlaySound(SFX_GUARDIAN_DEF);
Z4_ItemsAndTimers[DEF_BOOSTED] = 1;
}
//Runs from BoostDefence();
void NerfSwords(){
float presentPower;
for ( int q = 0; q <= 255; q++ ) {
itemdata id = Game->LoadItemData(q);
if ( id->Family == IC_SWORD ) {
presentPower = id->Power;
id->Power = presentPower * 0.5;
}
}
Game->PlaySound(SFX_NERF_POWER);
}
//Runs from BoostDefence();
void NerfRings(){
float presentPower;
for ( int q = 0; q <= 255; q++ ) {
itemdata id = Game->LoadItemData(q);
if ( id->Family == IC_RING ) {
presentPower = id->Power;
id->Power = presentPower * 0.5;
}
}
Game->PlaySound(SFX_NERF_DEF);
}
/////////////////////////
/// Utility Functions ///
/////////////////////////
//Returns number of Secret Shells collected.
int NumShells(){
return Z4_ItemsAndTimers[NUM_SHELLS];
}
////////////////////
/// Item Scripts ///
////////////////////
//Piece of Power item PICKUP script.
item script PieceOfPower{
void run(){
Z4_ItemsAndTimers[NUM_PIECES_POWER]++;
}
}
//Acorn item PICKUP script.
item script GuardianAcorn{
void run(){
Z4_ItemsAndTimers[NUM_ACORNS]++;
}
}
//Shell item PICKUP script.
item script SecretShell{
void run(){
Z4_ItemsAndTimers[NUM_SHELLS]++;
}
}
/////////////////////////////
/// Sample Global Scripts ///
/////////////////////////////
global script LA_Active{
void run(){
while(true){
ReduceBuffTimers();
LinksAwakeningItems();
Waitdraw();
Waitframe();
}
}
}
global script LA_OnContinue{
void run(){
Z4_ItemsAndTimers[DEF_TIMER] = 0;
Z4_ItemsAndTimers[POWER_TIMER] = 0;
//Set timers back to 0, disabling the boost.
}
}
global script LA_OnExit{
void run(){
Z4_ItemsAndTimers[DEF_TIMER] = 0;
Z4_ItemsAndTimers[POWER_TIMER] = 0;
//Set timers back to 0, disabling the boost.
}
}
//void LinksAwakeningItems(int swords, int rings){
//}
//int TempBoostItems[6];
//int TempBoostTimers[2];
//int SwordItems[4]={1};
//int DefItems[4]={64};
Ghost.zh
// ghost.zh
// Version 2.8.1
// See ghost.txt for documentation.
// Standard settings -----------------------------------------------------------
// Small (1x1) shadow settings
const int GH_SHADOW_TILE = 27400;
const int GH_SHADOW_CSET = 7;
const int GH_SHADOW_FRAMES = 4;
const int GH_SHADOW_ANIM_SPEED = 8;
const int GH_SHADOW_TRANSLUCENT = 1; // 0 = No, 1 = Yes
const int GH_SHADOW_FLICKER = 0; // 0 = No, 1 = Yes
// Large (2x2) shadow settings
// If GH_LARGE_SHADOW_TILE is 0, large shadows will be disabled
const int GH_LARGE_SHADOW_TILE = 27392; // Top-left corner
const int GH_LARGE_SHADOW_CSET = 7;
const int GH_LARGE_SHADOW_FRAMES = 4;
const int GH_LARGE_SHADOW_ANIM_SPEED = 8;
const int GH_LARGE_SHADOW_MIN_WIDTH = 3; // Enemies must be at least this wide
const int GH_LARGE_SHADOW_MIN_HEIGHT = 3; // and this high to use large shadows
// AutoGhost settings
const int AUTOGHOST_MIN_FFC = 1; // Min: 1, Max: 32
const int AUTOGHOST_MAX_FFC = 32; // Min: 1, Max: 32
const int AUTOGHOST_MIN_ENEMY_ID = 20; // Min: 20, Max: 511
const int AUTOGHOST_MAX_ENEMY_ID = 511; // Min: 20, Max: 511
// Other settings
const int GH_DRAW_OVER_THRESHOLD = 32;
const float GH_GRAVITY = 0.16;
const float GH_TERMINAL_VELOCITY = 3.2;
const int GH_SPAWN_SPRITE = 22; // Min: 0, Max: 255, Default: 22
const int GH_FAKE_Z = 0; // 0 = No, 1 = Yes
const int __GH_FAKE_EWEAPON_Z = 0; // 0 = No, 1 = Yes
const int GH_ENEMIES_FLICKER = 0; // 0 = No, 1 = Yes
const int GH_PREFER_GHOST_ZH_SHADOWS = 0; // 0 = No, 1 = Yes
// Top-left corner of a 4x4 block of blank tiles
const int GH_BLANK_TILE = 65456; // Min: 0, Max: 65456
// Invisible combo with no properties set
const int GH_INVISIBLE_COMBO = 1; // Min: 1, Max: 65279
// Always read script name and combo from the enemy's name,
// freeing up attributes 11 and 12
const int __GH_ALWAYS_USE_NAME = 0;
// End standard settings -------------------------------------------------------
// Advanced settings -----------------------------------------------------------
// AutoGhost will read a script name from the enemy's name if attribute 12
// is set to this. Must be a negative number.
const int AUTOGHOST_READ_NAME = -1;
// When reading a script from the enemy name, this character marks the
// beginning of the script name.
// Default: 64 ( @ )
const int AUTOGHOST_DELIMITER = 64;
// Misc. attribute 11 can be set to this instead of GH_INVISIBLE_COMBO.
// Must be a negative number.
const int __GH_INVISIBLE_ALT = -1;
// This will use the invisible combo, but also set npc->Extend to 3 or 4,
// hiding the initial spawn puff. Must be a negative number.
const int __GH_INVISIBLE_EXTEND = -2;
// If enabled, the FFC will be invisible, and Screen->DrawCombo will be used
// to display enemies.
const int __GH_USE_DRAWCOMBO = 1;
// Enemies flash or flicker for this many frames when hit. This does not
// affect enemies that use the invisible combo.
// Default: 32
const int __GH_FLASH_TIME = 32;
// Enemies will be knocked back for this many frames when hit.
// Default: 16
// Max: 4095
const int __GH_KNOCKBACK_TIME = 16;
// The speed at which enemies are knocked back, in pixels per frame.
// Default: 4
const int __GH_KNOCKBACK_STEP = 4;
// The imprecision setting used when a movement function is called internally
// (except for walking functions).
const int __GH_DEFAULT_IMPRECISION = 2;
// npc->Misc[] index
// Set this so it doesn't conflict with other scripts. Legal values are 0-15.
const int __GHI_NPC_DATA = 15;
// eweapon->Misc[] indices
// These must be unique numbers between 0 and 15.
const int __EWI_FLAGS = 15; // Every index but this one can be used by non-ghost.zh EWeapons
const int __EWI_ID = 3;
const int __EWI_XPOS = 4;
const int __EWI_YPOS = 5;
const int __EWI_WORK = 6;
const int __EWI_WORK_2 = 7; // Only used by a few movement types
const int __EWI_MOVEMENT = 8;
const int __EWI_MOVEMENT_ARG = 9;
const int __EWI_MOVEMENT_ARG_2 = 10;
const int __EWI_LIFESPAN = 11;
const int __EWI_LIFESPAN_ARG = 12;
const int __EWI_ON_DEATH = 13;
const int __EWI_ON_DEATH_ARG = 14;
// These are only used by dummy EWeapons;
// they can use the same values as __EWI_XPOS and __EWI_YPOS
const int __EWI_DUMMY_SOUND = 2;
const int __EWI_DUMMY_STEP = 4;
const int __EWI_DUMMY_SPRITE = 5;
// Returns true if the given combo should be considered a pit.
bool __IsPit(int combo)
{
return IsPit(combo); // std.zh implementation by default
}
// Returns true if enemies are visible on screens with the
// "All Enemies Are Invisible" flag enabled
bool __HaveAmulet()
{
return Link->Item[I_AMULET1] || Link->Item[I_AMULET2];
}
// End advanced settings -------------------------------------------------------
import "ghost_zh/2.8/common.zh"
import "ghost_zh/2.8/deprecated.zh"
import "ghost_zh/2.8/drawing.zh"
import "ghost_zh/2.8/eweapon.zh"
import "ghost_zh/2.8/eweaponDeath.zh"
import "ghost_zh/2.8/eweaponMovement.zh"
import "ghost_zh/2.8/flags.zh"
import "ghost_zh/2.8/global.zh"
import "ghost_zh/2.8/init.zh"
import "ghost_zh/2.8/modification.zh"
import "ghost_zh/2.8/movement.zh"
import "ghost_zh/2.8/other.zh"
import "ghost_zh/2.8/update.zh"
import "ghost_zh/2.8/scripts.z"
// Version 2.8.1
// See ghost.txt for documentation.
// Standard settings -----------------------------------------------------------
// Small (1x1) shadow settings
const int GH_SHADOW_TILE = 27400;
const int GH_SHADOW_CSET = 7;
const int GH_SHADOW_FRAMES = 4;
const int GH_SHADOW_ANIM_SPEED = 8;
const int GH_SHADOW_TRANSLUCENT = 1; // 0 = No, 1 = Yes
const int GH_SHADOW_FLICKER = 0; // 0 = No, 1 = Yes
// Large (2x2) shadow settings
// If GH_LARGE_SHADOW_TILE is 0, large shadows will be disabled
const int GH_LARGE_SHADOW_TILE = 27392; // Top-left corner
const int GH_LARGE_SHADOW_CSET = 7;
const int GH_LARGE_SHADOW_FRAMES = 4;
const int GH_LARGE_SHADOW_ANIM_SPEED = 8;
const int GH_LARGE_SHADOW_MIN_WIDTH = 3; // Enemies must be at least this wide
const int GH_LARGE_SHADOW_MIN_HEIGHT = 3; // and this high to use large shadows
// AutoGhost settings
const int AUTOGHOST_MIN_FFC = 1; // Min: 1, Max: 32
const int AUTOGHOST_MAX_FFC = 32; // Min: 1, Max: 32
const int AUTOGHOST_MIN_ENEMY_ID = 20; // Min: 20, Max: 511
const int AUTOGHOST_MAX_ENEMY_ID = 511; // Min: 20, Max: 511
// Other settings
const int GH_DRAW_OVER_THRESHOLD = 32;
const float GH_GRAVITY = 0.16;
const float GH_TERMINAL_VELOCITY = 3.2;
const int GH_SPAWN_SPRITE = 22; // Min: 0, Max: 255, Default: 22
const int GH_FAKE_Z = 0; // 0 = No, 1 = Yes
const int __GH_FAKE_EWEAPON_Z = 0; // 0 = No, 1 = Yes
const int GH_ENEMIES_FLICKER = 0; // 0 = No, 1 = Yes
const int GH_PREFER_GHOST_ZH_SHADOWS = 0; // 0 = No, 1 = Yes
// Top-left corner of a 4x4 block of blank tiles
const int GH_BLANK_TILE = 65456; // Min: 0, Max: 65456
// Invisible combo with no properties set
const int GH_INVISIBLE_COMBO = 1; // Min: 1, Max: 65279
// Always read script name and combo from the enemy's name,
// freeing up attributes 11 and 12
const int __GH_ALWAYS_USE_NAME = 0;
// End standard settings -------------------------------------------------------
// Advanced settings -----------------------------------------------------------
// AutoGhost will read a script name from the enemy's name if attribute 12
// is set to this. Must be a negative number.
const int AUTOGHOST_READ_NAME = -1;
// When reading a script from the enemy name, this character marks the
// beginning of the script name.
// Default: 64 ( @ )
const int AUTOGHOST_DELIMITER = 64;
// Misc. attribute 11 can be set to this instead of GH_INVISIBLE_COMBO.
// Must be a negative number.
const int __GH_INVISIBLE_ALT = -1;
// This will use the invisible combo, but also set npc->Extend to 3 or 4,
// hiding the initial spawn puff. Must be a negative number.
const int __GH_INVISIBLE_EXTEND = -2;
// If enabled, the FFC will be invisible, and Screen->DrawCombo will be used
// to display enemies.
const int __GH_USE_DRAWCOMBO = 1;
// Enemies flash or flicker for this many frames when hit. This does not
// affect enemies that use the invisible combo.
// Default: 32
const int __GH_FLASH_TIME = 32;
// Enemies will be knocked back for this many frames when hit.
// Default: 16
// Max: 4095
const int __GH_KNOCKBACK_TIME = 16;
// The speed at which enemies are knocked back, in pixels per frame.
// Default: 4
const int __GH_KNOCKBACK_STEP = 4;
// The imprecision setting used when a movement function is called internally
// (except for walking functions).
const int __GH_DEFAULT_IMPRECISION = 2;
// npc->Misc[] index
// Set this so it doesn't conflict with other scripts. Legal values are 0-15.
const int __GHI_NPC_DATA = 15;
// eweapon->Misc[] indices
// These must be unique numbers between 0 and 15.
const int __EWI_FLAGS = 15; // Every index but this one can be used by non-ghost.zh EWeapons
const int __EWI_ID = 3;
const int __EWI_XPOS = 4;
const int __EWI_YPOS = 5;
const int __EWI_WORK = 6;
const int __EWI_WORK_2 = 7; // Only used by a few movement types
const int __EWI_MOVEMENT = 8;
const int __EWI_MOVEMENT_ARG = 9;
const int __EWI_MOVEMENT_ARG_2 = 10;
const int __EWI_LIFESPAN = 11;
const int __EWI_LIFESPAN_ARG = 12;
const int __EWI_ON_DEATH = 13;
const int __EWI_ON_DEATH_ARG = 14;
// These are only used by dummy EWeapons;
// they can use the same values as __EWI_XPOS and __EWI_YPOS
const int __EWI_DUMMY_SOUND = 2;
const int __EWI_DUMMY_STEP = 4;
const int __EWI_DUMMY_SPRITE = 5;
// Returns true if the given combo should be considered a pit.
bool __IsPit(int combo)
{
return IsPit(combo); // std.zh implementation by default
}
// Returns true if enemies are visible on screens with the
// "All Enemies Are Invisible" flag enabled
bool __HaveAmulet()
{
return Link->Item[I_AMULET1] || Link->Item[I_AMULET2];
}
// End advanced settings -------------------------------------------------------
import "ghost_zh/2.8/common.zh"
import "ghost_zh/2.8/deprecated.zh"
import "ghost_zh/2.8/drawing.zh"
import "ghost_zh/2.8/eweapon.zh"
import "ghost_zh/2.8/eweaponDeath.zh"
import "ghost_zh/2.8/eweaponMovement.zh"
import "ghost_zh/2.8/flags.zh"
import "ghost_zh/2.8/global.zh"
import "ghost_zh/2.8/init.zh"
import "ghost_zh/2.8/modification.zh"
import "ghost_zh/2.8/movement.zh"
import "ghost_zh/2.8/other.zh"
import "ghost_zh/2.8/update.zh"
import "ghost_zh/2.8/scripts.z"
My attempt at combining them
global script ActiveSlot2
{
void run()
{
int difficulty = DIFF_MED;
for ( int i = Screen->NumNPCs(); i > 0; i-- ){
enem->Misc[NPC_MISC_DIFF] = 1; //Mark as adjusted
Waitframe();
StartGhostZH();
while (true)
{
UpdateGhostZH1();
LinksAwakeningFunction();
Waitdraw();
LinksAwakening();
UpdateGhostZH2();
Waitframe();
Waitframe();
}
}
}
{
void run()
{
int difficulty = DIFF_MED;
for ( int i = Screen->NumNPCs(); i > 0; i-- ){
enem->Misc[NPC_MISC_DIFF] = 1; //Mark as adjusted
Waitframe();
StartGhostZH();
while (true)
{
UpdateGhostZH1();
LinksAwakeningFunction();
Waitdraw();
LinksAwakening();
UpdateGhostZH2();
Waitframe();
Waitframe();
}
}
}