OSDN Git Service

Merge branch 'workSpace'
[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
138 int crCRL;
139
140 int crBCL;
141 bool bclRdy;
142
143 int crCSL;
144 bool cslRdy;
145 UNITCHIP CSLUC;
146 UNIT *CSLU;
147 UNIT *CSLUorigin;
148
149
150 bool battleSetUp;
151 bool battleSetUpIgnore;
152 bool battleRdy;
153 bool pushStanbyFlag;
154
155 UNITCHIP *BRU;
156 int BRUindex;
157
158 bool wtRdy;
159 bool wtRdyB;
160 int wtPx, wtPy, wtUnitNum;
161 UNIT *unitBreak;
162 bool wtMovedFlag;
163 bool wtAttackedFlag;
164
165 bool battleBegin;
166
167 int TeamCount0;
168 int TeamCount2;
169 bool TeamCountFlag;
170
171 bool endGameCondition;
172 bool blueWinFlag;
173 bool redWinFlag;
174
175 bool battleDef1Flag;
176 bool battleDef2Flag;
177 bool battleDod1Flag;
178 bool battleDod2Flag;
179 bool battleSetFlag;
180 bool battleSet1Flag;
181 bool battleSet2Flag;
182 bool battleSet2PushedFlag;
183 bool battleSettingFlag;
184
185 bool cIncludeCreateFlag;
186 bool cIncludeSummonFlag;
187
188 bool initMapEventFlag;
189 bool messageDialog;
190 int msgLvl;
191 int msgCnt;
192 int msgMax;
193 int msgLvlMax;
194 bool initImgFlag;
195 int MSDnum;
196 bool initStringNum;
197 bool messageSwitchFlag1;
198 bool bugFixFlag1;
199 bool bugFixFlag2;
200 bool bugFixFlag3;
201
202 bool messageEndFlag;
203
204 bool SwitchONflag;
205 bool SwitchOFFflag;
206
207 int mostNumSub;
208 bool cpuAImodeflag;
209
210 UNIT *UTop;
211
212 bool retardhelp1;
213 bool retardhelp2;
214 bool battleReadyUpFlag;
215
216 bool avPlayerFlag1;
217 bool avPlayerFlag2;
218 bool animationFlag1;
219 bool animationFlag2;
220 bool animationFlag3;
221 int aniFrameCnt;
222
223 ATTACK *attackCR;
224 ATTACK *attackCR2;
225 ATTACK *attackTop;
226 ATTACK *attackTop2;
227 UNIT *effCun;
228
229 struct _MAPSCRIPT0 *MSDP0top;
230 struct _MAPSCRIPT0 *MSDPtop;
231
232 int slctedBtnNum;
233 int slctBtnNum;
234 NSPoint slctPoint;
235
236 bool appearanceSAIKIflag;
237 bool waitx10flag;
238 bool waitSwtichFlag;
239 bool waitAllOverFlag;
240 double waitinTime;
241 NSSound *BGMsub;
242 NSSound *SEsub;
243
244 bool eventEndFlag;
245
246 bool gameOverFlag;
247 bool gameOverFlag2;
248 struct _GAMEOVER gaov;
249
250 bool stageClearFlag;
251 bool stageClearFlag2;
252
253
254 bool backTitleFlag;
255 bool backTitleFlag2;
256
257 int cntTimerMin;
258 int cntTimerSec;
259
260 bool coolTime;
261
262 int waypR[1002][1002];
263 int objeR[1002][1002];
264 int apprR[1002][1002];
265 UNITPOINT *postUnitPoint;
266 UNITPOINT *postUnitPointTop;
267 bool unitPointMakeSureFlag;
268 bool unitPointMakeSureFlag2;
269
270 UNITPOINT *UP;
271 UNITPOINT *UPT;
272
273 bool pussyLoopFlag;
274
275 int wtflag;
276
277 @interface FieldScene : NSObject
278 {
279     NSTimer *time;
280     
281     
282     IBOutlet NSTextField *battleReadyUpPN1;
283     IBOutlet NSTextField *battleReadyUpPN2;
284     IBOutlet NSTextField *battleReadyUpRule;
285     IBOutlet NSButtonCell *battleReadyUpMAN1A;
286     IBOutlet NSButtonCell *battleReadyUpMAN1B;
287     IBOutlet NSButtonCell *battleReadyUpMAN2A;
288     IBOutlet NSButtonCell *battleReadyUpMAN2B;
289     IBOutlet NSTextField *battleReadyUpSupply1;
290     IBOutlet NSTextField *battleReadyUpFood1;
291     IBOutlet NSTextField *battleReadyUpMoney1;
292     IBOutlet NSTextField *battleReadyUpSupply2;
293     IBOutlet NSTextField *battleReadyUpFood2;
294     IBOutlet NSTextField *battleReadyUpMoney2;
295     IBOutlet NSTextField *battleReadyUpLeader1;
296     IBOutlet NSTextField *battleReadyUpLeader2;
297     IBOutlet NSImageView *battleReadyUpIV1;
298     IBOutlet NSImageView *battleReadyUpIV2;
299     IBOutlet NSWindow *bsWindow;
300     
301     IBOutlet NSImageView *selectMesh;
302     IBOutlet NSTextField *selectMeshText;
303     IBOutlet NSTextField *selectMeshValue;
304     IBOutlet NSImageView *selectChara;
305     
306     IBOutlet NSWindow *mapWindow;
307     
308     IBOutlet NSPanel *menuPanel;
309     IBOutlet NSButton *TFmove;
310     IBOutlet NSButton *TFattack;
311     IBOutlet NSButton *TFstandby;
312     IBOutlet NSButton *TFcreate;
313     IBOutlet NSButton *TFstatus;
314     IBOutlet NSButton *TFcancel;
315     
316     IBOutlet NSPanel *menuPanel2;
317     IBOutlet NSButton *TFstatus2;
318     IBOutlet NSButton *TFcancel2;
319     
320     
321     NSMutableArray *CAttackListMA;
322     IBOutlet NSArrayController *CAttackListAC;
323     IBOutlet NSTableView *CAttackListTV;
324     
325     IBOutlet NSPanel *atkPanel;
326     NSPoint windowPoint;
327     
328     NSMutableArray *BCreateListMA;
329     IBOutlet NSArrayController *BCreateListAC;
330     IBOutlet NSTableView *BCreateListTV;
331     
332     IBOutlet NSPanel *createPanel;
333     
334     NSMutableArray *CSummonListMA;
335     IBOutlet NSArrayController *CSummonListAC;
336     IBOutlet NSTableView *CSummonListTV;
337     
338     IBOutlet NSPanel *summonPanel;
339     
340     IBOutlet NSTextField *bullet;
341     IBOutlet NSTextField *costP;
342     IBOutlet NSTextField *costV;
343     IBOutlet NSTextField *region;
344     IBOutlet NSTextField *crytical;
345     IBOutlet NSTextField *atkProperty;
346     
347     IBOutlet NSTextField *HPbarTF;
348     IBOutlet NSLevelIndicator *HPbarLI;
349     IBOutlet NSTextField *MPbarTF;
350     
351     
352     IBOutlet NSWindow *battleWindow;
353     IBOutlet NSImageView *bplayer1;
354     IBOutlet NSImageView *bplayer2;
355     IBOutlet NSTextField *nplayer1;
356     IBOutlet NSTextField *nplayer2;
357     IBOutlet NSTextField *tplayer1;
358     IBOutlet NSTextField *tplayer2;
359     IBOutlet NSLevelIndicator *lplayer1;
360     IBOutlet NSLevelIndicator *lplayer2;
361     IBOutlet NSTextField *mplayer1;
362     IBOutlet NSTextField *mplayer2;
363     IBOutlet NSImageView *iplayer1;
364     IBOutlet NSImageView *iplayer2;
365     IBOutlet NSTextField *rplayer1;
366     IBOutlet NSTextField *rplayer2;
367     IBOutlet NSTextField *hplayer1;
368     IBOutlet NSTextField *hplayer2;
369     IBOutlet NSTextField *battleDialog;
370     IBOutlet NSButton *battleCancelBtn;
371     IBOutlet NSButton *battleAttackBtn1;
372     IBOutlet NSButton *battleAttackBtn2;
373     IBOutlet NSButton *battleGuardBtn1;
374     IBOutlet NSButton *battleGuardBtn2;
375     IBOutlet NSButton *battleDodgeBtn1;
376     IBOutlet NSButton *battleDodgeBtn2;
377     IBOutlet NSButton *battleStartBtn;
378     
379     IBOutlet NSTextField *tfAttack;
380     IBOutlet NSTextField *tfDefence;
381     IBOutlet NSTextField *tfCalc;
382     IBOutlet NSTextField *tfHit;
383     IBOutlet NSTextField *tfDodge;
384     IBOutlet NSTextField *tfMove;
385     IBOutlet NSTextField *tfWait;
386     
387     IBOutlet NSTextField *tfName;
388     IBOutlet NSTextField *tfArmy;
389     IBOutlet NSTextField *tfResource;
390     IBOutlet NSTextField *tfFood;
391     IBOutlet NSTextField *tfMoney;
392     
393     IBOutlet NSPanel *battlePanel;
394     IBOutlet NSTextField *combatNAME1;
395     IBOutlet NSTextField *combatNAME2;
396     IBOutlet NSTextField *combatHP1;
397     IBOutlet NSTextField *combatHP2;
398     IBOutlet NSTextField *combatMP1;
399     IBOutlet NSTextField *combatMP2;
400     IBOutlet NSLevelIndicator *combatLHP1;
401     IBOutlet NSLevelIndicator *combatLHP2;
402     IBOutlet NSLevelIndicator *combatLMP1;
403     IBOutlet NSLevelIndicator *combatLMP2;
404     IBOutlet NSTextField *combatHIT1;
405     IBOutlet NSTextField *combatHIT2;
406     IBOutlet NSTextField *combatVIG1;
407     IBOutlet NSTextField *combatVIG2;
408     IBOutlet NSTextField *combatAP1;
409     IBOutlet NSTextField *combatAP2;
410     IBOutlet NSTextField *combatATK1;
411     IBOutlet NSTextField *combatATK2;
412     
413     IBOutlet NSPanel *researchPanel;
414     IBOutlet NSTextField *researchATK;
415     IBOutlet NSTextField *researchDEF;
416     IBOutlet NSTextField *researchCAP;
417     IBOutlet NSTextField *researchACU;
418     IBOutlet NSTextField *researchEVA;
419     IBOutlet NSTextField *researchMOV;
420     IBOutlet NSImageView *researchIMG;
421     
422     NSMutableArray *CResearchListMA;
423     IBOutlet NSArrayController *CResearchListAC;
424     IBOutlet NSTableView *CResearchListTV;
425     
426     ATTACK *U2A;
427     double dmg;
428     double hit;
429     double hitFix;
430     double mapDmgFix;
431     double costMP;
432     bool healFlag;
433     double graze;
434     bool grazeFlag;
435     
436     IBOutlet NSWindow *titleWindow;
437     IBOutlet NSWindow *esWindow;
438     IBOutlet NSWindow *fsWindow;
439     IBOutlet NSPanel *endGamePanel;
440     IBOutlet NSTextField *endGameText;
441     
442     IBOutlet NSPanel *commandPanel;
443     IBOutlet NSButton *moveBtn;
444     IBOutlet NSButton *attackBtn;
445     IBOutlet NSButton *stanbyBtn;
446     IBOutlet NSButton *createBtn;
447     IBOutlet NSButton *summonBtn;
448     IBOutlet NSButton *statusBtn;
449     IBOutlet NSButton *cancelBtn;
450     
451     bool buildSkillFlag;
452     bool summonSkillFlag;
453     
454     IBOutlet NSImageView *IVimage;
455     IBOutlet NSTextField *TFmessage;
456     IBOutlet NSTextField *TFname;
457     IBOutlet NSBox *BXmessage;
458     IBOutlet NSBox *BXname;
459
460     IBOutlet NSPanel *fsEffectPanel;
461     IBOutlet AVPlayerView *AVPV;
462     AVPlayer *AVpreview;
463     
464     
465     IBOutlet NSWindow *selectionWindow;
466     IBOutlet NSButton *slctBtn1;
467     IBOutlet NSButton *slctBtn2;
468     IBOutlet NSButton *slctBtn3;
469     IBOutlet NSButton *slctBtn4;
470     IBOutlet NSButton *slctBtn5;
471     IBOutlet NSButton *slctBtn6;
472     IBOutlet NSButton *slctBtn7;
473     IBOutlet NSButton *slctBtn8;
474     IBOutlet NSButton *slctBtn9;
475     
476     IBOutlet NSWindow *GameOverWindow;
477     IBOutlet NSImageView *GameOverIV;
478 }
479 -(MAPSCRIPT0*)setMessage:(MAPSCRIPT0*)MS0;
480
481 -(IBAction)battleReadyUpStartBtn:(id)sender;
482 -(IBAction)battleReadyUpState1:(id)sender;
483 -(IBAction)battleReadyUpState2:(id)sender;
484
485 -(IBAction)pushMove:(id)sender;
486 -(IBAction)pushAttack:(id)sender;
487 -(IBAction)pushStandby:(id)sender;
488 -(IBAction)pushCreate:(id)sender;
489 -(IBAction)pushSummon:(id)sender;
490 -(IBAction)pushStatus:(id)sender;
491 -(IBAction)pushCancel:(id)sender;
492
493 -(IBAction)battleStart:(id)sender;
494 -(IBAction)battleSet1:(id)sender;
495 -(IBAction)battleDef1:(id)sender;
496 -(IBAction)battleDod1:(id)sender;
497 -(IBAction)battleSet2:(id)sender;
498 -(IBAction)battleDef2:(id)sender;
499 -(IBAction)battleDod2:(id)sender;
500 -(IBAction)battleCancel:(id)sender;
501
502 -(IBAction)pushCancelCAL:(id)sender;
503 -(IBAction)pushCancelBCL:(id)sender;
504 -(IBAction)pushCancelCSL:(id)sender;
505
506 -(IBAction)researchCancel:(id)sender;
507
508 -(IBAction)selectionBtn1:(id)sender;
509 -(IBAction)selectionBtn2:(id)sender;
510 -(IBAction)selectionBtn3:(id)sender;
511 -(IBAction)selectionBtn4:(id)sender;
512 -(IBAction)selectionBtn5:(id)sender;
513 -(IBAction)selectionBtn6:(id)sender;
514 -(IBAction)selectionBtn7:(id)sender;
515 -(IBAction)selectionBtn8:(id)sender;
516 -(IBAction)selectionBtn9:(id)sender;
517
518 -(IBAction)gameOverSubmit:(id)sender;
519
520 @end
521
522
523
524
525
526
527 @interface FieldSceneEF : NSView
528 {
529     NSTimer *time;
530 }
531
532 @end
533
534
535
536
537
538
539
540
541
542