ghost2_eweapon.zh#

Variables#

const int

EWM_SINE_WAVE

const int

EWM_HOMING

const int

EWM_HOMING_REAIM

const int

EWM_RANDOM

const int

EWM_RANDOM_REAIM

const int

EWM_VEER

const int

EWM_THROW

const int

EWM_FALL

const int

EWM_DRIFT

const int

EWM_DRIFT_WAIT

const int

EWM_HOMING_P2

const int

EWM_HOMING_REAIM_P2

const int

EWMF_DIE

const int

EWMF_BOUNCE

const int

EWL_TIMER

const int

EWL_NEAR_LINK

const int

EWL_SLOW_TO_HALT

const int

EWD_VANISH

const int

EWD_AIM_AT_LINK

const int

EWD_EXPLODE

const int

EWD_SBOMB_EXPLODE

const int

EWD_4_FIREBALLS_HV

const int

EWD_4_FIREBALLS_DIAG

const int

EWD_4_FIREBALLS_RANDOM

const int

EWD_8_FIREBALLS

const int

EWD_4_FIRES_HV

const int

EWD_4_FIRES_DIAG

const int

EWD_4_FIRES_RANDOM

const int

EWD_8_FIRES

const int

EWD_SPAWN_NPC

const int

EWD_FIRE

const int

EWD_RUN_SCRIPT

const int

EWD_AIM_AT_P2

const int

EWD_EVEN

const int

EWD_RANDOM

const int

EWD_AIMED

const int

EWF_UNBLOCKABLE

const int

EWF_ROTATE

const int

EWF_ROTATE_360

const int

EWF_SHADOW

const int

EWF_FLICKER

const int

EWF_NO_COLLISION

const int

EWF_FAKE_Z

const int

__EWFI_DEAD

const int

__EWFI_DUMMY

const int

__EWFI_IS_GHZH_EWPN

const int

__EWFI_DUMMY_CHECK

const int

__EWFI_DEATH_EFFECT_DONE

const int

__EWFI_INTERNAL

Functions#

eweapon

FireEWeapon(int weaponID, int x, int y, int angle, int step, int damage, int sprite, int sound, int flags)

eweapon

FireAimedEWeapon(int weaponID, int x, int y, int angle, int step, int damage, int sprite, int sound, int flags)

eweapon

FireNonAngularEWeapon(int weaponID, int x, int y, int dir, int step, int damage, int sprite, int sound, int flags)

eweapon

FireBigEWeapon(int weaponID, int x, int y, int angle, int step, int damage, int sprite, int sound, int flags, int width, int height)

eweapon

FireBigAimedEWeapon(int weaponID, int x, int y, int angle, int step, int damage, int sprite, int sound, int flags, int width, int height)

eweapon

FireBigNonAngularEWeapon(int weaponID, int x, int y, int dir, int step, int damage, int sprite, int sound, int flags, int width, int height)

eweapon

CreateDummyEWeapon(int weaponID, int step, int damage, int sprite, int sound, int flags)

eweapon

CreateBigDummyEWeapon(int weaponID, int step, int damage, int sprite, int sound, int flags, int width, int height)

void

SetEWeaponMovement(eweapon wpn, int type, int arg, int arg2)

int

__GetEWeaponThrowHeight(eweapon wpn)

void

SetEWeaponLifespan(eweapon wpn, int type, int arg)

void

SetEWeaponDeathEffect(eweapon wpn, int type, int arg)

void

SetEWeaponDeathEffect(eweapon wpn, eweapon prototype, int numShots, int spreadType, int angle)

void

UpdateEWeapon(eweapon wpn)

void

__UpdateEWeaponVisualFlags(eweapon wpn)

void

SetEWeaponDir(eweapon wpn)

void

SetEWeaponRotation(eweapon wpn)

void

SetEWeaponRotation(eweapon wpn, int dir)

void

KillEWeapon(eweapon wpn)

void

DrawEWeaponShadow(eweapon wpn)

int

GetDefaultEWeaponSprite(int weaponID)

int

GetDefaultEWeaponSound(int weaponID)

eweapon

GetAssociatedEWeapon(int weaponID)

bool

IsGhostZHEWeapon(eweapon wpn)

bool

IsDummyEWeapon(eweapon wpn)

void

__CopyEWeapon(eweapon prototype, int centerX, int centerY, int angle)

int

__UnblockableDir(int dir)

Variable descriptions#

const int EWM_SINE_WAVE = 1 πŸ”— Source

ghost.zh Version 2.8.15 Arguments to SetEWeaponMovement()


const int EWM_HOMING = 3 πŸ”— Source


const int EWM_HOMING_REAIM = 4 πŸ”— Source


const int EWM_RANDOM = 5 πŸ”— Source


const int EWM_RANDOM_REAIM = 6 πŸ”— Source


const int EWM_VEER = 7 πŸ”— Source


const int EWM_THROW = 15 πŸ”— Source


const int EWM_FALL = 19 πŸ”— Source


const int EWM_DRIFT = 20 πŸ”— Source


const int EWM_DRIFT_WAIT = 28 πŸ”— Source


const int EWM_HOMING_P2 = 30 πŸ”— Source


const int EWM_HOMING_REAIM_P2 = 31 πŸ”— Source


const int EWMF_DIE = 1 πŸ”— Source

Flags used by certain EWeapon movement types


const int EWMF_BOUNCE = 2 πŸ”— Source


const int EWL_TIMER = 1 πŸ”— Source

Arguments to SetEWeaponLifespan()



const int EWL_SLOW_TO_HALT = 3 πŸ”— Source


const int EWD_VANISH = 1 πŸ”— Source

Arguments to SetEWeaponDeathEffect()



const int EWD_EXPLODE = 3 πŸ”— Source


const int EWD_SBOMB_EXPLODE = 4 πŸ”— Source


const int EWD_4_FIREBALLS_HV = 5 πŸ”— Source


const int EWD_4_FIREBALLS_DIAG = 6 πŸ”— Source


const int EWD_4_FIREBALLS_RANDOM = 7 πŸ”— Source


const int EWD_8_FIREBALLS = 8 πŸ”— Source


const int EWD_4_FIRES_HV = 9 πŸ”— Source


const int EWD_4_FIRES_DIAG = 10 πŸ”— Source


const int EWD_4_FIRES_RANDOM = 11 πŸ”— Source


const int EWD_8_FIRES = 12 πŸ”— Source


const int EWD_SPAWN_NPC = 13 πŸ”— Source


const int EWD_FIRE = 14 πŸ”— Source


const int EWD_RUN_SCRIPT = 15 πŸ”— Source


const int EWD_AIM_AT_P2 = 16 πŸ”— Source


const int EWD_EVEN = 1 πŸ”— Source

Prototype-based version


const int EWD_RANDOM = 2 πŸ”— Source


const int EWD_AIMED = 3 πŸ”— Source


const int EWF_UNBLOCKABLE = 1 πŸ”— Source

EWeapon flags


const int EWF_ROTATE = 2 πŸ”— Source


const int EWF_ROTATE_360 = 4 πŸ”— Source


const int EWF_SHADOW = 8 πŸ”— Source


const int EWF_FLICKER = 16 πŸ”— Source


const int EWF_NO_COLLISION = 32 πŸ”— Source


const int EWF_FAKE_Z = 64 πŸ”— Source


const int __EWFI_DEAD = 128 πŸ”— Source

Internal EWeapon flags


const int __EWFI_DUMMY = 256 πŸ”— Source


const int __EWFI_IS_GHZH_EWPN = 512 πŸ”— Source


const int __EWFI_DUMMY_CHECK = 768 πŸ”— Source


const int __EWFI_DEATH_EFFECT_DONE = 1024 πŸ”— Source


const int __EWFI_INTERNAL = 1920 πŸ”— Source


Function descriptions#

eweapon FireEWeapon(int weaponID, int x, int y, int angle, int step, int damage, int sprite, int sound, int flags) πŸ”— Source

Fire an eweapon


eweapon FireAimedEWeapon(int weaponID, int x, int y, int angle, int step, int damage, int sprite, int sound, int flags) πŸ”— Source

Fire an eweapon aimed based on Link’s position


eweapon FireNonAngularEWeapon(int weaponID, int x, int y, int dir, int step, int damage, int sprite, int sound, int flags) πŸ”— Source

Fire a non-angular eweapon


eweapon FireBigEWeapon(int weaponID, int x, int y, int angle, int step, int damage, int sprite, int sound, int flags, int width, int height) πŸ”— Source

Fire an eweapon larger than 1x1


eweapon FireBigAimedEWeapon(int weaponID, int x, int y, int angle, int step, int damage, int sprite, int sound, int flags, int width, int height) πŸ”— Source

Fire an eweapon larger than 1x1 aimed based on Link’s position


eweapon FireBigNonAngularEWeapon(int weaponID, int x, int y, int dir, int step, int damage, int sprite, int sound, int flags, int width, int height) πŸ”— Source

Fire a non-angular eweapon larger than 1x1


eweapon CreateDummyEWeapon(int weaponID, int step, int damage, int sprite, int sound, int flags) πŸ”— Source

Create a dummy eweapon to use as a prototype


eweapon CreateBigDummyEWeapon(int weaponID, int step, int damage, int sprite, int sound, int flags, int width, int height) πŸ”— Source

Create a dummy eweapon larger than 1x1


void SetEWeaponMovement(eweapon wpn, int type, int arg, int arg2) πŸ”— Source

Set an eweapon’s movement type


int __GetEWeaponThrowHeight(eweapon wpn) πŸ”— Source

Returns the Z velocity at which a weapon should be thrown to land at Link’s position.


void SetEWeaponLifespan(eweapon wpn, int type, int arg) πŸ”— Source

Set an eweapon’s lifespan


void SetEWeaponDeathEffect(eweapon wpn, int type, int arg) πŸ”— Source

Set an eweapon to use a standard death effect


void SetEWeaponDeathEffect(eweapon wpn, eweapon prototype, int numShots, int spreadType, int angle) πŸ”— Source

Set an eweapon to spawn more eweapons on death


void UpdateEWeapon(eweapon wpn) πŸ”— Source

Update a weapon’s movement, lifespan, and death effects


void __UpdateEWeaponVisualFlags(eweapon wpn) πŸ”— Source

End flags Used when Link is holding up an item. UpdateEWeapon() doesn’t run, but the appearance-related flags still need handled.


void SetEWeaponDir(eweapon wpn) πŸ”— Source

Set the weapon’s direction based on its angle; Can also makes weapons unblockable


void SetEWeaponRotation(eweapon wpn) πŸ”— Source

Flip the weapon’s sprite to match its direction


void SetEWeaponRotation(eweapon wpn, int dir) πŸ”— Source

Flip the weapon’s sprite to match the given direction


void KillEWeapon(eweapon wpn) πŸ”— Source

Kill an eweapon, triggering any death effects


void DrawEWeaponShadow(eweapon wpn) πŸ”— Source

Draw a shadow under an eweapon


int GetDefaultEWeaponSprite(int weaponID) πŸ”— Source

Get the standard sprite for this weapon type


int GetDefaultEWeaponSound(int weaponID) πŸ”— Source

Find the sound normally made by weapons of this type


eweapon GetAssociatedEWeapon(int weaponID) πŸ”— Source

Use this in a script started on eweapon death to find the weapon that created it


bool IsGhostZHEWeapon(eweapon wpn) πŸ”— Source

Is this a ghost.zh-controlled weapon?


bool IsDummyEWeapon(eweapon wpn) πŸ”— Source

Is this a dummy weapon?


void __CopyEWeapon(eweapon prototype, int centerX, int centerY, int angle) πŸ”— Source

Make a copy of the given eweapon, which should be a dummy


int __UnblockableDir(int dir) πŸ”— Source

Get the unblockable version (8-15) of a direction