Path: blob/main/Scripts/R7/KabasiraShot.txt
1319 views
//---------------Sonic CD Kabasira Shot Script----------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// Aliases5// Value0 is skipped over6#alias Object.Value1 : Object.XVelocity7#alias Object.Value2 : Object.YVelocity89// Global SFX10#alias 22 : SFX_G_EXPLOSION1112#alias 0 : DIRECTION_RIGHT13#alias 1 : DIRECTION_LEFT141516sub ObjectMain17// Update movement18Object.XPos += Object.XVelocity19Object.YPos += Object.YVelocity2021if Object.OutOfBounds == true22Object.Type = TypeName[Blank Object]23end if2425end sub262728sub ObjectPlayerInteraction29PlayerObjectCollision(C_TOUCH, -6, -6, 6, 6)3031if CheckResult == true32if Player.Animation == ANI_JUMPING33ResetObjectEntity(Object.EntityNo, TypeName[Explosion], 0, Object.XPos, Object.YPos)34PlaySfx(SFX_G_EXPLOSION, false)35else36if Player.Animation == ANI_SPINDASH37ResetObjectEntity(Object.EntityNo, TypeName[Explosion], 0, Object.XPos, Object.YPos)38PlaySfx(SFX_G_EXPLOSION, false)39else40// The player's not in an attacking animation, go ahead and hurt them41CallFunction(Player_Hit)42end if43end if44end if4546end sub474849sub ObjectDraw50// Use different sprites based on the shot's direction51if Object.PropertyValue == DIRECTION_RIGHT52// Going right!5354DrawSpriteFX(0, FX_INK, Object.XPos, Object.YPos)55DrawSpriteFX(1, FX_INK, Object.XPos, Object.YPos)56else57// Heading left!5859DrawSpriteFX(2, FX_INK, Object.XPos, Object.YPos)60DrawSpriteFX(3, FX_INK, Object.XPos, Object.YPos)61end if6263end sub646566sub ObjectStartup6768LoadSpriteSheet("R7/Objects.gif")6970// 0-1 - Going Right Frames71SpriteFrame(-8, -8, 16, 16, 133, 100)72SpriteFrame(-8, -6, 8, 8, 243, 101)7374// 2-3 - Going Left Frames75SpriteFrame(-8, -8, 16, 16, 201, 100)76SpriteFrame( 4, -6, 8, 8, 240, 65)7778end sub798081// ========================82// Editor Subs83// ========================8485sub RSDKDraw86if Object.PropertyValue == DIRECTION_RIGHT87DrawSpriteFX(0, FX_INK, Object.XPos, Object.YPos)88DrawSpriteFX(1, FX_INK, Object.XPos, Object.YPos)89else90DrawSpriteFX(2, FX_INK, Object.XPos, Object.YPos)91DrawSpriteFX(3, FX_INK, Object.XPos, Object.YPos)92end if93end sub949596sub RSDKLoad97LoadSpriteSheet("R7/Objects.gif")9899SpriteFrame(-8, -8, 16, 16, 133, 100)100SpriteFrame(-8, -6, 8, 8, 243, 101)101102SpriteFrame(-8, -8, 16, 16, 201, 100)103SpriteFrame( 4, -6, 8, 8, 240, 65)104105// Although used by the object, this object shouldn't even be placed in the scene at all106// (i still set up a object preview for it anyway though :)107SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")108end sub109110111