Commit 08edcb79 authored by Toldierone's avatar Toldierone

merge changes from remote branch (PHP5.2)

parent 00de90f0
......@@ -12,7 +12,7 @@ EOSQL;
EOSQL;
$GLOBALS['mysqli']->query($sql);
$sql=<<<EOSQL
DELETE FROM chat WHERE posted <= DATE_SUB(NOW(), INTERVAL 1 WEEK)
DELETE FROM chat WHERE posted <= DATE_SUB(NOW(), INTERVAL 4 WEEK)
EOSQL;
$GLOBALS['mysqli']->query($sql);
}
......
......@@ -50,11 +50,15 @@ EOFORM;
EOFORM;
$GLOBALS['mysqli']->query($sql);
$sql = <<<EOSQL
INSERT INTO alliance_creations VALUES ('{$_SESSION['user_id']}', '{$allianceid}', NOW())
EOSQL;
$GLOBALS['mysqli']->query($sql);
$sql = <<<EOSQL
SELECT COUNT(*) AS created_count, u.username FROM alliance_creations AS ac INNER JOIN users AS u ON ac.user_id = u.user_id WHERE ac.user_id = '{$_SESSION['user_id']}' AND ac.creationdate > DATE_SUB(NOW(), INTERVAL 7 DAY)
EOSQL;
$rs = onelinequery($sql);
//nah, let's raise the news limits to three alliances per week
if ($rs['created_count'] <= 2) {
if ($rs['created_count'] <= 3) {
$rawmessage = <<<EOMSG
The user <a href="viewuser.php?user_id={$_SESSION['user_id']}">{$rs['username']}</a> has created an alliance <a href="viewalliance.php?alliance_id={$allianceid}">{$mysql['alliancename']}</a>.
EOMSG;
......@@ -62,10 +66,6 @@ EOMSG;
$sql = "INSERT INTO news VALUES ('', '".$message."', NOW())";
$GLOBALS['mysqli']->query($sql);
}
$sql = <<<EOSQL
INSERT INTO alliance_creations VALUES ('{$_SESSION['user_id']}', '{$allianceid}', NOW())
EOSQL;
$GLOBALS['mysqli']->query($sql);
header("Location: myalliance.php");
exit;
}
......
......@@ -171,7 +171,8 @@ if ($_POST['sellone'] || $_POST['sellall'] || $_POST['sellamount']) {
if ($_POST['sellone']) {
$sellingamount = 1;
} else if ($_POST['sellall']) {
$sellingamount = $rs['amount'];
//$sellingamount = $rs['amount'];
$sellingamount = $mysql['quantity'];
} else if ($_POST['sellamount']) {
$sellingamount = (int)$mysql['sellingamount'];
if ($sellingamount < 1) {
......
......@@ -241,10 +241,10 @@ EOSQL;
WHERE fromnation = {$_SESSION['nation_id']}
EOSQL;
$currenttotal = onelinequery($sql);
if ($mysql['amount'] + $currenttotal['totalamount'] > $bitsmax) {
/*if ($mysql['amount'] + $currenttotal['totalamount'] > $bitsmax) {
$commasbitsmax = commas($bitsmax);
$errors[] = "You may only offer {$commasbitsmax} bits total in deals.";
}
}*/
if ($nationinfo['funds'] < $mysql['amount']) {
$errors[] = "You do not have that much money.";
}
......
......@@ -154,7 +154,8 @@ if ($_POST['action'] == "Buy One" || $_POST['action'] == "Buy All" || $_POST['ac
if ($_POST['action'] == "Buy One") {
$buyingamount = 1;
} else if ($_POST['action'] == "Buy All") {
$buyingamount = $rs['amount'];
//$buyingamount = $rs['amount'];
$buyingamount = $mysql['quantity'];
} else if ($_POST['action'] == "Buy:") {
$buyingamount = (int)$mysql['buyingamount'];
if ($buyingamount < 1) {
......
......@@ -114,7 +114,7 @@ EOSQL;
}
}
$sql = "SELECT COUNT(*) AS numusers FROM users";
$sql = "SELECT COUNT(*) AS numusers FROM users WHERE stasismode = '0'";
$sth = onelinequery($sql);
$allusers = $sth['numusers'];
......
......@@ -87,6 +87,7 @@ EOFORM;
<div class="btn-group btn-block">
<input type="submit" name="sellone" value="Sell One" class="btn btn-primary" style="width:50%"/>
<input type="submit" name="sellall" value="Sell All" class="btn btn-warning" style="width:50%"/>
<input type="hidden" name="quantity" value="{$deal['amount']}"/>
</div>
</form>
</div>
......
......@@ -84,6 +84,8 @@ echo <<<EOFORM
<script src="js/bootstrap.min.js"></script>
<script src="js/masonry.pkgd.min.js"></script>
<script src="js/async.js"></script>
<!--dynamically dispatch appropriate extension script-->
<script src="js/extension{$_SERVER['SCRIPT_NAME']}.js" defer></script>
<style type="text/css">
ul.nav li.dropdown:hover > ul.dropdown-menu {
......
......@@ -3,10 +3,6 @@ include_once("backend/allfunctions.php");
include("header.php");
echo <<<EOFORM
<center>
<img src="https://my.mixtape.moe/pfisue.png">
<h1>A bit of a fuckup here, aye m8?</h1><br>
<h2>place bets how long this one lasts :^)</h2><br>
<h3>I can't get old SQL since the previous account got locked, so we have to start <i>tabula rasa</i></h3><br><br>
<h4>Welcome to &gt;ReClop, an unofficial spiritual succesor to &gt;CLOP</h4>
&gt;CLOP was a game of war, politics, markets, deals, and ponies. Where you could join an alliance, build an empire, and rule your equines how you like.
<br>&gt;ReClop is hosted to keep the legacy on. Ded game, ahoy!
......
......@@ -87,6 +87,7 @@ EOFORM;
<div class="btn-group btn-block">
<input type="submit" name="action" value="Buy One" class="btn btn-primary" style="width:50%"/>
<input type="submit" name="action" value="Buy All" class="btn btn-warning" style="width:50%"/>
<input type="hidden" name="quantity" value="{$deal['amount']}"/>
</div>
</form>
</div>
......
......@@ -3,32 +3,47 @@ include("backend/backend_warguide.php");
$extratitle = "War Guide - ";
include("header.php");
echo <<<EOFORM
<center><h4>Basic Guide to War, Empires, and Combat</h4></center>
You lose 1 satisfaction per turn for every 2 total size of forces you have over 20.<br/>
It takes a minimum of 12 hours for friendly forces to reach their destination in the same region, 24 hours for enemy forces to reach their destination in the same region,
36 hours for friendly forces to reach their destination from another region, and 48 hours for enemy forces to reach their destination from another region.<br/>
These forces only actually get there when fights occur: at midnight and noon server time. These are the "war ticks", and they are also when the upkeep for forces is paid.<br/>
<b>If you cannot pay a unit's upkeep, its ponies lose confidence in your leadership and it immediately evaporates.</b>
Don't make a bigger army than you can afford.<br/>
Free Markets lose 100 sat for attacking other Free Markets, State Controlled economies lose 100 sat for attacking
other State Controlled economies, and free countries lose 200 sat for attacking other free countries. These numbers are per attacking group.
You do not get your satisfaction back if you recall your forces.<br/>
Both attacking and defending units hit simultaneously.<br/>
Units with the highest damage will attack first, followed by the largest units. Unit types will be attacked in this order: Cavalry, tanks, pegasi, unicorns, naval.
The only exception is units with weapons good against a certain unit type, who will attack that unit type out of order.<br/>
Units with the best armor against the particular attacking unit type will defend first, followed by the largest units.<br/>
Weapon values are per-hit base damage, and armor values are multipliers to incoming damage (lower = better). Units without weapons do .25 base damage.
Defending units in their home country take only .75x damage unless the nation's owner is in stasis during the fight.<br/>
Training improves units on a slight curve. Units automatically get 1 training at midnight (after any combat). Units' training cancels out enemy units' training.
Units with the maximum amount of training, 20, do 1.5x damage to untrained units and take 0.667x damage from untrained units.<br/>
A unit hits for a number of times equal to its size. For example, a unit of size 6 hits six times (and may destroy multiple units in the process).
For each one full point of damage a unit takes, it loses 1 size.<br/>
If there are no defenders at the end of a fight, the nation becomes the property of the biggest attacker.<br/>
To travel between regions, cavalry, tanks, and unicorns must be transported, either by air or water, by being in groups with units with enough carrying capacity.<br/>
You cannot attack a nation that is younger than Age 21.<br/>
If you take over another nation, you lose 20 sat per turn per nation for having an empire of 2 nations. This loss increases to 80 for an empire of 3, 180 for an empire of 4, etc.
Freshly conquered nations will take on the government and economy of the conquerer's oldest nation.<br/>
If you have a multi-nation empire, you can transfer your forces from one nation to another. Move the forces to the receiving nation to enable transferring them on the Send Forces page.
<center>
<h3>Basic Guide to War, Combat and Empires</h3></br>
</center>
<h4>War</h4></br>
<ul>
<li>You lose 1 satisfaction per turn for every 2 total size of forces you have over 20.</li>
<li>If you cannot pay a unit's upkeep, its ponies lose confidence in your leadership and it immediately evaporates. Don't make a bigger army than you can afford.</li>
<li>You cannot attack a nation that is younger than Age 14.</li>
<li>Free Markets lose 100 sat for attacking other Free Markets, State Controlled economies lose 100 sat for attacking other State Controlled economies, and free countries lose 200 sat for attacking other free countries.</br>
These numbers are per attacking group. You do not get your satisfaction back if you recall your forces.</li>
<li>To travel between regions, cavalry, tanks, and unicorns must be transported, either by air or water, by being in groups with units with enough carrying capacity.</li>
<li>It takes a minimum of: <ul>
<li>12 hours for friendly forces to reach their destination in the same region,</li>
<li>24 hours for enemy forces to reach their destination in the same region,</li>
<li>36 hours for friendly forces to reach their destination from another region,</li>
<li>48 hours for enemy forces to reach their destination from another region.</li>
</ul></li>
<li>These forces only actually get there when fights occur: at midnight and noon server time. These are the "war ticks", and they are also when the upkeep for forces is paid.</li>
</ul></br>
<h4>Combat</h4></br>
<ul>
<li>Both attacking and defending units hit simultaneously.</li>
<li>Units with the highest damage will attack first, followed by the largest units.</br>
Unit types will be attacked in this order: Cavalry, tanks, pegasi, unicorns, naval.</br>
The only exception is units with weapons good against a certain unit type, who will attack that unit type out of order.</li>
<li>Units with the best armor against the particular attacking unit type will defend first, followed by the largest units.</li>
<li>Weapon values are per-hit base damage, and armor values are multipliers to incoming damage (lower = better).</br>
Units without weapons do .25 base damage.</br>
Defending units in their home country take only .75x damage unless the nation's owner is in stasis during the fight.</li>
<li>Training improves units on a slight curve. Units automatically get 1 training at midnight (after any combat).</br>
Units' training cancels out enemy units' training. Units with the maximum amount of training, 20, do 1.5x damage to untrained units and take 0.667x damage from untrained units.</li>
<li>A unit hits for a number of times equal to its size.</br>
For example, a unit of size 6 hits six times (and may destroy multiple units in the process).</br>For each one full point of damage a unit takes, it loses 1 size.</li>
<li>If there are no defenders at the end of a fight, the nation becomes the property of the biggest attacker.</li>
</ul></br>
<h4>Empires</h4></br>
<li>Freshly conquered nations will take on the government and economy of the conqueror’s oldest nation.</li>
<li>If you take over another nation, you lose 20 sat per turn per nation for having an empire of 2 nations. This loss increases to 80 for an empire of 3, 180 for an empire of 4, etc.</li>
<li>If you have a multi-nation empire, you can transfer your forces from one nation to another. Move the forces to the receiving nation to enable transferring them on the Send Forces page.</li>
</ul>
<hr></br>
EOFORM;
echo <<<EOFORM
<center><h3>Weapons</h3></center>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment