Mummy: Difference between revisions

2,168 bytes added ,  5 days ago
no edit summary
No edit summary
No edit summary
 
Line 10:
 
See [[Zombie#RAM map]].
 
== Pseudocode ==
 
updateAnimation() {
this.cyclesUntilAnimUpdate -= 1
if (this.cyclesUntilAnimUpdate == 0) {
this.cyclesUntilAnimUpdate = 4
this.animationFrame = (this.animationFrame + 1) % 4
this.sprite.tileData.lowBytes = this.animations[this.direction][this.animationFrame]
this.sprite.tileData.bank = 0x90
if (this.direction < DOWN_LEFT) {
this.sprite.flipX = false
} else {
this.sprite.flipX = true
}
}
}
animations = {
{ 0xE1D4, 0xE1FD, 0xE226, 0xE24F },
{ 0xE278, 0xE2A1, 0xE2CA, 0xE2F3 },
{ 0xE118, 0xE149, 0xE172, 0xE1A3 },
{ 0xE118, 0xE149, 0xE172, 0xE1A3 },
{ 0xE118, 0xE149, 0xE172, 0xE1A3 },
{ 0xE1D4, 0xE1FD, 0xE226, 0xE24F },
{ 0xE118, 0xE149, 0xE172, 0xE1A3 },
{ 0xE118, 0xE149, 0xE172, 0xE1A3 },
{ 0xE118, 0xE149, 0xE172, 0xE1A3 }
}
init() {
{{ROM name|$81:8000}}()
this.animationFrame = 0
this.freezeTimer = 0
this.x = args.x
this.sprite.x = args.x
this.sprite.z = 0
this.y = args.y
this.sprite.y = args.y
this.sprite.tileData = $90:E118
this.sprite.alternatePalette = 6
this.sprite.visible = true
}
main() {
{{ROM name|$7E:00DE}} += 0x14
this.cyclesUntilAnimUpdate = 7
this.init()
{{ROM name|$81:832C}}(this.spawnAnimation)
this.sprite.type = MONSTER
zombie.wanderInRandomDirection_Hard()
this.health = 4
this.dontTargetTimer = -1
{{ROM name|$80:8475}}(zombie.collisionHandler)
this.deathStatus = 0
while (this.deathStatus == 0) {
{{ROM name|$80:8353}}(2)
zombie.checkForTarget_Hard()
this.state()
this.updateAnimation()
}
if (this.deathStatus == 0xF5F5) {
{{RAM name|$7E:1F66}} += 1
{{ROM name|$81:83A3}}(this.deathAnimation, this.deathStatus, 0x90)
}
{{ROM name|$7E:00DE}} -= 0x14
while ({{ROM name|$7E:00DE}} < 0) { }
{{ROM name|$80:BE41}}(this.sprite)
}
spawnAnimation = {
{ 0xE31C, 14 }, { 0xE35D, 14 }, { 0xE39E, 10 }, { 0xE1D4, 6 },
{ 0, 0 }
}
deathAnimation = {
{ 0xDDC2, 5 }, { 0xDDDB, 5 }, { 0xDE0C, 5 }, { 0xDE3D, 5 },
{ 0xDE66, 5 }, { 0xDE8F, 5 }, { 0xDEA8, 5 }, { 0xDEC1, 5 },
{ 0xDED2, 5 }, { 0xDEE3, 5 }, { 0xDEF4, 5 }, { 0, 0 }
}
 
[[Category:Respawning monster]]