Path: blob/master/Sonic 2/Scripts/CPZ/Fireball.txt
1480 views
// ----------------------------------1// RSDK Project: Sonic 22// Script Description: Fireball Object3// Script Author: Christian Whitehead/Simon Thomley4// Unpacked by Rubberduckycooly's script unpacker5// ----------------------------------67// ========================8// Function Declarations9// ========================1011reserve function Fireball_DebugDraw12reserve function Fireball_DebugSpawn131415// ========================16// Function Definitions17// ========================1819private function Fireball_DebugDraw20DrawSprite(0)21end function222324private function Fireball_DebugSpawn25CreateTempObject(TypeName[Fireball], 0, object.xpos, object.ypos)26end function272829// ========================30// Events31// ========================3233event ObjectUpdate34object.drawOrder = 53536object.animationTimer++37if object.animationTimer >= 1238object.animationTimer = 039end if40object.frame = object.animationTimer41object.frame >>= 242GetBit(object.direction, object.animationTimer, 1)4344foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)45BoxCollisionTest(C_TOUCH, object.entityPos, -8, -8, 8, 8, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)46if checkResult == true47CallFunction(Player_FireHit)48end if49next50end event515253event ObjectDraw54DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos)55end event565758event ObjectStartup59LoadSpriteSheet("CPZ/Objects.gif")60SpriteFrame(-6, -23, 12, 28, 5, 161)61SpriteFrame(-6, -26, 13, 31, 18, 158)62SpriteFrame(-5, -27, 14, 32, 32, 157)6364SetTableValue(TypeName[Fireball], DebugMode_ObjCount, DebugMode_TypesTable)65SetTableValue(Fireball_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable)66SetTableValue(Fireball_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable)67DebugMode_ObjCount++68end event697071// ========================72// Editor Events73// ========================7475event RSDKDraw76DrawSprite(0)77end event787980event RSDKLoad81LoadSpriteSheet("CPZ/Objects.gif")82SpriteFrame(-6, -23, 12, 28, 5, 161)8384SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")85end event868788