View Single Post
  #16  
Old 09-22-2016, 08:34 PM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 516
Gender: Unknown/Other
Credits: 67,907
Dinocanid is on a distinguished road
Default

Maybe changing the items around in the script might help somehow? This is the version with the fixes I mentioned in my previous posts:

PHP Code:
<?php

class ExploreArea2View extends View{
    
    public function 
index(){
        
$mysidia Registry::get("mysidia");
        
$document $this->document;
            
$document->setTitle("<center>Hanafuda with Eyre</center>");          
$item "asda";
$hasitem $mysidia->db->select("inventory", array("quantity"), "itemname ='{$item}' and owner='{$mysidia->user->username}'")->fetchColumn();
if(
$hasitem 0){
    
$document->add(new Comment("You have $hasitem {$item}!"));
}                    
   
$item_name "asda";
$qty 1;
$item = new PrivateItem($item$mysidia->user->username);
$item->remove($qty$mysidia->user->username); 
 
            
$document->add(new Comment("<center><a href='http://atrocity.mysidiahost.com/exploreeyresgame'>Play again?</a> Or <a href='http://atrocity.mysidiahost.com/pages/view/bakenekohalloween'> Go back to the event plaza</a></center>"FALSE));  
        
            
$random rand(1,115);
            
            if(
$random && $random 20){
$document->add(new Comment("<b><center>Eyres Hand</center></b>"FALSE));
                
$document->add(new Comment("<center><img src='http://atrocity.mysidiahost.com/picuploads/png/291a4c3f9d34e71b1a97ba1ea41a2476.png'>"));
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85238/Hanafuda%20winners.png'></center>"FALSE));
$document->add(new Comment("<b><center>Your Hand</center></b>"FALSE));
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85239/Hanafuda%20losers.png'></center>"FALSE));
                
$document->add(new Comment("<center>You lost!</center>"FALSE));
            }
            elseif(
$random >= 21 && $random <= 30){
                
$amount rand(5,20);
                
$mysidia->user->changecash($amount); 
$document->add(new Comment("<b><center>Eyres Hand.</center></b>"FALSE));
                
$document->add(new Comment("<center><img src='http://atrocity.mysidiahost.com/picuploads/png/8a513071bd47ab3361b61942118f8b87.png'>"));
$document->add(new Comment("center><img src='http://pile.randimg.net/1/90/85240/Hanafuda%20ties.png'></center>"FALSE));
$document->add(new Comment("<b><center>Your Hand</center></b>"FALSE));
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85240/Hanafuda%20ties.png'></center>"FALSE));
                
$document->add(new Comment("<center>Its a Tie...I guess I'll give you some beads...<i>You got $amount Beads!</center></i>"FALSE)); 
            }
            elseif(
$random >= 61 && $random <= 70){
                
$item "asda";
                
$qty 1;
                
$newitem = new StockItem($item);
                
$newitem->append($qty$mysidia->user->username);
                 
$document->add(new Comment("<b><center>Eyres Hand.</center></b>"FALSE));
                
$document->add(new Comment("<center><img src='http://atrocity.mysidiahost.com/picuploads/png/8a513071bd47ab3361b61942118f8b87.png'>"));
  
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85239/Hanafuda%20losers.png'></center>"FALSE));
$document->add(new Comment("<b><center>Your Hand.</center></b>, FALSE"));
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85238/Hanafuda%20winners.png'></center>"FALSE));  
                
$document->add(new Comment("Alright Human thing... you can have my uncommon <img src='http://atrocity.mysidiahost.com/picuploads/png/6cd9c65227f0ae199cf399f294c1acb1.png'> <b>$item</b>!</center>"FALSE));
            }
            elseif(
$random >= 71 && $random <= 75){
                
$item "asda";
                
$qty 1;
                
$newitem = new StockItem($item);
                
$newitem->append($qty$mysidia->user->username);
                 
$document->add(new Comment("<b><center>Eyres Hand.</center></b>"FALSE));
                
$document->add(new Comment("<center><img src='http://atrocity.mysidiahost.com/picuploads/png/8a513071bd47ab3361b61942118f8b87.png'>"));
  
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85239/Hanafuda%20losers.png'></center>"FALSE));
$document->add(new Comment("<b><center>Your Hand.</center></b>"FALSE));
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85238/Hanafuda%20winners.png'></center>"FALSE));  
                
$document->add(new Comment("No...not my rare <img src=http://atrocity.mysidiahost.com/picuploads/png/63388ceaa8e021597d9af37977138554.png'> <b>$item</b>!Human thing you are unfair!</center>"FALSE));
            }
            elseif(
$random >= 81 && $random <= 90){
                
$item "asda";
                
$qty 1;
                
$newitem = new StockItem($item);
                
$newitem->append($qty$mysidia->user->username);
                 
$document->add(new Comment("<b><center>Eyre's Hand.</center></b>"FALSE));
                
$document->add(new Comment("<center><img src='http://atrocity.mysidiahost.com/picuploads/png/8a513071bd47ab3361b61942118f8b87.png'>"));
  
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85239/Hanafuda%20losers.png'></center>"FALSE));
$document->add(new Comment("<b><center>Your Hand.</center></b>"FALSE));
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85238/Hanafuda%20winners.png'></center>"FALSE));  
                
$document->add(new Comment("This is why I hate Human things... they always take my <img src='http://atrocity.mysidiahost.com/picuploads/png/856746dbbefc14049ea9d29bf86049a7.png'><b>$item</b>!</center>"FALSE));
            }
            elseif(
$random >= 91 && $random <= 99){
                 
$document->add(new Comment("<b><center>Eyre's Hand.</center></b>"FALSE));
                
$document->add(new Comment("<center><img src='http://atrocity.mysidiahost.com/picuploads/png/291a4c3f9d34e71b1a97ba1ea41a2476.png'>"));
  
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85238/Hanafuda%20winners.png'></center>"FALSE));
$document->add(new Comment("<b><center>Your Hand.</center></b>"FALSE));
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85239/Hanafuda%20losers.png'></center>"FALSE));  
                
$document->add(new Comment("You lose Human thing!</center>"FALSE));
            }
            elseif(
$random == 100){
                
$document->add(new Comment("<b><center>Eyre's Hand.</center></b>"FALSE));
                
$document->add(new Comment("<center><img src='http://atrocity.mysidiahost.com/picuploads/png/291a4c3f9d34e71b1a97ba1ea41a2476.png'>"));
  
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85238/Hanafuda%20winners.png'></center>"FALSE));
$document->add(new Comment("<b><center>Your Hand.</center></b>"FALSE));
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85239/Hanafuda%20losers.png'></center>"FALSE));  
                
$document->add(new Comment("You lose Human thing!</center>"FALSE));
            }
             else {
    
$document->add(new Comment("<center><img src='http://atrocity.mysidiahost.com/picuploads/png/b30c16d80645c40477b2143fae5f5eeb.png'></center>"FALSE));
    
$document->add(new Comment("<center>You are out of candy...come back when you have more!!</center>"FALSE));
}   
    }
   } 
?>
Your site has specific items, so I had to change the one on mine to a test item (asda) so I wouldn't get errors on my end. Those are the only things I really changed besides the "extends view" line since that's what the .php I have it in is called. As a walkthrough of what I did to debug the problem and have the game run and end was:
1. Change the name of every item to the test item (asda) so I don't get any errors and it properly adds and removes the items from your inventory
2. I removed all but one of the lines that gave me an item so I would lose more often since I just kept winning over and over. This way, I can be sure the quantity is running out. You don't have to do that, I just did it because I was winning too much to see if a game over was possible.
3. I refreshed over and over until I had 0 "asda" and I got the game over message. If I happen to win another "asda", then it lets me play again. Obviously it wouldn't happen this way with yours since you wouldn't win back the item needed to play the game.

From my understanding, the game only runs if you have a "Sherlock Holmes book", did you change your inventory so you only have one of that item and test the game again? You should get a game over if you have 0 Sherlock Holmes books.
Reply With Quote