Esempio n. 1
0
 function createCyRoster()
 {
     /*
         public $noninjplayercount = 0;
         public $exist_journeyman = false;
         public $jm = 0;
         //team
         public $roster = '';
         public $team_id = 0;
         public $games = 0;
         public $name = '';
         public $race = '';
         public $coach_name = '';
         public $rerolls = 0;
         public $fan_factor = 0;
         public $ass_coaches = 0;
         public $cheerleaders = 0;
         public $apothecary = "false";
         public $treasury = 0;
         //players
         public $players;
     
         public $cyroster = '';
     */
     global $settings;
     $T_RACES_CYANIDE_1 = array(T_RACE_CHAOS, T_RACE_HUMAN, T_RACE_DWARF, T_RACE_SKAVEN, T_RACE_LIZARDMAN, T_RACE_WOOD_ELF, T_RACE_ORC, T_RACE_GOBLIN, T_RACE_DARK_ELF);
     $T_RACES_CYANIDE_2 = array_merge($T_RACES_CYANIDE_1, array(T_RACE_AMAZON, T_RACE_ELF, T_RACE_HALFLING, T_RACE_HIGH_ELF, T_RACE_KHEMRI, T_RACE_NECROMANTIC, T_RACE_NORSE, T_RACE_NURGLE, T_RACE_OGRE, T_RACE_UNDEAD, T_RACE_VAMPIRE));
     if (!in_array($this->race_id, ${"T_RACES_CYANIDE_" . $settings['leegmgr_cyanide_edition']})) {
         $this->error = "The race '{$this->race}' is not a valid Cyanide race in Cyanide edition {$settings['leegmgr_cyanide_edition']}.";
         return false;
     }
     include 'cyanide/lib_cy_team_db.php';
     $cy = new cyanide();
     $cy_team = new cy_team_db();
     $obblm_team['race'] = $this->race;
     $obblm_team['id'] = $this->team_id;
     $obblm_team['name'] = $this->name;
     $obblm_team['colorid'] = $this->cy;
     //rand(1,51); //@FIXME need to map cy colors 51 = brown
     $obblm_team['TeamMOTO'] = 'Live and Let Die!';
     $obblm_team['TeamBackground'] = 'This team is new and needs to prove it can cust the mustard';
     $obblm_team['TeamValue'] = $this->tv / 1000;
     $obblm_team['TeamFanFactor'] = $this->fan_factor;
     $obblm_team['gold'] = $this->treasury;
     $obblm_team['Cheerleaders'] = $this->cheerleaders;
     $obblm_team['AssistantCoaches'] = $this->ass_coaches;
     $obblm_team['apothecary'] = $this->apothecary == "true" ? 1 : 0;
     $obblm_team['rerolls'] = $this->rerolls;
     //conversions
     $cy->convert_race_id('cyid', $obblm_team['race']);
     //BUILD TEAM DATA
     $cy->set_team_constants();
     $cy->set_team_id($obblm_team['id']);
     $cy->set_team_name($obblm_team['name']);
     $cy->set_team_race_id($cy->race['id']);
     $cy->set_team_logo($cy->race['name'] . '_01');
     $cy->set_team_color($obblm_team['colorid']);
     $cy->set_team_moto($obblm_team['TeamMOTO']);
     $cy->set_team_background($obblm_team['TeamBackground']);
     $cy->set_team_value($obblm_team['TeamValue']);
     $cy->set_team_fanfactor($obblm_team['TeamFanFactor']);
     $cy->set_team_gold($obblm_team['gold']);
     $cy->set_team_cheerleaders($obblm_team['Cheerleaders']);
     $cy->set_team_assistantcoaches($obblm_team['AssistantCoaches']);
     $cy->set_team_apothecary($obblm_team['apothecary']);
     $cy->set_team_rerolls($obblm_team['rerolls']);
     $cy->set_team_rank_constants();
     //Build Race Data
     $cy->set_reroll_price($obblm_team['race']);
     $obblm_team['players'] = $this->obblm_team['players'];
     foreach ($obblm_team['players'] as $i => $player) {
         if ($player['Number'] < 1 || $player['Number'] > 32) {
             $this->error = "Player numbers must be between 1 and 32 to be valid for this roster output.";
             return false;
         }
         $local_id = $player['id'];
         $cy->add_player_to_array($local_id, $player['name'], $cy->convert_player_type($player['type']), $cy->team['ID'], $cy->race['id'], $player['skin'], $player['age'], $player['Number'], $cy->convert_ma($player['MA']), $cy->convert_st($player['ST']), $cy->convert_ag($player['AG']), $cy->convert_av($player['AV']), $player['Level'], $player['SPP'], $player['COST'], $player['VALUE']);
         //SKILLS
         foreach ($player['Skills'] as $ii => $skill) {
             if ($skill == False) {
             } else {
                 $cy->set_player_skills($local_id, $skill);
             }
         }
         //casulalty and injuries
         foreach ($player['Casualty'] as $ii => $cas) {
             if ($cas == False) {
             } else {
                 $cy->set_player_casualty($local_id, $cas);
             }
         }
     }
     $tempdir = sys_get_temp_dir();
     $cy_team->make_cy_roster(sys_get_temp_dir() . "/", 'NotUsed', $cy->players, $cy->team, $cy->race, $cy->player_skills, $cy->casualty);
     $filename = sys_get_temp_dir() . "/" . $obblm_team['name'] . ".db";
     $this->cy_teamname = $obblm_team['name'];
     $handle = fopen($filename, "r");
     $this->cyroster = fread($handle, filesize($filename));
     fclose($handle);
 }
Esempio n. 2
0
<?php

include 'lib_cy_team_db.php';
$cy = new cyanide();
$cy_team = new cy_team_db();
$obblm_team['race'] = "Skaven";
$obblm_team['id'] = 105;
$obblm_team['name'] = 'TeamSkaven';
$obblm_team['colorid'] = 51;
//@FIXME need to map cy colors 51 = brown
$obblm_team['TeamMOTO'] = 'Live and Let Die!';
$obblm_team['TeamBackground'] = 'This team is new and needs to prove it can cust the mustard';
$obblm_team['TeamValue'] = 1800;
$obblm_team['TeamFanFactor'] = 6;
$obblm_team['gold'] = 130000;
$obblm_team['Cheerleaders'] = 8;
$obblm_team['apothecary'] = 1;
$obblm_team['rerolls'] = 4;
//conversions
$cy->convert_race_id('cyid', $obblm_team['race']);
//BUILD TEAM DATA
$cy->set_team_constants();
$cy->set_team_id($obblm_team['id']);
$cy->set_team_name($obblm_team['name']);
$cy->set_team_race_id($cy->race['id']);
$cy->set_team_logo($cy->race['name'] . '_01');
$cy->set_team_color($obblm_team['colorid']);
$cy->set_team_moto($obblm_team['TeamMOTO']);
$cy->set_team_background($obblm_team['TeamBackground']);
$cy->set_team_value($obblm_team['TeamValue']);
$cy->set_team_fanfactor($obblm_team['TeamFanFactor']);