Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.45 KB | None | 0 0
  1. <font size="xx-small">
  2. <?php
  3.    
  4.     $pname = 'Ecko D\'Blaze';
  5.     $con = 5;
  6.     $str = 5;
  7.    
  8.     $phealth = $con + 20;
  9.    
  10.     $npcname = 'Stinson The Great';
  11.     $con = 6;
  12.     $str = 4;
  13.    
  14.     $npchealth = $con + 20;
  15.    
  16.     if($phealth < 1)
  17.     {
  18.         print("You have no health!");
  19.     }
  20.     else
  21.     {
  22.         $npcroll = rand(1 , 10);
  23.         $proll = rand(1 , 10);
  24.        
  25.         if($npcroll < $proll)
  26.         {
  27.             $turn = 0;
  28.         }
  29.         elseif($proll < $npcroll)
  30.         {
  31.             $turn=1;
  32.         }
  33.         else
  34.         {
  35.             $turn=rand(0,1);
  36.         }
  37.         for( ; ; )
  38.         {
  39.             if($npchealth < 1 || $phealth < 1)
  40.             {
  41.                 if($phealth < 1)
  42.                 {
  43.                     print("$pname has been defeated by $npcname!<br/>");
  44.                 }
  45.                 else
  46.                 {
  47.                     print("$npcname has been defeated by $pname!<br/>");
  48.                 }
  49.                 break;
  50.             }
  51.             $hit = rand(1 , 4);
  52.             if(($turn % 2) == 0)
  53.             {
  54.                 $npchealth -= $hit;
  55.                
  56.                 if($hit >= 4)
  57.                 {
  58.                     print("<font color='red'>\t$pname has just Bitch Slapped $npcname for $hit damage! - $npchealth remaining.</font><br/>");
  59.                 }
  60.                 else
  61.                 {
  62.                     print("\t$pname has just girly slapped $npcname for $hit damage! - $npchealth remaining.<br/>");
  63.                 }
  64.             }
  65.             else
  66.             {
  67.                 $phealth -= $hit;
  68.                     if($hit >= 4)
  69.                 {
  70.                     print("<font color='red'>\t$npcname has just Bitch Slapped $pname for $hit damage! - $phealth remaining.</font><br/>");
  71.                 }
  72.                 else
  73.                 {
  74.                     print("\t$npcname has just girly slapped $pname for $hit damage! - $phealth remaining.<br/>");
  75.                 }
  76.             }
  77.             $turn++;
  78.         }
  79.        
  80.     }
  81.    
  82. ?>
  83. </font>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement