징병창 우선 부활

This commit is contained in:
2018-07-18 04:30:54 +09:00
parent d3d3a56d58
commit dfd5940d51
4 changed files with 11 additions and 7 deletions
+5 -4
View File
@@ -221,7 +221,7 @@ function command_11($turn, $command, bool $is모병 = false) {
$leader = getGeneralLeadership($me, true, true, true); $leader = getGeneralLeadership($me, true, true, true);
$maxCrew = $leader - Util::round($me['crew']/100); $maxCrew = $leader - Util::round($me['crew']/100);
$abil = getTechAbil($nation['tech']); $abil = getTechAbil($tech);
$armTypes = []; $armTypes = [];
@@ -229,7 +229,7 @@ function command_11($turn, $command, bool $is모병 = false) {
$armTypeCrews = []; $armTypeCrews = [];
foreach(GameUnitConst::byType($armType) as $unit){ foreach(GameUnitConst::byType($armType) as $unit){
$crewObj = new stdClass; $crewObj = new \stdClass;
if(!$unit->isValid($ownCities, $ownRegions, $relativeYear, $tech)){ if(!$unit->isValid($ownCities, $ownRegions, $relativeYear, $tech)){
continue; //TODO: 불가능한 병종도 보여줄 필요가 있음. continue; //TODO: 불가능한 병종도 보여줄 필요가 있음.
} }
@@ -244,7 +244,7 @@ function command_11($turn, $command, bool $is모병 = false) {
} }
$crewObj->baseRice = $unit->rice * getTechCost($tech); $crewObj->baseRice = $unit->rice * getTechCost($tech);
$crewObj->baseCost = CharCost($unit->getTechCost($tech), $me['personal']); $crewObj->baseCost = CharCost(getTechCost($tech), $me['personal']);
$armType = $unit->armType; $armType = $unit->armType;
if($me['special2'] == 50 && $armType == GameUnitConst::T_FOOTMAN){ if($me['special2'] == 50 && $armType == GameUnitConst::T_FOOTMAN){
@@ -275,7 +275,7 @@ function command_11($turn, $command, bool $is모병 = false) {
$crewObj->img = ServConfig::$sharedIconPath."/default.jpg"; $crewObj->img = ServConfig::$sharedIconPath."/default.jpg";
} }
else{ else{
$crewObj->img = ServConfig::$gameImagePath."/weap{$unit->id}.png"; $crewObj->img = ServConfig::$gameImagePath."/weap".$unit->id.".png";
} }
$crewObj->baseRiceShort = round($crewObj->baseRice, 1); $crewObj->baseRiceShort = round($crewObj->baseRice, 1);
@@ -304,6 +304,7 @@ function command_11($turn, $command, bool $is모병 = false) {
'techLevelText'=>getTechCall($tech), 'techLevelText'=>getTechCall($tech),
'tech'=>$tech, 'tech'=>$tech,
'leader'=>$leader, 'leader'=>$leader,
'crewType'=>GameUnitConst::byId($me['crewtype'])->id,
'crewTypeName'=>GameUnitConst::byId($me['crewtype'])->name, 'crewTypeName'=>GameUnitConst::byId($me['crewtype'])->name,
'crew'=>$me['crew'], 'crew'=>$me['crew'],
'maxCrew'=>$maxCrew, 'maxCrew'=>$maxCrew,
+1
View File
@@ -451,6 +451,7 @@ class GameUnitConstBase{
static::$constName = $constName; static::$constName = $constName;
static::$constCity = $constCity; static::$constCity = $constCity;
static::$constRegion = $constRegion; static::$constRegion = $constRegion;
static::$constType = $constType;
} }
} }
+1
View File
@@ -39,6 +39,7 @@ class GameUnitDetail{
array $defenceCoef, array $defenceCoef,
array $info array $info
){ ){
$this->id = $id;
$this->name = $name; $this->name = $name;
$this->armType = $armType; $this->armType = $armType;
$this->attack = $attack; $this->attack = $attack;
+4 -3
View File
@@ -1,12 +1,12 @@
<script> <script>
var currentTech = <?=$tech?>; var currentTech = <?=$tech?>;
var leadership = <?=$leadership?>; var leader = <?=$leader?>;
var currentCrewType = <?=$crewType?>; var currentCrewType = <?=$crewType?>;
var currentCrew = <?=$crew?> var currentCrew = <?=$crew?>
var currentGold = <?=$gold?>; var currentGold = <?=$gold?>;
var is모병 = <?=($commandName=='모병')?'true':'false'?>; var is모병 = <?=($commandName=='모병')?'true':'false'?>;
function calc(id) { window.calc = function(id) {
var $obj = $('#crewType{0}'.format(id)); var $obj = $('#crewType{0}'.format(id));
var crew = $obj.find('.form_double').val(); var crew = $obj.find('.form_double').val();
var baseCost = $obj.data('cost'); var baseCost = $obj.data('cost');
@@ -60,6 +60,7 @@ function calc(id) {
</thead> </thead>
<tbody> <tbody>
<?php foreach($armTypes as [$armName,$armTypeCrews]): ?> <?php foreach($armTypes as [$armName,$armTypeCrews]): ?>
<tr><td colspan=10><?=$armName?> 계열</td></tr>
<?php foreach($armTypeCrews as $crewObj): ?> <?php foreach($armTypeCrews as $crewObj): ?>
<tr <tr
id="crewType<?=$crewObj->id?>" id="crewType<?=$crewObj->id?>"
@@ -67,7 +68,7 @@ function calc(id) {
data-rice="<?=$crewObj->baseRice?>" data-rice="<?=$crewObj->baseRice?>"
data-cost="<?=$crewObj->baseCost?>" data-cost="<?=$crewObj->baseCost?>"
> >
<td style='background-no-repeat center url("<?=$crewObj->img?>;backround-size:64px;background-color:#222222;'></td> <td style='background-no-repeat center url("<?=$crewObj->img?>");backround-size:64px;background-color:#222222;'></td>
<td style='text-align:center;vertical-align:middle;'><?=$crewObj->name?></td> <td style='text-align:center;vertical-align:middle;'><?=$crewObj->name?></td>
<td style='text-align:center;vertical-align:middle;'><?=$crewObj->attack?></td> <td style='text-align:center;vertical-align:middle;'><?=$crewObj->attack?></td>
<td style='text-align:center;vertical-align:middle;'><?=$crewObj->defence?></td> <td style='text-align:center;vertical-align:middle;'><?=$crewObj->defence?></td>