Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "nsmb.h"
- //Where is some function!?!?!
- extern "C" {
- int getPtrToPlayerActor();
- }
- int looseSpeed = 1; //Speed of loosing coins
- int startingCoins = 50; //Coins to start with
- int warning = 15; //when warning sound appear
- int timer = 0;
- int counter = 0;
- int *Coins = (int*) (0x0208B37C);
- void hook_0200696C_main()
- {
- *Coins = startingCoins;
- }
- void hook_0211F83C_ov_0A()
- {
- if(timer == 100)
- {
- //Kill Mario if 0 coins
- MarioActor* mario = (MarioActor*)getPtrToPlayerActor();
- if(*Coins == 0)
- {
- mario->DeathState = 0x21197FC;
- *Coins = startingCoins;
- }
- //Take Coins from Mario
- if(counter == looseSpeed)
- {
- counter = 0;
- *Coins = *Coins - 1;
- }
- counter = counter + 1;
- //Play sound if Mario Low on coins
- if(*Coins < warning + 1)
- {
- PlaySNDEffect(0x13D, 0);
- }
- timer = 0;
- }
- timer = timer + 1;
- }
- void nsub_02020354()
- {
- *Coins = *Coins + 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement