OSDN Git Service

ゲームのAT調整
authorKillery <Killery@kiritani-no-mac-mini.local>
Mon, 11 Apr 2016 23:49:42 +0000 (08:49 +0900)
committerKillery <Killery@kiritani-no-Mac-mini.local>
Mon, 11 Apr 2016 23:49:42 +0000 (08:49 +0900)
Awars III/EventScene.h
Awars III/EventScene.m
Awars III/FieldScene.h
Awars III/FieldScene.m
Awars III/FieldView.m
Awars III/MapEditor.h
Awars III/ScenarioList.m
Awars III/en.lproj/MainMenu.xib

index 4610459..9fca0d6 100755 (executable)
@@ -48,6 +48,8 @@ bool FieldSceneInitFlag;
 
 bool EventViewDraw;
 
+int esSceneProc;
+
 @interface EventScene : NSObject
 {
     NSTimer *timer;
index aab2634..a7fd1bf 100755 (executable)
@@ -76,6 +76,8 @@
         }
     }
     
+    
+    
    int dCount = 0;
     ST = evSTtop;
     if(!ST){
@@ -88,9 +90,8 @@
             [dialogTF setStringValue:@""];
             [faceIV setImage:nil];
             [wallIV setImage:nil];
-            [fsWindow makeKeyAndOrderFront:nil];
-            [esWindow close];
             FieldSceneInitFlag = true;
+            initMapFlag = true;
             EventViewDraw = true;
             UTop = NULL;
             if(MF[MFselectedRow+1].MS.battleSetMode){
             [dialogTF setStringValue:@""];
             [faceIV setImage:nil];
             [wallIV setImage:nil];
-            [titleWindow makeKeyAndOrderFront:nil];
-            [esWindow close];
+            if(esSceneProc == 0){
+                [titleWindow makeKeyAndOrderFront:nil];
+                 esSceneProc++;
+            }
+            
             return;
         }
+    }else{
+        
+        if(esSceneProc == 0){
+            [esWindow setFrameOrigin:NSMakePoint(titleWindow.frame.origin.x, titleWindow.frame.origin.y)];
+            [esWindow makeKeyAndOrderFront:nil];
+            [titleWindow close];
+            esSceneProc++;
+        }
     }
     
     if(jumpFlag){
         mapInitFlag = true;
         [MapViewInst loadMapChip];
         mapInitFlag = false;
-        [fsWindow makeKeyAndOrderFront:nil];
         [esWindow close];
         UTop = NULL;
         if(MF[MFselectedRow+1].MS.battleSetMode){
         postImageWall = NULL;
         evActive = true;
         FieldSceneInitFlag = true;
+        initMapFlag = true;
         
         startOrEndFlag = true;
         cnt = 0;
index 7844db8..9e81540 100755 (executable)
@@ -301,6 +301,8 @@ bool guildRE2;
 int Gnum1;
 int Gnum2;
 
+int mapChipDataLoadProc;
+
 @interface FieldScene : NSObject
 {
     NSTimer *time;
index 95bc506..0bbdc8f 100755 (executable)
         }
 
         MS.D->ET3 = MS.D->ET1 + (double)deltaR;
+        MS.D->ET4 = MS.D->ET3;
         
         MSDPt = MS.D->P;
         while (MS.D->P) {
         
         [self initGuildList];
         cpuTurnEndFlag = false;
+        mapChipDataLoadProc = 0;
     }
     
     if(unitBreak){
         }
     }
     
-    [self EventFunc];
+    [self EventFunc:true];
     if(wtRdy3)
         return;
     
                         B = BTop;
                     }
                     
+                    eventTime++;
+                    U = UTop;
+                    
+                    [self EventFunc:false];
+                    pussyCumsOnlyOnceFlag = false;
+                    
                     goto lolwtfshit;
                 }
                 
             }
             eventTime++;
             U = UTop;
+            
+            [self EventFunc:false];
+            
             pussyCumsOnlyOnceFlag = false;
             wtRdy = false;
             
     }
     
     if(mapChipDataLoadFail){
-        
         [endGamePanel close];
-        [esWindow makeKeyAndOrderFront:nil];
-        [fsWindow close];
         
         endGameCondition = false;
         initMapFlag = false;
         
         mapChipDataLoadFail = false;
         return;
+    }else if(initMapFlag){
+        mapChipDataLoadProc++;
+    }
+    
+    if(mapChipDataLoadProc > 2)
+        mapChipDataLoadProc = 2;
+    
+    if(mapChipDataLoadProc == 1){
+        [fsWindow makeKeyAndOrderFront:nil];
+        [esWindow close];
+        [titleWindow close];
+        mapChipDataLoadProc++;
     }
     
     if(TeamCountFlag && !endGameCondition){
         }
         
         [endGamePanel close];
-        [esWindow makeKeyAndOrderFront:nil];
+
         [fsWindow close];
         
+        esSceneProc = 0;
+        
         [BGMsub stop];
         
         endGameCondition = false;
         [titleWindow makeKeyAndOrderFront:nil];
         [fsWindow close];
         
+        esSceneProc = 0;
+        
         [BGMsub stop];
         
         endGameCondition = false;
             return;
         }
         
-        [esWindow makeKeyAndOrderFront:nil];
         [fsWindow close];
         
+        esSceneProc = 0;
+        
         [BGMsub stop];
         
         endGameCondition = false;
 
 }
 
--(void)EventFunc{
+-(void)EventFunc:(bool)eventLoopProcFlag{
     
-    if(battleBegin && !pussyLoopFlag && !pussyCumsOnlyOnceFlag){
+    if(battleBegin && !pussyLoopFlag){
         wtRdy3 = true;
         bool proccessTrue = false;
         static bool onlyBigin = false;
                 }
             
             
-            if(MS.D->ET3 <= eventTime)
+            if(eventTime == MS.D->ET4){
                 proccessTrue = true;
+                if(MS.D->ETtype == 4){
+                    
+                    double deltaET = floor(MS.D->ET2) - floor(MS.D->ET1);
+                    int deltaR = 0;
+                    if(deltaET < 0) deltaET = 0;
+                    
+                    if(MS.D->ET1 <= eventTime && MS.D->ET2 >= eventTime){
+                        if(deltaET > 0) deltaR = rand()%(int)deltaET;
+                    }
+                    
+                    MS.D->ET3 = MS.D->ET1 + (double)deltaR;
+                    
+                    MS.D->ET4 += MS.D->ET3;
+                }
+                
+               // NSLog(@"%g %d", eventTime, P[0].resource);
+            }else{
+            
+                MS.D = MS.D->next;
+                
+                continue;
+            }
+            
             
             
             if(MS.D->type == -1 && !EventFailFlag)
             if(MS.D->endFlag)
                 continue;
             
+            if(!MS.D->ET4 == 0 && pussyCumsOnlyOnceFlag){
+                EventFailFlag = true;
+            }
             
-            if(EventFailFlag){
+            if(EventFailFlag  || !proccessTrue){
                 while (MS.D->P) {
                     MS.D->P->endFlag = true;
                     MS.D->P = MS.D->P->next;
         MF[MFselectedRow+1].MS.D = MS.D;
         cpuTurnEndFlag = false;
         battleSetUpIgnore = false;
-        pussyCumsOnlyOnceFlag = true;
+        if(!eventLoopProcFlag)
+            pussyCumsOnlyOnceFlag = true;
         wtRdy3 = false;
     }
 
     if(MS0->type == 37)
         Proc = TITLE_FLAG;
     
+
+        
+    
     switch(Proc){
             
         case MESSAGE_FLAG:
             coolTime = true;
             break;
         case SELECTION_FLAG:
+            
             MS0 = [self setSelection:MS0];
             coolTime = true;
             break;
index 2579dd3..83ed8c5 100755 (executable)
     
     
     if(FieldSceneInitFlag){
-        initMapFlag = true;
         FieldSceneInitFlag = false;
         
         NSRect seRect = NSMakeRect(0, 0, chipWidth*32, chipHeight*32);
index 03b2082..dc23b7a 100644 (file)
@@ -280,6 +280,7 @@ typedef struct _MAPSCRIPTD{
     double ET1;
     double ET2;
     double ET3;
+    double ET4;
     int ETtype;
     
     int *switch1;
index d07e35e..3599d9d 100755 (executable)
     MFselectedRow = scenarioNumb + 1;
     [SLPanel close];
     [NSApp stopModal];
-    NSPoint windowPoint;
-    windowPoint.x = [titleWindow frame].origin.x;
-    windowPoint.y = [titleWindow frame].origin.y;
-    [eventSceneWindow setFrameOrigin:windowPoint];
-    [eventSceneWindow makeKeyAndOrderFront:nil];
-    [titleWindow close];
+    esSceneProc = 0;
     evActive = true;
     
     [SLPanel close];
     MFselectedRow = scenarioNumb + 1;
     [SLPanel close];
     [NSApp stopModal];
-    NSPoint windowPoint;
-    windowPoint.x = [titleWindow frame].origin.x;
-    windowPoint.y = [titleWindow frame].origin.y;
-    [eventSceneWindow setFrameOrigin:windowPoint];
-    [eventSceneWindow makeKeyAndOrderFront:nil];
-    [titleWindow close];
+    esSceneProc = 0;
     evActive = true;
 }
 
index 684e6c4..c4857c0 100755 (executable)
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                         <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" imageFrameStyle="photo" id="10281"/>
                     </imageView>
+                    <customView id="aPb-WE-XhR" customClass="EventView">
+                        <rect key="frame" x="0.0" y="0.0" width="640" height="480"/>
+                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                    </customView>
                     <box autoresizesSubviews="NO" title="Box" boxType="custom" borderType="line" titlePosition="noTitle" id="10247">
                         <rect key="frame" x="150" y="22" width="470" height="100"/>
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                         <color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
                         <color key="fillColor" red="0.79993206520000004" green="0.75136146059999998" blue="0.72815454430000004" alpha="0.65000000000000002" colorSpace="calibratedRGB"/>
                     </box>
-                    <customView id="aPb-WE-XhR" customClass="EventView">
-                        <rect key="frame" x="0.0" y="0.0" width="640" height="480"/>
-                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
-                    </customView>
                 </subviews>
             </view>
             <point key="canvasLocation" x="-465" y="1846"/>