Permalink
Browse files

Removed lrb5+5b support

  • Loading branch information...
nicholas.rathmann
nicholas.rathmann committed Feb 3, 2010
1 parent ac5653e commit 60307fcd2c552bd8ea0f5510950b2880e9dd6fba
View
@@ -1 +1,2 @@
Please replace the contents of this file, <i>LEAGUERULES</i>, with a description of your league rules.
Please replace the contents of this file, <i>LEAGUERULES</i>, with a description of your leagues' rules.<br>
OBBLM supports the rules of LRB6, but can be customized by editing the <i>settings.php</i> file.
View
@@ -25,9 +25,11 @@
<form method="POST">
<b>DB synchronisation procedures:</b><br>
<INPUT TYPE=RADIO NAME="act" VALUE="syncAll()"><i>syncAll()</i> - Synchronises all stats, relations and dynamic properties - may take a few minutes!<br>
<!--
<INPUT TYPE=RADIO NAME="act" VALUE="syncAllMVs()"><i>syncAllMVs()</i> - Synchronises all stats.<br>
<INPUT TYPE=RADIO NAME="act" VALUE="syncAllDProps()"><i>syncAllDProps()</i> - Synchronises all dynamic properties (TVs, PVs etc.).<br>
<INPUT TYPE=RADIO NAME="act" VALUE="syncAllRels()"><i>syncAllRels()</i> - Synchronises all object (player, team, coach) ownership relations.<br>
-->
<br><b>DB maitenance:</b><br>
<INPUT TYPE=RADIO NAME="act" VALUE="gdsync">Synchronise the PHP-stored BB game data (<i>lib/game_data*.php</i> files) with DB. <u>Run this when</u> having changed the BB game data files.<br>
<INPUT TYPE=RADIO NAME="act" VALUE="funcs">Re-install DB back-end procedures and functions. <u>Run this when</u> having altered the "house ranking systems" rule definitions defined in <i>settings.php</i>.<br>
View
@@ -26,7 +26,6 @@
'wt_0' => 'wt',
'gf_0' => 'gf',
'ga_0' => 'ga',
'tcas_0' => 'tcas',
);
foreach ($xmlteams->team as $t) {
View
@@ -1,7 +1,7 @@
<?php
/*
* Copyright (c) Nicholas Mossor Rathmann <nicholas.rathmann@gmail.com> 2008-2009. All Rights Reserved.
* Copyright (c) Nicholas Mossor Rathmann <nicholas.rathmann@gmail.com> 2008-2010. All Rights Reserved.
*
*
* This file is part of OBBLM.
@@ -82,10 +82,7 @@
// General OBBLM routines and data structures.
require_once('settings.php');
require_once('lib/game_data.php'); # LRB5
if ($rules['enable_lrb6']) {
require_once('lib/game_data_lrb6.php'); # LRB6
}
require_once('lib/game_data_lrb6.php'); # LRB6
require_once('lib/mysql.php');
require_once('lib/misc_functions.php');
View
@@ -17,8 +17,9 @@
<li>WT is Won Tournaments.</li>
<li>PTS is Points</li>
<li>SMP denotes Sportsmanship Points</li>
<li>tcas denotes total team cas</li>
<li>tcasf and tcasa denotes total team cas For and Against</li>
<li>sdiff denotes score difference (ie. arithmetic value of GF-GA)</li>
<li>tcdiff denotes total team cas difference (ie. arithmetic value of tcasf-tcasa)</li>
</ul>
</small>
</body>
View
@@ -513,42 +513,7 @@
</matches>
<rules>
<intro>
<![CDATA[
OBBLM supports the rules of <a href="http://www.bloodbowlonline.com/LivingRulebook5.pdf">LRB5</a>, but can be customized by editing the <i>settings.php</i> file.
<br><br>
OBBLM is currently set to use the following rules:
<br><br>
]]>
</intro>
<rule>Rule</rule>
<val>Value</val>
<yes>Yes</yes>
<no>No</no>
<unlimited>Unlimited</unlimited>
<refundptc>% refund</refundptc>
<rr_price>Static re-roll prices</rr_price>
<ap_price>Price of apothecary</ap_price>
<ff_price>Price of fan factor</ff_price>
<ac_price>Price of assistant coaches</ac_price>
<cl_price>Price of cheerleaders</cl_price>
<init_ts>Initial treasury</init_ts>
<init_rr>Initial re-rolls</init_rr>
<init_ff>Initial fan factor</init_ff>
<init_ac>Initial assistant coaches</init_ac>
<init_cl>Initial cheerleaders</init_cl>
<max_rr>Maximum re-rolls</max_rr>
<max_ff>Maximum fan factor</max_ff>
<max_ac>Maximum assistant coaches</max_ac>
<max_cl>Maximum cheerleaders</max_cl>
<max_jm>Journeymen limit</max_jm>
<max_pl>Maximum players on team</max_pl>
<refund>Player refund (on firing/selling)</refund>
<enable_lrb6>Enable LRB6 extensions</enable_lrb6>
<enable_post_ff>Allow post first game FF purchase</enable_post_ff>
<!-- None -->
</rules>
<about>
@@ -702,8 +667,7 @@
</en-GB>
<!-- Spanish is only PARTLY implemented -->
<!-- Spanish -->
<es>
@@ -1216,43 +1180,9 @@
</matches>
<rules>
<intro>
<![CDATA[
OBBLM soporta las reglas <a href="http://www.bloodbowlonline.com/LivingRulebook5.pdf">LRB5</a>, pero estas se pueden cambiar modificando el archivo <i>settings.php</i>
<br><br>
Esta instalación de OBBLM usa las siguientes reglas:
<br><br>
]]>
</intro>
<rule>Regla</rule>
<val>Valor</val>
<yes>Si</yes>
<no>No</no>
<unlimited>Ilimitado</unlimited>
<refundptc>% devolución</refundptc>
<rr_price>Precios estáticos de las segundas oportunidades</rr_price>
<ap_price>Precio del médico</ap_price>
<ff_price>Precio del factor de hinchas</ff_price>
<ac_price>Precio de los ayudantes del entrenador</ac_price>
<cl_price>Precio de las animadoras</cl_price>
<init_ts>Tesorería inicial</init_ts>
<init_rr>Segundas Oportunidades iniciales</init_rr>
<init_ff>Factor de Hinchas inicial</init_ff>
<init_ac>Ayudantes del entrenador iniciales</init_ac>
<init_cl>Animadoras iniciales</init_cl>
<max_rr>Segundas oportunidades máximas</max_rr>
<max_ff>Factor de Hinchas máximo</max_ff>
<max_ac>Ayudantes del entrenador máximos</max_ac>
<max_cl>Animadoras máximas</max_cl>
<max_jm>Límite de Independientes</max_jm>
<max_pl>Número máximo de jugadores en el equipo</max_pl>
<refund>Devolución de dinero por venta o despido de jugadores</refund>
<enable_lrb6>Activar extensiones LRB6</enable_lrb6>
<enable_post_ff>Permitir la compra de Factor de Hinchas tras el primer partido</enable_post_ff>
</rules>
<!-- None -->
</rules>
<about>
<intro>Introducción</intro>
<intro_txt>
@@ -170,8 +170,7 @@ private function _newTeam($ALLOW_EDIT)
'ff_bought' => $rules['initial_fan_factor'],
'ass_coaches' => $rules['initial_ass_coaches'],
'cheerleaders' => $rules['initial_cheerleaders'],
'won_0' => 0, 'lost_0' => 0, 'draw_0' => 0, 'played_0' => 0, 'wt_0' => 0,
'gf_0' => 0, 'ga_0' => 0, 'tcas_0' => 0,
'won_0' => 0, 'lost_0' => 0, 'draw_0' => 0, 'played_0' => 0, 'wt_0' => 0, 'gf_0' => 0, 'ga_0' => 0,
'imported' => 0,
'f_lid' => (int) $_POST['lid'],
'f_did' => isset($_POST['did']) ? (int) $_POST['did'] : Team::T_NO_DIVISION_TIE,
View
@@ -260,7 +260,9 @@ public static function standings($obj, $node, $node_id, array $opts)
'tv' => array('desc' => $lng->getTrn('common/value'), 'kilo' => true, 'suffix' => 'k'),
);
$fields_after = array(
'mv_tcas' => array('desc' => 'tcas'),
'mv_tcasa' => array('desc' => 'tcasa'),
'mv_tcasf' => array('desc' => 'tcasf'),
'mv_tcdiff' => array('desc' => 'tcdiff'),
'mv_smp' => array('desc' => 'SMP'),
);
if ($ALL_TIME) {
@@ -327,6 +329,9 @@ public static function standings($obj, $node, $node_id, array $opts)
'name' => array('desc' => $lng->getTrn('common/coach'), 'href' => array('link' => urlcompile(T_URL_PROFILE,T_OBJ_COACH,false,false,false), 'field' => 'obj_id', 'value' => 'coach_id')),
);
$fields_after = array(
'mv_tcasa' => array('desc' => 'tcasa'),
'mv_tcasf' => array('desc' => 'tcasf'),
'mv_tcdiff' => array('desc' => 'tcdiff'),
'mv_smp' => array('desc' => 'SMP'),
);
if ($sel_node == T_NODE_TOURNAMENT) {
@@ -787,7 +792,7 @@ public static function sort_table($title, $lnk, array $objs, array $fields, arra
if (array_key_exists('kilo', $a) && $a['kilo'])
$cpy /= 1000;
$cpy = (string) $cpy;
if (is_numeric($cpy) && !ctype_digit($cpy))
if (is_numeric($cpy) && !ctype_digit(($cpy[0] == '-') ? substr($cpy,1) : $cpy))
$cpy = sprintf("%1.2f", $cpy);
if (array_key_exists('suffix', $a) && $a['suffix'])
$cpy .= $a['suffix'];
View
@@ -777,7 +777,7 @@ public static function create(array $input, array $opts) {
self::T_CREATE_ERROR__JM_LIMIT_REACHED => $JM && $team->isJMLimitReached(),
// Is position valid to make a journeyman?
// Journeymen may be made from those positions, from which 16 players of the position is allowed on a team.
self::T_CREATE_ERROR__INVALID_JM_POS => $JM && $DEA[$team->f_rname]['players'][get_alt_col('game_data_players', 'pos_id', (int) $input['f_pos_id'], 'pos')]['qty'] < (($rules['enable_lrb6']) ? 12 : 16),
self::T_CREATE_ERROR__INVALID_JM_POS => $JM && $DEA[$team->f_rname]['players'][get_alt_col('game_data_players', 'pos_id', (int) $input['f_pos_id'], 'pos')]['qty'] < 12,
);
foreach ($errors as $exitStatus => $halt) {
if ($halt && !($FORCE && in_array($exitStatus, $ignoreableErrors))) return array($exitStatus, null);
View
@@ -69,8 +69,8 @@ public static function mkHRS(array $HRSs)
global $CT_cols, $core_tables;
$allowed_fields = array(
'mvp', 'cp', 'td', 'intcpt', 'bh', 'si', 'ki', 'cas', 'tdcas', 'tcas', 'smp', 'elo',
'gf', 'ga', 'sdiff', 'won', 'lost', 'draw', 'swon', 'slost', 'sdraw', 'played', 'win_pct',
'mvp', 'cp', 'td', 'intcpt', 'bh', 'si', 'ki', 'cas', 'tdcas', 'smp', 'elo',
'gf', 'ga', 'sdiff', 'tcasf', 'tcasa', 'tcdiff', 'won', 'lost', 'draw', 'swon', 'slost', 'sdraw', 'played', 'win_pct',
);
$query = 'CREATE FUNCTION getPTS(tid '.$CT_cols[T_OBJ_TEAM].', trid '.$CT_cols[T_NODE_TOURNAMENT].')
RETURNS '.$CT_cols['pts'].'
@@ -125,7 +125,8 @@ public static function installProcsAndFuncs($install = true)
draw = IFNULL((SELECT SUM(IF((team1_id = tid OR team2_id = tid) AND team1_score = team2_score, 1, 0)) REGEX_REPLACE_HERE), 0),
gf = IFNULL((SELECT SUM(IF(team1_id = tid, team1_score, IF(team2_id = tid, team2_score, 0))) REGEX_REPLACE_HERE), 0),
ga = IFNULL((SELECT SUM(IF(team1_id = tid, team2_score, IF(team2_id = tid, team1_score, 0))) REGEX_REPLACE_HERE), 0),
tcas = IFNULL((SELECT SUM(IF(team1_id = tid, tcas1, IF(team2_id = tid, tcas2, 0))) REGEX_REPLACE_HERE), 0),
tcasf = IFNULL((SELECT SUM(IF(team1_id = tid, tcas1, IF(team2_id = tid, tcas2, 0))) REGEX_REPLACE_HERE), 0),
tcasa = IFNULL((SELECT SUM(IF(team1_id = tid, tcas2, IF(team2_id = tid, tcas1, 0))) REGEX_REPLACE_HERE), 0),
smp = IFNULL((SELECT SUM(IF(team1_id = tid, smp1, IF(team2_id = tid, smp2, 0))) REGEX_REPLACE_HERE), 0),
ff = IFNULL((SELECT SUM(IF(team1_id = tid, ffactor1, IF(team2_id = tid, ffactor2, 0))) REGEX_REPLACE_HERE), 0)
';
@@ -836,7 +837,7 @@ public static function installProcsAndFuncs($install = true)
ELSE
UPDATE mv_players '.$mstat_fields_stars.' WHERE f_pid = pid AND f_trid = trid;
END IF;
UPDATE mv_players SET win_pct = winPct(won,lost,draw,played), sdiff = CAST(gf-ga AS SIGNED) WHERE f_pid = pid AND f_trid = trid;
UPDATE mv_players SET win_pct = winPct(won,lost,draw,played), sdiff = CAST(gf-ga AS SIGNED), tcdiff = CAST(tcasf-tcasa AS SIGNED) WHERE f_pid = pid AND f_trid = trid;
/* ES */
DELETE FROM mv_es_players WHERE f_pid = pid AND f_trid = trid;
@@ -867,7 +868,7 @@ public static function installProcsAndFuncs($install = true)
FROM match_data
WHERE match_data.f_team_id = tid AND match_data.f_tour_id = trid;
UPDATE mv_teams '.$mstat_fields_team.' WHERE f_tid = tid AND f_trid = trid;
UPDATE mv_teams SET win_pct = winPct(won,lost,draw,played), sdiff = CAST(gf-ga AS SIGNED) WHERE f_tid = tid AND f_trid = trid;
UPDATE mv_teams SET win_pct = winPct(won,lost,draw,played), sdiff = CAST(gf-ga AS SIGNED), tcdiff = CAST(tcasf-tcasa AS SIGNED) WHERE f_tid = tid AND f_trid = trid;
UPDATE mv_teams SET pts = getPTS(f_tid, f_trid) WHERE f_tid = tid AND f_trid = trid;
/* ES */
@@ -896,7 +897,7 @@ public static function installProcsAndFuncs($install = true)
FROM match_data
WHERE match_data.f_coach_id = cid AND match_data.f_tour_id = trid;
UPDATE mv_coaches '.$mstat_fields_coach.' WHERE f_cid = cid AND f_trid = trid;
UPDATE mv_coaches SET win_pct = winPct(won,lost,draw,played), sdiff = CAST(gf-ga AS SIGNED) WHERE f_cid = cid AND f_trid = trid;
UPDATE mv_coaches SET win_pct = winPct(won,lost,draw,played), sdiff = CAST(gf-ga AS SIGNED), tcdiff = CAST(tcasf-tcasa AS SIGNED) WHERE f_cid = cid AND f_trid = trid;
/* ES */
DELETE FROM mv_es_coaches WHERE f_cid = cid AND f_trid = trid;
@@ -924,7 +925,7 @@ public static function installProcsAndFuncs($install = true)
FROM match_data
WHERE match_data.f_race_id = rid AND match_data.f_tour_id = trid;
UPDATE mv_races '.$mstat_fields_race.' WHERE f_rid = rid AND f_trid = trid;
UPDATE mv_races SET win_pct = winPct(won,lost,draw,played), sdiff = CAST(gf-ga AS SIGNED) WHERE f_rid = rid AND f_trid = trid;
UPDATE mv_races SET win_pct = winPct(won,lost,draw,played), sdiff = CAST(gf-ga AS SIGNED), tcdiff = CAST(tcasf-tcasa AS SIGNED) WHERE f_rid = rid AND f_trid = trid;
/* ES */
DELETE FROM mv_es_races WHERE f_rid = rid AND f_trid = trid;
View
@@ -59,7 +59,6 @@ class Team
public $wt_0 = 0;
public $gf_0 = 0;
public $ga_0 = 0;
public $tcas_0 = 0;
/***************
* Methods
@@ -491,7 +490,7 @@ public static function getTeams($race_id = false) {
public static $createEXPECTED = array(
'name','owned_by_coach_id','f_race_id','f_lid','f_did',
'treasury', 'apothecary', 'rerolls', 'ff_bought', 'ass_coaches', 'cheerleaders',
'won_0','lost_0','draw_0','played_0','wt_0','gf_0','ga_0','tcas_0','imported',
'won_0','lost_0','draw_0','played_0','wt_0','gf_0','ga_0','imported',
);
public static function create(array $input) {
@@ -664,14 +664,14 @@ private function _actionBoxes($ALLOW_EDIT, $players)
</tr>
<tr>
<td><?php echo $lng->getTrn('common/league');?></td>
<td><?php echo $leagues[$team->f_lid]['lname'];?></td>
<td><?php echo isset($leagues[$team->f_lid]) ? $leagues[$team->f_lid]['lname'] : '<i>'.$lng->getTrn('common/none').'</i>';?></td>
</tr>
<?php
if ($team->f_did != self::T_NO_DIVISION_TIE) {
?>
<tr>
<td><?php echo $lng->getTrn('common/division');?></td>
<td><?php echo $divisions[$team->f_did]['dname'];?></td>
<td><?php echo isset($divisions[$team->f_did]) ? $divisions[$team->f_did]['dname'] : '<i>'.$lng->getTrn('common/none').'</i>';?></td>
</tr>
<?php
}
@@ -840,7 +840,7 @@ private function _actionBoxes($ALLOW_EDIT, $players)
// Show players on the select list if buyable, or if player is a potential journeyman AND team has not reached journeymen limit.
if (($team->isPlayerBuyable($details['pos_id']) && $team->treasury >= $details['cost']) ||
(($details['qty'] == 16 || (($rules['enable_lrb6']) ? ($details['qty'] == 12) : false)) && count($active_players) < $rules['journeymen_limit'])) {
(($details['qty'] == 16 || $details['qty'] == 12) && count($active_players) < $rules['journeymen_limit'])) {
echo "<option value='$details[pos_id]'>" . $details['cost']/1000 . "k | $pos</option>\n";
$DISABLE = false;
}
View
@@ -20,6 +20,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
require('lib/game_data.php'); # LRB5
/*
* Game data replacement for LRB6 experimental rules (LRB5b).
View
@@ -163,7 +163,7 @@ function rule_dict(array $sortRule) {
'date_played' => 'date played',
'wt_cnt' => 'WT',
'sdiff' => 'score diff.',
# 'cdiff' => 'tcas diff.',
'tcdiff' => 'tcas diff.',
'tdcas' => '{td+cas}',
'swon' => 'SW',
'slost' => 'SL',
Oops, something went wrong.

0 comments on commit 60307fc

Please sign in to comment.