전투 시뮬레이터 UI 추가 구현

This commit is contained in:
2018-08-25 11:15:33 +09:00
parent cb54e56417
commit 3916cc0562
3 changed files with 174 additions and 97 deletions
+100 -30
View File
@@ -72,6 +72,14 @@ $startYear = $gameStor->getValue('startyear');
</div> </div>
<div class="card-body"> <div class="card-body">
<div class="input-group mb-1"> <div class="input-group mb-1">
<div class="input-group-prepend">
<span class="input-group-text">국가 성향</span>
</div>
<select class="custom-select form_nation_type" style="width:25ch;">
<?php foreach(getNationTypeList() as $typeID => [$name,$pros,$cons]): ?>
<option value="<?=$typeID?>"><?=$name?> (<?=$pros?>, <?=$cons?>)</option>
<?php endforeach; ?>
</select>
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text">기술</span> <span class="input-group-text">기술</span>
</div> </div>
@@ -80,27 +88,15 @@ $startYear = $gameStor->getValue('startyear');
<span class="input-group-text">등급</span> <span class="input-group-text">등급</span>
</div> </div>
</div> </div>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text">국가 성향</span>
</div>
<select class="custom-select form_nation_type">
<?php foreach(getNationTypeList() as $typeID => [$name,$pros,$cons]): ?>
<option value="<?=$typeID?>"><?=$name?> (<?=$pros?>, <?=$cons?>)</option>
<?php endforeach; ?>
</select>
</div>
<div class="input-group mb-3"> <div class="input-group mb-3">
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text">국가 규모</span> <span class="input-group-text">국가 규모</span>
</div> </div>
<select class="custom-select form_nation_level"> <select class="custom-select form_nation_level">
<?php foreach(getNationTypeList() as $typeID => [$name,$pros,$cons]): ?> <?php foreach(getNationLevelList() as $nationLevel => [$name,$chiefCnt,$cityCnt]): ?>
<option value="<?=$typeID?>"><?=$name?> (<?=$pros?>, <?=$cons?>)</option> <option value="<?=$nationLevel?>"><?=$name?></option>
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
</div>
<div class="input-group mb-1">
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text">도시 규모</span> <span class="input-group-text">도시 규모</span>
</div> </div>
@@ -120,6 +116,10 @@ $startYear = $gameStor->getValue('startyear');
<input type="radio" name="is_attacker_capital" id="is_attacker_capital_n" autocomplete="off" checked>N <input type="radio" name="is_attacker_capital" id="is_attacker_capital_n" autocomplete="off" checked>N
</label> </label>
</div> </div>
</div>
<div class="input-group mb-1">
</div> </div>
</div> </div>
</div> </div>
@@ -138,21 +138,32 @@ $startYear = $gameStor->getValue('startyear');
</div> </div>
</div> </div>
<div class="card-body"> <div class="card-body">
<div class="input-group mb-1"> <div class="input-group mb-3">
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text">직위</span> <span class="input-group-text">직위</span>
</div> </div>
<select class="custom-select form_general_level"> <select class="custom-select form_general_level">
<option value="12">군주</option> <option value="1">일반</option>
<option value="11">참모</option>
<option value="10">무장 수뇌</option>
<option value="9">지장 수뇌</option>
<option value="4">태수</option> <option value="4">태수</option>
<option value="3">군사</option> <option value="3">군사</option>
<option value="2">시중</option> <option value="2">시중</option>
<option value="1">일반</option> <option value="10">무장 수뇌</option>
<option value="9">지장 수뇌</option>
<option value="11">참모</option>
<option value="12">군주</option>
</select> </select>
<div class="input-group-prepend">
<span class="input-group-text">Level</span>
</div>
<input type="number" class="form-control form_exp_level" value="20" min="0" max="300" step="1">
<div class="input-group-prepend">
<span class="input-group-text">부상</span>
</div>
<input type="number" class="form-control form_leadership" value="0" min="0" max="80" step="1">
<div class="input-group-append">
<span class="input-group-text">%(<span class="injury_helptext">건강</span>)</span>
</div>
</div> </div>
<div class="input-group mb-1"> <div class="input-group mb-1">
<div class="input-group-prepend"> <div class="input-group-prepend">
@@ -194,25 +205,34 @@ $startYear = $gameStor->getValue('startyear');
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
</div> </div>
<div class="input-group mb-1"> <div class="input-group mb-3">
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text">부상</span> <span class="input-group-text">자금</span>
</div> </div>
<input type="number" class="form-control form_leadership" value="50" min="1" max="300" step="1"> <input type="number" class="form-control form_power" value="0" min="0" max="20000" step="50">
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text">군량</span> <span class="input-group-text">군량</span>
</div> </div>
<input type="number" class="form-control form_power" value="50" min="1" max="300" step="1"> <input type="number" class="form-control form_power" value="5000" min="50" max="20000" step="50">
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text">도구</span> <span class="input-group-text">도구</span>
</div> </div>
<input type="number" class="form-control form_intel" value="50" min="1" max="300" step="1"> <select class="custom-select form_general_item">
<?php foreach(range(0, 26) as $bookID): ?>
<option value="<?=$bookID?>"><?=getItemName($bookID)?></option>
<?php endforeach; ?>
</select>
</div> </div>
<div class="input-group mb-1"> <div class="input-group mb-1">
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text">병종</span> <span class="input-group-text">병종</span>
</div> </div>
<input type="number" class="form-control form_crew" value="7000" min="100" step="100"> <select class="custom-select form_crewtype">
<?php foreach(GameUnitConst::all() as $crewTypeID => $crewType): ?>
<?php if($crewTypeID < 0){ continue; } ?>
<option value="<?=$crewTypeID?>"><?=$crewType->name?></option>
<?php endforeach; ?>
</select>
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text">병사</span> <span class="input-group-text">병사</span>
</div> </div>
@@ -226,7 +246,7 @@ $startYear = $gameStor->getValue('startyear');
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
</div> </div>
<div class="input-group mb-1"> <div class="input-group mb-3">
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text">훈련</span> <span class="input-group-text">훈련</span>
</div> </div>
@@ -244,8 +264,58 @@ $startYear = $gameStor->getValue('startyear');
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
</div> </div>
<div class="input-group mb-1">
레벨,보숙,궁숙,기숙,귀숙,차숙 <div class="input-group-prepend">
<span class="input-group-text">보병숙련</span>
</div>
<select class="custom-select form_dex0">
<?php foreach(getDexLevelList() as $dexLevel => [$dexAmount, $color, $name]): ?>
<option value="<?=$dexLevel?>"><?="{$name} (".number_format($dexAmount).")"?></option>
<?php endforeach; ?>
</select>
<div class="input-group-prepend">
<span class="input-group-text">궁병숙련</span>
</div>
<select class="custom-select form_dex10">
<?php foreach(getDexLevelList() as $dexLevel => [$dexAmount, $color, $name]): ?>
<option value="<?=$dexLevel?>"><?="{$name} (".number_format($dexAmount).")"?></option>
<?php endforeach; ?>
</select>
<div class="input-group-prepend">
<span class="input-group-text">기병숙련</span>
</div>
<select class="custom-select form_dex20">
<?php foreach(getDexLevelList() as $dexLevel => [$dexAmount, $color, $name]): ?>
<option value="<?=$dexLevel?>"><?="{$name} (".number_format($dexAmount).")"?></option>
<?php endforeach; ?>
</select>
</div>
<div class="input-group mb-1">
<div class="input-group-prepend">
<span class="input-group-text">귀병숙련</span>
</div>
<select class="custom-select form_dex30">
<?php foreach(getDexLevelList() as $dexLevel => [$dexAmount, $color, $name]): ?>
<option value="<?=$dexLevel?>"><?="{$name} (".number_format($dexAmount).")"?></option>
<?php endforeach; ?>
</select>
<div class="input-group-prepend">
<span class="input-group-text">차병숙련</span>
</div>
<select class="custom-select form_dex40">
<?php foreach(getDexLevelList() as $dexLevel => [$dexAmount, $color, $name]): ?>
<option value="<?=$dexLevel?>"><?="{$name} (".number_format($dexAmount).")"?></option>
<?php endforeach; ?>
</select>
<div class="input-group-prepend">
<span class="input-group-text">수비여부</span>
</div>
<select class="custom-select form_defend_mode">
<option value="2">훈사 80</option>
<option value="3">훈사 60</option>
<option value="0">안함</option>
</select>
</div>
</div> </div>
</div> </div>
</div><!-- <div class="col-sm"> --> </div><!-- <div class="col-sm"> -->
+65 -66
View File
@@ -441,74 +441,73 @@ function getTechCall($tech) : string {
return "{$techLevel}등급"; return "{$techLevel}등급";
} }
function getDexCall($dex) : string { function getDexLevelList(): array{
if($dex < 2500) { $str = '<font color="navy">F-</font>'; } return [
elseif($dex < 7500) { $str = '<font color="navy">F</font>'; } [0, 'navy', 'F-'],
elseif($dex < 15000) { $str = '<font color="navy">F+</font>'; } [2500, 'navy', 'F'],
elseif($dex < 25000) { $str = '<font color="skyblue">E-</font>'; } [7500, 'navy', 'F+'],
elseif($dex < 37500) { $str = '<font color="skyblue">E</font>'; } [15000, 'skyblue', 'E-'],
elseif($dex < 52500) { $str = '<font color="skyblue">E+</font>'; } [25000, 'skyblue', 'E'],
elseif($dex < 70000) { $str = '<font color="seagreen">D-</font>'; } [37500, 'skyblue', 'E+'],
elseif($dex < 90000) { $str = '<font color="seagreen">D</font>'; } [52500, 'seagreen', 'D-'],
elseif($dex < 112500) { $str = '<font color="seagreen">D+</font>'; } [70000, 'seagreen', 'D'],
elseif($dex < 137500) { $str = '<font color="teal">C-</font>'; } [90000, 'seagreen', 'D+'],
elseif($dex < 165000) { $str = '<font color="teal">C</font>'; } [112500, 'teal', 'C-'],
elseif($dex < 195000) { $str = '<font color="teal">C+</font>'; } [137500, 'teal', 'C'],
elseif($dex < 227500) { $str = '<font color="limegreen">B-</font>'; } [165000, 'teal', 'C+'],
elseif($dex < 262500) { $str = '<font color="limegreen">B</font>'; } [195000, 'limegreen', 'B-'],
elseif($dex < 300000) { $str = '<font color="limegreen">B+</font>'; } [227500, 'limegreen', 'B'],
elseif($dex < 340000) { $str = '<font color="gold">A-</font>'; } [262500, 'limegreen', 'B+'],
elseif($dex < 382500) { $str = '<font color="gold">A</font>'; } [300000, 'gold', 'A-'],
elseif($dex < 427500) { $str = '<font color="gold">A+</font>'; } [340000, 'gold', 'A'],
elseif($dex < 475000) { $str = '<font color="darkorange">S-</font>'; } [382500, 'gold', 'A+'],
elseif($dex < 525000) { $str = '<font color="darkorange">S</font>'; } [427500, 'darkorange', 'S-'],
elseif($dex < 577500) { $str = '<font color="darkorange">S+</font>'; } [475000, 'darkorange', 'S'],
elseif($dex < 632500) { $str = '<font color="tomato">SS-</font>'; } [525000, 'darkorange', 'S+'],
elseif($dex < 690000) { $str = '<font color="tomato">SS</font>'; } [577500, 'tomato', 'SS-'],
elseif($dex < 750000) { $str = '<font color="tomato">SS+</font>'; } [632500, 'tomato', 'SS'],
elseif($dex < 812500) { $str = '<font color="red">SSS-</font>'; } [690000, 'tomato', 'SS+'],
elseif($dex < 877500) { $str = '<font color="red">SSS</font>'; } [750000, 'red', 'SSS-'],
elseif($dex < 945000) { $str = '<font color="red">SSS+</font>'; } [812500, 'red', 'SSS'],
elseif($dex < 1015000) { $str = '<font color="darkviolet">Z-</font>'; } [877500, 'red', 'SSS+'],
elseif($dex < 1087500) { $str = '<font color="darkviolet">Z</font>'; } [945000, 'darkviolet', 'Z-'],
elseif($dex < 1162500) { $str = '<font color="darkviolet">Z+</font>'; } [1015000, 'darkviolet', 'Z'],
else { $str = '<font color="white">?</font>'; } [1087500, 'darkviolet', 'Z+'],
return $str; [1162500, 'white', '?']
];
} }
function getDexLevel($dex) : int { function getDexCall(int $dex) : string {
if($dex < 2500) { $lvl = 0; } if($dex < 0){
elseif($dex < 7500) { $lvl = 1; } throw new \InvalidArgumentException();
elseif($dex < 15000) { $lvl = 2; } }
elseif($dex < 25000) { $lvl = 3; }
elseif($dex < 37500) { $lvl = 4; } $color = null;
elseif($dex < 52500) { $lvl = 5; } $name = null;
elseif($dex < 70000) { $lvl = 6; } foreach(getDexLevelList() as $dexLevel => [$dexKey, $nextColor, $nextName]){
elseif($dex < 90000) { $lvl = 7; } if($dex < $dexKey){
elseif($dex < 112500) { $lvl = 8; } break;
elseif($dex < 137500) { $lvl = 9; } }
elseif($dex < 165000) { $lvl = 10; } $color = $nextColor;
elseif($dex < 195000) { $lvl = 11; } $name = $nextName;
elseif($dex < 227500) { $lvl = 12; } }
elseif($dex < 262500) { $lvl = 13; }
elseif($dex < 300000) { $lvl = 14; } return "<font color='{$color}'>{$name}</font>";
elseif($dex < 340000) { $lvl = 15; } }
elseif($dex < 382500) { $lvl = 16; }
elseif($dex < 427500) { $lvl = 17; } function getDexLevel(int $dex) : int {
elseif($dex < 475000) { $lvl = 18; } if($dex < 0){
elseif($dex < 525000) { $lvl = 19; } throw new \InvalidArgumentException();
elseif($dex < 577500) { $lvl = 20; } }
elseif($dex < 632500) { $lvl = 21; }
elseif($dex < 690000) { $lvl = 22; } $retVal = null;
elseif($dex < 750000) { $lvl = 23; } foreach(getDexLevelList() as $dexLevel => [$dexKey, $nextColor, $nextName]){
elseif($dex < 812500) { $lvl = 24; } if($dex < $dexKey){
elseif($dex < 877500) { $lvl = 25; } break;
elseif($dex < 945000) { $lvl = 26; } }
elseif($dex < 1015000) { $lvl = 27; } $retVal = $dexLevel;
elseif($dex < 1087500) { $lvl = 28; } }
elseif($dex < 1162500) { $lvl = 29; } return $dexLevel;
else { $lvl = 30; }
return $lvl;
} }
function getDexLog($dex1, $dex2) { function getDexLog($dex1, $dex2) {
+9 -1
View File
@@ -7,8 +7,16 @@ namespace sammo;
function getNationLevelList():array{ function getNationLevelList():array{
$table = [ $table = [
7 => ['황제', 8, ] 0 => ['방랑군', 2, 0],
1 => ['호족', 2, 1],
2 => ['군벌', 4, 2],
3 => ['주자사', 4, 5],
4 => ['주목', 6, 8],
5 => ['공', 6, 11],
6 => ['왕', 8, 16],
7 => ['황제', 8, 21],
]; ];
return $table;
} }
function getNationTypeList():array{ function getNationTypeList():array{