OSDN Git Service

ver0.631
[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 MAPSCRIPTD *MSDTO;
204
205 bool messageEndFlag;
206
207 bool SwitchONflag;
208 bool SwitchOFFflag;
209
210 int mostNumSub;
211 bool cpuAImodeflag;
212
213 UNIT *UTop;
214
215 bool retardhelp1;
216 bool retardhelp2;
217 bool battleReadyUpFlag;
218
219 bool avPlayerFlag1;
220 bool avPlayerFlag2;
221 bool animationFlag1;
222 bool animationFlag2;
223 bool animationFlag3;
224 int aniFrameCnt;
225
226 ATTACK *attackCR;
227 ATTACK *attackCR2;
228 ATTACK *attackTop;
229 ATTACK *attackTop2;
230 UNIT *effCun;
231
232 struct _MAPSCRIPT0 *MSDP0top;
233 struct _MAPSCRIPT0 *MSDPtop;
234
235 int slctedBtnNum;
236 int slctBtnNum;
237 NSPoint slctPoint;
238
239 bool appearanceSAIKIflag;
240 bool waitx10flag;
241 bool waitSwtichFlag;
242 bool waitAllOverFlag;
243 double waitinTime;
244 NSSound *BGMsub;
245 NSSound *SEsub;
246
247 bool eventEndFlag;
248
249 bool gameOverFlag;
250 bool gameOverFlag2;
251 struct _GAMEOVER gaov;
252
253 bool stageClearFlag;
254 bool stageClearFlag2;
255
256
257 bool backTitleFlag;
258 bool backTitleFlag2;
259
260 int cntTimerMin;
261 int cntTimerSec;
262
263 bool coolTime;
264
265 int waypR[1002][1002];
266 int objeR[1002][1002];
267 int apprR[1002][1002];
268 UNITPOINT *postUnitPoint;
269 UNITPOINT *postUnitPointTop;
270 bool unitPointMakeSureFlag;
271 bool unitPointMakeSureFlag2;
272
273 UNITPOINT *UP;
274 UNITPOINT *UPT;
275
276 bool pussyLoopFlag;
277
278 int wtflag;
279
280 bool atkExtentFlag;
281 int DUNnum;
282 bool extentBattleFlag2;
283 bool extentMPcostFlag;
284
285 int *GuildChosen1;
286 int *GuildChosen2;
287 int GCnum1;
288 int GCnum2;
289
290 int *GuildDisp1;
291 int *GuildDisp2;
292
293 int *saveGuildList;
294 int guildc;
295 bool guildRE1;
296 bool guildRE2;
297 int Gnum1;
298 int Gnum2;
299
300 @interface FieldScene : NSObject
301 {
302     NSTimer *time;
303     
304     
305     IBOutlet NSTextField *battleReadyUpPN1;
306     IBOutlet NSTextField *battleReadyUpPN2;
307     IBOutlet NSTextField *battleReadyUpRule;
308     IBOutlet NSButtonCell *battleReadyUpMAN1A;
309     IBOutlet NSButtonCell *battleReadyUpMAN1B;
310     IBOutlet NSButtonCell *battleReadyUpMAN2A;
311     IBOutlet NSButtonCell *battleReadyUpMAN2B;
312     IBOutlet NSTextField *battleReadyUpSupply1;
313     IBOutlet NSTextField *battleReadyUpFood1;
314     IBOutlet NSTextField *battleReadyUpMoney1;
315     IBOutlet NSTextField *battleReadyUpSupply2;
316     IBOutlet NSTextField *battleReadyUpFood2;
317     IBOutlet NSTextField *battleReadyUpMoney2;
318     IBOutlet NSTextField *battleReadyUpLeader1;
319     IBOutlet NSTextField *battleReadyUpLeader2;
320     IBOutlet NSImageView *battleReadyUpIV1;
321     IBOutlet NSImageView *battleReadyUpIV2;
322     IBOutlet NSWindow *bsWindow;
323     
324     IBOutlet NSImageView *selectMesh;
325     IBOutlet NSTextField *selectMeshText;
326     IBOutlet NSTextField *selectMeshValue;
327     IBOutlet NSImageView *selectChara;
328     
329     IBOutlet NSWindow *mapWindow;
330     
331     IBOutlet NSPanel *menuPanel;
332     IBOutlet NSButton *TFmove;
333     IBOutlet NSButton *TFattack;
334     IBOutlet NSButton *TFstandby;
335     IBOutlet NSButton *TFcreate;
336     IBOutlet NSButton *TFstatus;
337     IBOutlet NSButton *TFcancel;
338     
339     IBOutlet NSPanel *menuPanel2;
340     IBOutlet NSButton *TFstatus2;
341     IBOutlet NSButton *TFcancel2;
342     
343     
344     NSMutableArray *CAttackListMA;
345     IBOutlet NSArrayController *CAttackListAC;
346     IBOutlet NSTableView *CAttackListTV;
347     
348     IBOutlet NSPanel *atkPanel;
349     NSPoint windowPoint;
350     
351     NSMutableArray *BCreateListMA;
352     IBOutlet NSArrayController *BCreateListAC;
353     IBOutlet NSTableView *BCreateListTV;
354     
355     IBOutlet NSPanel *createPanel;
356     
357     NSMutableArray *CSummonListMA;
358     IBOutlet NSArrayController *CSummonListAC;
359     IBOutlet NSTableView *CSummonListTV;
360     
361     IBOutlet NSPanel *summonPanel;
362     
363     IBOutlet NSTextField *bullet;
364     IBOutlet NSTextField *costP;
365     IBOutlet NSTextField *costV;
366     IBOutlet NSTextField *region;
367     IBOutlet NSTextField *crytical;
368     IBOutlet NSTextField *atkProperty;
369     
370     IBOutlet NSTextField *HPbarTF;
371     IBOutlet NSLevelIndicator *HPbarLI;
372     IBOutlet NSTextField *MPbarTF;
373     
374     
375     IBOutlet NSWindow *battleWindow;
376     IBOutlet NSImageView *bplayer1;
377     IBOutlet NSImageView *bplayer2;
378     IBOutlet NSTextField *nplayer1;
379     IBOutlet NSTextField *nplayer2;
380     IBOutlet NSTextField *tplayer1;
381     IBOutlet NSTextField *tplayer2;
382     IBOutlet NSLevelIndicator *lplayer1;
383     IBOutlet NSLevelIndicator *lplayer2;
384     IBOutlet NSTextField *mplayer1;
385     IBOutlet NSTextField *mplayer2;
386     IBOutlet NSImageView *iplayer1;
387     IBOutlet NSImageView *iplayer2;
388     IBOutlet NSTextField *rplayer1;
389     IBOutlet NSTextField *rplayer2;
390     IBOutlet NSTextField *hplayer1;
391     IBOutlet NSTextField *hplayer2;
392     IBOutlet NSTextField *battleDialog;
393     IBOutlet NSButton *battleCancelBtn;
394     IBOutlet NSButton *battleAttackBtn1;
395     IBOutlet NSButton *battleAttackBtn2;
396     IBOutlet NSButton *battleGuardBtn1;
397     IBOutlet NSButton *battleGuardBtn2;
398     IBOutlet NSButton *battleDodgeBtn1;
399     IBOutlet NSButton *battleDodgeBtn2;
400     IBOutlet NSButton *battleStartBtn;
401     
402     IBOutlet NSTextField *tfAttack;
403     IBOutlet NSTextField *tfDefence;
404     IBOutlet NSTextField *tfCalc;
405     IBOutlet NSTextField *tfHit;
406     IBOutlet NSTextField *tfDodge;
407     IBOutlet NSTextField *tfMove;
408     IBOutlet NSTextField *tfWait;
409     
410     IBOutlet NSTextField *tfName;
411     IBOutlet NSTextField *tfArmy;
412     IBOutlet NSTextField *tfResource;
413     IBOutlet NSTextField *tfFood;
414     IBOutlet NSTextField *tfMoney;
415     
416     IBOutlet NSPanel *battlePanel;
417     IBOutlet NSTextField *combatNAME1;
418     IBOutlet NSTextField *combatNAME2;
419     IBOutlet NSTextField *combatHP1;
420     IBOutlet NSTextField *combatHP2;
421     IBOutlet NSTextField *combatMP1;
422     IBOutlet NSTextField *combatMP2;
423     IBOutlet NSLevelIndicator *combatLHP1;
424     IBOutlet NSLevelIndicator *combatLHP2;
425     IBOutlet NSLevelIndicator *combatLMP1;
426     IBOutlet NSLevelIndicator *combatLMP2;
427     IBOutlet NSTextField *combatHIT1;
428     IBOutlet NSTextField *combatHIT2;
429     IBOutlet NSTextField *combatVIG1;
430     IBOutlet NSTextField *combatVIG2;
431     IBOutlet NSTextField *combatAP1;
432     IBOutlet NSTextField *combatAP2;
433     IBOutlet NSTextField *combatATK1;
434     IBOutlet NSTextField *combatATK2;
435     
436     IBOutlet NSPanel *researchPanel;
437     IBOutlet NSTextField *researchATK;
438     IBOutlet NSTextField *researchDEF;
439     IBOutlet NSTextField *researchCAP;
440     IBOutlet NSTextField *researchACU;
441     IBOutlet NSTextField *researchEVA;
442     IBOutlet NSTextField *researchMOV;
443     IBOutlet NSImageView *researchIMG;
444     
445     NSMutableArray *CResearchListMA;
446     IBOutlet NSArrayController *CResearchListAC;
447     IBOutlet NSTableView *CResearchListTV;
448     
449     ATTACK *U2A;
450     double dmg;
451     double hit;
452     double hitFix;
453     double mapDmgFix;
454     double costMP;
455     double costVIG;
456     bool healFlag;
457     double graze;
458     bool grazeFlag;
459     
460     IBOutlet NSWindow *titleWindow;
461     IBOutlet NSWindow *esWindow;
462     IBOutlet NSWindow *fsWindow;
463     IBOutlet NSPanel *endGamePanel;
464     IBOutlet NSTextField *endGameText;
465     
466     IBOutlet NSPanel *commandPanel;
467     IBOutlet NSButton *moveBtn;
468     IBOutlet NSButton *attackBtn;
469     IBOutlet NSButton *stanbyBtn;
470     IBOutlet NSButton *createBtn;
471     IBOutlet NSButton *summonBtn;
472     IBOutlet NSButton *statusBtn;
473     IBOutlet NSButton *cancelBtn;
474     
475     bool buildSkillFlag;
476     bool summonSkillFlag;
477     
478     IBOutlet NSImageView *IVimage;
479     IBOutlet NSTextField *TFmessage;
480     IBOutlet NSTextField *TFname;
481     IBOutlet NSBox *BXmessage;
482     IBOutlet NSBox *BXname;
483
484     IBOutlet NSPanel *fsEffectPanel;
485     IBOutlet AVPlayerView *AVPV;
486     AVPlayer *AVpreview;
487     
488     
489     IBOutlet NSWindow *selectionWindow;
490     IBOutlet NSButton *slctBtn1;
491     IBOutlet NSButton *slctBtn2;
492     IBOutlet NSButton *slctBtn3;
493     IBOutlet NSButton *slctBtn4;
494     IBOutlet NSButton *slctBtn5;
495     IBOutlet NSButton *slctBtn6;
496     IBOutlet NSButton *slctBtn7;
497     IBOutlet NSButton *slctBtn8;
498     IBOutlet NSButton *slctBtn9;
499     
500     IBOutlet NSWindow *GameOverWindow;
501     IBOutlet NSImageView *GameOverIV;
502     
503     IBOutlet NSWindow *STwindow;
504     
505     IBOutlet NSImageView *STIV;
506     IBOutlet NSTextField *STnameTF;
507     IBOutlet NSTextField *STclassTF;
508     IBOutlet NSTextField *SThpTF;
509     IBOutlet NSTextField *STmpTF;
510     IBOutlet NSTextField *STatkTF;
511     IBOutlet NSTextField *STdefTF;
512     IBOutlet NSTextField *STcapTF;
513     IBOutlet NSTextField *STacuTF;
514     IBOutlet NSTextField *STevaTF;
515     IBOutlet NSTextField *STstrTF;
516     IBOutlet NSTextField *STvitTF;
517     IBOutlet NSTextField *STagiTF;
518     IBOutlet NSTextField *STdexTF;
519     IBOutlet NSTextField *STmenTF;
520     IBOutlet NSTextField *STintTF;
521     IBOutlet NSTextField *STmelTF;
522     IBOutlet NSTextField *STmisTF;
523     IBOutlet NSTextField *SThitTF;
524     IBOutlet NSTextField *STdodTF;
525     IBOutlet NSTextField *STreaTF;
526     IBOutlet NSTextField *STskiTF;
527     IBOutlet NSTextField *STvigTF;
528     
529     NSMutableArray *STjoinListMA;
530     IBOutlet NSArrayController *STjoinListAC;
531     IBOutlet NSTableView *STjoinListTV;
532     
533     NSMutableArray *STequipListMA;
534     IBOutlet NSArrayController *STequipListAC;
535     IBOutlet NSTableView *STequipListTV;
536     
537     NSMutableArray *STskillListMA;
538     IBOutlet NSArrayController *STskillListAC;
539     IBOutlet NSTableView *STskillListTV;
540     
541 }
542 -(MAPSCRIPT0*)setMessage:(MAPSCRIPT0*)MS0;
543
544 -(IBAction)STsubmit:(id)sender;
545
546 -(IBAction)battleReadyUpStartBtn:(id)sender;
547 -(IBAction)battleReadyUpState1:(id)sender;
548 -(IBAction)battleReadyUpState2:(id)sender;
549
550 -(IBAction)pushMove:(id)sender;
551 -(IBAction)pushAttack:(id)sender;
552 -(IBAction)pushStandby:(id)sender;
553 -(IBAction)pushCreate:(id)sender;
554 -(IBAction)pushSummon:(id)sender;
555 -(IBAction)pushStatus:(id)sender;
556 -(IBAction)pushCancel:(id)sender;
557
558 -(IBAction)battleStart:(id)sender;
559 -(IBAction)battleSet1:(id)sender;
560 -(IBAction)battleDef1:(id)sender;
561 -(IBAction)battleDod1:(id)sender;
562 -(IBAction)battleSet2:(id)sender;
563 -(IBAction)battleDef2:(id)sender;
564 -(IBAction)battleDod2:(id)sender;
565 -(IBAction)battleCancel:(id)sender;
566
567 -(IBAction)pushCancelCAL:(id)sender;
568 -(IBAction)pushCancelBCL:(id)sender;
569 -(IBAction)pushCancelCSL:(id)sender;
570
571 -(IBAction)researchCancel:(id)sender;
572
573 -(IBAction)selectionBtn1:(id)sender;
574 -(IBAction)selectionBtn2:(id)sender;
575 -(IBAction)selectionBtn3:(id)sender;
576 -(IBAction)selectionBtn4:(id)sender;
577 -(IBAction)selectionBtn5:(id)sender;
578 -(IBAction)selectionBtn6:(id)sender;
579 -(IBAction)selectionBtn7:(id)sender;
580 -(IBAction)selectionBtn8:(id)sender;
581 -(IBAction)selectionBtn9:(id)sender;
582
583 -(IBAction)gameOverSubmit:(id)sender;
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600 -(int)chooseGuildList:(int*)value gcnum:(int)gcnum;
601 -(void)addBuildStatus;
602
603 @end
604
605 FieldScene *fieldScene;
606
607
608
609
610 @interface FieldSceneEF : NSView
611 {
612     NSTimer *time;
613 }
614
615 @end
616
617
618
619
620
621
622
623
624
625