function __construct($data = null, $arg = false, $scenario = false) { parent::__construct($data, $arg, $scenario); $crt = new \Wargame\TMCW\CombatResultsTable(); $this->combatRules->injectCrt($crt); if ($data) { } else { $this->victory = new \Wargame\Victory("\\Wargame\\TMCW\\RetreatOne\\retreatOneVictoryCore"); if (!empty($scenario->supplyLen)) { $this->victory->setSupplyLen($scenario->supplyLen); } if ($scenario && !empty($scenario->supply) === true) { $this->moveRules->enterZoc = 2; $this->moveRules->exitZoc = 1; $this->moveRules->noZocZocOneHex = true; } else { $this->moveRules->enterZoc = "stop"; $this->moveRules->exitZoc = 0; $this->moveRules->noZocZocOneHex = false; } // game data $this->gameRules->setMaxTurn(15); $this->gameRules->setInitialPhaseMode(RED_DEPLOY_PHASE, DEPLOY_MODE); $this->gameRules->attackingForceId = RED_FORCE; /* object oriented! */ $this->gameRules->defendingForceId = BLUE_FORCE; /* object oriented! */ $this->force->setAttackingForceId($this->gameRules->attackingForceId); /* so object oriented */ $this->gameRules->addPhaseChange(RED_DEPLOY_PHASE, BLUE_DEPLOY_PHASE, DEPLOY_MODE, BLUE_FORCE, RED_FORCE, false); $this->gameRules->addPhaseChange(BLUE_DEPLOY_PHASE, BLUE_MOVE_PHASE, MOVING_MODE, BLUE_FORCE, RED_FORCE, false); $this->gameRules->addPhaseChange(BLUE_MOVE_PHASE, BLUE_COMBAT_PHASE, COMBAT_SETUP_MODE, BLUE_FORCE, RED_FORCE, false); $this->gameRules->addPhaseChange(BLUE_COMBAT_PHASE, BLUE_MECH_PHASE, MOVING_MODE, BLUE_FORCE, RED_FORCE, false); $this->gameRules->addPhaseChange(BLUE_MECH_PHASE, RED_MOVE_PHASE, MOVING_MODE, RED_FORCE, BLUE_FORCE, false); $this->gameRules->addPhaseChange(RED_MOVE_PHASE, RED_COMBAT_PHASE, COMBAT_SETUP_MODE, RED_FORCE, BLUE_FORCE, false); $this->gameRules->addPhaseChange(RED_COMBAT_PHASE, RED_MECH_PHASE, MOVING_MODE, RED_FORCE, BLUE_FORCE, false); $this->gameRules->addPhaseChange(RED_MECH_PHASE, BLUE_MOVE_PHASE, MOVING_MODE, BLUE_FORCE, RED_FORCE, true); } }
function __construct($data = null, $arg = false, $scenario = false) { // die("const"); parent::__construct($data, $arg, $scenario); $crt = new \Wargame\TMCW\MartianCivilWar\CombatResultsTable(); $this->combatRules->injectCrt($crt); if ($data) { } else { $this->terrainName = "terrain-MartianCivilWar"; $this->victory = new \Wargame\Victory("\\Wargame\\TMCW\\MartianCivilWar\\victoryCore"); if (!empty($scenario->supplyLen)) { $this->victory->setSupplyLen($scenario->supplyLen); } if (!empty($scenario->supply)) { $this->moveRules->enterZoc = 2; $this->moveRules->exitZoc = 1; $this->moveRules->noZocZocOneHex = true; } else { $this->moveRules->enterZoc = "stop"; $this->moveRules->exitZoc = 0; $this->moveRules->noZocZocOneHex = false; } $this->combatRules->crt->aggressorId = REBEL_FORCE; // game data $this->gameRules->setMaxTurn(7); $this->gameRules->setInitialPhaseMode(BLUE_MOVE_PHASE, MOVING_MODE); $this->gameRules->addPhaseChange(BLUE_REPLACEMENT_PHASE, BLUE_MOVE_PHASE, MOVING_MODE, BLUE_FORCE, RED_FORCE, false); $this->gameRules->addPhaseChange(BLUE_MOVE_PHASE, BLUE_COMBAT_PHASE, COMBAT_SETUP_MODE, BLUE_FORCE, RED_FORCE, false); $this->gameRules->addPhaseChange(BLUE_COMBAT_PHASE, BLUE_MECH_PHASE, MOVING_MODE, BLUE_FORCE, RED_FORCE, false); $this->gameRules->addPhaseChange(BLUE_MECH_PHASE, RED_REPLACEMENT_PHASE, REPLACING_MODE, RED_FORCE, BLUE_FORCE, false); $this->gameRules->addPhaseChange(RED_REPLACEMENT_PHASE, RED_MOVE_PHASE, MOVING_MODE, RED_FORCE, BLUE_FORCE, false); $this->gameRules->addPhaseChange(RED_MOVE_PHASE, RED_COMBAT_PHASE, COMBAT_SETUP_MODE, RED_FORCE, BLUE_FORCE, false); $this->gameRules->addPhaseChange(RED_COMBAT_PHASE, RED_MECH_PHASE, MOVING_MODE, RED_FORCE, BLUE_FORCE, false); $this->gameRules->addPhaseChange(RED_MECH_PHASE, BLUE_REPLACEMENT_PHASE, REPLACING_MODE, BLUE_FORCE, RED_FORCE, true); } }
function __construct($data = null, $arg = false, $scenario = false) { parent::__construct($data, $arg, $scenario); $crt = new \Wargame\TMCW\Moskow\CombatResultsTable(); $this->combatRules->injectCrt($crt); if ($data) { $this->specialHexA = $data->specialHexA; $this->specialHexB = $data->specialHexB; $this->specialHexC = $data->specialHexC; } else { $this->victory = new \Wargame\Victory("Wargame\\TMCW\\Moskow\\moskowVictoryCore"); if (!empty($scenario->supplyLen)) { $this->victory->setSupplyLen($scenario->supplyLen); } $this->moveRules->enterZoc = "stop"; $this->moveRules->exitZoc = 0; $this->moveRules->noZocZocOneHex = false; // game data $this->gameRules->setMaxTurn(11); $this->gameRules->setInitialPhaseMode(RED_DEPLOY_PHASE, DEPLOY_MODE); $this->gameRules->attackingForceId = RED_FORCE; /* object oriented! */ $this->gameRules->defendingForceId = BLUE_FORCE; /* object oriented! */ $this->force->setAttackingForceId($this->gameRules->attackingForceId); /* so object oriented */ $this->gameRules->addPhaseChange(RED_DEPLOY_PHASE, BLUE_DEPLOY_PHASE, DEPLOY_MODE, GERMAN_FORCE, SOVIET_FORCE, false); $this->gameRules->addPhaseChange(BLUE_DEPLOY_PHASE, BLUE_MOVE_PHASE, MOVING_MODE, GERMAN_FORCE, SOVIET_FORCE, false); $this->gameRules->addPhaseChange(BLUE_REPLACEMENT_PHASE, BLUE_MOVE_PHASE, MOVING_MODE, GERMAN_FORCE, SOVIET_FORCE, false); $this->gameRules->addPhaseChange(BLUE_MOVE_PHASE, BLUE_COMBAT_PHASE, COMBAT_SETUP_MODE, GERMAN_FORCE, SOVIET_FORCE, false); $this->gameRules->addPhaseChange(BLUE_COMBAT_PHASE, BLUE_MECH_PHASE, MOVING_MODE, GERMAN_FORCE, SOVIET_FORCE, false); $this->gameRules->addPhaseChange(BLUE_MECH_PHASE, RED_REPLACEMENT_PHASE, REPLACING_MODE, SOVIET_FORCE, GERMAN_FORCE, false); $this->gameRules->addPhaseChange(RED_REPLACEMENT_PHASE, RED_MOVE_PHASE, MOVING_MODE, SOVIET_FORCE, GERMAN_FORCE, false); $this->gameRules->addPhaseChange(RED_MOVE_PHASE, RED_COMBAT_PHASE, COMBAT_SETUP_MODE, SOVIET_FORCE, GERMAN_FORCE, false); $this->gameRules->addPhaseChange(RED_COMBAT_PHASE, RED_MECH_PHASE, MOVING_MODE, SOVIET_FORCE, GERMAN_FORCE, false); $this->gameRules->addPhaseChange(RED_MECH_PHASE, BLUE_REPLACEMENT_PHASE, REPLACING_MODE, GERMAN_FORCE, SOVIET_FORCE, true); } }
function __construct($data = null, $arg = false, $scenario = false) { parent::__construct($data, $arg, $scenario); $crt = new \Wargame\TMCW\Chawinda1965\CombatResultsTable(); $this->combatRules->injectCrt($crt); $this->mapData = MapData::getInstance(); if ($data) { $this->specialHexA = $data->specialHexA; $this->specialHexB = $data->specialHexB; $this->specialHexC = $data->specialHexC; } else { $this->victory = new \Wargame\Victory("Wargame\\TMCW\\Chawinda1965\\chawinda1965VictoryCore"); if (!empty($scenario->supplyLen)) { $this->victory->setSupplyLen($scenario->supplyLen); } $this->moveRules->enterZoc = 1; $this->moveRules->exitZoc = 2; $this->moveRules->noZocZocOneHex = false; $this->moveRules->stacking = 3; $this->moveRules->friendlyAllowsRetreat = true; $this->moveRules->blockedRetreatDamages = true; $this->gameRules->legacyExchangeRule = false; // game data $this->gameRules->setMaxTurn(8); $this->gameRules->setInitialPhaseMode(BLUE_DEPLOY_PHASE, DEPLOY_MODE); $this->gameRules->attackingForceId = BLUE_FORCE; /* object oriented! */ $this->gameRules->defendingForceId = RED_FORCE; /* object oriented! */ $this->force->setAttackingForceId($this->gameRules->attackingForceId); /* so object oriented */ $this->gameRules->addPhaseChange(BLUE_DEPLOY_PHASE, RED_DEPLOY_PHASE, DEPLOY_MODE, PAKISTANI_FORCE, INDIAN_FORCE, false); $this->gameRules->addPhaseChange(RED_DEPLOY_PHASE, BLUE_MOVE_PHASE, MOVING_MODE, INDIAN_FORCE, PAKISTANI_FORCE, false); // $this->gameRules->addPhaseChange(BLUE_REPLACEMENT_PHASE, BLUE_MOVE_PHASE, MOVING_MODE, INDIAN_FORCE, PAKISTANI_FORCE, false); $this->gameRules->addPhaseChange(BLUE_MOVE_PHASE, BLUE_COMBINE_PHASE, COMBINING_MODE, INDIAN_FORCE, PAKISTANI_FORCE, false); $this->gameRules->addPhaseChange(BLUE_COMBINE_PHASE, BLUE_COMBAT_PHASE, COMBAT_SETUP_MODE, INDIAN_FORCE, PAKISTANI_FORCE, false); $this->gameRules->addPhaseChange(BLUE_COMBAT_PHASE, BLUE_MECH_PHASE, MOVING_MODE, INDIAN_FORCE, PAKISTANI_FORCE, false); $this->gameRules->addPhaseChange(BLUE_MECH_PHASE, BLUE_MECH_COMBINE_PHASE, COMBINING_MODE, INDIAN_FORCE, PAKISTANI_FORCE, false); $this->gameRules->addPhaseChange(BLUE_MECH_COMBINE_PHASE, RED_MOVE_PHASE, MOVING_MODE, PAKISTANI_FORCE, INDIAN_FORCE, false); // $this->gameRules->addPhaseChange(RED_REPLACEMENT_PHASE, RED_MOVE_PHASE, MOVING_MODE, PAKISTANI_FORCE, INDIAN_FORCE, false); $this->gameRules->addPhaseChange(RED_MOVE_PHASE, RED_COMBINE_PHASE, COMBINING_MODE, PAKISTANI_FORCE, INDIAN_FORCE, false); $this->gameRules->addPhaseChange(RED_COMBINE_PHASE, RED_COMBAT_PHASE, COMBAT_SETUP_MODE, PAKISTANI_FORCE, INDIAN_FORCE, false); $this->gameRules->addPhaseChange(RED_COMBAT_PHASE, RED_MECH_PHASE, MOVING_MODE, PAKISTANI_FORCE, INDIAN_FORCE, false); $this->gameRules->addPhaseChange(RED_MECH_PHASE, RED_MECH_COMBINE_PHASE, COMBINING_MODE, PAKISTANI_FORCE, INDIAN_FORCE, false); $this->gameRules->addPhaseChange(RED_MECH_COMBINE_PHASE, BLUE_MOVE_PHASE, MOVING_MODE, INDIAN_FORCE, PAKISTANI_FORCE, true); } $this->moveRules->stacking = function ($mapHex, $forceId, $unit) { $limit = 0; if ($unit->isReduced !== true) { $limit++; } $limit++; foreach ($mapHex->forces[$forceId] as $mKey => $mVal) { if ($this->force->units[$mKey]->isReduced !== true) { $limit++; } $limit++; } return $limit > 6; }; }
function __construct($data = null, $arg = false, $scenario = false) { parent::__construct($data, $arg, $scenario); $crt = new NomonhanCombatResultsTable(); $this->combatRules->injectCrt($crt); if ($data) { } else { $this->victory = new \Wargame\Victory("\\Wargame\\TMCW\\Nomonhan\\nomonhanVictoryCore"); // $this->mapData->setData(40, 25, "js/Nomonhan3Small.png"); // $this->terrain->setMaxHex("4025"); if ($scenario && !empty($scenario->supply) === true) { $this->moveRules->enterZoc = 2; $this->moveRules->exitZoc = 1; $this->moveRules->noZocZocOneHex = true; } else { $this->moveRules->enterZoc = "stop"; $this->moveRules->exitZoc = 0; $this->moveRules->noZocZocOneHex = false; } $this->players = array("", "", ""); // /* Observer, BLUE_FORCE, RED_FORCE */ // for($i = 0; $i < 3;$i++){ // $this->mapViewer[$i]->setData(54, 79, // originX, originY // 25.5, 25.5, // top hexagon height, bottom hexagon height // 14.725, 29.45, // hexagon edge width, hexagon center width // 4025, 4025 // max right hexagon, max bottom hexagon // ); // } // game data $this->gameRules->setMaxTurn(20); $this->gameRules->setInitialPhaseMode(RED_DEPLOY_PHASE, DEPLOY_MODE); $this->gameRules->attackingForceId = RED_FORCE; /* object oriented! */ $this->gameRules->defendingForceId = BLUE_FORCE; /* object oriented! */ $this->force->setAttackingForceId($this->gameRules->attackingForceId); /* so object oriented */ $this->gameRules->addPhaseChange(RED_DEPLOY_PHASE, BLUE_SURPRISE_MOVE_PHASE, MOVING_MODE, BLUE_FORCE, RED_FORCE, false); // $this->gameRules->addPhaseChange(BLUE_DEPLOY_PHASE, BLUE_MOVE_PHASE, MOVING_MODE, BLUE_FORCE, RED_FORCE, false); // $this->gameRules->addPhaseChange(BLUE_REPLACEMENT_PHASE, BLUE_MOVE_PHASE, MOVING_MODE, BLUE_FORCE, RED_FORCE, false); $this->gameRules->addPhaseChange(BLUE_SURPRISE_MOVE_PHASE, BLUE_MOVE_PHASE, MOVING_MODE, BLUE_FORCE, RED_FORCE, false); $this->gameRules->addPhaseChange(BLUE_MOVE_PHASE, BLUE_COMBAT_PHASE, COMBAT_SETUP_MODE, BLUE_FORCE, RED_FORCE, false); $this->gameRules->addPhaseChange(BLUE_COMBAT_PHASE, BLUE_MECH_PHASE, MOVING_MODE, BLUE_FORCE, RED_FORCE, false); $this->gameRules->addPhaseChange(BLUE_MECH_PHASE, RED_REPLACEMENT_PHASE, REPLACING_MODE, RED_FORCE, BLUE_FORCE, false); $this->gameRules->addPhaseChange(RED_REPLACEMENT_PHASE, RED_MOVE_PHASE, MOVING_MODE, RED_FORCE, BLUE_FORCE, false); $this->gameRules->addPhaseChange(RED_MOVE_PHASE, RED_COMBAT_PHASE, COMBAT_SETUP_MODE, RED_FORCE, BLUE_FORCE, false); $this->gameRules->addPhaseChange(RED_COMBAT_PHASE, RED_MECH_PHASE, MOVING_MODE, RED_FORCE, BLUE_FORCE, false); $this->gameRules->addPhaseChange(RED_MECH_PHASE, BLUE_MOVE_PHASE, MOVING_MODE, BLUE_FORCE, RED_FORCE, true); // force data // unit terrain data--------------------------------------- // end terrain data ---------------------------------------- } $this->combatRules->crt = new NomonhanCombatResultsTable(); }
function __construct($data = null, $arg = false, $scenario = false) { parent::__construct($data, $arg, $scenario); $crt = new \Wargame\TMCW\KievCorps\CombatResultsTable(GERMAN_FORCE); $this->combatRules->injectCrt($crt); if ($data) { $this->specialHexA = $data->specialHexA; $this->specialHexB = $data->specialHexB; $this->specialHexC = $data->specialHexC; } else { $this->victory = new \Wargame\Victory("\\Wargame\\TMCW\\KievCorps\\kievVictoryCore"); if (!empty($scenario->supplyLen)) { $this->victory->setSupplyLen($scenario->supplyLen); } $this->moveRules->enterZoc = 3; $this->moveRules->exitZoc = 2; $this->moveRules->noZocZocOneHex = true; $this->moveRules->stacking = 1; $this->moveRules->friendlyAllowsRetreat = true; $this->moveRules->blockedRetreatDamages = true; $this->gameRules->legacyExchangeRule = false; // game data $this->gameRules->setMaxTurn(8); $this->gameRules->setInitialPhaseMode(BLUE_MOVE_PHASE, MOVING_MODE); $this->gameRules->attackingForceId = BLUE_FORCE; /* object oriented! */ $this->gameRules->defendingForceId = RED_FORCE; /* object oriented! */ $this->force->setAttackingForceId($this->gameRules->attackingForceId); /* so object oriented */ $this->gameRules->addPhaseChange(RED_DEPLOY_PHASE, BLUE_DEPLOY_PHASE, DEPLOY_MODE, GERMAN_FORCE, SOVIET_FORCE, false); $this->gameRules->addPhaseChange(BLUE_DEPLOY_PHASE, BLUE_MOVE_PHASE, MOVING_MODE, GERMAN_FORCE, SOVIET_FORCE, false); $this->gameRules->addPhaseChange(BLUE_REPLACEMENT_PHASE, BLUE_MOVE_PHASE, MOVING_MODE, GERMAN_FORCE, SOVIET_FORCE, false); $this->gameRules->addPhaseChange(BLUE_MOVE_PHASE, BLUE_COMBAT_PHASE, COMBAT_SETUP_MODE, GERMAN_FORCE, SOVIET_FORCE, false); $this->gameRules->addPhaseChange(BLUE_COMBAT_PHASE, BLUE_MECH_PHASE, MOVING_MODE, GERMAN_FORCE, SOVIET_FORCE, false); $this->gameRules->addPhaseChange(BLUE_MECH_PHASE, RED_REPLACEMENT_PHASE, REPLACING_MODE, SOVIET_FORCE, GERMAN_FORCE, false); $this->gameRules->addPhaseChange(RED_REPLACEMENT_PHASE, RED_MOVE_PHASE, MOVING_MODE, SOVIET_FORCE, GERMAN_FORCE, false); $this->gameRules->addPhaseChange(RED_MOVE_PHASE, RED_COMBAT_PHASE, COMBAT_SETUP_MODE, SOVIET_FORCE, GERMAN_FORCE, false); $this->gameRules->addPhaseChange(RED_COMBAT_PHASE, RED_MECH_PHASE, MOVING_MODE, SOVIET_FORCE, GERMAN_FORCE, false); $this->gameRules->addPhaseChange(RED_MECH_PHASE, BLUE_REPLACEMENT_PHASE, REPLACING_MODE, GERMAN_FORCE, SOVIET_FORCE, true); } }
function __construct($data = null, $arg = false, $scenario = false, $game = false) { parent::__construct($data, $arg, $scenario, $game); $crt = new \Wargame\SPI\FinalChapter\CombatResultsTable(); $this->combatRules->injectCrt($crt); if ($data) { $this->specialHexA = $data->specialHexA; $this->specialHexB = $data->specialHexB; $this->specialHexC = $data->specialHexC; } else { $this->victory = new \Wargame\Victory("\\Wargame\\SPI\\FinalChapter\\finalChapterVictoryCore"); foreach ($this->mapViewer as $mapView) { $mapView->trueRows = true; } $this->moveRules->noZocZocOneHex = true; $this->moveRules->blockedRetreatDamages = false; $this->moveRules->enterZoc = "stop"; $this->moveRules->exitZoc = 0; $this->moveRules->noZocZoc = true; $this->moveRules->friendlyAllowsRetreat = false; // $this->moveRules->stacking = 2; // game data $this->gameRules->setMaxTurn(10); $this->gameRules->setInitialPhaseMode(BLUE_MOVE_PHASE, MOVING_MODE); $this->gameRules->attackingForceId = EASTERN_FORCE; /* object oriented! */ $this->gameRules->defendingForceId = EASTERN_EMPIRE_FORCE; /* object oriented! */ $this->force->setAttackingForceId($this->gameRules->attackingForceId, $this->gameRules->defendingForceId); /* so object oriented */ $this->gameRules->addPhaseChange(BLUE_REPLACEMENT_PHASE, BLUE_MOVE_PHASE, MOVING_MODE, EASTERN_FORCE, EASTERN_EMPIRE_FORCE, false); $this->gameRules->addPhaseChange(BLUE_MOVE_PHASE, BLUE_COMBAT_PHASE, COMBAT_SETUP_MODE, EASTERN_FORCE, EASTERN_EMPIRE_FORCE, false); $this->gameRules->addPhaseChange(BLUE_COMBAT_PHASE, TEAL_REPLACEMENT_PHASE, REPLACING_MODE, WESTERN_EMPIRE_FORCE, WESTERN_FORCE, false); $this->gameRules->addPhaseChange(TEAL_REPLACEMENT_PHASE, TEAL_MOVE_PHASE, MOVING_MODE, WESTERN_EMPIRE_FORCE, WESTERN_FORCE, false); $this->gameRules->addPhaseChange(TEAL_MOVE_PHASE, TEAL_COMBAT_PHASE, COMBAT_SETUP_MODE, WESTERN_EMPIRE_FORCE, WESTERN_FORCE, false); $this->gameRules->addPhaseChange(TEAL_COMBAT_PHASE, RED_REPLACEMENT_PHASE, REPLACING_MODE, WESTERN_FORCE, WESTERN_EMPIRE_FORCE, false); $this->gameRules->addPhaseChange(RED_REPLACEMENT_PHASE, RED_MOVE_PHASE, MOVING_MODE, WESTERN_FORCE, WESTERN_EMPIRE_FORCE, false); $this->gameRules->addPhaseChange(RED_MOVE_PHASE, RED_COMBAT_PHASE, COMBAT_SETUP_MODE, WESTERN_FORCE, WESTERN_EMPIRE_FORCE, false); $this->gameRules->addPhaseChange(RED_COMBAT_PHASE, PURPLE_REPLACEMENT_PHASE, REPLACING_MODE, EASTERN_EMPIRE_FORCE, EASTERN_FORCE, false); $this->gameRules->addPhaseChange(PURPLE_REPLACEMENT_PHASE, PURPLE_MOVE_PHASE, MOVING_MODE, EASTERN_EMPIRE_FORCE, EASTERN_FORCE, false); $this->gameRules->addPhaseChange(PURPLE_MOVE_PHASE, PURPLE_COMBAT_PHASE, COMBAT_SETUP_MODE, EASTERN_EMPIRE_FORCE, EASTERN_FORCE, false); $this->gameRules->addPhaseChange(PURPLE_COMBAT_PHASE, BLUE_REPLACEMENT_PHASE, REPLACING_MODE, EASTERN_FORCE, EASTERN_EMPIRE_FORCE, true); $this->victory->victoryPoints[WESTERN_FORCE] = 3; } if ($this->players) { /* * if player 3 set, they become player 3 and four * if 3 and 4 not set 3 becomes 1 and 4 becomes 2 */ if (!isset($this->players[4]) && isset($this->players[3])) { $this->players[4] = $this->players[3]; } if (!isset($this->players[3]) && $this->players[1]) { $this->players[3] = $this->players[1]; } if (!isset($this->players[4]) && $this->players[2]) { $this->players[4] = $this->players[2]; } } $this->moveRules->stacking = function ($mapHex, $forceId, $unit) { $armyGroup = false; if ($unit->name == "xxxxx") { if (count((array) $mapHex->forces[$forceId]) >= 1) { $armyGroup = true; } } foreach ($mapHex->forces[$forceId] as $mKey => $mVal) { if ($this->force->units[$mKey]->name == "xxxxx") { if ($armyGroup) { return true; } } } return count((array) $mapHex->forces[$forceId]) >= 2; }; }
function __construct($data = null, $arg = false, $scenario = false, $game = false) { parent::__construct($data, $arg, $scenario, $game); if ($data) { } else { $this->victory = new \Wargame\Victory("\\Wargame\\NTA\\victoryCore"); $this->mapData->setSpecialHexes(array(1005 => 0)); $this->force->combatRequired = true; $this->moveRules->stickyZoc = true; // game data $this->gameRules->setMaxTurn(7); $this->gameRules->setInitialPhaseMode(BLUE_MOVE_PHASE, MOVING_MODE); $this->gameRules->addPhaseChange(BLUE_DEPLOY_PHASE, BLUE_MOVE_PHASE, MOVING_MODE, BLUE_FORCE, RED_FORCE, false); // $this->gameRules->addPhaseChange(BLUE_REPLACEMENT_PHASE, BLUE_MOVE_PHASE, MOVING_MODE, BLUE_FORCE, RED_FORCE, false); $this->gameRules->addPhaseChange(BLUE_MOVE_PHASE, BLUE_COMBAT_PHASE, COMBAT_SETUP_MODE, BLUE_FORCE, RED_FORCE, false); $this->gameRules->addPhaseChange(BLUE_COMBAT_PHASE, RED_MOVE_PHASE, MOVING_MODE, RED_FORCE, BLUE_FORCE, false); // $this->gameRules->addPhaseChange(RED_REPLACEMENT_PHASE, RED_MOVE_PHASE, MOVING_MODE, RED_FORCE, BLUE_FORCE, false); $this->gameRules->addPhaseChange(RED_MOVE_PHASE, RED_COMBAT_PHASE, COMBAT_SETUP_MODE, RED_FORCE, BLUE_FORCE, false); $this->gameRules->addPhaseChange(RED_COMBAT_PHASE, BLUE_MOVE_PHASE, MOVING_MODE, BLUE_FORCE, RED_FORCE, true); // force data //$this->force->setEliminationTrayXY(900); // end terrain data ---------------------------------------- } $crt = new \Wargame\NTA\CombatResultsTable(); $this->combatRules->injectCrt($crt); }
function __construct($data = null, $arg = false, $scenario = false, $game = false) { parent::__construct($data, $arg, $scenario, $game); $crt = new \Wargame\SPI\ClashOverCrude\CombatResultsTable(); $this->combatRules->injectCrt($crt); if ($data) { $this->specialHexA = $data->specialHexA; } else { $this->victory = new \Wargame\Victory("\\Wargame\\SPI\\ClashOverCrude\\ClashOverCrudeVictoryCore"); $this->moveRules = new \Wargame\MoveRules($this->force, $this->terrain); $this->moveRules->enterZoc = 0; $this->moveRules->exitZoc = 0; // game data $this->gameRules->setMaxTurn(7); $this->gameRules->setInitialPhaseMode(RED_DEPLOY_PHASE, DEPLOY_MODE); $this->gameRules->attackingForceId = RED_FORCE; /* object oriented! */ $this->gameRules->defendingForceId = BLUE_FORCE; /* object oriented! */ $this->force->setAttackingForceId($this->gameRules->attackingForceId); /* so object oriented */ $this->gameRules->addPhaseChange(RED_DEPLOY_PHASE, BLUE_REBASE_PHASE, REBASE_MODE, BLUE_FORCE, RED_FORCE, false); $this->gameRules->addPhaseChange(BLUE_REBASE_PHASE, BLUE_SUPPLY_PHASE, SUPPLY_MODE, BLUE_FORCE, RED_FORCE, false); $this->gameRules->addPhaseChange(BLUE_SUPPLY_PHASE, BLUE_TRANSPORT_PHASE, REPLACING_MODE, BLUE_FORCE, RED_FORCE, false); $this->gameRules->addPhaseChange(BLUE_TRANSPORT_PHASE, BLUE_MOVE_PHASE, MOVING_MODE, BLUE_FORCE, RED_FORCE, false); $this->gameRules->addPhaseChange(BLUE_MOVE_PHASE, BLUE_AIR_COMBAT_PHASE, COMBAT_SETUP_MODE, BLUE_FORCE, RED_FORCE, false); $this->gameRules->addPhaseChange(BLUE_AIR_COMBAT_PHASE, BLUE_COMBAT_PHASE, COMBAT_SETUP_MODE, BLUE_FORCE, RED_FORCE, false); $this->gameRules->addPhaseChange(BLUE_COMBAT_PHASE, RED_MOVE_PHASE, MOVING_MODE, RED_FORCE, BLUE_FORCE, false); $this->gameRules->addPhaseChange(RED_MOVE_PHASE, RED_COMBAT_PHASE, COMBAT_SETUP_MODE, RED_FORCE, BLUE_FORCE, false); $this->gameRules->addPhaseChange(RED_AIR_COMBAT_PHASE, RED_COMBAT_PHASE, COMBAT_SETUP_MODE, RED_FORCE, BLUE_FORCE, false); $this->gameRules->addPhaseChange(RED_COMBAT_PHASE, BLUE_MOVE_PHASE, MOVING_MODE, BLUE_FORCE, RED_FORCE, true); } $this->moveRules->stacking = function ($mapHex, $forceId, $unit) { $land = $air = 0; if ($unit->class === "air") { if (count((array) $mapHex->forces[$forceId]) >= 1) { $air = 1; } foreach ($mapHex->forces[$forceId] as $mKey => $mVal) { if ($this->force->units[$mKey]->class === "air") { $air++; } } return $air > 2; } else { if (count((array) $mapHex->forces[$forceId]) >= 1) { $land = 1; } foreach ($mapHex->forces[$forceId] as $mKey => $mVal) { if ($this->force->units[$mKey]->class !== "air") { $land++; } } return $land > 2; } }; $this->moveRules->enemyStackingLimit = function ($mapHex, $forceId, $unit) { $land = $air = 0; if ($unit->class === "air") { if (count((array) $mapHex->forces[$forceId]) >= 1) { foreach ($mapHex->forces[$forceId] as $mKey => $mVal) { if ($this->force->units[$mKey]->class === "air") { return true; } } } return false; } else { if (count((array) $mapHex->forces[$forceId]) >= 1) { foreach ($mapHex->forces[$forceId] as $mKey => $mVal) { if ($this->force->units[$mKey]->class !== "air") { return true; } } } return false; } }; }
function __construct($data = null, $arg = false, $scenario = false) { parent::__construct($data, $arg, $scenario); $crt = new \Wargame\TMCW\CombatResultsTable(); $this->combatRules->injectCrt($crt); if ($data) { $this->specialHexA = $data->specialHexA; $this->specialHexB = $data->specialHexB; $this->specialHexC = $data->specialHexC; $this->gameRules->options = $data->options; $this->gameRules->option = $data->option; } else { $this->victory = new \Wargame\Victory("Wargame\\TMCW\\Amph\\amphVictoryCore"); if (!empty($scenario->supplyLen)) { $this->victory->setSupplyLen($scenario->supplyLen); } $this->moveRules = new MoveRules($this->force, $this->terrain); if ($scenario && !empty($scenario->supply) === true) { $this->moveRules->enterZoc = 2; $this->moveRules->exitZoc = 1; $this->moveRules->noZocZocOneHex = true; } else { $this->moveRules->enterZoc = "stop"; $this->moveRules->exitZoc = 0; $this->moveRules->noZocZocOneHex = false; } // game data $this->gameRules->setMaxTurn(7); $this->gameRules->options = ['Nuclear Facility', 'Chateau sur mer', 'Marine Science Facility']; $this->gameRules->setInitialPhaseMode(BLUE_OPTION_PHASE, OPTION_MODE); // $this->gameRules->setInitialPhaseMode(RED_DEPLOY_PHASE, DEPLOY_MODE); $this->gameRules->attackingForceId = BLUE_FORCE; /* object oriented! */ $this->gameRules->defendingForceId = RED_FORCE; /* object oriented! */ $this->force->setAttackingForceId($this->gameRules->attackingForceId); /* so object oriented */ $this->gameRules->addPhaseChange(BLUE_OPTION_PHASE, RED_DEPLOY_PHASE, DEPLOY_MODE, RED_FORCE, BLUE_FORCE, false); $this->gameRules->addPhaseChange(RED_DEPLOY_PHASE, BLUE_DEPLOY_PHASE, DEPLOY_MODE, BLUE_FORCE, RED_FORCE, false); $this->gameRules->addPhaseChange(BLUE_DEPLOY_PHASE, BLUE_MOVE_PHASE, MOVING_MODE, BLUE_FORCE, RED_FORCE, false); $this->gameRules->addPhaseChange(BLUE_MOVE_PHASE, BLUE_COMBAT_PHASE, COMBAT_SETUP_MODE, BLUE_FORCE, RED_FORCE, false); $this->gameRules->addPhaseChange(BLUE_COMBAT_PHASE, RED_MOVE_PHASE, MOVING_MODE, RED_FORCE, BLUE_FORCE, false); $this->gameRules->addPhaseChange(RED_MOVE_PHASE, RED_COMBAT_PHASE, COMBAT_SETUP_MODE, RED_FORCE, BLUE_FORCE, false); $this->gameRules->addPhaseChange(RED_COMBAT_PHASE, RED_MECH_PHASE, MOVING_MODE, RED_FORCE, BLUE_FORCE, false); $this->gameRules->addPhaseChange(RED_MECH_PHASE, BLUE_MOVE_PHASE, MOVING_MODE, BLUE_FORCE, RED_FORCE, true); } }