From 8b272addf052c9114bcf177eab94423e364ba5f4 Mon Sep 17 00:00:00 2001 From: Killery Date: Mon, 11 Apr 2016 19:08:47 +0900 Subject: [PATCH] =?utf8?q?=E3=82=B9=E3=82=AF=E3=83=AD=E3=83=BC=E3=83=AB?= =?utf8?q?=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Awars III/FieldScene.m | 61 +++++++++++++++++++++++++++++--------------------- Awars III/FieldView.h | 3 +++ Awars III/FieldView.m | 14 ++++++++++++ 3 files changed, 52 insertions(+), 26 deletions(-) diff --git a/Awars III/FieldScene.m b/Awars III/FieldScene.m index ca2379e..95bc506 100755 --- a/Awars III/FieldScene.m +++ b/Awars III/FieldScene.m @@ -1526,6 +1526,27 @@ } [self initGuildList]; + cpuTurnEndFlag = false; + } + + if(unitBreak){ + if(unitBreak->team == 2 && MF[MFselectedRow+1].MS.playerSet2 == 2){ + unitBreak->CPU = true; + cpuAImodeflag = true; + //NSLog(@"OMFG"); + }else if(unitBreak->team == 0 && MF[MFselectedRow+1].MS.playerSet1 == 2){ + unitBreak->CPU = true; + cpuAImodeflag = true; + //NSLog(@"OMFG"); + }else if(unitBreak->team == 1){ + unitBreak->CPU = true; + cpuAImodeflag = true; + //NSLog(@"OMFG"); + } + else{ + unitBreak->CPU = false; + cpuAImodeflag = false; + } } [self EventFunc]; @@ -1548,12 +1569,14 @@ if(U->C.S_C.WT <= 0 && !U->dead){//WTターン周り U->C.S_C.WT = 0; + wtUnitNum = U->number; wtPx = U->x; wtPy = U->y; wtRdy = true; wtRdy2 = true; unitBreak = U; + Uselected = U; possionX = unitBreak->x; possionY = unitBreak->y; //おまんちん @@ -1563,6 +1586,8 @@ guildRE1 = false; guildRE2 = false; + [fieldView scrollPoint:NSMakePoint((wtPx-8)*32, (wtPy-8)*32)]; + if(buildNum[U->x][U->y] >= 0){ B = BTop; while(B){ @@ -2039,26 +2064,6 @@ pussyLoopFlag = false; } - if(unitBreak){ - if(unitBreak->team == 2 && MF[MFselectedRow+1].MS.playerSet2 == 2){ - unitBreak->CPU = true; - cpuAImodeflag = true; - //NSLog(@"OMFG"); - }else if(unitBreak->team == 0 && MF[MFselectedRow+1].MS.playerSet1 == 2){ - unitBreak->CPU = true; - cpuAImodeflag = true; - //NSLog(@"OMFG"); - }else if(unitBreak->team == 1){ - unitBreak->CPU = true; - cpuAImodeflag = true; - //NSLog(@"OMFG"); - } - else{ - unitBreak->CPU = false; - cpuAImodeflag = false; - } - } - w000p: @@ -9027,14 +9032,18 @@ SKIP1: -(void)setCommandPanel{ - if(buildSkillFlag) cIncludeCreateFlag = true; - else cIncludeCreateFlag = false; - if(summonSkillFlag) cIncludeSummonFlag = true; - else cIncludeSummonFlag = false; + menuPoint.x = [mapWindow frame].origin.x + possionLocalX*32; + menuPoint.y = [mapWindow frame].origin.y + possionLocalY*32 - 180; - menuPoint.x = [mapWindow frame].origin.x + possionX*32; - menuPoint.y = [mapWindow frame].origin.y + 32*15 - possionY*32 - 140; + if(buildSkillFlag) { + cIncludeCreateFlag = true; + menuPoint.y -= 20; + }else cIncludeCreateFlag = false; + if(summonSkillFlag) { + cIncludeSummonFlag = true; + menuPoint.y -= 20; + }else cIncludeSummonFlag = false; int plusBtnValue = 0; if(cIncludeCreateFlag && cIncludeSummonFlag){ diff --git a/Awars III/FieldView.h b/Awars III/FieldView.h index 60b67da..dc68993 100755 --- a/Awars III/FieldView.h +++ b/Awars III/FieldView.h @@ -19,6 +19,8 @@ int possionX; int possionY; +int possionLocalX; +int possionLocalY; int g_selectRange[1002][1002]; int g_moveCost[4][128]; @@ -173,3 +175,4 @@ bool CPUturn; //-(void)loadMesh:(NSMutableArray *)theMapString; @end +FieldView *fieldView; diff --git a/Awars III/FieldView.m b/Awars III/FieldView.m index 16b99de..2579dd3 100755 --- a/Awars III/FieldView.m +++ b/Awars III/FieldView.m @@ -19,6 +19,8 @@ self = [super initWithFrame:frame]; if (self) { + fieldView = self; + time = [NSTimer scheduledTimerWithTimeInterval:1.0/30 target:self @@ -71,6 +73,7 @@ //if(unitBreak) NSLog(@"unitBreakAtkrange %d", unitBreak->atkRange); + if(evInitMap) {evInitMap = false; NSRect seRect = NSMakeRect(0, 0, chipWidth*32, chipHeight*32); @@ -540,6 +543,11 @@ possionX = (int)drugPoint.x/32+1; possionY = (int)drugPoint.y/32+1; + NSPoint drugPoint2 = [self convertPoint:[theEvent locationInWindow] fromView:self]; + + possionLocalX = (int)drugPoint2.x/32+1; + possionLocalY = (int)drugPoint2.y/32+1; + menuDisplayFlag = false; U = UTop; @@ -1845,6 +1853,7 @@ if(Utarget) NSLog(@"Utarg %d", Utarget->number); else NSLog(@"Utarg NULL"); cpuModeMOVEflag = true; + [self scrollPoint:NSMakePoint((wtPx-8)*32, (wtPy-8)*32)]; if(unitNoMoveStanbyFlag){ static int waitTimer = 20; cpuModeATTACKflag = true; @@ -1964,6 +1973,7 @@ return; }else{ waitTimer0 = 20; + pushStanbyFlag = true; cpuModeMOVEflag = false; @@ -1992,6 +2002,7 @@ return; }else{ waitTimer = 20; + [self scrollPoint:NSMakePoint((wtPx-8)*32, (wtPy-8)*32)]; wtAttackedFlag = true; if(!cpuAtkExtendFlag){ CPUAttackSubmitFlag = true; @@ -4256,6 +4267,9 @@ if(FieldSceneInitFlag){ initMapFlag = true; FieldSceneInitFlag = false; + + NSRect seRect = NSMakeRect(0, 0, chipWidth*32, chipHeight*32); + [self setFrame:seRect]; } } -- 2.11.0