Jump to content
MakeWebGames

Mccodes V2 Crimes Format HELP


benlucraft

Recommended Posts

In docrime.php, the $sucrate (or success rate) is determined, by default, using basic maths - algebra, to be exact.

$find = ['LEVEL', 'CRIMEXP', 'EXP', 'WILL', 'IQ'];
$repl = [$ir['level'], $ir['crimexp'], $ir['exp'], $ir['will'], $ir['IQ']];
$sucrate = str_replace($find, $repl, $r['crimePERCFORM']);

 

The default formula upon crime creation is

((WILL*0.8)/2.5)+(LEVEL/4)

Remember that "BODMAS", BIDMAS", "PEMDAS", or however you remember it, all play in here - I was taught the "BIDMAS" method, though they all mean basically the same thing.

  • Brackets
  • Indices
  • Division
  • Multiplication
  • Addition
  • Subtraction

(in that order)

Now, for example, we'll use the "stats" that would be there as a brand new player (i.e. Will = 100, Level = 1, CrimeXP = 0, EXP = 0, IQ = 10)

Break up the formula, brackets comes first.

((100 * 0.8) / 2.5) = 80 / 2.5 = 32

(1 / 4) = 0.25

32 + 0.25 = 32.25

So, that leaves us with 32.25. Now, because of the way that the docrime.php is setup, the closer to 100 the formula equals, the easier the crime (anything above 100 is treated as success anyway).

With that logic, and with a newbie (to your game), there's at least 32.25% chance of successfully completing that crime. I say "at least" because there's also a rand() in there too, adding to the chances of success

The output from the crime failure is simple. It's a 50% chance of just a fail or jail time.

---------

You can easily add to that str_replace() logic at the top, adding more things like 'TOTAL_STATS', 'STRENGTH', 'MONEY', etc. (and obviously add the replacements too) to be able to use more modifiers.

Link to comment
Share on other sites

  • 2 months later...

No matter what I try I get division by zero. My first crime is just set at 100, so everyone can begin crimes. My next set I wanted to be their will % -.- zero=zero=zero

Just saying I graduated from school about 15 years ago and .92 = 92%

My issue is NOT going over 100 -.-

Edited by boionfire81
hating math
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...