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
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 UNITPOINT *postUnitPoint;
265 UNITPOINT *postUnitPointTop;
266 bool unitPointMakeSureFlag;
267 bool unitPointMakeSureFlag2;
268
269 UNITPOINT *UP;
270 UNITPOINT *UPT;
271
272 bool pussyLoopFlag;
273
274 @interface FieldScene : NSObject
275 {
276     NSTimer *time;
277     
278     
279     IBOutlet NSTextField *battleReadyUpPN1;
280     IBOutlet NSTextField *battleReadyUpPN2;
281     IBOutlet NSTextField *battleReadyUpRule;
282     IBOutlet NSButtonCell *battleReadyUpMAN1A;
283     IBOutlet NSButtonCell *battleReadyUpMAN1B;
284     IBOutlet NSButtonCell *battleReadyUpMAN2A;
285     IBOutlet NSButtonCell *battleReadyUpMAN2B;
286     IBOutlet NSTextField *battleReadyUpSupply1;
287     IBOutlet NSTextField *battleReadyUpFood1;
288     IBOutlet NSTextField *battleReadyUpMoney1;
289     IBOutlet NSTextField *battleReadyUpSupply2;
290     IBOutlet NSTextField *battleReadyUpFood2;
291     IBOutlet NSTextField *battleReadyUpMoney2;
292     IBOutlet NSTextField *battleReadyUpLeader1;
293     IBOutlet NSTextField *battleReadyUpLeader2;
294     IBOutlet NSImageView *battleReadyUpIV1;
295     IBOutlet NSImageView *battleReadyUpIV2;
296     IBOutlet NSWindow *bsWindow;
297     
298     IBOutlet NSImageView *selectMesh;
299     IBOutlet NSTextField *selectMeshText;
300     IBOutlet NSTextField *selectMeshValue;
301     IBOutlet NSImageView *selectChara;
302     
303     IBOutlet NSWindow *mapWindow;
304     
305     IBOutlet NSPanel *menuPanel;
306     IBOutlet NSButton *TFmove;
307     IBOutlet NSButton *TFattack;
308     IBOutlet NSButton *TFstandby;
309     IBOutlet NSButton *TFcreate;
310     IBOutlet NSButton *TFstatus;
311     IBOutlet NSButton *TFcancel;
312     
313     IBOutlet NSPanel *menuPanel2;
314     IBOutlet NSButton *TFstatus2;
315     IBOutlet NSButton *TFcancel2;
316     
317     
318     NSMutableArray *CAttackListMA;
319     IBOutlet NSArrayController *CAttackListAC;
320     IBOutlet NSTableView *CAttackListTV;
321     
322     IBOutlet NSPanel *atkPanel;
323     NSPoint windowPoint;
324     
325     NSMutableArray *BCreateListMA;
326     IBOutlet NSArrayController *BCreateListAC;
327     IBOutlet NSTableView *BCreateListTV;
328     
329     IBOutlet NSPanel *createPanel;
330     
331     NSMutableArray *CSummonListMA;
332     IBOutlet NSArrayController *CSummonListAC;
333     IBOutlet NSTableView *CSummonListTV;
334     
335     IBOutlet NSPanel *summonPanel;
336     
337     IBOutlet NSTextField *bullet;
338     IBOutlet NSTextField *costP;
339     IBOutlet NSTextField *costV;
340     IBOutlet NSTextField *region;
341     IBOutlet NSTextField *crytical;
342     IBOutlet NSTextField *atkProperty;
343     
344     IBOutlet NSTextField *HPbarTF;
345     IBOutlet NSLevelIndicator *HPbarLI;
346     IBOutlet NSTextField *MPbarTF;
347     
348     
349     IBOutlet NSWindow *battleWindow;
350     IBOutlet NSImageView *bplayer1;
351     IBOutlet NSImageView *bplayer2;
352     IBOutlet NSTextField *nplayer1;
353     IBOutlet NSTextField *nplayer2;
354     IBOutlet NSTextField *tplayer1;
355     IBOutlet NSTextField *tplayer2;
356     IBOutlet NSLevelIndicator *lplayer1;
357     IBOutlet NSLevelIndicator *lplayer2;
358     IBOutlet NSTextField *mplayer1;
359     IBOutlet NSTextField *mplayer2;
360     IBOutlet NSImageView *iplayer1;
361     IBOutlet NSImageView *iplayer2;
362     IBOutlet NSTextField *rplayer1;
363     IBOutlet NSTextField *rplayer2;
364     IBOutlet NSTextField *hplayer1;
365     IBOutlet NSTextField *hplayer2;
366     IBOutlet NSTextField *battleDialog;
367     IBOutlet NSButton *battleCancelBtn;
368     IBOutlet NSButton *battleAttackBtn1;
369     IBOutlet NSButton *battleAttackBtn2;
370     IBOutlet NSButton *battleGuardBtn1;
371     IBOutlet NSButton *battleGuardBtn2;
372     IBOutlet NSButton *battleDodgeBtn1;
373     IBOutlet NSButton *battleDodgeBtn2;
374     IBOutlet NSButton *battleStartBtn;
375     
376     IBOutlet NSTextField *tfAttack;
377     IBOutlet NSTextField *tfDefence;
378     IBOutlet NSTextField *tfCalc;
379     IBOutlet NSTextField *tfHit;
380     IBOutlet NSTextField *tfDodge;
381     IBOutlet NSTextField *tfMove;
382     IBOutlet NSTextField *tfWait;
383     
384     IBOutlet NSTextField *tfName;
385     IBOutlet NSTextField *tfArmy;
386     IBOutlet NSTextField *tfResource;
387     IBOutlet NSTextField *tfFood;
388     IBOutlet NSTextField *tfMoney;
389     
390     IBOutlet NSPanel *battlePanel;
391     IBOutlet NSTextField *combatNAME1;
392     IBOutlet NSTextField *combatNAME2;
393     IBOutlet NSTextField *combatHP1;
394     IBOutlet NSTextField *combatHP2;
395     IBOutlet NSTextField *combatMP1;
396     IBOutlet NSTextField *combatMP2;
397     IBOutlet NSLevelIndicator *combatLHP1;
398     IBOutlet NSLevelIndicator *combatLHP2;
399     IBOutlet NSLevelIndicator *combatLMP1;
400     IBOutlet NSLevelIndicator *combatLMP2;
401     IBOutlet NSTextField *combatHIT1;
402     IBOutlet NSTextField *combatHIT2;
403     IBOutlet NSTextField *combatVIG1;
404     IBOutlet NSTextField *combatVIG2;
405     IBOutlet NSTextField *combatAP1;
406     IBOutlet NSTextField *combatAP2;
407     IBOutlet NSTextField *combatATK1;
408     IBOutlet NSTextField *combatATK2;
409     
410     IBOutlet NSPanel *researchPanel;
411     IBOutlet NSTextField *researchATK;
412     IBOutlet NSTextField *researchDEF;
413     IBOutlet NSTextField *researchCAP;
414     IBOutlet NSTextField *researchACU;
415     IBOutlet NSTextField *researchEVA;
416     IBOutlet NSTextField *researchMOV;
417     IBOutlet NSImageView *researchIMG;
418     
419     NSMutableArray *CResearchListMA;
420     IBOutlet NSArrayController *CResearchListAC;
421     IBOutlet NSTableView *CResearchListTV;
422     
423     ATTACK *U2A;
424     double dmg;
425     double hit;
426     double hitFix;
427     double mapDmgFix;
428     double costMP;
429     bool healFlag;
430     double graze;
431     bool grazeFlag;
432     
433     IBOutlet NSWindow *titleWindow;
434     IBOutlet NSWindow *esWindow;
435     IBOutlet NSWindow *fsWindow;
436     IBOutlet NSPanel *endGamePanel;
437     IBOutlet NSTextField *endGameText;
438     
439     IBOutlet NSPanel *commandPanel;
440     IBOutlet NSButton *moveBtn;
441     IBOutlet NSButton *attackBtn;
442     IBOutlet NSButton *stanbyBtn;
443     IBOutlet NSButton *createBtn;
444     IBOutlet NSButton *summonBtn;
445     IBOutlet NSButton *statusBtn;
446     IBOutlet NSButton *cancelBtn;
447     
448     bool buildSkillFlag;
449     bool summonSkillFlag;
450     
451     IBOutlet NSImageView *IVimage;
452     IBOutlet NSTextField *TFmessage;
453     IBOutlet NSTextField *TFname;
454     IBOutlet NSBox *BXmessage;
455     IBOutlet NSBox *BXname;
456
457     IBOutlet NSPanel *fsEffectPanel;
458     IBOutlet AVPlayerView *AVPV;
459     AVPlayer *AVpreview;
460     
461     
462     IBOutlet NSWindow *selectionWindow;
463     IBOutlet NSButton *slctBtn1;
464     IBOutlet NSButton *slctBtn2;
465     IBOutlet NSButton *slctBtn3;
466     IBOutlet NSButton *slctBtn4;
467     IBOutlet NSButton *slctBtn5;
468     IBOutlet NSButton *slctBtn6;
469     IBOutlet NSButton *slctBtn7;
470     IBOutlet NSButton *slctBtn8;
471     IBOutlet NSButton *slctBtn9;
472     
473     IBOutlet NSWindow *GameOverWindow;
474     IBOutlet NSImageView *GameOverIV;
475 }
476 -(MAPSCRIPT0*)setMessage:(MAPSCRIPT0*)MS0;
477
478 -(IBAction)battleReadyUpStartBtn:(id)sender;
479 -(IBAction)battleReadyUpState1:(id)sender;
480 -(IBAction)battleReadyUpState2:(id)sender;
481
482 -(IBAction)pushMove:(id)sender;
483 -(IBAction)pushAttack:(id)sender;
484 -(IBAction)pushStandby:(id)sender;
485 -(IBAction)pushCreate:(id)sender;
486 -(IBAction)pushSummon:(id)sender;
487 -(IBAction)pushStatus:(id)sender;
488 -(IBAction)pushCancel:(id)sender;
489
490 -(IBAction)battleStart:(id)sender;
491 -(IBAction)battleSet1:(id)sender;
492 -(IBAction)battleDef1:(id)sender;
493 -(IBAction)battleDod1:(id)sender;
494 -(IBAction)battleSet2:(id)sender;
495 -(IBAction)battleDef2:(id)sender;
496 -(IBAction)battleDod2:(id)sender;
497 -(IBAction)battleCancel:(id)sender;
498
499 -(IBAction)pushCancelCAL:(id)sender;
500 -(IBAction)pushCancelBCL:(id)sender;
501 -(IBAction)pushCancelCSL:(id)sender;
502
503 -(IBAction)researchCancel:(id)sender;
504
505 -(IBAction)selectionBtn1:(id)sender;
506 -(IBAction)selectionBtn2:(id)sender;
507 -(IBAction)selectionBtn3:(id)sender;
508 -(IBAction)selectionBtn4:(id)sender;
509 -(IBAction)selectionBtn5:(id)sender;
510 -(IBAction)selectionBtn6:(id)sender;
511 -(IBAction)selectionBtn7:(id)sender;
512 -(IBAction)selectionBtn8:(id)sender;
513 -(IBAction)selectionBtn9:(id)sender;
514
515 -(IBAction)gameOverSubmit:(id)sender;
516
517 @end
518
519
520
521
522
523
524 @interface FieldSceneEF : NSView
525 {
526     NSTimer *time;
527 }
528
529 @end
530
531
532
533
534
535
536
537
538
539