From: misomosi Date: Tue, 1 Sep 2026 23:56:30 +0000 (-0400) Subject: Add initial CAV RA Script X-Git-Url: http://git.misomosispi.com/?a=commitdiff_plain;h=4d7d5788dc58578d6f160e6835ac3919175f04af;p=radev.git Add initial CAV RA Script --- diff --git a/CastlevaniaTheAdventure/CAV.rascript b/CastlevaniaTheAdventure/CAV.rascript new file mode 100644 index 0000000..6ebe393 --- /dev/null +++ b/CastlevaniaTheAdventure/CAV.rascript @@ -0,0 +1,29 @@ +// Castlevania: The Adventure +// #ID = 689 + + +CandleStart = 0xc580 +CandleSize = 32 +CandleStatusActive = 0x0280 +CandleStatusInactive = 0x0000 +MaxCandleActive = 4 +function StageNumber() { return byte(0xc02b) } +function Candle(i) { return CandleStart + i * CandleSize } +function CandleStatus(i) { return word(Candle(i) + 0) } +function CandleID(i) { return byte(Candle(i) + 28) } + +gCandleID = 0 +function gCheckItemCollected(index) { + return once( + ((prev(CandleStatus(index))-CandleStatus(index))*256+CandleID(index)) == (CandleStatusActive-CandleStatusInactive)*256+gCandleID + ) +} +function gCheckCandleCollected(id) { + gCandleID = id + return any_of(range(0, 4), gCheckItemCollected) +} +function CheckAllCandles() { + return all_of(range(0, 4), gCheckCandleCollected) +} +achievement(title = "RATools Test", description = "Get the Candle", points = 0, + trigger = CheckAllCandles()) \ No newline at end of file