-- name: Wormys Big Mario Mod! -- description: an example of big mario and small mario powerups local BigmarioTimer = 0 local BigmarioDuration = 1600 * 20 local minimarioTimer = 0 local minimarioDuration = 1600 * 20 local prev_area = 1 local wasontreeDuration = 5 * 20 local justtouchedtree = false local justtouchedtreeTimer = 0 function mario_update(m) if (m.controller.buttonPressed & U_JPAD) ~= 0 then BigmarioTimer = BigmarioDuration minimarioTimer = 0 end if (m.controller.buttonPressed & D_JPAD) ~= 0 then minimarioTimer = minimarioDuration BigmarioTimer = 0 end if BigmarioTimer > 0 then BigmarioTimer = BigmarioTimer - 1 m.invincTimer = 1 m.health = 0x800 m.marioObj.header.gfx.scale.x = 4 m.marioObj.header.gfx.scale.y = 4 m.marioObj.header.gfx.scale.z = 4 big_mario_instant_kill(m) elseif minimarioTimer > 0 then if m.faceAngle.x == 0 then m.vel.y = m.vel.y + 1 end peakHeight = 0 minimarioTimer = minimarioTimer - 1 m.marioObj.header.gfx.scale.x = 0.4 m.marioObj.header.gfx.scale.y = 0.4 m.marioObj.header.gfx.scale.z = 0.4 m.hurtCounter = 0 if m.area.index ~= prev_area then m.peakHeight = m.peakHeight + 32000 * (prev_area - m.area.index) prev_area = m.area.index end else m.marioObj.header.gfx.scale.x = 1 m.marioObj.header.gfx.scale.y = 1 m.marioObj.header.gfx.scale.z = 1 end end function big_mario_instant_kill(m) if m.action == ACT_FLAG_ON_POLE or m.action == ACT_CLIMBING_POLE or m.action == ACT_GRAB_POLE_FAST or m.action == ACT_GRAB_POLE_SLOW and justtouchedtree then set_mario_action(m, ACT_FLAG_AIR, 0) justtouchedtree = false end local targets = { id_bhvGoomba, id_bhvBobomb, id_bhvKoopa, id_bhvFlyGuy, id_bhvMontyMole, id_bhvSpindrift, id_bhvBoo, id_bhvGhostHuntBoo, id_bhvBooInCastle, id_bhvBooWithCage, id_bhvMerryGoRoundBoo, id_bhvFlyingBookend, id_bhvSkeeter, id_bhvMoneybag, id_bhvSnufit, id_bhvSwoop, id_bhvEnemyLakitu, id_bhvSpiny, id_bhvPokey, id_bhvPokeyBodyPart, id_bhvFirePiranhaPlant, id_bhvBigBoulder, id_bhvGhostHuntBigBoo, id_bhvMerryGoRoundBigBoo, id_bhvChainChomp, id_bhvBreakableBox, id_bhvWigglerHead, id_bhvStarDoor, id_bhvHeaveHo, id_bhvSmallBully, id_bhvBigBully, id_bhvSmallChillBully, id_bhvBigChillBully, id_bhvPitBowlingBall, id_bhvPiranhaPlant, id_bhvBulletBill, id_bhvChuckya, id_bhvWhompKingBoss, id_bhvSignOnWall, id_bhvTree, id_bhvBowlingBall, id_bhvFreeBowlingBall, id_bhvBobombBuddy, id_bhvWoodenPost, id_bhvScuttlebug, id_bhvCannonBarrel, id_bhvMrI, id_bhvHomingAmp, id_bhvCannonBarrelBubbles, id_bhvCannonBarrel, id_bhvCirclingAmp, id_bhvBobombBuddyOpensCannon, id_bhvFireSpitter, id_bhvMessagePanel, id_bhvExclamationBox, id_bhvChainChompGate, id_bhvOpenableCageDoor } for _, target_behavior in ipairs(targets) do local target = cur_obj_nearest_object_with_behavior(get_behavior_from_id(target_behavior)) if target ~= nil and obj_check_hitbox_overlap(m.marioObj, target) then if target_behavior == id_bhvSmallBully or target_behavior == id_bhvBigBully or target_behavior == id_bhvSmallChillBully or target_behavior == id_bhvBigChillBully then target.oInteractStatus = target.oInteractStatus | ATTACK_FAST_ATTACK | INT_STATUS_WAS_ATTACKED | INT_STATUS_INTERACTED | ATTACK_FROM_ABOVE target.oForwardVel = 100 target.oAction = 8 target.oVelY = 30 elseif target_behavior == id_bhvBreakableBox or target_behavior == id_bhvExclamationBox then target.oInteractStatus = target.oInteractStatus | ATTACK_FAST_ATTACK | INT_STATUS_WAS_ATTACKED | INT_STATUS_INTERACTED | ATTACK_FROM_ABOVE elseif target_behavior == id_bhvHomingAmp or target_behavior == id_bhvCirclingAmp or target_behavior == id_bhvHeaveHo or target_behavior == id_bhvFireSpitter then spawn_mist_particles_with_sound(SOUND_GENERAL_BREAK_BOX) obj_mark_for_deletion(target) elseif target_behavior == id_bhvMessagePanel or target_behavior == id_bhvBigBoulder or target_behavior == id_bhvWoodenPost then spawn_mist_particles_with_sound(SOUND_GENERAL_BREAK_BOX) obj_mark_for_deletion(target) elseif target_behavior == id_bhvTree then justtouchedtree = true spawn_mist_particles_with_sound(SOUND_GENERAL_BREAK_BOX) obj_mark_for_deletion(target) elseif target_behavior == id_bhvBobomb or target_behavior == id_bhvBobombBuddy or target_behavior == id_bhvBobombBuddyOpensCannon or target_behavior == id_bhvPitBowlingBall then spawn_mist_particles_with_sound(SOUND_GENERAL2_BOBOMB_EXPLOSION) obj_mark_for_deletion(target) elseif target_behavior == id_bhvChainChomp then target.oInteractStatus = target.oInteractStatus | ATTACK_FAST_ATTACK | INT_STATUS_WAS_ATTACKED | INT_STATUS_INTERACTED | INT_STATUS_TOUCHED_BOB_OMB elseif target_behavior == id_bhvChainChompGate then spawn_mist_particles_with_sound(SOUND_GENERAL2_BOBOMB_EXPLOSION) obj_mark_for_deletion(target) elseif target_behavior == id_bhvFreeBowlingBall then target.oInteractStatus = target.oInteractStatus | ATTACK_FAST_ATTACK | INT_STATUS_WAS_ATTACKED | INT_STATUS_INTERACTED | INT_STATUS_TOUCHED_BOB_OMB target.oMoveAngleYaw = m.marioObj.oMoveAngleYaw target.oForwardVel = 100 target.oAction = 8 target.oVelY = 30 spawn_mist_particles_with_sound(SOUND_GENERAL2_BOBOMB_EXPLOSION) obj_mark_for_deletion(target) else target.oInteractStatus = target.oInteractStatus | ATTACK_FAST_ATTACK | INT_STATUS_WAS_ATTACKED | INT_STATUS_INTERACTED | INT_STATUS_TOUCHED_BOB_OMB target.oMoveAngleYaw = m.marioObj.oMoveAngleYaw target.oForwardVel = 100 target.oAction = 8 target.oVelY = 30 end end end end hook_event(HOOK_MARIO_UPDATE, mario_update)