TJSJ

PokeAttempt / Mon Object

Nov 14th, 2019
365
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Information about object: Mon
  2. Sprite: spr_mon_front
  3. Solid: false
  4. Visible: false
  5. Depth: 0
  6. Persistent: false
  7. Parent:
  8. Children:
  9. Mask:
  10.  
  11. No Physics Object
  12. Create Event:
  13.  
  14. execute code:
  15.  
  16. ///CREATE PLAYER ID
  17.  
  18. o = 0; // 0 is the controlling player, 1 is the opposing player !!!
  19.  
  20. CurrentPartyMember = 1;
  21.  
  22. c = CurrentPartyMember;
  23.  
  24. PlaySound = false;
  25. PlaySoundAgain = false;
  26.  
  27. m = irandom_range(0,global.MonAmount); // which pokemon are we? (note: this is changed in BattleDummy)
  28.  
  29. if instance_exists(BattleDummy) {
  30.     _xoff = BattleDummy.xoff
  31.     _yoff = BattleDummy.yoff
  32. }
  33.  
  34. visible = false;
  35.  
  36. //irandom_range(0,global.Moves);
  37.  
  38. Amp = 50;
  39. Freq = 6;
  40. DamageInflicted = 0;
  41. Waiting[0] = -1;
  42. Waiting[1] = -1;
  43. Waiting[0] = false;
  44. Waiting[1] = false;
  45. aDamageInflicted = 0;
  46. bDamageInflicted = 0;
  47. Plyr[o] = true;
  48. StoredText[0] = "text";
  49. StoredText[1] = "text";
  50. StoredText[o] = "sample text";
  51. StoredPower1 = 0;
  52. StoredPower2 = 0;
  53. Health[o] = 0;
  54. PlyrName[0] = "";
  55. PlyrHlth[0] = 0;
  56. PlyrAttk[0] = 0;
  57. PlyrDfns[0] = 0;
  58. PlyrSped[0] = 0;
  59. PlyrName[1] = "";
  60. PlyrHlth[1] = 0;
  61. PlyrAttk[1] = 0;
  62. PlyrDfns[1] = 0;
  63. PlyrSped[1] = 0;
  64. PlyrName[o] = "";
  65. PlyrHlth[o] = 0;
  66. PlyrAttk[o] = 0;
  67. PlyrDfns[o] = 0;
  68. //PlyrSped[o] = 0;
  69. aPlyrMove1 = 0;
  70. aPlyrMove2 = 0;
  71. aPlyrMove3 = 0;
  72. aPlyrMove4 = 0;
  73. bPlyrMove1 = 0;
  74. bPlyrMove2 = 0;
  75. bPlyrMove3 = 0;
  76. bPlyrMove4 = 0;
  77. MoveSelected = false;
  78. Waiting[o] = false; // are we done selecting a move?
  79. Moving[o] = false;
  80. IsDamaged[0] = false;
  81. IsDamaged[1] = false;
  82. PartyTotal[o] = 4; // default value, this is changed in BattleDummy
  83. Move[0] = 0;
  84. Move[1] = 1;
  85. Move[2] = 2;
  86. Move[3] = 3;
  87. aMoveSelected = false;
  88. bMoveSelected = false;
  89. aFainted = false;
  90. bFainted = false;
  91. aType1 = "Normal";
  92. aType2 = "";
  93. bType1 = "Normal";
  94. bType2 = "";
  95. faint = false;
  96. aCHitMod = choose(1,1,1,1,1,1,1,1,2);
  97. bCHitMod = choose(1,1,1,1,1,1,1,1,2);
  98. global.aCHitMod = aCHitMod;
  99. global.bCHitMod = bCHitMod;
  100. aCrit = false;
  101. bCrit = false;
  102. aDamage = 0;
  103. bDamage = 0;
  104. idle_phase = 0;
  105. can_idle = 0;
  106. sizeMod = 1;
  107. scaleMod = 1;
  108. damageFrameCount = 0;
  109. global.aSpecial = false;
  110. global.bSpecial = false;
  111.  
  112. for ( n=0; n<PartyTotal[o]; n++ ) {
  113.    
  114.     // PLAYER ONE
  115.     aStoredPlyrName[m,n] = "";
  116.     aStoredPlyrHlth[m,n] = 0;
  117.     aStoredPlyrHlthCache[m,n] = 0;
  118.     aStoredPlyrAttk[m,n] = 0;
  119.     aStoredPlyrDfns[m,n] = 0;
  120.     aStoredPlyrSpat[m,n] = 0;
  121.     aStoredPlyrSpdf[m,n] = 0;
  122.     aStoredPlyrSped[m,n] = 0;
  123.     aStoredPlyrMove1[m,n] = irandom_range(0,global.Moves);
  124.     aStoredPlyrMove2[m,n] = irandom_range(0,global.Moves);
  125.     aStoredPlyrMove3[m,n] = irandom_range(0,global.Moves);
  126.     aStoredPlyrMove4[m,n] = irandom_range(0,global.Moves);
  127.     aStoredPlyrFaint[m,n] = false;
  128.    
  129.     // PLAYER TWO
  130.     bStoredPlyrName[m,n] = "";
  131.     bStoredPlyrHlth[m,n] = 0;
  132.     bStoredPlyrHlthCache[m,n] = 0;
  133.     bStoredPlyrAttk[m,n] = 0;
  134.     bStoredPlyrDfns[m,n] = 0;
  135.     bStoredPlyrSpat[m,n] = 0;
  136.     bStoredPlyrSpdf[m,n] = 0;
  137.     bStoredPlyrSped[m,n] = 0;
  138.     bStoredPlyrMove1[m,n] = irandom_range(0,global.Moves);
  139.     bStoredPlyrMove2[m,n] = irandom_range(0,global.Moves);
  140.     bStoredPlyrMove3[m,n] = irandom_range(0,global.Moves);
  141.     bStoredPlyrMove4[m,n] = irandom_range(0,global.Moves);
  142.     bStoredPlyrFaint[m,n] = false;
  143.     }
  144.  
  145. if o = 0 {
  146. cx = view_xview + view_wview*0.2
  147. cy = view_yview + view_hview*0.6
  148. x = cx;
  149. y = cy;
  150. }
  151.  
  152. visible = true;
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163. /*
  164. If ((Player[a].Health > (Player[a].Health - Player[b].DamageInflicted))
  165. && Player[a].IsDamaged = true) {
  166.     Player[a].Health -= 1/128 //lose health at 1/128 rate if damaged by opponent.
  167. }
  168.  
  169. 100 > (100 - 50)
  170.       which is 50
  171.       */
  172.  
  173. Step Event:
  174.  
  175. execute code:
  176.  
  177. ///MON INSTRUCTION
  178.  
  179. /*
  180.  
  181. Notes:
  182.  
  183. look for aCrit and bCrit and check if they are false
  184. so critical hits don't softlock the game
  185.  
  186. //for moves that require custom attention to the health bar
  187.        
  188.         //for explosion
  189.         if (global.aHealth > 0 && Var.ComplexMove[global.aMoveChosen] = true && Var.ComplexMoveType[global.aMoveChosen] = "Explosion" && global.DamageActivateDelay = false && global.DamageFrame >= 6 && BattleDummy.PreAttackDelay < 0 && global.MoveDelay >= global.MoveDelayAmount) {
  190.             if global.aCHitMod = 1 {
  191.                 global.aHealth -= 4; //lose health at 1/4 rate if damaged
  192.                 }
  193.             if global.aCHitMod > 1 {
  194.                 global.aHealth -= 8;
  195.                 }
  196.             if global.aHealth < 0.5 {
  197.                 global.aHealth = 0;
  198.                 }
  199.         }
  200.  
  201. */
  202.  
  203. mon_sound(); //make sound for the mons when switching or fainting
  204.  
  205. mon_animation(); //animate sprites that have animations
  206.  
  207. mon_positioning(); //position mons on the field accordingly
  208.    
  209. if o = 0 && global.aMonPositioned = false {
  210.     visible = !visible;
  211.     }
  212.    
  213. if o = 1 && global.bMonPositioned = false {
  214.     visible = !visible;
  215.     }
  216.  
  217.  
  218. // if we are damaged at all...
  219.  
  220. // if player 1 is affected/damaged by player 2 (health not zero)
  221.  
  222. if (o = 0
  223.     && global.bFinishQueue = 0
  224.     && global.Player1Damaged = true
  225.     && global.aWaiting = true
  226.     && global.aSwitching = false) { //PRE-CONDITIONS FOR if player 1 is attacked
  227.    
  228.     if global.aHealth > 0 { //if health is not zero, decrease health by attack damage increments
  229.    
  230.         if (global.aHealth >
  231.             (aStoredPlyrHlthCache[m,c] - (global.bDamageInflicted/* * global.bMoveTypeEffect*/))
  232.             //if health is greater than damage received, times critical hit ratio, times type effectiveness
  233.             && Var.ComplexMove[global.aMoveChosen] = false
  234.             //if the move used is a regular attack (not drain, suicide, etc)
  235.             && global.DamageActivateDelay = false
  236.             //delay before damage frames occur
  237.             && global.DamageFrame >= 6
  238.             && BattleDummy.PreAttackDelay < 0
  239.             && global.MoveDelay >= global.MoveDelayAmount) {
  240.            
  241.             //decrease health normally
  242.             if global.aCHitMod = 1 {
  243.                 global.aHealth -= 4;
  244.                 }
  245.            
  246.             //decrease health faster if a critical hit
  247.             if global.aCHitMod > 1 {
  248.                 global.aHealth -= 8;
  249.                 }
  250.            
  251.             //set health to zero if a decimal less than 1
  252.             if global.aHealth < 1 {
  253.                 global.aHealth = 0;
  254.                 }
  255.        
  256.         }
  257.  
  258.         if global.aHealth <= (aStoredPlyrHlthCache[m,c] - (global.bDamageInflicted/* * global.bMoveTypeEffect*/))  {
  259.             //say you landed a critical hit once conditions have been met
  260.            
  261.             //TYPE EFFECTIVENESS MESSAGE MODULE
  262.             with(BattleDummy) {
  263.                 if PreAttackDelay <= -1 && global.bMoveTypeEffect != 1 && global.HoldOffNextMove = false {
  264.                     switch(global.bMoveTypeEffect) {
  265.                         case 4: message_text = "It's extremely effective!"; break;
  266.                        case 2: message_text = "It's super effective!"; break;
  267.                         case 0.5: message_text = "It's not very effective!"; break;
  268.                        case 0.25: message_text = "It's barely effective..."; break;
  269.                         case 0: message_text = "It doesn't affect "+string(global.aStoredPlyrName)+"..."; break;
  270.                        case -1: message_text = "The opposing "+string(global.bStoredPlyrName)+" missed!";
  271.                        }
  272.                    PreAttackDelay = 10;
  273.                    global.SideBattleText += string(message_text)+"##";
  274.                    global.HoldOffNextMove = true;
  275.                    }
  276.                if PreAttackDelay <= -1 && global.HoldOffNextMove = true && other.aCrit = false {
  277.                    global.UseDamageFrames = false;
  278.                    global.HoldOffNextMove = false;
  279.                    }
  280.                }
  281.            
  282.            //CRITICAL HIT MESSAGE MODULE
  283.            if global.aCHitMod >= 2 && aCrit = false && global.aSwitching = false && global.aFaintAction = false && BattleDummy.PreAttackDelay <= 0 && global.bMoveTypeEffect = 1 {
  284.                global.HoldOffNextMove = true;
  285.                with(BattleDummy) {
  286.                    PreAttackDelay = 10;
  287.                    message_text = "The opposing "+string(global.bStoredPlyrName)+" landed a critical hit!";
  288.                    global.SideBattleText += string(message_text)+"##";
  289.                    }
  290.                aCrit = true;
  291.                }
  292.            if BattleDummy.PreAttackDelay <= 0 && aCrit = true {
  293.                global.HoldOffNextMove = false;
  294.                aCrit = false;
  295.                }
  296.            if global.HoldOffNextMove = false && aCrit = false { //RESET
  297.                global.bFinishQueue = 1; // FINISH PLAYER 2 TURN !!!!!
  298.                global.aDamageFrame = false;
  299.                global.MoveDelay = 0;
  300.                global.DamageFrame = 0;
  301.                if global.Player2Moving = true {
  302.                    global.Player2Moving = false;
  303.                    global.Player2DoneMoving = true;
  304.                    }
  305.                global.PlayHitSfx = false;
  306.                global.Player1Damaged = false;
  307.                global.CalcCrit = false;
  308.                global.aMoveTypeEffect = 1;
  309.                global.bMoveTypeEffect = 1;
  310.            }
  311.        }
  312.    
  313.    }
  314.    
  315.    if global.aHealth <= 0 && global.aComplexMove = false {    
  316.        //Pokemon faints, pauses turn until player either switches manually or automatically
  317.        with(BattleDummy) {
  318.            if global.aFainted = false {
  319.                PreAttackDelay = 10;
  320.                }
  321.            }
  322.        global.aFainted = true;
  323.        if (image_yscale > 0 && BattleDummy.PreAttackDelay < 0 && !audio_is_playing(sfx)) {
  324.            image_yscale -= 0.33*scaleMod;
  325.            if faint = false {
  326.                audio_play_sound(Var.SndFaint,1,false);
  327.                faint = true;
  328.                }
  329.            }
  330.        if image_yscale <= 0 && aStoredPlyrFaint[m,c] = false {
  331.        
  332.            visible = false;
  333.            
  334.            with(BattleDummy) {
  335.                
  336.                //when a critical hit is landed right before fainting
  337.                if other.aCrit = true {
  338.                    message_text = "The opposing "+string(global.bStoredPlyrName)+" landed a critical hit!";
  339.                    global.SideBattleText += string(message_text)+"##";
  340.                    PreAttackDelay = 10;
  341.                    other.aCrit = false;
  342.                    }
  343.                
  344.                //faint message
  345.                if other.aCrit = false && PreAttackDelay <= 0 && other.aStoredPlyrFaint[other.m,other.c] = false {
  346.                    message_text = string(global.aStoredPlyrName)+" fainted!";
  347.                    global.SideBattleText += string(message_text)+"##";
  348.                    global.aMonPositioned = false;
  349.                    global.text_rand = irandom_range(0,8);
  350.                    PreAttackDelay = 10;
  351.                    other.aStoredPlyrFaint[other.m,other.c] = true;
  352.                    global.bDamageInflicted = 0;
  353.                    global.aSpecial = false;
  354.                    }
  355.                
  356.                }
  357.                
  358.            if global.aFaintAction = true {
  359.                global.aHealth = 2;
  360.                //global.bFinishQueue = 1;
  361.            }
  362.        }
  363.        
  364.        if image_yscale <= 0 && aStoredPlyrFaint[m,c] = true && BattleDummy.PreAttackDelay < 1 && aCrit = false {
  365.            global.aSwitching = true;
  366.            global.aFaintAction = true;
  367.            global.Player1Score += 1;
  368.            instance_destroy();
  369.            }
  370.    
  371.    }
  372.    
  373.    if global.aHealth <= 0 && global.aComplexMove = true {
  374.        ComplexMoveCheck();
  375.    }
  376.    
  377.    }
  378.  
  379. // if player 2 is affected/damaged by player 1 (health not zero)
  380. if (o = 1 && global.aFinishQueue = 0 && global.Player2Damaged = true && global.bWaiting = true && global.bSwitching = false) {
  381.  
  382.    if global.bHealth > 0 {
  383.    
  384.        if (global.bHealth > (bStoredPlyrHlthCache[m,c] - (global.aDamageInflicted)) && global.DamageActivateDelay = false && global.DamageFrame >= 6 && BattleDummy.PreAttackDelay < 0 && global.MoveDelay >= global.MoveDelayAmount) {
  385.            if global.bCHitMod = 1 {
  386.                global.bHealth -= 4; //lose health at 1/4 rate if damaged
  387.                }
  388.            if global.bCHitMod > 1 {
  389.                global.bHealth -= 8;
  390.                }
  391.            if global.bHealth < 0.5 {
  392.                global.bHealth = 0;
  393.                }
  394.        }
  395.        
  396.        if global.bHealth <= (bStoredPlyrHlthCache[m,c] - (global.aDamageInflicted))  {
  397.            
  398.            //TYPE EFFECTIVENESS MESSAGE MODULE
  399.            with(BattleDummy) {
  400.                if PreAttackDelay <= -1 && global.aMoveTypeEffect != 1 && global.HoldOffNextMove = false {
  401.                    switch(global.aMoveTypeEffect) {
  402.                        case 4: message_text = "It's extremely effective!"; break;
  403.                         case 2: message_text = "It's super effective!"; break;
  404.                        case 0.5: message_text = "It's not very effective!"; break;
  405.                         case 0.25: message_text = "It's barely effective..."; break;
  406.                        case 0: message_text = "It doesn't affect the opposing "+string(global.bStoredPlyrName)+"..."; break;
  407.                         case -1: message_text = string(global.aStoredPlyrName)+" missed!";
  408.                         }
  409.                     PreAttackDelay = 10;
  410.                     global.SideBattleText += string(message_text)+"##";
  411.                     global.HoldOffNextMove = true;  
  412.                     }
  413.                 if PreAttackDelay <= 0 && global.HoldOffNextMove = true && other.bCrit = false {
  414.                     global.UseDamageFrames = false;
  415.                     global.HoldOffNextMove = false;
  416.                     global.Player1Moving = false;
  417.                     global.Player1DoneMoving = true;
  418.                     }
  419.                 }
  420.            
  421.             //CRITICAL HIT MESSAGE MODULE
  422.             if global.bCHitMod >= 2 && bCrit = false && global.bSwitching = false && global.bFaintAction = false && BattleDummy.PreAttackDelay <= 0 && global.aMoveTypeEffect = 1 {
  423.                 global.HoldOffNextMove = true;
  424.                 with(BattleDummy) {
  425.                     PreAttackDelay = 10;
  426.                     message_text = "A critical hit!";
  427.                     global.SideBattleText += string(message_text)+"##";
  428.                     }
  429.                 bCrit = true;
  430.                 }
  431.             if BattleDummy.PreAttackDelay <= 0 && bCrit = true {
  432.                 global.HoldOffNextMove = false;
  433.                 bCrit = false;
  434.                 }
  435.             if global.HoldOffNextMove = false && bCrit = false {
  436.                 global.aFinishQueue = 1; // FINISH PLAYER 1 TURN !!!!!  && global.aStoredPlyrStatusChecked = true
  437.                 global.bDamageFrame = false;
  438.                 global.MoveDelay = 0;
  439.                 global.DamageFrame = 0;
  440.                 if global.Player1Moving = true {
  441.                     global.Player1Moving = false;
  442.                     global.Player1DoneMoving = true;
  443.                     }
  444.                 global.PlayHitSfx = false;
  445.                 global.Player2Damaged = false;
  446.                 global.CalcCrit = false;
  447.                 global.aMoveTypeEffect = 1;
  448.                 global.bMoveTypeEffect = 1;
  449.             }
  450.         }
  451.        
  452.     }
  453.    
  454.     if global.bHealth <= 0 && global.bComplexMove = false {    
  455.         //Pokemon faints, pauses turn until player either switches manually or automatically
  456.         with(BattleDummy) {
  457.             if global.bFainted = false {
  458.                 PreAttackDelay = 10;
  459.                 }
  460.             }
  461.         global.bFainted = true;
  462.         if (image_yscale > 0 && BattleDummy.PreAttackDelay < 0 && !audio_is_playing(sfx)) {
  463.             image_yscale -= 0.25*scaleMod;
  464.             if faint = false {
  465.                 audio_play_sound(Var.SndFaint,1,false);
  466.                 faint = true;
  467.                 }
  468.             }
  469.         if image_yscale <= 0 && bStoredPlyrFaint[m,c] = false {
  470.            
  471.             with(BattleDummy) {
  472.                
  473.                 if other.bCrit = true {
  474.                     message_text = "A critical hit!";
  475.                     global.SideBattleText += string(message_text)+"##";
  476.                     PreAttackDelay = 10;
  477.                     other.bCrit = false;
  478.                     }
  479.                
  480.                 if other.bCrit = false && PreAttackDelay <= 0 && other.bStoredPlyrFaint[other.m,other.c] = false {
  481.                     message_text = "The opposing "+string(global.bStoredPlyrName)+" fainted!";
  482.                     global.SideBattleText += string(message_text)+"##";
  483.                     global.bMonPositioned = false;
  484.                     PreAttackDelay = 10;
  485.                     other.bStoredPlyrFaint[other.m,other.c] = true;
  486.                     global.aDamageInflicted = 0;
  487.                     global.bSpecial = false;
  488.                     }
  489.                    
  490.                 }
  491.                
  492.                 if bCrit = false {
  493.                    
  494.                 }
  495.                
  496.             if global.bFaintAction = true {
  497.                 global.bHealth = 2;
  498.                 //global.aFinishQueue = 1;
  499.             }
  500.         }
  501.            
  502.         if image_yscale <= 0 && bStoredPlyrFaint[m,c] = true && BattleDummy.PreAttackDelay < 1 && bCrit = false {
  503.             global.bSwitching = true;
  504.             global.bFaintAction = true;
  505.             global.Player2Score += 1;
  506.             instance_destroy();
  507.             }
  508.    
  509.     }
  510.    
  511.     if global.bHealth <= 0 && global.bComplexMove = true {
  512.         ComplexMoveCheck();
  513.     }
  514.    
  515.     }
  516.  
  517. if (global.aWaiting = 0 && o = 0 && global.aSpecial = false) {
  518.     Freq += 14;
  519.     y = ystart + Amp*sin(Freq * pi / 360);
  520.     }
  521.  
  522. if (o = 0 && global.Player1DoneMoving = true && global.Player2DoneMoving = true/*global.aWaiting = false*/) {
  523.     aStoredPlyrHlthCache[m,c] = global.aHealth;
  524.     }
  525.  
  526. if (o = 1 && global.Player1DoneMoving = true && global.Player2DoneMoving = true/*global.bWaiting = false*/) {
  527.     bStoredPlyrHlthCache[m,c] = global.bHealth;
  528.     }
  529.  
  530. execute code:
  531.  
  532. ///TYPE EFFECTIVENESS
  533.  
  534. /*
  535. if o = 0 && global.Player2Moving = true && global.Player1TypeCalculated = false {
  536.     defender_type_matchup_plyr1_type1();
  537.     global.Player1TypeCalculated = true;
  538.     }
  539.    
  540. if o = 0 && global.Player1Moving = true && global.Player1TypeCalculated = false {
  541.     global.Player1TypeCalculated = false;
  542.     }
  543.    
  544. if o = 1 && global.Player1Moving = true && global.Player2TypeCalculated = false {
  545.     defender_type_matchup_plyr2_type1();
  546.     global.Player2TypeCalculated = true;
  547.     }
  548.    
  549. if o = 1 && global.Player2Moving = true && global.Player2TypeCalculated = false {
  550.     global.Player2TypeCalculated = false;
  551.     }
  552.  
  553.  
  554. execute code:
  555.  
  556. ///IDLE ANIMATIONS
  557.  
  558. /*if (m = 5 || m = 16) {
  559.     switch(o) {
  560.         case 0: global.aSpecial = true;
  561.         case 1: global.bSpecial = true;
  562.         }
  563.     }*/
  564.  
  565. if m = 5 {
  566.     if o = 0 {
  567.         sprite_index = shrek_back;
  568.         if global.aHealth < global.aStoredPlyrHlth/1.5 {
  569.             image_speed = 0.60;
  570.             global.aStoredPlyrAttk = Var.AttkId[m]*3;
  571.             global.aStoredPlyrSped = Var.SpedId[m]*3;
  572.             global.aMadPhase = true;
  573.             } else {
  574.             image_speed = 0.35;
  575.             global.aStoredPlyrAttk = Var.AttkId[m];
  576.             global.aStoredPlyrSped = Var.SpedId[m];
  577.             global.aMadPhase = false;
  578.             }
  579.         }
  580.     if o = 1 {
  581.         sprite_index = shrek_front;
  582.         if global.bHealth < global.bStoredPlyrHlth/1.5 {
  583.             image_speed = 0.60;
  584.             global.bStoredPlyrAttk = Var.AttkId[m]*3;
  585.             global.bStoredPlyrSped = Var.SpedId[m]*3;
  586.             global.bMadPhase = true;
  587.             } else {
  588.             image_speed = 0.35;
  589.             global.bStoredPlyrAttk = Var.AttkId[m];
  590.             global.bStoredPlyrSped = Var.SpedId[m];
  591.             global.bMadPhase = false;
  592.             }
  593.         }
  594.     }
  595.    
  596. if m = 6 {
  597.     if o = 0 {
  598.         sprite_index = baldi_back;
  599.         if global.aHealth < global.aStoredPlyrHlth/1.5 {
  600.             image_speed = 0.60;
  601.             global.aStoredPlyrAttk = Var.AttkId[m]*4;
  602.             global.aStoredPlyrSped = Var.SpedId[m]*4;
  603.             global.aStoredPlyrSpat = Var.SpatId[m]*4;
  604.             global.aStoredPlyrDfns = Var.DfnsId[m]*2;
  605.             global.aStoredPlyrSpat = Var.SpatId[m]*2;
  606.             global.aMadPhase = true;
  607.             } else {
  608.             image_speed = 0.30;
  609.             global.aStoredPlyrAttk = Var.AttkId[m];
  610.             global.aStoredPlyrSped = Var.SpedId[m];
  611.             global.aStoredPlyrSpat = Var.SpatId[m];
  612.             global.aStoredPlyrDfns = Var.DfnsId[m];
  613.             global.aStoredPlyrSpat = Var.SpatId[m];
  614.             global.aMadPhase = false;
  615.             }
  616.         }
  617.     if o = 1 {
  618.         sprite_index = baldi_front;
  619.         if global.bHealth < global.bStoredPlyrHlth/1.5 {
  620.             image_speed = 0.60;
  621.             global.bStoredPlyrAttk = Var.AttkId[m]*4;
  622.             global.bStoredPlyrSped = Var.SpedId[m]*4;
  623.             global.bStoredPlyrSpat = Var.SpatId[m]*4;
  624.             global.bStoredPlyrDfns = Var.DfnsId[m]*2;
  625.             global.bStoredPlyrSpat = Var.SpatId[m]*2;
  626.             global.bMadPhase = true;
  627.             } else {
  628.             image_speed = 0.30;
  629.             global.bStoredPlyrAttk = Var.AttkId[m];
  630.             global.bStoredPlyrSped = Var.SpedId[m];
  631.             global.bStoredPlyrSpat = Var.SpatId[m];
  632.             global.bStoredPlyrDfns = Var.DfnsId[m];
  633.             global.bStoredPlyrSpat = Var.SpatId[m];
  634.             global.bMadPhase = false;
  635.             }
  636.         }
  637.     }
  638.    
  639. if m = 27 {
  640.     if o = 0 {
  641.         sprite_index = blooper_back;
  642.         }
  643.     if o = 1 {
  644.         sprite_index = blooper_front;
  645.         }
  646.     image_speed = 0.30;
  647.     }
  648.    
  649. if m = 28 {
  650.     if o = 0 {
  651.         sprite_index = petey_back;
  652.         if global.aHealth < global.aStoredPlyrHlth/1.5 {
  653.             image_speed = 0.60;
  654.             global.aStoredPlyrAttk = Var.AttkId[m]*3;
  655.             global.aStoredPlyrSped = Var.SpedId[m]*3;
  656.             global.aMadPhase = true;
  657.             } else {
  658.             image_speed = 0.30;
  659.             global.aStoredPlyrAttk = Var.AttkId[m];
  660.             global.aStoredPlyrSped = Var.SpedId[m];
  661.             global.aMadPhase = false;
  662.             }
  663.         }
  664.     if o = 1 {
  665.         sprite_index = petey_front;
  666.         if global.bHealth < global.bStoredPlyrHlth/1.5 {
  667.             image_speed = 0.60;
  668.             global.bStoredPlyrAttk = Var.AttkId[m]*3;
  669.             global.bStoredPlyrSped = Var.SpedId[m]*3;
  670.             global.bMadPhase = true;
  671.             } else {
  672.             image_speed = 0.30;
  673.             global.bStoredPlyrAttk = Var.AttkId[m];
  674.             global.bStoredPlyrSped = Var.SpedId[m];
  675.             global.bMadPhase = false;
  676.             }
  677.         }
  678.     }
  679.    
  680. if m = 30 {
  681.     if o = 0 {
  682.         sprite_index = bill_cipher_back;
  683.         if global.aHealth < global.aStoredPlyrHlth/2 {
  684.             image_speed = 0.40;
  685.             global.aStoredPlyrSpat = Var.SpatId[m]*3;
  686.             global.aStoredPlyrSped = Var.SpedId[m]*3;
  687.             global.aMadPhase = true;
  688.             } else {
  689.             image_speed = 0.21;
  690.             global.aStoredPlyrSpat = Var.SpatId[m];
  691.             global.aStoredPlyrSped = Var.SpedId[m];
  692.             global.aMadPhase = false;
  693.             }
  694.         }
  695.     if o = 1 {
  696.         sprite_index = bill_cipher_front;
  697.         if global.bHealth < global.bStoredPlyrHlth/2 {
  698.             image_speed = 0.40;
  699.             global.bStoredPlyrSpat = Var.SpatId[m]*3;
  700.             global.bStoredPlyrSped = Var.SpedId[m]*3;
  701.             global.bMadPhase = true;
  702.             } else {
  703.             image_speed = 0.21;
  704.             global.bStoredPlyrSpat = Var.SpatId[m];
  705.             global.bStoredPlyrSped = Var.SpedId[m];
  706.             global.bMadPhase = false;
  707.             }
  708.         }
  709.     }
  710.    
  711. if m = 31 {
  712.     if o = 0 {
  713.         sprite_index = mmo_back;
  714.         }
  715.     if o = 1 {
  716.         sprite_index = mmo_front;
  717.         }
  718.     image_speed = 0.18;
  719.     }
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734. if m = 16 { // FOR BOWSER ONLY VVVVVVVVVVVVVVVVVV
  735.  
  736. if idle_phase = 0 && can_idle < 900 {
  737.     if o = 0 {
  738.         sprite_index = bowser_back;
  739.         if global.aHealth < global.aStoredPlyrHlth/1.5 {
  740.             image_speed = 0.60;
  741.             global.aStoredPlyrAttk = Var.AttkId[m]*3;
  742.             global.aStoredPlyrSped = Var.SpedId[m]*4.5;
  743.             global.aStoredPlyrSpat = Var.SpatId[m]*3;
  744.             global.aMadPhase = true;
  745.             } else {
  746.             image_speed = 0.45;
  747.             global.aStoredPlyrAttk = Var.AttkId[m];
  748.             global.aStoredPlyrSped = Var.SpedId[m];
  749.             global.aStoredPlyrSpat = Var.SpatId[m];
  750.             global.aMadPhase = false;
  751.             }
  752.         }
  753.     if o = 1 {
  754.         sprite_index = bowser_front;
  755.         if global.bHealth < global.bStoredPlyrHlth/1.5 {
  756.             image_speed = 0.60;
  757.             global.bStoredPlyrAttk = Var.AttkId[m]*3;
  758.             global.bStoredPlyrSped = Var.SpedId[m]*4.5;
  759.             global.bStoredPlyrSpat = Var.SpatId[m]*3;
  760.             global.bMadPhase = true;
  761.             } else {
  762.             image_speed = 0.45;
  763.             global.bStoredPlyrAttk = Var.AttkId[m];
  764.             global.bStoredPlyrSped = Var.SpedId[m];
  765.             global.bStoredPlyrSpat = Var.SpatId[m];
  766.             global.bMadPhase = false;
  767.             }
  768.         }  
  769.     can_idle = irandom_range(-2620,940);
  770.     }
  771.  
  772. if idle_phase = 0 && can_idle >= 900 {
  773.     image_index = 0;
  774.     image_speed = 0.45;
  775.     idle_phase = 1;
  776.     }
  777.    
  778. if (idle_phase = 1 && can_idle >= 900) {
  779.     if o = 0 {
  780.         sprite_index = bowser_back_idle;
  781.         if global.aHealth < global.aStoredPlyrHlth/1.5 {
  782.             image_speed = 0.60;
  783.             global.aStoredPlyrAttk = Var.AttkId[m]*3;
  784.             global.aStoredPlyrSped = Var.SpedId[m]*4.5;
  785.             global.aStoredPlyrSpat = Var.SpatId[m]*3;
  786.             global.aMadPhase = true;
  787.             } else {
  788.             image_speed = 0.42;
  789.             global.aStoredPlyrAttk = Var.AttkId[m];
  790.             global.aStoredPlyrSped = Var.SpedId[m];
  791.             global.aStoredPlyrSpat = Var.SpatId[m];
  792.             global.aMadPhase = false;
  793.             }
  794.         }
  795.     if o = 1 {
  796.         sprite_index = bowser_front_idle;
  797.         if global.bHealth < global.bStoredPlyrHlth/1.5 {
  798.             image_speed = 0.60;
  799.             global.bStoredPlyrAttk = Var.AttkId[m]*3;
  800.             global.bStoredPlyrSped = Var.SpedId[m]*4.5;
  801.             global.bStoredPlyrSpat = Var.SpatId[m]*3;
  802.             global.bMadPhase = true;
  803.             } else {
  804.             image_speed = 0.42;
  805.             global.bStoredPlyrAttk = Var.AttkId[m];
  806.             global.bStoredPlyrSped = Var.SpedId[m];
  807.             global.bStoredPlyrSpat = Var.SpatId[m];
  808.             global.bMadPhase = false;
  809.             }
  810.         }
  811.     }
  812.    
  813. if image_index >= 19 && idle_phase = 1 {
  814.         can_idle = 0;
  815.         idle_phase = 0;
  816.         }
  817.    
  818. if o = 0 && global.aHealth = 0 && idle_phase < 9 {
  819.     idle_phase = 9;
  820.     sprite_index = bowser_back_die;
  821.     image_index = 0;
  822.     image_speed = 0.3;
  823.     }
  824.    
  825. if o = 1 && global.bHealth = 0 && idle_phase < 9 {
  826.     idle_phase = 9;
  827.     sprite_index = bowser_front_die;
  828.     image_index = 0;
  829.     image_speed = 0.3;
  830.     }
  831.    
  832. if image_index >= 12 && idle_phase = 9 {
  833.     image_index = 12;
  834.     }
  835.  
  836. }
  837.  
  838.  
  839. Draw Event:
  840.  
  841. execute code:
  842.  
  843. ///DRAW EVENT
  844.  
  845. //x1 = x-64*2*1.2;
  846. //y1 = y-64*2*1.4;
  847. //x2 = x+64*2*1.2;
  848. //y2 = y-64*2*1.2;
  849.  
  850. x1 = 128 * 1.2// + _xoff;
  851. y1 = 128 * 1.4// + _yoff;
  852. x2 = 128 * 1.2// + _xoff; //153.6
  853. y2 = 128 * 1.3// + _yoff;
  854.  
  855. if o = 0 {
  856. aX1 = global.aX-x1;
  857. aY1 = global.aY-y1;
  858. aX2 = global.aX+x2;
  859. aY2 = global.aY-y2;
  860. }
  861.  
  862. if o = 1 {
  863. bX1 = global.bX-x1;
  864. bY1 = global.bY-y1;
  865. bX2 = global.bX+x2;
  866. bY2 = global.bY-y2;
  867. }
  868.  
  869. xdiff = x2-x1
  870. draw_self();
  871. if o = 0 && global.aMadPhase = false {
  872.     draw_sprite_ext(sprite_index,image_index,x,y,image_xscale,image_yscale,0,-1,1);
  873.     }  
  874. if o = 1 && global.bMadPhase = false {
  875.     draw_sprite_ext(sprite_index,image_index,x,y,image_xscale,image_yscale,0,-1,1);
  876.     }
  877. if o = 0 && global.aMadPhase = true {
  878.     draw_sprite_ext(sprite_index,image_index,x,y,image_xscale,image_yscale,0,c_red,1);
  879.     }  
  880. if o = 1 && global.bMadPhase = true {
  881.     draw_sprite_ext(sprite_index,image_index,x,y,image_xscale,image_yscale,0,c_red,1);
  882.     }
  883. draw_set_font(font0);
  884. draw_set_color(c_teal);
  885.  
  886. if o = 0 && global.aHealth > 0 {
  887.     draw_rectangle(x-x1,cy-y1,x+x2,cy-y2,false);
  888. }
  889.  
  890. if o = 1 && global.bHealth > 0 {
  891.     draw_rectangle(x-x1,y-y1,x+x2,y-y2,false);
  892. }
  893.  
  894. aHlthPercent = (global.aHealth/global.aStoredPlyrHlth*100);
  895. bHlthPercent = (global.bHealth/global.bStoredPlyrHlth*100);
  896.  
  897. //text_draw(x1,y1-100,"Error: "+string(bStoredPlyrSped[m,c]),c_black);
  898.  
  899. if o = 0 {
  900.     if aHlthPercent > 55 {
  901.         draw_set_color(c_yellow);
  902.         }
  903.     if aHlthPercent > 23 && aHlthPercent < 55 {
  904.         draw_set_color(c_lime);
  905.         }
  906.     if aHlthPercent < 23 {
  907.         draw_set_color(c_red);
  908.         }
  909.     if global.aHealth > 0 {
  910.     draw_rectangle(x-x1,cy-y1,x-x2+((x2*2)*(global.aHealth/global.aStoredPlyrHlth)),cy-y2,false)
  911.     text_draw(x-x1,cy-y1-40,string(PlyrName[0]),c_yellow);
  912.         if global.aStoredPlyrType2 = "" {
  913.             text_draw(x-x1,cy-y1-24,string(global.aStoredPlyrType1),c_white);
  914.             } else {
  915.             text_draw(x-x1,cy-y1-24,string(global.aStoredPlyrType1)+"/"+string(global.aStoredPlyrType2),c_white);
  916.             }
  917.     text_draw(aX1,cy-y1+((cy-y2)-(cy-y1)),"HP: "+string(round(global.aHealth)),c_white);
  918.     text_draw(aX1+string_width("HP: "+string(round(global.aHealth))),cy-y1+((cy-y2)-(cy-y1)),"/"+string(round(global.aStoredPlyrHlth)),c_white);
  919.     //text_draw(aX1,aY1+40,"aCHit: "+string(global.aCHitMod),c_white);
  920.     if BattleDummy.debugger = true {
  921.         //text_draw(aX1,aY1+39,"aPlyrHlthCache: "+string(aStoredPlyrHlthCache[m,c]),c_black);
  922.         //text_draw(aX1,aY1+55,"aX: "+string(aX1),c_black);  
  923.         //text_draw(aX1,aY1+69,"aX1: "+string(aX2*(global.aHealth/aStoredPlyrHlth[m,c])),c_black);
  924.         text_draw(aX1,cy,"Damage: "+string(bDamage)+"#",c_aqua);
  925.         if global.Player2Moving = true {
  926.             bDamage = global.bDamageInflicted;
  927.             } else {
  928.             bDamage = 0;
  929.             }
  930.         }
  931.     }
  932. }
  933.  
  934. if o = 1 {
  935.     if bHlthPercent > 55 {
  936.         draw_set_color(c_yellow);
  937.         }
  938.     if bHlthPercent > 23 && bHlthPercent < 55 {
  939.         draw_set_color(c_lime);
  940.         }
  941.     if bHlthPercent < 23 {
  942.         draw_set_color(c_red);
  943.         }
  944.     if global.bHealth > 0 {
  945.     draw_rectangle(x-x1,y-y1,x-x2+((x2*2)*(global.bHealth/global.bStoredPlyrHlth)),y-y2,false)
  946.     text_draw(x-x1,y-y1-24,string(PlyrName[1]),c_yellow);  
  947.         if global.bStoredPlyrType2 = "" {
  948.             text_draw(x-x1,y-y1+((y-y2)-(y-y1)),string(global.bStoredPlyrType1),c_white);
  949.             } else {
  950.             text_draw(x-x1,y-y1+((y-y2)-(y-y1)),string(global.bStoredPlyrType1)+"/"+string(global.bStoredPlyrType2),c_white);
  951.             }
  952.     //text_draw(bX1,bY1+40,"bCHit: "+string(global.bCHitMod),c_white);
  953.     //text_draw(bX1,bY1+14*2/1.25,"HP: "+string(round(global.bHealth)),c_white);
  954.     //text_draw(bX1+string_width("HP: "+string(round(global.bHealth))),bY1+14*2/1.25,"/"+string(round(global.bStoredPlyrHlth)),c_white);
  955.     if BattleDummy.debugger = true {
  956.         //text_draw(bX1,bY1+39,"bPlyrHlthCache: "+string(bStoredPlyrHlthCache[m,c]),c_black);
  957.         //text_draw(bX1,bY1+55,"bX: "+string(bX1),c_black);
  958.         //text_draw(bX1,bY1+71,"bX1: "+string(bX2*(global.bHealth/bStoredPlyrHlth[m,c])),c_black);
  959.         text_draw(bX1+string_width("HP: "+string(round(global.bHealth))),bY1-(y1+((y-y2)-(y-y1)))*0.5,"/"+string(round(global.bStoredPlyrHlth)),c_white);
  960.         text_draw(bX1,bY1+87,"1. "+string(Var.MoveName[bPlyrMove1])+"#"+"2. "+string(Var.MoveName[bPlyrMove2])+"#"+"3. "+string(Var.MoveName[bPlyrMove3])+"#"+"4. "+string(Var.MoveName[bPlyrMove4])+"#"+"Damage: "+string(aDamage)+"#",c_aqua);
  961.         if global.Player1Moving = true {
  962.             aDamage = global.aDamageInflicted;
  963.             } else {
  964.             aDamage = 0;
  965.             }
  966.         }
  967.     }
  968. }
Add Comment
Please, Sign In to add comment