Modding MI

Character Modding
          Character Health
               Protagonist Health
               NPC Health
               Jesus Health
          Weapon-Determined Costumes
          Health Bars
               Colour-Changing Health Bars



Character Health

Protagonist Health
Frame 6 / pgen (mc.guy)
Line 436
if (_root.matrix) {
     health=40;
} else {
     health=10;
}

The top "health=" is when you're in the Matrix minigame.
The second "health=" is whenever you aren't in the Matrix minigame.
That's because in the Matrix minigame, you have more health. Obviously.


NPC Health:
Frame 6 / pgen (mc.guy)
Line 460
health=3;


Jesus Health:
Frame 6 / pgen (mc.guy)
Line 469
if (_root.maingame) {
     health=175;
} else {
     health=25;
}

The top "health=" is when you're is in the main game.
The second "health=" is whenever you aren't in the main game (which means you're in the Zombies minigame).
That's because in the main game, Jesus has more health. Obviously.


Weapon-Determined Costumes
Use this if you want the type of weapon an enemy is carrying to determine what sort of enemy they are.

Frame 6 / pgen (mc.guy)
Line 456
} else if (!_root.maingame) {
     hat=beard=glasses=suit=1;
}

Replace with:

} else{
     if(guntype == #GUN#){
          hat=#HAT#;
          beard=#BEARD#;
          glasses=#GLASSES#;
          suit=#SUIT#;
     }
     else{
          hat=beard=glasses=suit=1;
     }
}

#WEAPON# is the guntype that you want to determine the costume.
#COSTUMES# are what you want the costumes to become when enemies are holding that gun.

To make more guns point to that combination of costumes, simple add an or onto the end of the guntypes.

} else{
     if(guntype == #GUN# || guntype == #GUN#){
          hat=#HAT#;
          beard=#BEARD#;
          glasses=#GLASSES#;
          suit=#SUIT#;
     }
     else{
          hat=beard=glasses=suit=1;
     }
}

To add more choices, add another if statement.

} else{
     if(guntype == #GUN#){
          hat=#HAT#;
          beard=#BEARD#;
          glasses=#GLASSES#;
          suit=#SUIT#;
     }
     else if(guntype == #GUN#){
          hat=#HAT#;
          beard=#BEARD#;
          glasses=#GLASSES#;
          suit=#SUIT#;
     }
     else{
          hat=beard=glasses=suit=1;
     }
}


Health Bars
Use this if you want people to have Health Bars.

Frame 6 / pgen (mc.guy)
Line 495
     }
}
onClipEvent (enterFrame) {

Replace that with:

     }
     HealthBarHealth = health;
     HealthBarWidth = 75;
     HealthBarHeight = 10;
     HealthBarColour = 0x3399FF;
}
onClipEvent (enterFrame) {
     clear();
     if(health > 0){
          this.beginFill(HealthBarColour);
          this.moveTo(-(HealthBarWidth/2),-105-HealthBarHeight);
          this.lineTo(((health/HealthBarHealth)*HealthBarWidth)-(HealthBarWidth/2),-105-HealthBarHeight);
          this.lineTo(((health/HealthBarHealth)*HealthBarWidth)-(HealthBarWidth/2),-105);
          this.lineTo(-(HealthBarWidth/2),-105);
          this.lineTo(-(HealthBarWidth/2),-105-HealthBarHeight);
          this.endFill();
     }
     this.lineStyle(2,0x000000);
     this.moveTo(-(HealthBarWidth/2),-105-HealthBarHeight);
     this.lineTo(HealthBarWidth/2,-105-HealthBarHeight);
     this.lineTo(HealthBarWidth/2,-105);
     this.lineTo(-(HealthBarWidth/2),-105);
     this.lineTo(-(HealthBarWidth/2),-105-HealthBarHeight);

Frame 6 / pgen (mc.guy)
Line 545
if (_root.invincibility || entertimer>0) {
     health=10000000;
} else if (health>100000) {
     health=10;
}

Replace that with:

if (_root.invincibility || entertimer>0) {
     health=10000000;
     HealthBarHealth = health;
} else if (health>100000) {
     health=10;
     HealthBarHealth = health;
}

HealthBarHealth you shouldn't edit. It finds out the Total Health of the character.
HealthBarWidth is how wide you want the Health Bar to be.
HealthBarHeight is how tall you want the Health Bar to be.
HealthBarColour is what colour you want the Health Bar to be. It is 0x and then the Hexadecimal number.      Example: 0xFF6600

For help with finding certain colours in Hexadecimal, go to the Hexadecimal Colour Chart.


Colour-Changing Health Bars
Use this if you want people to have Health Bars that change colour depending on how much damage they have taken.
Follow the steps desribed in the Health Bars section, and then go on to do what this section says.

Frame 6 / pgen (mc.guy)
Line 499
HealthBarColour = 0x3399FF;

Replace that with:

HealthBarColour_Fine = 0x00CC00;
HealthBarColour_Hurt = 0xCCCC00;
HealthBarColour_VeryHurt = 0xCC0000;

Frame 6 / pgen (mc.guy)
Line 503
if(health > 0){
     this.beginFill(HealthBarColour);

Replace that with:

if(health > 0){
     if(health/HealthBarHealth >= .75){
          this.beginFill(HealthBarColour_Fine);
     }
     else if(health/HealthBarHealth >= .5){
          this.beginFill(HealthBarColour_Hurt);
     }
     else{
          this.beginFill(HealthBarColour_VeryHurt);
     }

HealthBarColour_Fine is what colour you want the Health Bar to be when the health is above 75%.
HealthBarColour_Hurt is what colour you want the Health Bar to be when the health is above 50% and below 75%.
HealthBarColour_VeryHurt is what colour you want the Health Bar to be when the health is below 50%.

All those colours are 0x and then the Hexadecimal number.      Example: 0xFF6600

For help with finding certain colours in Hexadecimal, go to the Hexadecimal Colour Chart.