OSDN Git Service

範囲攻撃修正
authorKillery <Killery@kiritani-no-mac-mini.local>
Wed, 10 Feb 2016 02:11:10 +0000 (11:11 +0900)
committerKillery <Killery@kiritani-no-Mac-mini.local>
Wed, 10 Feb 2016 02:11:10 +0000 (11:11 +0900)
26 files changed:
Awars III.xcodeproj/project.pbxproj
Awars III/BuildChipList.m
Awars III/ChipView.h
Awars III/ChipView.m
Awars III/CommandView.h
Awars III/CommandView.m
Awars III/EventScene.h
Awars III/EventScene.m
Awars III/EventView.m
Awars III/FPS.h [new file with mode: 0644]
Awars III/FPS.m [new file with mode: 0644]
Awars III/FieldScene.m
Awars III/FieldView.m
Awars III/Idle.h [new file with mode: 0644]
Awars III/Idle.m [new file with mode: 0644]
Awars III/LoadChipList.m
Awars III/MapChipList.m
Awars III/MapEditor.h
Awars III/MapEditor.m
Awars III/MapView.h
Awars III/MapView.m
Awars III/SeedView.h
Awars III/SeedView.m
Awars III/UnitChipList.h
Awars III/UnitChipList.m
Awars III/en.lproj/MainMenu.xib

index 5cb8495..e56c0c2 100755 (executable)
@@ -33,6 +33,7 @@
                C6241AE51A570BE900EA35C2 /* ucb52.png in Resources */ = {isa = PBXBuildFile; fileRef = C6241AE11A570BE900EA35C2 /* ucb52.png */; };
                C629F5EC18BD54C2001A42B0 /* アクセラレータ.jpg in Resources */ = {isa = PBXBuildFile; fileRef = C629F5EB18BD54C2001A42B0 /* アクセラレータ.jpg */; };
                C632BD8916C4B7A40087CDAA /* サトシ.png in Resources */ = {isa = PBXBuildFile; fileRef = C632BD8816C4B7A40087CDAA /* サトシ.png */; };
+               C633EC241C5F5DC200B9E0E5 /* Idle.m in Sources */ = {isa = PBXBuildFile; fileRef = C633EC231C5F5DC200B9E0E5 /* Idle.m */; };
                C63622E21A57456B006A20BF /* ucb53.png in Resources */ = {isa = PBXBuildFile; fileRef = C63622DE1A57456B006A20BF /* ucb53.png */; };
                C63622E31A57456B006A20BF /* ucb54.png in Resources */ = {isa = PBXBuildFile; fileRef = C63622DF1A57456B006A20BF /* ucb54.png */; };
                C63622E41A57456B006A20BF /* ucb55.png in Resources */ = {isa = PBXBuildFile; fileRef = C63622E01A57456B006A20BF /* ucb55.png */; };
                C6DDC78F16A1C5DA0093865D /* haik2.png in Resources */ = {isa = PBXBuildFile; fileRef = C6DDC78B16A1C5D90093865D /* haik2.png */; };
                C6DDC79016A1C5DA0093865D /* img1.png in Resources */ = {isa = PBXBuildFile; fileRef = C6DDC78C16A1C5D90093865D /* img1.png */; };
                C6DDC79116A1C5DA0093865D /* img2.png in Resources */ = {isa = PBXBuildFile; fileRef = C6DDC78D16A1C5DA0093865D /* img2.png */; };
+               C6E02F3C1C5FAF0D00B3304B /* FPS.m in Sources */ = {isa = PBXBuildFile; fileRef = C6E02F3B1C5FAF0D00B3304B /* FPS.m */; };
                C6E8DA25167C85D200BFEC32 /* MapView.m in Sources */ = {isa = PBXBuildFile; fileRef = C6E8DA24167C85D200BFEC32 /* MapView.m */; };
                C6E8DA29167C85EE00BFEC32 /* ChipView.m in Sources */ = {isa = PBXBuildFile; fileRef = C6E8DA28167C85EE00BFEC32 /* ChipView.m */; };
                C6E8DA2C167C860B00BFEC32 /* SeedView.m in Sources */ = {isa = PBXBuildFile; fileRef = C6E8DA2B167C860B00BFEC32 /* SeedView.m */; };
                C6241AE11A570BE900EA35C2 /* ucb52.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ucb52.png; sourceTree = "<group>"; };
                C629F5EB18BD54C2001A42B0 /* アクセラレータ.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "アクセラレータ.jpg"; sourceTree = "<group>"; };
                C632BD8816C4B7A40087CDAA /* サトシ.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "サトシ.png"; sourceTree = "<group>"; };
+               C633EC221C5F5DC200B9E0E5 /* Idle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Idle.h; sourceTree = "<group>"; };
+               C633EC231C5F5DC200B9E0E5 /* Idle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Idle.m; sourceTree = "<group>"; };
                C63622DE1A57456B006A20BF /* ucb53.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ucb53.png; sourceTree = "<group>"; };
                C63622DF1A57456B006A20BF /* ucb54.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ucb54.png; sourceTree = "<group>"; };
                C63622E01A57456B006A20BF /* ucb55.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ucb55.png; sourceTree = "<group>"; };
                C6DDC78B16A1C5D90093865D /* haik2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = haik2.png; sourceTree = "<group>"; };
                C6DDC78C16A1C5D90093865D /* img1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = img1.png; sourceTree = "<group>"; };
                C6DDC78D16A1C5DA0093865D /* img2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = img2.png; sourceTree = "<group>"; };
+               C6E02F3A1C5FAF0D00B3304B /* FPS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FPS.h; sourceTree = "<group>"; };
+               C6E02F3B1C5FAF0D00B3304B /* FPS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FPS.m; sourceTree = "<group>"; };
                C6E8DA23167C85D200BFEC32 /* MapView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MapView.h; sourceTree = "<group>"; };
                C6E8DA24167C85D200BFEC32 /* MapView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MapView.m; sourceTree = "<group>"; };
                C6E8DA27167C85EE00BFEC32 /* ChipView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChipView.h; sourceTree = "<group>"; };
                                C679EB461671B577001EB662 /* StartMenu.h */,
                                C679EB491671B587001EB662 /* ContinueMenu.h */,
                                C679EB4A1671B587001EB662 /* ContinueMenu.m */,
+                               C6E02F3A1C5FAF0D00B3304B /* FPS.h */,
+                               C6E02F3B1C5FAF0D00B3304B /* FPS.m */,
+                               C633EC221C5F5DC200B9E0E5 /* Idle.h */,
+                               C633EC231C5F5DC200B9E0E5 /* Idle.m */,
                                C69C3ED716D2350A00FA2D1B /* Game */,
                                C6E8DA33167C988C00BFEC32 /* MapEditor */,
                                C68DD4A51686E0CE009CE3AE /* Scenario */,
                                C6AA2925188489520083001C /* LoadChipList.m in Sources */,
                                C69C3EDA16D2356200FA2D1B /* EventScene.m in Sources */,
                                C69C3EDD16D2358500FA2D1B /* EventView.m in Sources */,
+                               C633EC241C5F5DC200B9E0E5 /* Idle.m in Sources */,
+                               C6E02F3C1C5FAF0D00B3304B /* FPS.m in Sources */,
                                C67E1F8C16D6CB570085009B /* FieldScene.m in Sources */,
                                C67E1F9016D6CB6F0085009B /* FieldView.m in Sources */,
                                C67AA7D616FDBB5A0091C9A8 /* BattleView.m in Sources */,
index 9a3ad64..6e6aeaa 100755 (executable)
@@ -70,7 +70,7 @@ NSInteger clickIndex;
         [TFcostMe setIntValue:BC[clickIndex].Emoney];
         [TFWTE setIntValue:BC[clickIndex].S_M.WTE];
         [TFWTN setIntValue:BC[clickIndex].S_M.WTN];
-        [BC[clickIndex].img setFlipped:NO];
+        //[BC[clickIndex].img setFlipped:NO];
         [IVimg setImage:BC[clickIndex].img];
         [IVimgBig setImage:BC[clickIndex].imgb];
         [PUPtype selectItemAtIndex:BC[clickIndex].type];
index e151907..e4a4f3a 100755 (executable)
@@ -22,6 +22,8 @@ int SLindexB;
 int SLindexU;
 int SLindexL;
 
+
+
 @interface ChipView : NSView
 {
     NSTimer *time;
@@ -37,4 +39,8 @@ int SLindexL;
 -(NSImage*)LoadImage:(NSString*)name;
 -(void)DrawImage:(NSImage*)image x:(float)x y:(float)y cx:(int)cx cy:(int)cy;
 
+-(void)EventLoopChipView;
+
 @end
+
+ChipView *ChipViewInst;
\ No newline at end of file
index 5c39de0..2023e35 100755 (executable)
 {
     self = [super initWithFrame:frame];
     if (self) {
+        /*
         time  = [NSTimer
-                 scheduledTimerWithTimeInterval:0.05f
+                 scheduledTimerWithTimeInterval:1.0/30
                  target:self
                  selector:@selector(EventLoop:)
                  userInfo:nil
                  repeats:YES
-                 ];
+                 ];*/
+        
+        ChipViewInst = self;
+        
         chip = [[self LoadImage:@"マス.png"] retain];
         chip2 = [[self LoadImage:@"セレクター.png"] retain];
         chipA = [[self LoadImage:@"cc旗青.png"] retain];
@@ -44,7 +48,7 @@
     return self;
 }
 
--(void)EventLoop:(NSTimer*)time{
+-(void)EventLoopChipView{
     
     SLindex = (SLy*3 + SLx)+(MapChipListIndex-1)*24;
     SLindexB = (SLy*3 + SLx)+(BuildChipListIndex-1)*24;
index 5057eda..7737388 100755 (executable)
@@ -25,4 +25,7 @@ bool CommandSelected;
 -(NSImage*)LoadImage:(NSString*)name;
 -(void)DrawImage:(NSImage*)image x:(float)x y:(float)y cx:(int)cx cy:(int)cy;
 
+-(void)EventLoopCommandView;
 @end
+
+CommandView *CommandViewInst;
\ No newline at end of file
index fcfc4cd..c6cf5b0 100755 (executable)
 {
     self = [super initWithFrame:frame];
     if (self) {
+        /*
         time  = [NSTimer
-                 scheduledTimerWithTimeInterval:0.05f
+                 scheduledTimerWithTimeInterval:1.0/30
                  target:self
                  selector:@selector(EventLoop:)
                  userInfo:nil
                  repeats:YES
-                 ];
+                 ];*/
         
         chip = [[self LoadImage:@"マス.png"] retain];
         chip2 = [[self LoadImage:@"ccなし.png"] retain];
@@ -35,7 +36,7 @@
     return self;
 }
 
--(void)EventLoop:(NSTimer*)time{
+-(void)EventLoopCommandView{
     
     [self setNeedsDisplay:YES];
 }
index 9fed4b7..4610459 100755 (executable)
@@ -10,6 +10,7 @@
 #import "StringText.h"
 #import "MapView.h"
 #import "MapEditor.h"
+#import "FPS.h"
 
 bool evMouseClicked;
 bool evMouseDowned;
@@ -92,4 +93,6 @@ bool EventViewDraw;
 -(IBAction)btn9:(id)sender;
 
 
+-(void)EventFunc;
+
 @end
index 76b7b4b..70da387 100755 (executable)
@@ -18,7 +18,7 @@
     [super init];
     if (self) {
         timer = [NSTimer
-                 scheduledTimerWithTimeInterval:0.1
+                 scheduledTimerWithTimeInterval:1.0/30
                  target:self selector:@selector(EventLoopES:)
                  userInfo:nil repeats:YES
                  ];
 
 
 -(void)EventLoopES:(NSTimer *)timer{
+
+    [self EventFunc];
+}
+
+
+-(void)EventFunc{
+    
     
     if(!startES) return;
     ST = NULL;
index 092f54a..40730a4 100755 (executable)
@@ -16,7 +16,7 @@
     self = [super initWithFrame:frame];
     if (self) {
         time  = [NSTimer
-                 scheduledTimerWithTimeInterval:0.001f
+                 scheduledTimerWithTimeInterval:1.0/30
                  target:self
                  selector:@selector(EventLoopEV:)
                  userInfo:nil
diff --git a/Awars III/FPS.h b/Awars III/FPS.h
new file mode 100644 (file)
index 0000000..f819267
--- /dev/null
@@ -0,0 +1,21 @@
+//
+//  FPS.h
+//  Awars III
+//
+//  Created by 桐谷 諭史 on 2016/02/01.
+//  Copyright © 2016年 Killery. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <Cocoa/Cocoa.h>
+
+
+@interface FPS : NSObject
+{
+    NSTimer *timer;
+}
+
+bool CtrlFPS(double num);
+int GetFrameRate();
+int GetFrameRateMAX();
+@end
diff --git a/Awars III/FPS.m b/Awars III/FPS.m
new file mode 100644 (file)
index 0000000..599840b
--- /dev/null
@@ -0,0 +1,84 @@
+//
+//  FPS.m
+//  Awars III
+//
+//  Created by 桐谷 諭史 on 2016/02/01.
+//  Copyright © 2016年 Killery. All rights reserved.
+//
+
+#import "FPS.h"
+
+@implementation FPS
+
+-(id)init{
+    
+    
+    timer = [NSTimer
+             scheduledTimerWithTimeInterval:1.0/30
+             target:self
+             selector:@selector(FPSFnc:)
+             userInfo:nil
+             repeats:YES];
+    
+    
+    
+    
+    
+    
+    return self;
+    
+    
+}
+
+
+-(void)FPSFnc:(id)sender{
+    
+    GetFrameRate();
+    
+}
+
+int GetFrameRateMAX(){
+    
+    static CFTimeInterval lastTime = 0;
+    static int fps = 0;
+    static bool fpsInit = false;
+    
+    if(!fpsInit){
+        lastTime = CFAbsoluteTimeGetCurrent();
+        fpsInit = true;
+    }
+    
+    CFTimeInterval currentTime = CFAbsoluteTimeGetCurrent();
+    fps++;
+    if(currentTime - lastTime >= 1){
+        NSLog(@"MAXFPS = %d", fps);
+        fps = 0;
+        lastTime = currentTime;
+    }
+    
+    return fps;
+}
+
+int GetFrameRate(){
+    
+    static CFTimeInterval lastTime = 0;
+    static int fps = 0;
+    static bool fpsInit = false;
+    
+    if(!fpsInit){
+        lastTime = CFAbsoluteTimeGetCurrent();
+        fpsInit = true;
+    }
+    
+    CFTimeInterval currentTime = CFAbsoluteTimeGetCurrent();
+    fps++;
+    if(currentTime - lastTime >= 1){
+        NSLog(@"FPS = %d", fps);
+        fps = 0;
+        lastTime = currentTime;
+    }
+    
+    return fps;
+}
+
+@end
index 9dffdd6..1821eab 100755 (executable)
@@ -55,7 +55,7 @@
 
     if(self){
         time  = [NSTimer
-                 scheduledTimerWithTimeInterval:0.015
+                 scheduledTimerWithTimeInterval:1.0/30
                  target:self
                  selector:@selector(EventLoopFS:)
                  userInfo:nil
         U = U->next;
     }
     
-    if(Utarget) NSLog(@"PX %d PY %d UX %d UY %d", possionX, possionY, Utarget->x, Utarget->y);
+    //if(Utarget) NSLog(@"PX %d PY %d UX %d UY %d", possionX, possionY, Utarget->x, Utarget->y);
         U = UTop;
     }
     
@@ -3970,7 +3970,7 @@ w000p:
     double hi = U->C.S_C.LUK - U2->C.S_C.LUK;
     if(hi < 0) hi = 0;
     
-    hit = 60 + hit/hit2*10 - hit2/hit*10 + hitFix - log(hi+1)*hit2/hit*10;
+    hit = 60 + hit/hit2*10 - hit2/hit*10 + hitFix - log(hi/10+1)*hit2/hit*10;
 
     if(battleDod2Flag) hit = hit / 2;
     hit = floor(hit);
@@ -4188,7 +4188,7 @@ w000p:
         double hi = U->C.S_C.LUK - U2->C.S_C.LUK;
         if(hi < 0) hi = 0;
         
-        hit = 60 + hit/hit2*10 - hit2/hit*10 + hitFix - log(hi+1)*hit2/hit*10;
+        hit = 60 + hit/hit2*10 - hit2/hit*10 + hitFix - log(hi/10+1)*hit2/hit*10;
         if(battleDod1Flag) hit /= 2;
         hit = floor(hit);
         
@@ -4808,7 +4808,7 @@ w000p:
     double hi = U->C.S_C.LUK - U2->C.S_C.LUK;
     if(hi < 0) hi = 0;
     
-    hit = 60 + hit/hit2*10 - hit2/hit*10 + hitFix - log(hi+1)*hit2/hit*10;
+    hit = 60 + hit/hit2*10 - hit2/hit*10 + hitFix - log(hi/10+1)*hit2/hit*10;
     if(battleDod2Flag) hit = hit / 2;
     hit = floor(hit);
     
@@ -5282,7 +5282,7 @@ w000p:
         double hi = U->C.S_C.LUK - U2->C.S_C.LUK;
         if(hi < 0) hi = 0;
         
-        hit = 60 + hit/hit2*10 - hit2/hit*10 + hitFix - log(hi+1)*hit2/hit*10;
+        hit = 60 + hit/hit2*10 - hit2/hit*10 + hitFix - log(hi/10+1)*hit2/hit*10;
         if(battleDod1Flag) hit /= 2;
         hit = floor(hit);
         
@@ -5648,7 +5648,7 @@ w000p:
             double hi = U->C.S_C.LUK - U2->C.S_C.LUK;
             if(hi < 0) hi = 0;
             
-            hit = 60 + hit/hit2*10 - hit2/hit*10 + hitFix - log(hi+1)*hit2/hit*10;
+            hit = 60 + hit/hit2*10 - hit2/hit*10 + hitFix - log(hi/10+1)*hit2/hit*10;
             if(hit > 100) hit = 100;
             if(hit < 0) hit = 0;
             if(U2A->D->sort == 1){
@@ -5828,7 +5828,7 @@ w000p:
             }else if(extentBattleFlag2){
                 DUNnum++;
                 messageProcess = 1;
-                if(DUN[DUNnum] == -1){
+                if(DUN[DUNnum] <= 0){
                     DUNnum = 1;
                     messageProcess++;
                     messageProcess++;
@@ -6148,7 +6148,7 @@ w000p:
             hi = U->C.S_C.LUK - U2->C.S_C.LUK;
             if(hi < 0) hi = 0;
             
-            hit = 60 + hit/hit2*10 - hit2/hit*10 + hitFix - log(hi+1)*hit2/hit*10;
+            hit = 60 + hit/hit2*10 - hit2/hit*10 + hitFix - log(hi/10+1)*hit2/hit*10;
             if(hit > 100) hit = 100;
             if(hit < 0) hit = 0;
             
@@ -7109,7 +7109,7 @@ avAWESOME2A:{}
     double hi = U->C.S_C.LUK - U2->C.S_C.LUK;
     if(hi < 0) hi = 0;
     
-    hit = 60 + hit/hit2*10 - hit2/hit*10 + hitFix - log(hi+1)*hit2/hit*10;
+    hit = 60 + hit/hit2*10 - hit2/hit*10 + hitFix - log(hi/10+1)*hit2/hit*10;
     if(hit > 100) hit = 100;
     if(U2A->D->sort == 1){
         hit = 100;
@@ -8001,7 +8001,7 @@ avAWESOME3A:{}
     }else if(extentBattleFlag2){
         DUNnum++;
         messageProcess = 1;
-        if(DUN[DUNnum] == -1){
+        if(DUN[DUNnum] <= 0){
             DUNnum = 1;
             messageProcess++;
             messageProcess++;
@@ -8164,7 +8164,7 @@ avAWESOME3B:{}
     double hi = U->C.S_C.LUK - U2->C.S_C.LUK;
     if(hi < 0) hi = 0;
     
-    hit = 60 + hit/hit2*10 - hit2/hit*10 + hitFix - log(hi+1)*hit2/hit*10;
+    hit = 60 + hit/hit2*10 - hit2/hit*10 + hitFix - log(hi/10+1)*hit2/hit*10;
     if(hit > 100) hit = 100;
     
     battleDod1Flag = false;
index ed1305c..1909e4a 100755 (executable)
@@ -18,8 +18,9 @@
 {
     self = [super initWithFrame:frame];
     if (self) {
+        
         time  = [NSTimer
-                 scheduledTimerWithTimeInterval:0.01
+                 scheduledTimerWithTimeInterval:1.0/30
                  target:self
                  selector:@selector(EventLoopFV:)
                  userInfo:nil
     if(stanbyFlag){
         
         
-        if(!submitFlag) movePlus += 4;
-        if( i0 < g_shallowDepth && movePlus >= 32 && !submitFlag)
+        if(!submitFlag) movePlus += 1;
+        if( i0 < g_shallowDepth && movePlus >= 3 && !submitFlag)
         {
             cPosX = g_moveRoute[i0][1]*32;
             cPosY = g_moveRoute[i0][0]*32;
         
         //if(unitBreak->CPU) cpuTurnEndFlag = false;
         
-        if(!cpuTurnEndFlag && wtRdy){
+        if(!cpuTurnEndFlag && wtRdy && unitBreak->C.S_C.WT == 0){
             [self modeCPUturn];
             
         }
     
     
     if(unitBreak){
-        if(unitBreak->dead){
+        if(unitBreak->dead && unitBreak->C.S_C.WT != 999999){
             unitNum[unitBreak->x][unitBreak->y] = -1;
             unitBreak->C.S_C.WT = 999999;
-            //wtRdy = false;
+            wtRdy = false;
             stanbyFlag = true;
         }
         
     if(coolTime)
         return;
     
+    /*
     if(cpuAImodeflag)
-        return;
+        return;*/
     
     if(P[1].type == 1){
         
     switch (cpuMODE) {
         case MODE_CPU_IDLE:
             
+            
+            
             if(coolTime)
                 return;
             
+            
             if(stanbyFlag)
                 return;
             
             
             wtRdy = true;
             unitMoveEndFlag = false;
+            cpuAtkExtendFlag = false;
+            cpuAtkExtendFlag2 = false;
+            extentBattleFlag2 = false;
             CPUAttackFlag = false;
             CPUAttackFlag2 = false;
             if(cpuAImodeflag && unitBreak->C.nameID)
             else NSLog(@"Utarg NULL");
             cpuModeMOVEflag = true;
             if(unitNoMoveStanbyFlag){
-                static int waitTimer = 50;
+                static int waitTimer = 30;
                 cpuModeATTACKflag = true;
                 if (waitTimer > 0) {
                     waitTimer--;
                     return;
                 }else{
-                    waitTimer = 50;
+                    waitTimer = 30;
                     unitNoMoveFlag = true;
                     U = UTop;
                     
                 
                 if(cpuModeBATTLEendFlag){
                     
-                    static int waitTimer0 = 50;
+                    static int waitTimer0 = 30;
                     
                     if (waitTimer0 > 0) {
                         waitTimer0--;
                         return;
                     }else{
-                        waitTimer0 = 50;
+                        waitTimer0 = 30;
                     pushStanbyFlag = true;
                     
                     cpuModeMOVEflag = false;
             }
             else if((CPUAttackFlag && unitMoveEndFlag )|| CPUAttackFlag2){
                 
-                static int waitTimer = 50;
+                static int waitTimer = 30;
                 
                 if (waitTimer > 0) {
                     waitTimer--;
                     return;
                 }else{
-                    waitTimer = 50;
+                    waitTimer = 30;
                     wtAttackedFlag = true;
                     if(!cpuAtkExtendFlag){
                         CPUAttackSubmitFlag = true;
                 }
             }else if((CPUAttackFlag && !unitMoveEndFlag)){
                 
-                static int waitTimer = 50;
+                static int waitTimer = 30;
                 
                 if (waitTimer > 0) {
                     waitTimer--;
                     return;
                 }else{
-                    waitTimer = 50;
+                    waitTimer = 30;
                     wtAttackedFlag = true;
                     if(!cpuAtkExtendFlag){
                         CPUAttackSubmitFlag = true;
             
             if(!Utarget){
                 CPUAttackFlag = false;
+                cpuAtkExtendFlag = false;
             }
             
             if(!CPUAttackFlag){
                 wtRdy = false;
                 pushStanbyFlag = true;
                 
+
                 cpuModeMOVEflag = false;
                 cpuModeATTACKflag = false;
                 cpuAImodeflag = false;
             
             pushStanbyFlag = true;
             
+
             cpuModeMOVEflag = false;
             cpuModeATTACKflag = false;
             cpuAImodeflag = false;
diff --git a/Awars III/Idle.h b/Awars III/Idle.h
new file mode 100644 (file)
index 0000000..59c26c5
--- /dev/null
@@ -0,0 +1,18 @@
+//
+//  Idle.h
+//  Awars III
+//
+//  Created by 桐谷 諭史 on 2016/02/01.
+//  Copyright © 2016年 Killery. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "FPS.h"
+#import "EventScene.h"
+
+
+@interface Idle : NSObject
+{
+    NSTimer *Timer;
+}
+@end
diff --git a/Awars III/Idle.m b/Awars III/Idle.m
new file mode 100644 (file)
index 0000000..45536f0
--- /dev/null
@@ -0,0 +1,55 @@
+//
+//  Idle.m
+//  Awars III
+//
+//  Created by 桐谷 諭史 on 2016/02/01.
+//  Copyright © 2016年 Killery. All rights reserved.
+//
+
+#import "Idle.h"
+
+@implementation Idle
+-(id)init{
+    
+    if(self){
+        /*
+        Timer = [NSTimer
+                 scheduledTimerWithTimeInterval:0.00000001
+                 target:self
+                 selector:@selector(EventLoop:)
+                 userInfo:nil
+                 repeats:YES
+                 ];
+        
+        
+        
+        ESh = [EventScene new];
+        [[NSBundle mainBundle] loadNibNamed:@"Event Scene" owner:ESh topLevelObjects:nil];
+        */
+    }
+    
+    
+    return self;
+}
+
+-(void)EventLoop:(id)sender{
+    
+    //[self Idling];
+    
+}
+
+-(void)Idling{
+    /*
+    GetFrameRateMAX();
+    if(!CtrlFPS(60))
+        return;
+    GetFrameRate();
+     setNeedsDisplayFlag = true;
+    */
+    
+    //[ESh EventFunc];
+    
+    
+    
+}
+@end
index d54f344..9eb3938 100644 (file)
 
 
 -(id)init{
-
+/*
     LCLtime  = [NSTimer
-                scheduledTimerWithTimeInterval:0.01f
+                scheduledTimerWithTimeInterval:1.0/30
                 target:self
                 selector:@selector(EventLoopLCL:)
                 userInfo:nil
                 repeats:YES
-                ];
+                ];*/
 
     chipNumb = 23;
     [self initFileDirectory];
index 0a77b53..40f0b8e 100755 (executable)
     [super init];
     
     if (self) {
+        /*
         MCLtime  = [NSTimer
-                 scheduledTimerWithTimeInterval:0.05f
+                 scheduledTimerWithTimeInterval:1.0/30
                  target:self
                  selector:@selector(EventLoopMCL:)
                  userInfo:nil
                  repeats:YES
                  ];
+         */
         [self initFileDirectory];
         [self initMapChipList];
         MapChipMax = (int)chipNumb/25+1;
@@ -59,7 +61,7 @@ NSInteger clickIndex;
         [TFchu setIntValue:MC[clickIndex].chu];
         [TFsora setIntValue:MC[clickIndex].sora];
         [TFtype selectItemAtIndex:MC[clickIndex].type];
-        [MC[clickIndex].img setFlipped:NO];
+        //[MC[clickIndex].img setFlipped:NO];
         [IVimg setImage:MC[clickIndex].img];
     }
     
@@ -211,7 +213,7 @@ NSInteger clickIndex;
             NSString *imgName = @"mc";
             imgName = [imgName stringByAppendingFormat:@"%d", i+1];
             MC[i].img = [[NSImage imageNamed:imgName] retain];
-            [MC[i].img setFlipped:NO];
+            //[MC[i].img setFlipped:NO];
             
             NSString *imagePath = @"data/MapChip/img/";
             imagePath = [imagePath stringByAppendingString:MC[i].iName];
index d1a71ff..2c95ca2 100644 (file)
@@ -465,9 +465,11 @@ bool fuckingRetardedBtnPushed1;
 
 int fileNumb;
 
+NSTimer *timeMapEditor;
+
 @interface MapEditor : NSObject
 {
-    NSTimer *time0;
+    
     
     IBOutlet NSImageView *topIV;
     IBOutlet NSTextField *topName;
index cc29f05..a25dc30 100755 (executable)
 
 -(id)init{
     if (self) {
-        time0  = [NSTimer
-                 scheduledTimerWithTimeInterval:0.05
+        timeMapEditor  = [NSTimer
+                 scheduledTimerWithTimeInterval:1.0/30
                  target:self
                  selector:@selector(EventLoop0:)
                  userInfo:nil
 
 
 -(void)EventLoop0:(NSTimer*)time{
+    
+    
+    [MapViewInst EventLoopMapView];
+    [ChipViewInst EventLoopChipView];
+    [SeedViewInst EventLoopSeedView];
+    [CommandViewInst EventLoopCommandView];
+    
     /*
     if(doubleClickedFlag && EDbranchPlaceTenFlag){
         NSLog(@"omg", MSDTOPP);
index 75fc22f..332893f 100755 (executable)
@@ -40,6 +40,8 @@ bool doubleClickedFlag;
 
 int MSDPONOFFFlagNum;
 
+
+
 @interface MapView : NSView
 {
     NSTimer *time0;
@@ -62,4 +64,7 @@ int MSDPONOFFFlagNum;
 
 -(void)loadMapChip;
 
+-(void)EventLoopMapView;
 @end
+
+MapView *MapViewInst;
index 29d1295..f475ee6 100644 (file)
 {
     self = [super initWithFrame:frame];
     if (self) {
-        time0  = [NSTimer
-                 scheduledTimerWithTimeInterval:0.05f
+        
+        /*time0  = [NSTimer
+                 scheduledTimerWithTimeInterval:1.0/30
                  target:self
                  selector:@selector(EventLoop00:)
                  userInfo:nil
                  repeats:YES
-                 ];
+                 ];*/
+        
+        MapViewInst = self;
+        
         chip = [[self LoadImage:@"マス.png"] retain];
         chip2 = [[self LoadImage:@"セレクター.png"] retain];
         
@@ -70,7 +74,7 @@
     
     return self;
 }
--(void)EventLoop00:(NSTimer*)time{
+-(void)EventLoopMapView{
     
     if(saveMapChipFlag){saveMapChipFlag = false;
         [self saveMapChip];
index b6cea57..cc71c83 100755 (executable)
@@ -27,5 +27,9 @@ bool DoubleClicked;
 
 -(NSImage*)LoadImage:(NSString*)name;
 -(void)DrawImage:(NSImage*)image x:(float)x y:(float)y cx:(int)cx cy:(int)cy;
+-(void)EventLoopSeedView;
 
 @end
+
+
+SeedView *SeedViewInst;
\ No newline at end of file
index 10eeb4d..34d10ed 100755 (executable)
 {
     self = [super initWithFrame:frame];
     if (self) {
+        /*
         time  = [NSTimer
-                 scheduledTimerWithTimeInterval:0.05f
+                 scheduledTimerWithTimeInterval:1.0/30
                  target:self
                  selector:@selector(EventLoop:)
                  userInfo:nil
                  repeats:YES
-                 ];
+                 ];*/
+        SeedViewInst = self;
+        
         chip = [[self LoadImage:@"マス.png"] retain];
         chip2 = [[self LoadImage:@"地形.png"] retain];
         chip3 = [[self LoadImage:@"建物.png"] retain];
@@ -35,7 +38,7 @@
     return self;
 }
 
--(void)EventLoop:(NSTimer*)time{
+-(void)EventLoopSeedView{
     
     [self setNeedsDisplay:YES];
 }
index ac9dbe0..c718b2b 100755 (executable)
@@ -385,6 +385,9 @@ bool ATaniFlag;
 bool frameRunFlag;
 bool ATalphaFlag;
 
+bool attackEffectPreviewBtnFlag;
+
+
 @interface UnitChipList : NSObject
 {
     NSTimer *UCLtime;
@@ -791,8 +794,16 @@ bool ATalphaFlag;
 -(void)initFileDirectoryAttack2;
 -(void)setTotalDamage2:(int)i row:(int)r;
 
+
+
+
+
+
+
+-(void)aniTFChanged;
 @end
 
+UnitChipList *UnitChipListInst;
 
 @interface UnitChipListEV : NSView
 {
index 7d60656..26bad10 100644 (file)
     
     if (self) {
         UCLtime  = [NSTimer
-                    scheduledTimerWithTimeInterval:0.01f
+                    scheduledTimerWithTimeInterval:1.0/30
                     target:self
                     selector:@selector(EventLoopUCL:)
                     userInfo:nil
                     repeats:YES
                     ];
-        [[NSRunLoop currentRunLoop] addTimer: UCLtime forMode:NSDefaultRunLoopMode];
-        
         
+        /*
         aniTimer  = [NSTimer
-                    scheduledTimerWithTimeInterval:0.015
+                    scheduledTimerWithTimeInterval:1.0/30
                     target:self
                     selector:@selector(EventLoopANI:)
                     userInfo:nil
                     repeats:YES
-                    ];
-        [[NSRunLoop currentRunLoop] addTimer: aniTimer forMode:NSDefaultRunLoopMode];
+                    ];*/
+        UnitChipListInst = self;
         
         [self initFileDirectoryItem];
         [self initItemList];
@@ -7373,6 +7372,10 @@ int omfgErase() {
 -(IBAction)attackEffectPreviewBtn:(id)sender{
     
     
+    
+    
+    
+    
     ATTACK *A;
     
     if(EQmodeFlag){
@@ -7522,6 +7525,8 @@ int omfgErase() {
             }
         }
         [ATEffectAniWindow makeKeyAndOrderFront:nil];
+        attackEffectPreviewBtnFlag = true;
+        [UCLtime invalidate];
     }
 }
 
@@ -7683,6 +7688,13 @@ int omfgErase() {
 -(IBAction)attackEffectAniCloseBtn:(id)sender{
     
     frameRunFlag = false;
+    UCLtime  = [NSTimer
+                scheduledTimerWithTimeInterval:1.0/30
+                target:self
+                selector:@selector(EventLoopUCL:)
+                userInfo:nil
+                repeats:YES
+                ];
     [ATEffectAniWindow close];
     
 }
@@ -8018,79 +8030,7 @@ int omfgErase() {
 
 -(void)EventLoopANI:(NSTimer*)time{
     
-    static int frameCnt = 0;
-    
-    if(!frameRunFlag){
-        frameCnt = 0;
-        return;
-    }
-    
-    ATTACK *A;
-    
-    if(EQmodeFlag){
-        A = EQ[clickIndexEQ].A;
-    }else{
-        if(!loadChipSideFlag){
-        A = UC[clickIndex].A;
-        }else{
-        A = LC[cil].A;
-        }
-        
-    }
-    atkTop = A;
-    
-    for(int i = 0;i < clickIndexAL;i++){
-        A = A->next;
-    }
-    
-    if(frameCnt == 0){
-        
-        ani = A->AN.ANI;
-        ANI *aniTop = ani;
-        
-        for (int i = 0; i < frameNum-1;i++) {
-            ani = ani->next;
-        }
-        
-        if(ani->snd){
-            [ani->snd setCurrentTime:0];
-            [ani->snd play];
-            ani->snd.loops = NO;
-        }
-        ani = aniTop;
-        
-        A->AN.ANI = ani;
-    }
-    
-    if(frameCnt < A->AN.frame){
-        frameCnt++;
-    }else{
-        
-        frameCnt = 0;
-        
-        if(frameNum < frameMax){
-            frameNum++;
-        }else{
-            frameNum = 1;
-            
-            A->AN.ANI = ani;
-        }
-        [ATframeCntTF setStringValue:[NSString stringWithFormat:@"%d/%d", frameNum, frameMax]];
-        
-    }
-    
-    A = atkTop;
-    
-    if(EQmodeFlag){
-        EQ[clickIndexEQ].A = atkTop;
-    }else{
-        if(!loadChipSideFlag){
-        UC[clickIndex].A = atkTop;
-        }else{
-        LC[cil].A = atkTop;
-        }
     
-    }
 }
 
 -(IBAction)attackEffectRun:(id)sender{
@@ -8143,7 +8083,9 @@ int omfgErase() {
 }
 
 
-
+-(void)aniTFChanged{
+    [ATframeCntTF setStringValue:[NSString stringWithFormat:@"%d/%d", frameNum, frameMax]];
+}
 
 
 
@@ -8176,7 +8118,7 @@ int omfgErase() {
     
     if (self) {
         timer  = [NSTimer
-                 scheduledTimerWithTimeInterval:0.015f
+                 scheduledTimerWithTimeInterval:1.0/30
                  target:self
                  selector:@selector(EventLoopAN:)
                  userInfo:nil
@@ -8189,6 +8131,80 @@ int omfgErase() {
 }
 
 -(void)EventLoopAN:(NSTimer*)timer{
+    static int frameCnt = 0;
+    
+    if(!frameRunFlag){
+        frameCnt = 0;
+        return;
+    }
+    
+    ATTACK *A;
+    
+    if(EQmodeFlag){
+        A = EQ[clickIndexEQ].A;
+    }else{
+        if(!loadChipSideFlag){
+            A = UC[clickIndex].A;
+        }else{
+            A = LC[cil].A;
+        }
+        
+    }
+    atkTop = A;
+    
+    for(int i = 0;i < clickIndexAL;i++){
+        A = A->next;
+    }
+    
+    if(frameCnt == 0){
+        
+        ani = A->AN.ANI;
+        ANI *aniTop = ani;
+        
+        for (int i = 0; i < frameNum-1;i++) {
+            ani = ani->next;
+        }
+        
+        if(ani->snd){
+            [ani->snd setCurrentTime:0];
+            [ani->snd play];
+            ani->snd.loops = NO;
+        }
+        ani = aniTop;
+        
+        A->AN.ANI = ani;
+    }
+    
+    if(frameCnt < A->AN.frame){
+        frameCnt++;
+    }else{
+        
+        frameCnt = 0;
+        
+        if(frameNum < frameMax){
+            frameNum++;
+        }else{
+            frameNum = 1;
+            
+            A->AN.ANI = ani;
+        }
+        [UnitChipListInst aniTFChanged];
+        
+    }
+    
+    A = atkTop;
+    
+    if(EQmodeFlag){
+        EQ[clickIndexEQ].A = atkTop;
+    }else{
+        if(!loadChipSideFlag){
+            UC[clickIndex].A = atkTop;
+        }else{
+            LC[cil].A = atkTop;
+        }
+        
+    }
+    
     [self setNeedsDisplay:YES];
 }
 
index 9a29caf..2ea3f9a 100755 (executable)
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9531" systemVersion="14F27" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9532" systemVersion="14F27" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.AVKitIBPlugin" version="9531"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9531"/>
+        <plugIn identifier="com.apple.AVKitIBPlugin" version="9532"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9532"/>
         <capability name="box content view" minToolsVersion="7.0"/>
     </dependencies>
     <objects>
-        <customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
+        <customObject id="-2" userLabel="File's Owner" customClass="Idle">
             <connections>
                 <outlet property="delegate" destination="494" id="495"/>
             </connections>
             </connections>
         </customObject>
         <customObject id="420" customClass="NSFontManager"/>
+        <customObject id="263-Vk-nul" customClass="Idle"/>
+        <customObject id="vWh-oC-VAv" customClass="FPS"/>
         <customObject id="1697" customClass="Title">
             <connections>
                 <outlet property="ContinueWindow" destination="702" id="1699"/>
                             <autoresizingMask key="autoresizingMask"/>
                         </scroller>
                         <tableHeaderView key="headerView" id="ZbX-lt-I6z">
-                            <rect key="frame" x="0.0" y="0.0" width="238" height="17"/>
+                            <rect key="frame" x="0.0" y="0.0" width="402" height="17"/>
                             <autoresizingMask key="autoresizingMask"/>
                         </tableHeaderView>
                     </scrollView>