OSDN Git Service

致命的なバグを解消
[awarsiii/AwarsIV.git] / Awars III / FieldScene.h
1 //
2 //  FieldScene.h
3 //  Awars III
4 //
5 //  Created by Killery on 2013/02/22.
6 //  Copyright (c) 2013年 Killery. All rights reserved.
7 //
8
9 #import <Foundation/Foundation.h>
10 #import <AVFoundation/AVFoundation.h>
11 #import <AVKit/AVKit.h>
12 #import "MapEditor.h"
13 #import "MapView.h"
14 #import "FieldView.h"
15 #import "MapChipList.h"
16 #import "UnitChipList.h"
17 #import "BuildChipList.h"
18 #import "EventScene.h"
19
20 typedef struct _UNIT{
21     struct _UNIT *next;
22     struct _UNITCHIP C;
23     struct _LOADCHIP CL;
24     bool CPU;
25     int number;
26     int team;
27     int chipNumber;
28     int chipNumberL;
29     
30     int x;
31     int y;
32     int z;
33     
34     int ix;
35     int iy;
36     int iz;
37     
38     NSImage *img;
39     
40     bool loadChipFlag;
41     
42     bool dead;
43     NSString *army;
44     bool unControlable;
45     bool joinArmyFromNext;
46     bool persuasion;
47     int atkRange;
48     
49     bool targType1L;
50     bool targType2L;
51     bool targType1D;
52     bool targType2D;
53     
54 }UNIT;
55
56 typedef struct _UNION{
57     
58     
59     
60 }UNION;
61
62 typedef struct _BUILD{
63     struct _BUILD *next;
64     struct _BUILDCHIP C;
65     int number;
66     int team;
67     int chipNumber;
68     int makeLv;
69     
70     int x;
71     int y;
72     int z;
73     
74     NSImage *img;
75     
76     bool dead;
77     
78
79 }BUILD;
80
81
82 typedef struct _PLAYER{
83     
84     NSString *name;
85     int type;
86     
87     int resource;
88     int food;
89     int money;
90     
91     int base;
92     int unit;
93     
94     UNIT *U;
95
96 }PLAYER;
97
98 typedef struct _UNITPOINT{
99
100     struct _UNITPOINT *next;
101     
102     int x;
103     int y;
104
105 }UNITPOINT;
106
107 double eventTime;
108
109 PLAYER P[10];
110
111 UNIT *U;
112 UNIT *U2;
113 int AUN[255];
114 int DUN[255];
115 int messageProcess;
116
117 int targType1cnt[2];
118 int targType2cnt[2];
119 bool targType2Lflag;
120 bool targType2Dflag;
121
122 int placeVL[64];
123 int placeVD[64];
124
125 BUILD *B;
126 BUILD *BTop;
127
128 NSPoint menuPoint;
129 bool menuDisplayFlag;
130 bool initStatusFlag;
131
132 bool bLoopFlag;
133 int crCAL;
134 int crCAL1;
135 int crCAL2;
136 bool dcRdy;
137 bool dcRdy2;
138
139 int crCRL;
140
141 int crBCL;
142 bool bclRdy;
143
144 int crCSL;
145 bool cslRdy;
146 UNITCHIP CSLUC;
147 UNIT *CSLU;
148 UNIT *CSLUorigin;
149
150
151 bool battleSetUp;
152 bool battleSetUpIgnore;
153 bool battleRdy;
154 bool pushStanbyFlag;
155
156 UNITCHIP *BRU;
157 int BRUindex;
158
159 bool wtRdy;
160 bool wtRdyB;
161 int wtPx, wtPy, wtUnitNum;
162 UNIT *unitBreak;
163 bool wtMovedFlag;
164 bool wtAttackedFlag;
165
166 bool battleBegin;
167
168 int TeamCount0;
169 int TeamCount2;
170 bool TeamCountFlag;
171
172 bool endGameCondition;
173 bool blueWinFlag;
174 bool redWinFlag;
175
176 bool battleDef1Flag;
177 bool battleDef2Flag;
178 bool battleDod1Flag;
179 bool battleDod2Flag;
180 bool battleSetFlag;
181 bool battleSet1Flag;
182 bool battleSet2Flag;
183 bool battleSet2PushedFlag;
184 bool battleSettingFlag;
185
186 bool cIncludeCreateFlag;
187 bool cIncludeSummonFlag;
188
189 bool initMapEventFlag;
190 bool messageDialog;
191 int msgLvl;
192 int msgCnt;
193 int msgMax;
194 int msgLvlMax;
195 bool initImgFlag;
196 int MSDnum;
197 bool initStringNum;
198 bool messageSwitchFlag1;
199 bool bugFixFlag1;
200 bool bugFixFlag2;
201 bool bugFixFlag3;
202
203 bool messageEndFlag;
204
205 bool SwitchONflag;
206 bool SwitchOFFflag;
207
208 int mostNumSub;
209 bool cpuAImodeflag;
210
211 UNIT *UTop;
212
213 bool retardhelp1;
214 bool retardhelp2;
215 bool battleReadyUpFlag;
216
217 bool avPlayerFlag1;
218 bool avPlayerFlag2;
219 bool animationFlag1;
220 bool animationFlag2;
221 bool animationFlag3;
222 int aniFrameCnt;
223
224 ATTACK *attackCR;
225 ATTACK *attackCR2;
226 ATTACK *attackTop;
227 ATTACK *attackTop2;
228 UNIT *effCun;
229
230 struct _MAPSCRIPT0 *MSDP0top;
231 struct _MAPSCRIPT0 *MSDPtop;
232
233 int slctedBtnNum;
234 int slctBtnNum;
235 NSPoint slctPoint;
236
237 bool appearanceSAIKIflag;
238 bool waitx10flag;
239 bool waitSwtichFlag;
240 bool waitAllOverFlag;
241 double waitinTime;
242 NSSound *BGMsub;
243 NSSound *SEsub;
244
245 bool eventEndFlag;
246
247 bool gameOverFlag;
248 bool gameOverFlag2;
249 struct _GAMEOVER gaov;
250
251 bool stageClearFlag;
252 bool stageClearFlag2;
253
254
255 bool backTitleFlag;
256 bool backTitleFlag2;
257
258 int cntTimerMin;
259 int cntTimerSec;
260
261 bool coolTime;
262
263 int waypR[1002][1002];
264 int objeR[1002][1002];
265 int apprR[1002][1002];
266 UNITPOINT *postUnitPoint;
267 UNITPOINT *postUnitPointTop;
268 bool unitPointMakeSureFlag;
269 bool unitPointMakeSureFlag2;
270
271 UNITPOINT *UP;
272 UNITPOINT *UPT;
273
274 bool pussyLoopFlag;
275
276 int wtflag;
277
278 bool atkExtentFlag;
279 int DUNnum;
280 bool extentBattleFlag2;
281 bool extentMPcostFlag;
282
283 @interface FieldScene : NSObject
284 {
285     NSTimer *time;
286     
287     
288     IBOutlet NSTextField *battleReadyUpPN1;
289     IBOutlet NSTextField *battleReadyUpPN2;
290     IBOutlet NSTextField *battleReadyUpRule;
291     IBOutlet NSButtonCell *battleReadyUpMAN1A;
292     IBOutlet NSButtonCell *battleReadyUpMAN1B;
293     IBOutlet NSButtonCell *battleReadyUpMAN2A;
294     IBOutlet NSButtonCell *battleReadyUpMAN2B;
295     IBOutlet NSTextField *battleReadyUpSupply1;
296     IBOutlet NSTextField *battleReadyUpFood1;
297     IBOutlet NSTextField *battleReadyUpMoney1;
298     IBOutlet NSTextField *battleReadyUpSupply2;
299     IBOutlet NSTextField *battleReadyUpFood2;
300     IBOutlet NSTextField *battleReadyUpMoney2;
301     IBOutlet NSTextField *battleReadyUpLeader1;
302     IBOutlet NSTextField *battleReadyUpLeader2;
303     IBOutlet NSImageView *battleReadyUpIV1;
304     IBOutlet NSImageView *battleReadyUpIV2;
305     IBOutlet NSWindow *bsWindow;
306     
307     IBOutlet NSImageView *selectMesh;
308     IBOutlet NSTextField *selectMeshText;
309     IBOutlet NSTextField *selectMeshValue;
310     IBOutlet NSImageView *selectChara;
311     
312     IBOutlet NSWindow *mapWindow;
313     
314     IBOutlet NSPanel *menuPanel;
315     IBOutlet NSButton *TFmove;
316     IBOutlet NSButton *TFattack;
317     IBOutlet NSButton *TFstandby;
318     IBOutlet NSButton *TFcreate;
319     IBOutlet NSButton *TFstatus;
320     IBOutlet NSButton *TFcancel;
321     
322     IBOutlet NSPanel *menuPanel2;
323     IBOutlet NSButton *TFstatus2;
324     IBOutlet NSButton *TFcancel2;
325     
326     
327     NSMutableArray *CAttackListMA;
328     IBOutlet NSArrayController *CAttackListAC;
329     IBOutlet NSTableView *CAttackListTV;
330     
331     IBOutlet NSPanel *atkPanel;
332     NSPoint windowPoint;
333     
334     NSMutableArray *BCreateListMA;
335     IBOutlet NSArrayController *BCreateListAC;
336     IBOutlet NSTableView *BCreateListTV;
337     
338     IBOutlet NSPanel *createPanel;
339     
340     NSMutableArray *CSummonListMA;
341     IBOutlet NSArrayController *CSummonListAC;
342     IBOutlet NSTableView *CSummonListTV;
343     
344     IBOutlet NSPanel *summonPanel;
345     
346     IBOutlet NSTextField *bullet;
347     IBOutlet NSTextField *costP;
348     IBOutlet NSTextField *costV;
349     IBOutlet NSTextField *region;
350     IBOutlet NSTextField *crytical;
351     IBOutlet NSTextField *atkProperty;
352     
353     IBOutlet NSTextField *HPbarTF;
354     IBOutlet NSLevelIndicator *HPbarLI;
355     IBOutlet NSTextField *MPbarTF;
356     
357     
358     IBOutlet NSWindow *battleWindow;
359     IBOutlet NSImageView *bplayer1;
360     IBOutlet NSImageView *bplayer2;
361     IBOutlet NSTextField *nplayer1;
362     IBOutlet NSTextField *nplayer2;
363     IBOutlet NSTextField *tplayer1;
364     IBOutlet NSTextField *tplayer2;
365     IBOutlet NSLevelIndicator *lplayer1;
366     IBOutlet NSLevelIndicator *lplayer2;
367     IBOutlet NSTextField *mplayer1;
368     IBOutlet NSTextField *mplayer2;
369     IBOutlet NSImageView *iplayer1;
370     IBOutlet NSImageView *iplayer2;
371     IBOutlet NSTextField *rplayer1;
372     IBOutlet NSTextField *rplayer2;
373     IBOutlet NSTextField *hplayer1;
374     IBOutlet NSTextField *hplayer2;
375     IBOutlet NSTextField *battleDialog;
376     IBOutlet NSButton *battleCancelBtn;
377     IBOutlet NSButton *battleAttackBtn1;
378     IBOutlet NSButton *battleAttackBtn2;
379     IBOutlet NSButton *battleGuardBtn1;
380     IBOutlet NSButton *battleGuardBtn2;
381     IBOutlet NSButton *battleDodgeBtn1;
382     IBOutlet NSButton *battleDodgeBtn2;
383     IBOutlet NSButton *battleStartBtn;
384     
385     IBOutlet NSTextField *tfAttack;
386     IBOutlet NSTextField *tfDefence;
387     IBOutlet NSTextField *tfCalc;
388     IBOutlet NSTextField *tfHit;
389     IBOutlet NSTextField *tfDodge;
390     IBOutlet NSTextField *tfMove;
391     IBOutlet NSTextField *tfWait;
392     
393     IBOutlet NSTextField *tfName;
394     IBOutlet NSTextField *tfArmy;
395     IBOutlet NSTextField *tfResource;
396     IBOutlet NSTextField *tfFood;
397     IBOutlet NSTextField *tfMoney;
398     
399     IBOutlet NSPanel *battlePanel;
400     IBOutlet NSTextField *combatNAME1;
401     IBOutlet NSTextField *combatNAME2;
402     IBOutlet NSTextField *combatHP1;
403     IBOutlet NSTextField *combatHP2;
404     IBOutlet NSTextField *combatMP1;
405     IBOutlet NSTextField *combatMP2;
406     IBOutlet NSLevelIndicator *combatLHP1;
407     IBOutlet NSLevelIndicator *combatLHP2;
408     IBOutlet NSLevelIndicator *combatLMP1;
409     IBOutlet NSLevelIndicator *combatLMP2;
410     IBOutlet NSTextField *combatHIT1;
411     IBOutlet NSTextField *combatHIT2;
412     IBOutlet NSTextField *combatVIG1;
413     IBOutlet NSTextField *combatVIG2;
414     IBOutlet NSTextField *combatAP1;
415     IBOutlet NSTextField *combatAP2;
416     IBOutlet NSTextField *combatATK1;
417     IBOutlet NSTextField *combatATK2;
418     
419     IBOutlet NSPanel *researchPanel;
420     IBOutlet NSTextField *researchATK;
421     IBOutlet NSTextField *researchDEF;
422     IBOutlet NSTextField *researchCAP;
423     IBOutlet NSTextField *researchACU;
424     IBOutlet NSTextField *researchEVA;
425     IBOutlet NSTextField *researchMOV;
426     IBOutlet NSImageView *researchIMG;
427     
428     NSMutableArray *CResearchListMA;
429     IBOutlet NSArrayController *CResearchListAC;
430     IBOutlet NSTableView *CResearchListTV;
431     
432     ATTACK *U2A;
433     double dmg;
434     double hit;
435     double hitFix;
436     double mapDmgFix;
437     double costMP;
438     bool healFlag;
439     double graze;
440     bool grazeFlag;
441     
442     IBOutlet NSWindow *titleWindow;
443     IBOutlet NSWindow *esWindow;
444     IBOutlet NSWindow *fsWindow;
445     IBOutlet NSPanel *endGamePanel;
446     IBOutlet NSTextField *endGameText;
447     
448     IBOutlet NSPanel *commandPanel;
449     IBOutlet NSButton *moveBtn;
450     IBOutlet NSButton *attackBtn;
451     IBOutlet NSButton *stanbyBtn;
452     IBOutlet NSButton *createBtn;
453     IBOutlet NSButton *summonBtn;
454     IBOutlet NSButton *statusBtn;
455     IBOutlet NSButton *cancelBtn;
456     
457     bool buildSkillFlag;
458     bool summonSkillFlag;
459     
460     IBOutlet NSImageView *IVimage;
461     IBOutlet NSTextField *TFmessage;
462     IBOutlet NSTextField *TFname;
463     IBOutlet NSBox *BXmessage;
464     IBOutlet NSBox *BXname;
465
466     IBOutlet NSPanel *fsEffectPanel;
467     IBOutlet AVPlayerView *AVPV;
468     AVPlayer *AVpreview;
469     
470     
471     IBOutlet NSWindow *selectionWindow;
472     IBOutlet NSButton *slctBtn1;
473     IBOutlet NSButton *slctBtn2;
474     IBOutlet NSButton *slctBtn3;
475     IBOutlet NSButton *slctBtn4;
476     IBOutlet NSButton *slctBtn5;
477     IBOutlet NSButton *slctBtn6;
478     IBOutlet NSButton *slctBtn7;
479     IBOutlet NSButton *slctBtn8;
480     IBOutlet NSButton *slctBtn9;
481     
482     IBOutlet NSWindow *GameOverWindow;
483     IBOutlet NSImageView *GameOverIV;
484     
485     IBOutlet NSWindow *STwindow;
486     
487     IBOutlet NSImageView *STIV;
488     IBOutlet NSTextField *STnameTF;
489     IBOutlet NSTextField *STclassTF;
490     IBOutlet NSTextField *SThpTF;
491     IBOutlet NSTextField *STmpTF;
492     IBOutlet NSTextField *STatkTF;
493     IBOutlet NSTextField *STdefTF;
494     IBOutlet NSTextField *STcapTF;
495     IBOutlet NSTextField *STacuTF;
496     IBOutlet NSTextField *STevaTF;
497     IBOutlet NSTextField *STstrTF;
498     IBOutlet NSTextField *STvitTF;
499     IBOutlet NSTextField *STagiTF;
500     IBOutlet NSTextField *STdexTF;
501     IBOutlet NSTextField *STmenTF;
502     IBOutlet NSTextField *STintTF;
503     IBOutlet NSTextField *STmelTF;
504     IBOutlet NSTextField *STmisTF;
505     IBOutlet NSTextField *SThitTF;
506     IBOutlet NSTextField *STdodTF;
507     IBOutlet NSTextField *STreaTF;
508     IBOutlet NSTextField *STskiTF;
509     
510     NSMutableArray *STjoinListMA;
511     IBOutlet NSArrayController *STjoinListAC;
512     IBOutlet NSTableView *STjoinListTV;
513     
514     NSMutableArray *STequipListMA;
515     IBOutlet NSArrayController *STequipListAC;
516     IBOutlet NSTableView *STequipListTV;
517     
518     NSMutableArray *STskillListMA;
519     IBOutlet NSArrayController *STskillListAC;
520     IBOutlet NSTableView *STskillListTV;
521     
522 }
523 -(MAPSCRIPT0*)setMessage:(MAPSCRIPT0*)MS0;
524
525 -(IBAction)STsubmit:(id)sender;
526
527 -(IBAction)battleReadyUpStartBtn:(id)sender;
528 -(IBAction)battleReadyUpState1:(id)sender;
529 -(IBAction)battleReadyUpState2:(id)sender;
530
531 -(IBAction)pushMove:(id)sender;
532 -(IBAction)pushAttack:(id)sender;
533 -(IBAction)pushStandby:(id)sender;
534 -(IBAction)pushCreate:(id)sender;
535 -(IBAction)pushSummon:(id)sender;
536 -(IBAction)pushStatus:(id)sender;
537 -(IBAction)pushCancel:(id)sender;
538
539 -(IBAction)battleStart:(id)sender;
540 -(IBAction)battleSet1:(id)sender;
541 -(IBAction)battleDef1:(id)sender;
542 -(IBAction)battleDod1:(id)sender;
543 -(IBAction)battleSet2:(id)sender;
544 -(IBAction)battleDef2:(id)sender;
545 -(IBAction)battleDod2:(id)sender;
546 -(IBAction)battleCancel:(id)sender;
547
548 -(IBAction)pushCancelCAL:(id)sender;
549 -(IBAction)pushCancelBCL:(id)sender;
550 -(IBAction)pushCancelCSL:(id)sender;
551
552 -(IBAction)researchCancel:(id)sender;
553
554 -(IBAction)selectionBtn1:(id)sender;
555 -(IBAction)selectionBtn2:(id)sender;
556 -(IBAction)selectionBtn3:(id)sender;
557 -(IBAction)selectionBtn4:(id)sender;
558 -(IBAction)selectionBtn5:(id)sender;
559 -(IBAction)selectionBtn6:(id)sender;
560 -(IBAction)selectionBtn7:(id)sender;
561 -(IBAction)selectionBtn8:(id)sender;
562 -(IBAction)selectionBtn9:(id)sender;
563
564 -(IBAction)gameOverSubmit:(id)sender;
565
566 @end
567
568
569
570
571
572
573 @interface FieldSceneEF : NSView
574 {
575     NSTimer *time;
576 }
577
578 @end
579
580
581
582
583
584
585
586
587
588