SHARE
TWEET

phplala

a guest Feb 21st, 2020 83 in 317 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. /* project not finished yet ! lol ! */
  4.  
  5. /* Two bots char and enemy fighting for glory ! */
  6. /* stat health is for both 200, note there is a stat healthy as well */
  7. /* Invest max 40 total points in #strength, #agility, #migitation, #crit, #mana, #int, #healthy and win of enemy bot ! */
  8.  
  9.  
  10. $charhealth=200;
  11.  
  12.   $charstrength=3;
  13.   $charagility=2;
  14.   $charmigitation=5;
  15.   $charcrit=7;
  16.   $charmana=8; $charmanaintern=30+3*$charmana; /*chance of getting a spell off 30%+3*charmana */
  17.   $charint=4;
  18.   $charhealthy=11; $charhealth=$charhealth+10*$charhealthy;
  19.  
  20.  
  21. $enemyhealth=200;
  22.  
  23.   $enemystrength=10;
  24.   $enemyagility=5;
  25.   $enemymigitation=3;
  26.   $enemycrit=2;
  27.   $enemymana=9;$enemymanaintern=30+3*$enemymana; /*chance of getting a spell off 30%+3*charmana */
  28.   $enemyint=8;
  29.   $enemyhealthy=3; $enemyhealth=$enemyhealth+10*$enemyhealthy;
  30.  
  31.  
  32.  
  33. /* 20 agility = 50% dodgemax, dus 1 agility = 2.5% dodgechance */
  34. /* 20 migitation = 40% migitation, dus 1 migitation = 2% realmigitation ==estrength   *((100-$charmigitation*3)/100)    */
  35.  
  36.  
  37.  
  38. for ($i = 1; $i <= 20; $i++) {
  39.     echo " Charhealth: $charhealth"; echo " Enemyhealth: $enemyhealth"; echo " <BR>";
  40.  
  41.     /*Enemy hits char*/
  42.     $chargothit=rand(1, 100);
  43.  
  44.     $enemygotspelloff=rand(1,100);
  45.     if ($enemymanaintern>$enemygotspelloff) {echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Enemy got spell off! and hits Char !"; $charhealth=ceil($charhealth-(1.15^$enemyint));echo "Char health now on $charhealth <BR>";}
  46.      
  47.  
  48.     $enemygotcrit=rand(1, 100);
  49.     if ($enemygotcrit<=$enemycrit) {$crithit=1.6;echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Enemy hit is a crit !!<BR>";} else {$crithit=1;}
  50.  
  51.      if ($chargothit>($charagility*2.5)) {$charhealth=ceil($charhealth-$enemystrength*$crithit*((100-$charmigitation*3)/100));}
  52.                         else { echo "Enemy misses!! Char health now on $charhealth . <BR>";}
  53.  
  54.  
  55.  
  56.  
  57.  
  58.     /*Char hits enemy*/
  59.     $enemygothit=rand(1, 100);
  60.  
  61.     $chargotspelloff=rand(1,100);
  62.     if ($charmanaintern>$chargotspelloff) {echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Char got spell off! and hits Enemy !"; $enemyhealth=ceil($enemyhealth-(1.15^$charint));echo "Enemy health now on $enemyhealth<BR>";}
  63.  
  64.     $chargotcrit=rand(1, 100);
  65.     if ($chargotcrit<=$charcrit) {$crithit=1.6;echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Char hit is a crit !!<BR>";} else {$crithit=1;}
  66.  
  67.     if ($enemygothit>($enemyagility*2.5)) {$enemyhealth=ceil($enemyhealth-$charstrength*$crithit*((100-$enemymigitation*3)/100));}
  68.                         else { echo "Char misses !! Enemy health now on $enemyhealth . <BR>";}
  69.     }
  70.  
  71.  
  72.  
  73. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top