-
Posts
912 -
Joined
-
Last visited
-
Days Won
7
Content Type
Profiles
Forums
Events
Everything posted by Coly010
-
Only thing I store in the session is a Boolean for if they logged in and an int for their userid. Other things get stored in the db. Why? Because if you store it all in session you have to update all the DB records anyway so it persists after session is destroyed
-
despite me writing that its not a working script? whats the difference in posting its not working in the same post as the code, and you saying its not working? however, I do appreciate your input :)
-
What part of "quick example on my phone" and "it's not a working script either, there are functions missing and it can be optimised do you not get? Wow that question makes me sound angry and bad tempered lol. I know all about visibility, keeping consistent indent is difficult when typing on a phone and you're trying to deal with autocorrect. I'm well aware of the parse error; and the unneeded variabs, hence why I said it can be optimised.
-
its somewhat basic math? GCSE standard I'd think. [MENTION=68711]KyleMassacre[/MENTION] - I didn't even think about dictating a place to hit on the other place lol. but yeah, the script is easily scalable which is partially why i'm quite proud of it haha.
-
it is based on strength, defence and agility? it uses strength and defence to work out the damage, and it uses agility to see if the other person avoids the attack or not?
-
You mean this? $dmg = ($str * mt_rand(1, 5)) - $def; I thought it up as I typed the code.. There isn't any specific damage calculation formula. For example if you have weapons that add to the damage then it may look something like this: $dmg = ($str + $wepdmg) - $def; I add the mt_rand so that it provides a bit of variety into the damage being dealt.
-
Not at all. It depends on the game and how their attack system works? This could be a perfectly viable attack system. You have 3 attack so you do 3 damage each time you land a successful hit. Now i personally like to have a few different stats that will contribute to the attack formula. I'm gonna attempt to do a quick example here on my phone. Ok so every user has three stats relating to the attack system. Strength - determines how much hp to take Agility - determines who attacks first and also determines how high a chance you have of avoiding an attack Defence - made up from your armour, reduces damage received Let's put a cap on the stats at 80. I like OOP so im going to style it using that. I'll leave out some functions code as they should be easy to work out class Attack { var $attackFirst, $opponent, $user; var $attacking; var $statCap = 80; // create the attack public function __construct($oppid, $userid){ $this->user = $this->getUserStats($userid); $this->opponent = $this->getUserStats($oppid); $this->determineAttackFirst(); while($this->attacking){ $this->attack(); } } // use a conditional statement to determine who strikes first private function determineAttackFirst(){ $this->attackFirst = $this->user['agility'] > $this->opponent['agility'] ? $this->user['id'] : $this->opponent['id']; } private function avoidAttack($agi){ // to make it simple, create a random between 1 and the stat cap. If the random is below or equals it, success, they avoid the attack (mt_rand(1, $this->statCap) <= $agu ? return true : return false); } // simple enough damage calculator private function calculateDamage($str, $def){ $dmg = ($str * mt_rand(1, 5)) - $def; if( $dmg < 0) { $dmg = 0; } return $dmg; } private function userAttack(){ $dmg = $this->calculateDamage($this->user['strength'], $this->opponent['defence']); $avoided = $this->avoidAttack( $this->opponent['agility']); $log = $this->user['name']." attempts to strike ". $this->opponent['name'] ."! <br />"; switch($avoided){ case true: $log .= "But ".$this->opponent['name']." avoids the attack!<br /><br />"; break; case false: $hpleft = $this->opponent['hp']-$dmg; $hpleft = ($hpleft < 0 ? 0 : $hpleft); $log .= "You deal ".$dmg." leaving them with ".$hpleft; } $this->attacking = (isset($hpleft) && $hpleft <= 0 ? false : true); } private function attack(){ if($this->attackFirst == $this->user['id']){ $this->userAttack(); $this->opponentAttack(); } else { // vice versa of above } } } Hopefully that's understandable if not ask questions and I'll answer. It's not a working script either, there are functions missing and it can be optimised quite a bit.
-
Looks pretty sweet :)
-
Pretty sure you have to do that with Elder Scrolls Online
-
Hence why Sim wants to see code examples. Inspect Element only shows HTML and JavaScript. No server side languages
-
This is gonna turn back into the discussion that was on here previously except it was to do with code. Im not sure exactly how it works and it depends on the wording of the contract
-
Aw I never said it was ethical, I'm just curious if he had those assets lying around on his computer, got lazy and resused them in the hope no-one would notice.
-
Here's a question. Did Zettieee make the templates for those other sites?
-
Why not? If you're putting someone off using him you should give reasons why.
-
I think you do still need their approval to have their business listed on your website.
-
Or I'll just drop a mention to the two that I know of here: [MENTION=65100]W3Theory || Peter[/MENTION] [MENTION=69001]Zettieee[/MENTION]
-
When I stated "Yeah the game has very little in it" I was implying agreement to his comment about 30%. I probably should have made that more specific but I was on my phone and was lazy lol.
-
Yeah the game has very little in it from what I can see /: [ATTACH]2164[/ATTACH][ATTACH]2165[/ATTACH][ATTACH]2166[/ATTACH] There are other blank pages I didn't screenshot also
-
[MENTION=66223]DreamCoder[/MENTION] on your description for G'Lul, be careful with your grammar, your mixing tenses.
-
Lol yeah trust me that went through my head but he said he didn't have a staff panel for it
-
$ratings = array("1"=>"thanks", "2"=>"likes", "3"=>"dislikes", "4"=>"etc"); $response = (!in_array($_GET['rating'], $ratings) ? "Invalid Rating!" : "You have successfully ".$ratings[$_GET['rating']]." this post."); $response = ($db->num_rows() > 0 ? "You have already rated this!" : $response); $response .= "redirecting you in <span id='timer'>3 Seconds</span>"; echo $response; I dunno, I just think this looks neater. Done on my phone.
-
Meh, if my hard drive didnt die last night I could have provided you with one that's easy to use and is cheap. But in all honestly, if you aren't going to be developing for it, in other words hiring a developer to add mods for you, try get on that has an OOP base. To me it's easier to develop for.
-
If we gonna dump the gym, every time player levels up give them points to spend on their stats. each point they spend on their stat increases that stat by say 10.
-
Well you have one already. Multiple gyms. Have it that they unlock new gyms at certain levels which gives better gains to stats, or maybe let them train more times for the same amount of energy etc. How about making them pay a gym membership, heck God knows we all do. Mostly. How about allowing players their own personal, upgradable gym? They buy the basic gym setup which gives them the same gains as the normal gym, but then let them but a series of equipment for their gym that will increase the gains they get from the gym. It'll also take money out if the game which is a good thing. Have it so that they need to be a certain level to buy certain equipment. Implement it with the gym membership. If they have a gym then they don't need a gym membership. Take it further. Let them rent it out to other players for a fee. Better gym, better gains, players are gonna want to use that gym at price rather than paying for a gym that gives mediocre gains. Take it one step further. Let gangs own a gym. Let gang members donate money to their gang which can be used to upgrade the gym. Then only gang members can use it, free of charge. Needs to be more interesting you say? Let warring gangs sabotage each other's gyms. Give them an option, destroy equipment or sabotage equipment. If they destroy it then it the gains from the gym decrease, if they sabotage it, high chance the gym will kill members that use it. If it does kill a member, the saboteur earns respect for their gang. Make it an organised crime or something so that it isn't really easy to destroy/sabotage gyms. Damn I'm good.
-
yeah a modal box.