示例#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);
 }
示例#2
0
    //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);
        }
    }
}
$cy_team->make_cy_roster('data/teams/', 'NotUsed', $cy->players, $cy->team, $cy->race, $cy->player_skills, $cy->casualty);
//BUILD PLAYER DATA
//Set Injurys of player including longterm ones and death
//$cy->set_player_casualty(919,'Smashed Collar Bone');
/*
$cy->add_player_to_array(915,'Lhycut Speed Demon (C)',18,$cy->team['ID'],$cy->race['id'],3,'100.',17,83.33,40,66.664,58.333,4,38,80000,170);
$cy->set_player_skills(915,'Claw/Claws');
$cy->set_player_skills(915,'Big Hand');
$cy->set_player_skills(915,'MA +1');

$cy->add_player_to_array(916,'Deeych                ',19,$cy->team['ID'],$cy->race['id'],1,'100.',18,58.331,50,49.998,72.222,3,17,90000,130);
$cy->set_player_skills(916,'Tackle');
$cy->set_player_skills(916,'Strip Ball');

$cy->add_player_to_array(917,'leekch                ',19,$cy->team['ID'],$cy->race['id'],2,'100.',22,58.331,50,49.998,72.222,3,28,90000,140);
$cy->set_player_skills(917,'Dauntless');