Compare commits

..
15 Commits
Author SHA1 Message Date
Hide_D 30c219716d 오타 수정 2018-07-18 09:08:20 +09:00
Hide_D 5dd47cb89b 오타수정 2018-07-18 09:05:36 +09:00
Hide_D abe856bd3f 버그 수정. 오타 수정 2018-07-18 08:24:09 +09:00
Hide_D 6ecb009466 오타 수정 2018-07-18 04:51:19 +09:00
Hide_D 3b4b2383a8 $me 버그 2018-07-18 04:50:17 +09:00
Hide_D 4ddd46c4a2 모병코드 2018-07-18 04:49:30 +09:00
Hide_D 69ec2469b4 쌀 검사 코드 2018-07-18 04:47:28 +09:00
Hide_D 5789af801a 징모병창 코스트 2018-07-18 04:44:12 +09:00
Hide_D 7171b6302b formattext 2018-07-18 04:41:08 +09:00
Hide_D 51d4818b1e gameStor 값 버그 2018-07-18 04:40:18 +09:00
Hide_D 1c2875e7fc 모병창 수정 2018-07-18 04:37:00 +09:00
Hide_D 5048a88310 징병창 우선 부활 2018-07-18 04:30:54 +09:00
Hide_D aef37f4362 징모병창 변수명 에러 2018-07-18 04:18:15 +09:00
Hide_D d04641041b 아이템 return 값 수정 2018-07-18 04:15:28 +09:00
Hide_D 67b2ccea86 급한대로 도시명 띄움 2018-07-18 04:10:07 +09:00
11 changed files with 74 additions and 45 deletions
+11
View File
@@ -94,6 +94,15 @@
background:transparent;
}
.world_map .city_detail_name{
background-color:rgba(0,0,0,0.5);
font-size:10px;
position:absolute;
white-space:nowrap;
left:70%;
bottom:-10px;
color:white;
}
.city_base{
position:absolute;
@@ -338,6 +347,8 @@
/* Basic */
.world_map.map_basic .city_filler{
position:absolute;
width:100%;
+12 -12
View File
@@ -2304,55 +2304,55 @@ function checkAbilityEx(int $generalID, ActionLogger $actLog){
}
if($general['leader2'] < 0){
$general->updqte('general',[
$db->update('general',[
'leader2'=>$db->sqleval('leader2 + %i', GameConst::$upgradeLimit),
'leader'=>$db->sqleval('leader - 1')
]);
], 'no=%i', $generalID);
$actLog->pushGeneralActionLog('<R>통솔</>이 <C>1</> 떨어졌습니다!', ActionLogger::PLAIN);
return;
}
if($general['power2'] < 0){
$general->updqte('general',[
$db->update('general',[
'power2'=>$db->sqleval('power2 + %i', GameConst::$upgradeLimit),
'power'=>$db->sqleval('power - 1')
]);
], 'no=%i', $generalID);
$actLog->pushGeneralActionLog('<R>무력</>이 <C>1</> 떨어졌습니다!', ActionLogger::PLAIN);
return;
}
if($general['intel2'] < 0){
$general->updqte('general',[
$db->update('general',[
'intel2'=>$db->sqleval('intel2 + %i', GameConst::$upgradeLimit),
'intel'=>$db->sqleval('intel - 1')
]);
], 'no=%i', $generalID);
$actLog->pushGeneralActionLog('<R>지력</>이 <C>1</> 떨어졌습니다!', ActionLogger::PLAIN);
return;
}
if($general['leader2'] >= GameConst::$upgradeLimit){
$general->updqte('general',[
$db->update('general',[
'leader2'=>$db->sqleval('leader2 - %i', GameConst::$upgradeLimit),
'leader'=>$db->sqleval('leader + 1')
]);
], 'no=%i', $generalID);
$actLog->pushGeneralActionLog('<R>통솔</>이 <C>1</> 올랐습니다!', ActionLogger::PLAIN);
return;
}
if($general['power2'] >= GameConst::$upgradeLimit){
$general->updqte('general',[
$db->update('general',[
'power2'=>$db->sqleval('power2 - %i', GameConst::$upgradeLimit),
'power'=>$db->sqleval('power + 1')
]);
], 'no=%i', $generalID);
$actLog->pushGeneralActionLog('<R>무력</>이 <C>1</> 올랐습니다!', ActionLogger::PLAIN);
return;
}
if($general['intel2'] >= GameConst::$upgradeLimit){
$general->updqte('general',[
$db->update('general',[
'intel2'=>$db->sqleval('intel2 - %i', GameConst::$upgradeLimit),
'intel'=>$db->sqleval('intel + 1')
]);
], 'no=%i', $generalID);
$actLog->pushGeneralActionLog('<R>지력</>이 <C>1</> 올랐습니다!', ActionLogger::PLAIN);
return;
}
+6 -6
View File
@@ -615,7 +615,7 @@ function getDexLog($dex1, $dex2) {
}
function getWeapName($weap) : string {
function getWeapName($weap) : ?string {
switch($weap) {
case 0: $weapname = '-'; break;
case 1: $weapname = '단도(+1)'; break;
@@ -649,7 +649,7 @@ function getWeapName($weap) : string {
return $weapname;
}
function getWeapEff($weap) : int{
function getWeapEff($weap) : ?int{
switch($weap) {
case 7: $weap = 7; break;
case 8: $weap = 7; break;
@@ -676,7 +676,7 @@ function getWeapEff($weap) : int{
return $weap;
}
function getBookName($book) : string {
function getBookName($book) : ?string {
switch($book) {
case 0: $bookname = '-'; break;
case 1: $bookname = '효경전(+1)'; break;
@@ -710,7 +710,7 @@ function getBookName($book) : string {
return $bookname;
}
function getBookEff($book) : int {
function getBookEff($book) : ?int {
switch($book) {
case 7: $book = 7; break;
case 8: $book = 7; break;
@@ -737,7 +737,7 @@ function getBookEff($book) : int {
return $book;
}
function getHorseName($horse) : string {
function getHorseName($horse) : ?string {
switch($horse) {
case 0: $horsename = '-'; break;
case 1: $horsename = '노기(+1)'; break;
@@ -771,7 +771,7 @@ function getHorseName($horse) : string {
return $horsename;
}
function getHorseEff($horse) : int {
function getHorseEff($horse) : ?int {
switch($horse) {
case 7: $horse = 7; break;
case 8: $horse = 7; break;
+1 -1
View File
@@ -116,7 +116,7 @@ function getSpecial2($leader, $power, $intel, $nodex=1, $dex0=0, $dex10=0, $dex2
function getGenDex($general, $type) {
//XXX: 지금은 동작하지만.. 병종 구성이 보궁기귀차 에서 바뀌면...
$ntype = GameUnitCons::byId($type)->armType * 10;
$ntype = GameUnitConst::byId($type)->armType * 10;
return $general["dex{$ntype}"]??0;
}
+6 -4
View File
@@ -872,7 +872,7 @@ function process_11(&$general, $type) {
$defaulttrain = GameConst::$defaultTrainHigh;
}
[$startYear, $year, $month] = $gameStor->getValuesAsArray(['startyear, year, month']);
[$startyear, $year, $month] = $gameStor->getValuesAsArray(['startyear', 'year', 'month']);
$actLog = new ActionLogger($general['no'], $general['nation'], $year, $month);
@@ -942,19 +942,21 @@ function process_11(&$general, $type) {
if($general['gold'] < $cost){
$actLog->pushGeneralActionLog("자금이 모자랍니다. $dtype 실패. <1>$date</>");
return;
}
if($general['rice'] < $crew) {
if($general['rice'] < $crew / 100) {
$actLog->pushGeneralActionLog("군량이 모자랍니다. $dtype 실패. <1>$date</>");
return;
}
$ownCities = [];
$ownRegions = [];
foreach($db->queryFirstColumn('SELECT city FROM city WHERE nation = %i', $me['nation']) as $ownCity){
foreach($db->queryFirstColumn('SELECT city FROM city WHERE nation = %i', $general['nation']) as $ownCity){
$ownCities[$ownCity] = 1;
$ownRegions[CityConst::byId($ownCity)->region] = 1;
}
$valid = $crewTypeObj->isValid($ownCities, $ownRegions, $admin['year'] - $admin['startyear'], $tech);
$valid = $crewTypeObj->isValid($ownCities, $ownRegions, $year - $startyear, $tech);
if(!$valid) {
$actLog->pushGeneralActionLog("현재 $dtype 할 수 없는 병종입니다. $dtype 실패. <1>$date</>");
+5
View File
@@ -276,6 +276,9 @@ function reloadWorldMap(option){
}
$imgObj.append($flagObj);
}
var $nameObj = $('<span class="city_detail_name">{0}</span>'.format(city.name));
$imgObj.append($nameObj);
$map_body.append($cityObj);
@@ -336,6 +339,8 @@ function reloadWorldMap(option){
$imgObj.append($capitalObj);
}
var $nameObj = $('<span class="city_detail_name">{0}</span>'.format(city.name));
$imgObj.append($nameObj);
$map_body.append($cityObj);
});
+18 -10
View File
@@ -205,12 +205,19 @@ function command_11($turn, $command, bool $is모병 = false) {
);
[$nationLevel, $tech] = $db->queryFirstList('SELECT level,tech FROM nation WHERE nation=%i', $me['nation']);
if(!$nationLevel){
$nationLevel = 0;
}
$lbonus = setLeadershipBonus($general, $nationLevel);
if(!$tech){
$tech = 0;
}
$lbonus = setLeadershipBonus($me, $nationLevel);
$ownCities = [];
$ownRegions = [];
[$year, $startYear] = $gameStor->getValuesAsArray(['year','startyear']);
[$year, $startyear] = $gameStor->getValuesAsArray(['year','startyear']);
$relativeYear = $year - $startyear;
@@ -219,9 +226,9 @@ function command_11($turn, $command, bool $is모병 = false) {
$ownRegions[$city['region']] = 1;
}
$leader = getGeneralLeadership($general, true, true, true);
$leader = getGeneralLeadership($me, true, true, true);
$maxCrew = $leader - Util::round($me['crew']/100);
$abil = getTechAbil($nation['tech']);
$abil = getTechAbil($tech);
$armTypes = [];
@@ -229,7 +236,7 @@ function command_11($turn, $command, bool $is모병 = false) {
$armTypeCrews = [];
foreach(GameUnitConst::byType($armType) as $unit){
$crewObj = new stdClass;
$crewObj = new \stdClass;
if(!$unit->isValid($ownCities, $ownRegions, $relativeYear, $tech)){
continue; //TODO: 불가능한 병종도 보여줄 필요가 있음.
}
@@ -244,7 +251,7 @@ function command_11($turn, $command, bool $is모병 = false) {
}
$crewObj->baseRice = $unit->rice * getTechCost($tech);
$crewObj->baseCost = CharCost($unit->getTechCost($tech), $me['personal']);
$crewObj->baseCost = CharCost($unit->costWithTech($tech), $me['personal']);
$armType = $unit->armType;
if($me['special2'] == 50 && $armType == GameUnitConst::T_FOOTMAN){
@@ -275,7 +282,7 @@ function command_11($turn, $command, bool $is모병 = false) {
$crewObj->img = ServConfig::$sharedIconPath."/default.jpg";
}
else{
$crewObj->img = ServConfig::$gameImagePath."/weap{$unit->id}.png";
$crewObj->img = ServConfig::$gameImagePath."/weap".$unit->id.".png";
}
$crewObj->baseRiceShort = round($crewObj->baseRice, 1);
@@ -304,10 +311,11 @@ function command_11($turn, $command, bool $is모병 = false) {
'techLevelText'=>getTechCall($tech),
'tech'=>$tech,
'leader'=>$leader,
'crewTypeName'=>GameUnitConst::byId($general['crewtype'])->name,
'crew'=>$general['crew'],
'crewType'=>GameUnitConst::byId($me['crewtype'])->id,
'crewTypeName'=>GameUnitConst::byId($me['crewtype'])->name,
'crew'=>$me['crew'],
'maxCrew'=>$maxCrew,
'gold'=>$general['gold'],
'gold'=>$me['gold'],
'turn'=>$turn,
'armTypes'=>$armTypes,
]);
+7 -7
View File
@@ -109,7 +109,7 @@ class ActionLogger{
return;
}
$text = $this->formatText($formatType);
$text = $this->formatText($text, $formatType);
$this->generalHistoryLog[] = $text;
}
@@ -124,7 +124,7 @@ class ActionLogger{
return;
}
$text = $this->formatText($formatType);
$text = $this->formatText($text, $formatType);
$this->generalActionLog[] = $text;
}
@@ -139,7 +139,7 @@ class ActionLogger{
return;
}
$text = $this->formatText($formatType);
$text = $this->formatText($text, $formatType);
$this->generalBattleResultLog[] = $text;
}
@@ -154,7 +154,7 @@ class ActionLogger{
return;
}
$text = $this->formatText($formatType);
$text = $this->formatText($text, $formatType);
$this->generalBattleDetailLog[] = $text;
}
@@ -169,7 +169,7 @@ class ActionLogger{
return;
}
$text = $this->formatText($formatType);
$text = $this->formatText($text, $formatType);
$this->nationalHistoryLog[] = $text;
}
@@ -184,7 +184,7 @@ class ActionLogger{
return;
}
$text = $this->formatText($formatType);
$text = $this->formatText($text, $formatType);
$this->globalActionLog[] = $text;
}
@@ -199,7 +199,7 @@ class ActionLogger{
return;
}
$text = $this->formatText($formatType);
$text = $this->formatText($text, $formatType);
$this->globalHistoryLog[] = $text;
}
+1
View File
@@ -451,6 +451,7 @@ class GameUnitConstBase{
static::$constName = $constName;
static::$constCity = $constCity;
static::$constRegion = $constRegion;
static::$constType = $constType;
}
}
+1
View File
@@ -39,6 +39,7 @@ class GameUnitDetail{
array $defenceCoef,
array $info
){
$this->id = $id;
$this->name = $name;
$this->armType = $armType;
$this->attack = $attack;
+6 -5
View File
@@ -1,18 +1,18 @@
<script>
var currentTech = <?=$tech?>;
var leadership = <?=$leadership?>;
var leader = <?=$leader?>;
var currentCrewType = <?=$crewType?>;
var currentCrew = <?=$crew?>
var currentCrew = <?=$crew?>;
var currentGold = <?=$gold?>;
var is모병 = <?=($commandName=='모병')?'true':'false'?>;
function calc(id) {
window.calc = function(id) {
var $obj = $('#crewType{0}'.format(id));
var crew = $obj.find('.form_double').val();
var baseCost = $obj.data('cost');
var $cost = $obj.find('.form_cost');
var cost = crew * baseCost.val();
var cost = crew * baseCost;
if(is모병){
cost *= 2;
}
@@ -60,6 +60,7 @@ function calc(id) {
</thead>
<tbody>
<?php foreach($armTypes as [$armName,$armTypeCrews]): ?>
<tr><td colspan=10><?=$armName?> 계열</td></tr>
<?php foreach($armTypeCrews as $crewObj): ?>
<tr
id="crewType<?=$crewObj->id?>"
@@ -67,7 +68,7 @@ function calc(id) {
data-rice="<?=$crewObj->baseRice?>"
data-cost="<?=$crewObj->baseCost?>"
>
<td style='background-no-repeat center url("<?=$crewObj->img?>;backround-size:64px;background-color:#222222;'></td>
<td style='background:#222222 no-repeat center url("<?=$crewObj->img?>");background-size:64px'></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->defence?></td>