WildCat: Pressgang formula?

Started by Disl, August 27, 2020, 12:57:11 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Disl

Anyone know the formula for pressgang?

windhound

Here you go -

        global $users, $lratio, $uera, $cocounter, $spellswork, $config, $cterms;
        if ($lratio >= 90) {
            $peasants = 0.1 * $users[peasants];
            $users[peasants] -= $peasants;
            $amt_armtrp = $peasants * ($users[ind_armtrp] / 100) * $config[armtrp][prod];
            $amt_lndtrp = $peasants * ($users[ind_lndtrp] / 100) * $config[lndtrp][prod];
            $amt_flytrp = $peasants * ($users[ind_flytrp] / 100) * $config[flytrp][prod];
            $amt_seatrp = $peasants * ($users[ind_seatrp] / 100) * $config[seatrp][prod];
            $users[armtrp] += $amt_armtrp;
            $users[lndtrp] += $amt_lndtrp;
            $users[flytrp] += $amt_flytrp;
            $users[seatrp] += $amt_seatrp;
            saveUserData($users, "networth armtrp lndtrp flytrp seatrp peasants");
            if (!$cocounter[hide])
                SpellSucceed(commas($peasants * ($users[ind_armtrp] / 100)) . " $uera[armtrp], " . commas($peasants * ($users[ind_lndtrp] / 100)) . " $uera[lndtrp], " . commas($peasants * ($users[ind_flytrp] / 100)) . " $uera[flytrp], and " . commas($peasants * ($users[ind_seatrp] / 100)) . " $uera[seatrp] have been pressganged to your $cterms[army].");
            $cocounter[armtrp] += $amt_armtrp;
            $cocounter[lndtrp] += $amt_lndtrp;
            $cocounter[flytrp] += $amt_flytrp;
            $cocounter[seatrp] += $amt_seatrp;
        }
        else
            SpellFail("You need " . commas((90 * $users[labs] / $users[raceinfo][magic]) - $users[wizards]) . " more $uera[wizards].");
    }


And I 'spose you'd like the constants -

// Troop Production Multipliers
$config[armtrp][prod] = 1.2;
$config[lndtrp][prod] = 0.6;
$config[flytrp][prod] = 0.3;
$config[seatrp][prod] = 0.2;


...we kept the original promi names on the backend, so
peasants = workers
armtrp = rats
lndtrp = weasels
flytrp = stoats
seatrp = skiffs
A Goldfish has an attention span of 3 seconds...  so do I
~ In the beginning there was nothing, which exploded ~
There are only 10 types of people in the world: Those who understand binary, and those who don't

Disl

Awesome thank you!

Pretty simple spell. 10% of workers turns into troops.