-
Notifications
You must be signed in to change notification settings - Fork 0
/
Class1.cs
1004 lines (981 loc) · 35.9 KB
/
Class1.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
namespace pil
{
static class common
{
public const int MAXPLAY = 2;
public const int MAXX = 10000;
public const int MAXS = 20000;
public const int MAXI = 5000;
public const int MAXTMP = 21;
public const int MAXC = 1024;
public const int MAXIP = 21;
public const int MAXP = 5;
public const int MAXN = 11;
public const string BAN = "3.4.1.20230218";//版本号
public delegate void pfux(int a, int b, int c);//士员 上阵/怒气/怨念函数 武器使用/法术函数
public static int inxbk = 26;//士员数量
public static int pu_inxbk = 26;//基础士员数量
public static int infsk = 6;//法术数量
public static int inwqk = 2;//武器数量
public static wuqi NULLW = new wuqi();
//空武器
public static fashu NULLF = new fashu();
//空法术
public static xiaobin NULLB = new xiaobin();
//空士员
public static xiaobin[,,] bing = new xiaobin[MAXPLAY, MAXP, MAXN];
// 场地
public static wuqi[] pwuqi = new wuqi[MAXPLAY] { new wuqi(), new wuqi() };
//双方武器槽
public static int[,] k = new int[MAXPLAY, MAXP];
//每排的士员数量
public static int[] kqian = new int[MAXPLAY];
//前锋数量
public static int dead ;
// 死者
public static string[] p = new string[MAXPLAY], ppai = new string[MAXPLAY];
// 玩家名称 牌组文件路径
public static string tmpapz = "\0", sendtext="", fatext="", prtext = "";
//创建牌组名 回传zhu 发送text 打印text
public static int[] pxue = new int[MAXPLAY] { 20, 20 }, ndian = new int[MAXPLAY] { 15, 15 };
// 玩家血量 玩家点数
public static int[,] paip = new int[MAXPLAY, MAXIP];
//玩家队伍
public static int huihes, mode, maxadd, t_fir;
// 回合数 操作 最大添加数量 是否为先手
//mode 0 对方回合
//mode 1 空闲中
//mode 2 选择攻击
//mode 3 选择技能
//t_fir 1 先手
//t_fir 0 后手
public static int[] usefa = new int[MAXPLAY], usewu = new int[MAXPLAY], xbapz = new int[MAXX], fsapz = new int[MAXX], wqapz = new int[MAXX];
// 是否使用技能 是否使用武器 创建牌组时是否被选择 左同 左同
public static xiaobin[] xblist = new xiaobin[MAXX]; //初始士员列表
public static fashu[] fslist = new fashu[MAXX];//初始法术列表
public static wuqi[] wqlist = new wuqi[MAXX];//初始武器列表
public static pfux bback;//事件绑定
public static abc clilin = new abc(0, 0, 0);//点击临时储存
public static int[] I1 = new int[] { 0, 5, 5, 0, 5, -5, 3, 4, 10, 5, 5, 2, 0, 10, 10, 5, 0, 10, 10, 5, 5, 0, 0, 5, 1, 5, 5 };//gongji 攻击
public static int[] I2 = new int[] { 0, 5, 5, 0, 5, 0, 0, 4, 10, 5, 5, 2, 0, 10, 10, 5, 0, 0, 10, 5, 5, 10, 2, 5, 1, 5, 5 };//fanci 反刺
public static int[] I3 = new int[] { 0, 10, 5, 15, 2, 3, 3, 20, 5, 15, 7, 3, 10, 5, 5, 7, 10, 10, 5, 5, 5, 10, 12, 10, 6, 5, 10 };//xue 血量
public static int[] I4 = new int[] { 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 3, 0, 1, 1, 1, 0, 2, 1, 1, 1, 0, 1, 1, 1, 1, 1 };//gjcishu 攻击次数
public static int[] I5 = new int[] { 0, 1, 2, 1, 1, 3, 3, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };//shecheng 射程
public static int[] I6 = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };//dun 盾
public static int[] I7 = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 1, 0, 0 };//lingjcs 临时攻击次数
public static int[] I8 = new int[] { 0, 5, 5, 5, 2, 5, 5, 20, 10, 15, 5, 5, 5, 10, 10, 5, 5, 10, 7, 5, 5, 5, 5, 15, 0, 10, 10 };//dianshu 点数
public static int[] I9 = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };//xixue 吸血
public static int[] I10 = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };//boolpojia 是否破甲
public static int[] I11 = new int[] { 0, 1, 2, 1, 1, 3, 3, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1 };//paishu 排数
public static int[] I12 = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 };//qianfeng 是否前锋
public static int[] I13 = new int[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };//boolji 是否攻击
public static int[] I14 = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };//bihu 是否庇护
public static int[] I15 = new int[] { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };//dianji 是否电击
public static int[] I16 = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, -20, 21, 22, 23, 24, 25, 26 };//bian 编号
public static int[] I17 = new int[] { 0, 10, 5, 15, 2, 3, 3, 20, 5, 15, 8, 3, 10, 5, 5, 7, 10, 10, 5, 5, 5, 10, 12, 10, 6, 5, 10 };//maxxue 最大血量
public static int[] FDI = new int[] { 0, 5, 1, 0, 5, 3, 0, 5 };//法术点数
public static int[] FBI = new int[] { 0, 1001, 1002, 1003, 1004, 1005, 1006 };//法术编号
public static int[] WDI = new int[] { 0, 5, 5 };//武器点数
public static int[] WBI = new int[] { 0, 2001, 2002 };//武器编号
public static int[] NAI = new int[] { 0, 2, 2 }; //武器耐久
public static string[] NAME = new string[] { "", "卫兵", "猎手", "重甲", "爆兵", "仁心", "火击", "炼狱", "英灵", "安德拉", "坚石", "忍", "缄默", "执剑人", "狡", "利矛", "清心", "叛军", "破阵", "彼岸", "双生", "禅", "断罪", "诙谐", "突击兵", "亡灵法师", "血月" };
public static string[] HNAME = new string[] { "", "木头", "陈醋", "破损老搞", "BUG精灵", "草草", "肚纸", "地狱木头", "英灵", "吸血鬼", "前锋假豪", "BUG终结者", "重甲破损搞", "细菌", "反木头", "笑天犬", "刘动", "叛军", "破阵", "22", "33", "反抗木头", "破锋反搞", "诙谐", "突击兵", "灵魂召唤师", "血月" };
//士员名称
public static string[] FNA = new string[] { "", "暗杀", "惊扰", "禁忌术", "风暴", "焕发", "背刺" };
public static string[] HFNA = new string[] { "", "火球术", "惊扰", "死亡黎明", "风暴", "焕发", "自残" };
//法术名称
public static string[] WNA = new string[] { "", "y12激光步枪", "急救剂" };
public static string[] HWNA = new string[] { "", "战争拳套", "急救剂" };
//武器名称
public static pfux[] FA = new pfux[] { null, fa1, fa2, fa3, fa4, fa5, fa6 };
//法术集合
public static pfux[] WU = new pfux[] { tmpwu, wu1, wu2 };
//武器集合
public static pfux[] F1 = new pfux[] { tmpyuan, tmpyuan, tmpyuan, tmpyuan, tmpyuan, tmpyuan, tmpyuan, tmpyuan, tmpyuan, tmpyuan, tmpyuan, tmpyuan, tmpyuan, yuan13, tmpyuan, tmpyuan, tmpyuan, yuan17, tmpyuan, yuan19, tmpyuan, tmpyuan, tmpyuan, tmpyuan, tmpyuan, tmpyuan, tmpyuan };//yuannian
//怨念法术集合
public static pfux[] F2 = new pfux[] { tmpji, tmpji, tmpji, tmpji, tmpji, tmpji, tmpji, tmpji, tmpji, tmpji, tmpji, tmpji, tmpji, tmpji, tmpji, tmpji, ji16, tmpji, tmpji, tmpji, tmpji, tmpji, tmpji, ji23, ji24, ji25, tmpji }; //jineng
//上阵函数集合
public static pfux[] F3 = new pfux[] { tmphui, tmphui, tmphui, tmphui, tmphui, tmphui, tmphui, hui7, tmphui, tmphui, tmphui, tmphui, hui12, tmphui, tmphui, tmphui, tmphui, tmphui, tmphui, tmphui, tmphui, tmphui, tmphui, tmphui, tmphui, tmphui, hui26 };//huihe
//怒气函数集合
public static int gongji(int a, int b, int c, int aa, int bb, int cc)
{//攻击函数
if (bing[aa, bb, cc].bihu != 0)
{//庇护情况
bing[aa, bb, cc].bihu = 0;
bing[a, b, c].lingjcs--;
if (bing[a, b, c].dianji == 0) fanci(a, b, c, aa, bb, cc);
return 1;
}
bing[a, b, c].xue += bing[a, b, c].xixue;//吸血情况
if (bing[a, b, c].xue > bing[a, b, c].maxxue) bing[a, b, c].xue = bing[a, b, c].maxxue;
if (bing[a, b, c].boolpojia == 0 && bing[aa, bb, cc].dun > 0)
{//护盾情况
bing[aa, bb, cc].dun -= bing[a, b, c].gongji;
}
else
{
bing[aa, bb, cc].xue -= bing[a, b, c].gongji;
}
bing[a, b, c].lingjcs--;
if (bing[a, b, c].dianji == 0) fanci(a, b, c, aa, bb, cc);//电击情况
else isdie(aa, bb, cc);
if (bing[a, b, c].xue > bing[a, b, c].maxxue) bing[a, b, c].xue = bing[a, b, c].maxxue;
if (bing[aa, bb, cc].xue > bing[aa, bb, cc].maxxue) bing[aa, bb, cc].xue = bing[aa, bb, cc].maxxue;
fatext += bing[a, b, c].name + "攻击了" + bing[aa, bb, cc].name + "\n";
return 1;
}
public static void fanci(int a, int b, int c, int aa, int bb, int cc)
{//反刺函数
int she = 0;
for (int i = 1; i <= b; i++)
{
if (bing[a, i, c].bian != 0) she++;
}
if (bing[aa, bb, cc].shecheng < she)
{
isdie(a, b, c);
isdie(aa, bb, cc);
return;
}
if (bing[a, b, c].bihu != 0)
{
bing[a, b, c].bihu = 0;
isdie(a, b, c);
isdie(aa, bb, cc);
return;
}
if (bing[aa, bb, cc].boolpojia == 0 && bing[a, b, c].dun > 0)
{
bing[a, b, c].dun -= bing[aa, bb, cc].fanci;
}
else
{
bing[a, b, c].xue -= bing[aa, bb, cc].fanci;
}
isdie(a, b, c);
isdie(aa, bb, cc);
return;
}
public static void isdie(int a, int b, int c)
{//判定死亡
if (bing[a, b, c].xue > 0)
{//有血返回
return;
}
if (F1[bing[a, b, c].yuan] != tmpyuan)
{
fatext += bing[a, b, c].name + "释放了怨念\n";
}
bing[a, b, c].yuannian();//释放怨念
fatext += bing[a, b, c].name + "死亡" + "\n";
dead = bing[a, b, c].bian;
if (bing[a, b, c].qianfeng != 0)
{
kqian[a]--;
}
bing[a, b, c] = NULLB.copy();
for (int i = c + 1; i <= k[a, b]; i++)
{//存者向左移动
if (bing[a, b, i].bian != 0)
{
bing[a, b, i - 1] = bing[a, b, i].copy();
bing[a, b, i - 1].c = i - 1;
bing[a, b, i] = NULLB.copy();
}
}
k[a, b]--;
return;
}
public static void isbreak(int pl)
{
if (pwuqi[pl].naiju > 0)
{
return;
}
pwuqi[pl] = NULLW.copy();
return;
}
public static abc addxb(int bought, int pl)
{//增加士员
bing[pl, xblist[bought].paishu, ++k[pl, xblist[bought].paishu]] = xblist[bought].copy();//赋值上场
if (xblist[bought].qianfeng != 0) kqian[pl]++;//前锋士员总数增加
bing[pl, xblist[bought].paishu, k[pl, xblist[bought].paishu]].a = pl;
bing[pl, xblist[bought].paishu, k[pl, xblist[bought].paishu]].b = xblist[bought].paishu;
bing[pl, xblist[bought].paishu, k[pl, xblist[bought].paishu]].c = k[pl, xblist[bought].paishu];
//记录下a b c
bing[pl, xblist[bought].paishu, k[pl, xblist[bought].paishu]].jineng();//释放上阵技能
fatext += "购买了" + bing[pl, xblist[bought].paishu, k[pl, xblist[bought].paishu]].name+"\n";
if (F2[bing[pl, xblist[bought].paishu, k[pl, xblist[bought].paishu]].ji] != tmpji)
{
fatext += bing[pl, xblist[bought].paishu, k[pl, xblist[bought].paishu]].name + "使用了上阵\n";
}
abc tmp = new abc(pl, xblist[bought].paishu, k[pl, xblist[bought].paishu]);
return tmp;
}
public static void addfs(int bought, int pl)
{
bought -= 1000;
ndian[pl] -= fslist[bought].dianshu;
usefa[pl] = 1;
fslist[bought].use();
fatext += "购买并使用了" + fslist[bought].name + "\n";
}
public static void addwq(int bought, int pl)
{
bought -= 2000;
ndian[pl] -= wqlist[bought].dianshu;
pwuqi[pl] = wqlist[bought].copy();
fatext += "购买了" + wqlist[bought].name + "\n";
}
public static void useji()
{
for (int i = 1; i <= MAXP - 1; i++)
{
for (int j = 1; j <= k[1 , i]; j++)
{
if (bing[1, i, j].bian != 0)
{
bing[1, i, j].huihe();
bing[1, i, j].lingjcs = bing[1, i, j].gjcishu;
if (F3[bing[1, i, j].hui] != tmphui) fatext += bing[1, i, j].name + "使用了怒气\n";
}
}
}
return;
}
public static void tmpfa(int a, int b, int c)
{
//空法术
return;
}
public static void tmpwu(int a, int b, int c)
{
//空武器
return;
}
public static void tmpyuan(int a, int b, int c)
{//普通怨念函数
return;
}
public static void tmpji(int a, int b, int c)
{//普通上阵函数
return;
}
public static void tmphui(int a, int b, int c)
{//普通怒气函数
return;
}
public static void hui7(int a, int b, int c)
{//7士员怒气函数
if (bing[a, b, c].tmp[1] == 0)
{
bing[a, b, c].tmp[1] = 1;
return;
}
bing[a, b, c].gongji += 4;
bing[a, b, c].fanci += 4;
return;
}
public static void hui12(int a, int b, int c)
{//12士员怒气函数
usefa[a ^ 1] = 1;
return;
}
public static void yuan13(int a, int b, int c)
{//13士员怨念函数
if (bing[a ^ 1, 3, 1].xue > 0)
{
bing[a ^ 1, 3, 1].xue = 0;
isdie(a ^ 1, 3, 1);
}
}
public static void ji16(int a, int b, int c)
{//16士员上阵函数
abc tmp = new abc(a, b, c);
if (clilin.a == 0 && clilin.b == 0 && clilin.c == 0)
{
setmode(3, ji16, "选择被增加攻击的士员");
clilin.a = 1;
return;
}
if (bing[tmp.a, tmp.b, tmp.c].xue <= 0)
{
prtext = "受击者为空或者血量不足";
return;
}
bing[tmp.a, tmp.b, tmp.c].gongji += 5;
bing[tmp.a, tmp.b, tmp.c].fanci += 5;
clean(xblist[16].name + "上阵技能使用完毕");
return;
}
public static void yuan17(int a, int b, int c)
{//17士员怨念函数
pxue[a] -= 3;
}
public static void yuan19(int a, int b, int c)
{//19士员怨念函数
addxb(20, a);
return;
}
public static void ji23(int a, int b, int c)
{//23士员上阵函数
abc tmp = new abc(a, b, c);
if (clilin.a == 0 && clilin.b == 0 && clilin.c == 0)
{
setmode(3, ji23, "点击第一排:与左边血量及上限相等\n第二排:与左边攻击及反刺相等");
clilin.a = 1;
return;
}
if (tmp.c == 1)
{
return;
}
if (tmp.b == 1)
{
bing[a, b, c].xue = bing[a, b, c - 1].xue;
bing[a, b, c].maxxue = bing[a, b, c - 1].maxxue;
}
else if (tmp.b == 2)
{
bing[a, b, c].gongji = bing[a, b, c - 1].gongji;
bing[a, b, c].fanci = bing[a, b, c - 1].fanci;
}
else
{
prtext = "错误的选择";
return;
}
clean(xblist[23].name + "上阵技能使用完毕");
return;
}
public static void ji24(int a, int b, int c)
{//24士员上阵函数
ndian[a] -= 1;
}
public static void ji25(int a, int b, int c)
{//25士员上阵函数
if (dead == 0) return;
abc tmp = addxb(dead, a);
bing[tmp.a, tmp.b, tmp.c].xue = 1;
}
public static void hui26(int a, int b, int c)
{//26士员怒气函数
if (bing[a, b, c].xue <= 5)
{
bing[a, b, c].gongji = 15;
}
}
public static void fa1(int a, int b, int c)
{//1001法术使用函数
abc tmp = new abc(a, b, c);
if (tmp.a == 0 && tmp.b == 0 && tmp.c == 0)
{
setmode(3, fa1, "选择被攻击的一排士员");
return;
}
if (tmp.b > 2)
{
prtext = "被攻击士员大于了2排";
return;
}
if (bing[tmp.a, tmp.b, tmp.c].xue <= 0)
{
prtext = "受击者为空或者血量不足";
return;
}
if (bing[tmp.a, tmp.b, tmp.c].bihu != 0)
{
bing[tmp.a, tmp.b, tmp.c].bihu = 0;
clean(fslist[1].name + "使用完毕");
return;
}
if (bing[tmp.a, tmp.b, tmp.c].dun > 0)
{
bing[tmp.a, tmp.b, tmp.c].dun -= 5;
}
else
{
bing[tmp.a, tmp.b, tmp.c].xue -= 5;
isdie(tmp.a, tmp.b, tmp.c);
}
clean(fslist[1].name + "使用完毕");
return;
}
public static void fa2(int a, int b, int c)
{//1002法术使用函数
abc tmp = new abc(a, b, c);
if (tmp.a == 0 && tmp.b == 0 && tmp.c == 0)
{
setmode(3, fa2, "选择被攻击的一排士员");
return;
}
if (tmp.b > 2)
{
prtext = "被攻击士员大于了2排";
return;
}
if (bing[tmp.a, tmp.b, tmp.c].xue <= 0)
{
prtext = "受击者为空或者血量不足";
return;
}
if (bing[tmp.a, tmp.b, tmp.c].bihu != 0)
{
bing[tmp.a, tmp.b, tmp.c].bihu = 0;
clean(fslist[2].name + "使用完毕");
return;
}
if (bing[tmp.a, tmp.b, tmp.c].dun > 0)
{
bing[tmp.a, tmp.b, tmp.c].dun -= 1;
}
else
{
bing[tmp.a, tmp.b, tmp.c].xue -= 1;
isdie(tmp.a, tmp.b, tmp.c);
}
clean(fslist[2].name + "使用完毕");
return;
}
public static void fa3(int a, int b, int c)
{//1003法术使用函数
ndian[1] -= 30;
for (int i = 1; i <= MAXP - 1; i++)
{
for (int j = 1; j <= k[0, i]; j++)
{
if (bing[0, i, j].bian != 0)
{
bing[0, i, j].xue = -1000;
//isdie(0, i, j);
}
}
}
for (int i = 1; i <= MAXP - 1; i++)
{
for (int j = 1; j <= k[1, i]; j++)
{
if (bing[1, i, j].bian != 0)
{
bing[1, i, j].xue = -1000;
//isdie(1, i, j);
}
}
}
for (int k = 0; k <= 1; k++)
{
for (int i = 1; i <= MAXP - 1; i++)
{
for (int j = 1; j <= MAXN; j++)
{
if (bing[k, i, 1].bian != 0)
{
isdie(k, i, 1);
}
}
}
}
}
public static void fa4(int a, int b, int c)
{//1004法术使用函数
for (int i = 1; i <= MAXP - 1; i++)
{
for (int j = k[0, i]; j >= 1; j--)
{
if (bing[0, i, j].bian != 0)
{
bing[0, i, j].xue -= 1;
isdie(0, i, j);
}
}
}
for (int i = 1; i <= MAXP - 1; i++)
{
for (int j = k[1, i]; j >= 1; j--)
{
if (bing[1, i, j].bian != 0)
{
bing[1, i, j].xue -= 1;
isdie(1, i, j);
}
}
}
}
public static void fa5(int a, int b, int c)
{//1005法术使用函数
abc tmp = new abc(a, b, c);
if (tmp.a == 0 && tmp.b == 0 && tmp.c == 0)
{
setmode(3, fa5, "选择被增加射程的士员");
return;
}
if (bing[tmp.a, tmp.b, tmp.c].xue <= 0)
{
prtext = "受击者为空或者血量不足";
return;
}
bing[tmp.a, tmp.b, tmp.c].shecheng++;
clean(fslist[5].name + "使用完毕");
return;
}
public static void fa6(int a, int b, int c)
{//1006法术使用函数
abc tmp = new abc(a, b, c);
if (tmp.a == 0 && tmp.b == 0 && tmp.c == 0)
{
setmode(3, fa6, "选择背刺的士员");
return;
}
if (bing[tmp.a, tmp.b, tmp.c].xue <= 0)
{
prtext = "受击者为空或者血量不足";
return;
}
if (tmp.a != 1)
{
prtext = "非己方士员";
}
bing[tmp.a, tmp.b, tmp.c].xue -= 1;
usefa[1] = 0;
isdie(tmp.a, tmp.b, tmp.c);
clean(fslist[6].name + "使用完毕");
return;
}
public static void wu1(int a, int b, int c)
{//2001武器使用函数
abc tmp = new abc(a, b, c);
if (tmp.a == 0 && tmp.b == 0 && tmp.c == 0)
{
setmode(3, wu1, "选择被攻击的一排士员");
return;
}
if (tmp.b > 2)
{
prtext = "被攻击士员大于了2排";
return;
}
if (bing[tmp.a, tmp.b, tmp.c].xue <= 0)
{
prtext = "受击者为空或者血量不足";
return;
}
if (bing[tmp.a, tmp.b, tmp.c].bihu != 0)
{
bing[tmp.a, tmp.b, tmp.c].bihu = 0;
clean(wqlist[1].name + "使用完毕");
return;
}
if (bing[tmp.a, tmp.b, tmp.c].dun > 0)
{
bing[tmp.a, tmp.b, tmp.c].dun -= 5;
}
else
{
bing[tmp.a, tmp.b, tmp.c].xue -= 5;
isdie(tmp.a, tmp.b, tmp.c);
}
clean(wqlist[1].name + "使用完毕");
return;
}
public static void wu2(int a, int b, int c)
{//2002武器使用函数
abc tmp = new abc(a, b, c);
if (tmp.a == 0 && tmp.b == 0 && tmp.c == 0)
{
setmode(3, wu2, "选择被治疗的士员");
return;
}
if (bing[tmp.a, tmp.b, tmp.c].xue <= 0)
{
prtext = "受击者为空或者血量不足";
return;
}
bing[tmp.a, tmp.b, tmp.c].xue += 5;
if (bing[tmp.a, tmp.b, tmp.c].xue > bing[tmp.a, tmp.b, tmp.c].maxxue) bing[tmp.a, tmp.b, tmp.c].xue = bing[tmp.a, tmp.b, tmp.c].maxxue;
clean(wqlist[2].name + "使用完毕");
return;
}
public static int wquse(int pl)
{
pwuqi[pl].use();
pwuqi[pl].naiju--;
usewu[pl] = 1;
isbreak(pl);
prtext = "使用了" + pwuqi[pl].name + "\n";
return 1;
}
public static int gjshou(int a, int b, int c, int pl)
{//能否攻击首脑
pxue[pl] -= bing[a, b, c].gongji;
bing[a, b, c].xue = 0;
isdie(a, b, c);
return 1;
}
public static void gj1(int a, int b, int c)
{
if (clilin.a == 0 && clilin.b == 0 && clilin.c == 0)
{
if (a >= 0)
{
if (a == 0)
{
prtext = "无法选择对方士员";
return;
}
if (bing[a, b, c].xue <= 0)
{
prtext = "攻击者为空或者血量不足";
return;
}
if (bing[a, b, c].lingjcs <= 0)
{
prtext = "已经攻击过了或者没有攻击次数";
return;
}
clilin.a = a; clilin.b = b; clilin.c = c;
sendtext = "选择被攻击的对象";
}
else if (a == -1 || a == -2)
{
prtext = "无法选择首脑";
return;
}
else if (a == -3)
{
if (pwuqi[1].naiju <= 0)
{
prtext = "未装备武器";
return;
}
if (usewu[1] == 1)
{
prtext = "本回合已经使用过武器";
return;
}
wquse(1);
}
else if (a == -4)
{
prtext = "无法选择对方武器";
return;
}
}
else
{
if (a >= 0)
{
if (bing[a, b, c].xue <= 0)
{
prtext = "受攻击者为空或者血量不足";
return;
}
if (kqian[a] > 0)
{
if (bing[a, b, c].qianfeng == 0)
{
prtext = "先攻击前锋对象";
return;
}
}
int she = 0;//实际排数
for (int i = 1; i <= b; i++)
{
if (bing[a, i, c].bian != 0) she++;
}
if (bing[clilin.a, clilin.b, clilin.c].shecheng < she)
{
prtext = "射程不够";
return;
}
gongji(clilin.a, clilin.b, clilin.c, a, b, c);
clean("攻击完毕");
}
else if (a == -1 || a == -2)
{
int pl = a + 2;
for (int i = 1; i <= MAXP - 1; i++)
{
if (k[pl, i] > 0)
{
prtext = p[pl] + "仍有士员在场";
}
}
gjshou(clilin.a, clilin.b, clilin.c, pl);
clean("攻击完毕");
return;
}
else if (a == -3 || a == -4)
{
prtext = "无法选择武器";
return;
}
}
}
public static void initpai()
{//初始化购买列表
for (int i = 1; i <= inxbk + 5; i++)
{
xblist[i] = new xiaobin();
fslist[i] = new fashu();
wqlist[i] = new wuqi();
}
for (int i = 1; i <= inxbk; i++)
{
xblist[i].Xiaobin(NAME[i], I1[i], I2[i], I3[i], I4[i], I5[i], I6[i], I7[i], I8[i], I9[i], I10[i], I11[i], I12[i], I13[i], I14[i], I15[i], I16[i], I17[i], i, i, i);
}
for (int i = 1; i <= infsk; i++)
{
fslist[i].Fashu(FNA[i], FA[i], FDI[i], FBI[i]);
}
for (int i = 1; i <= inwqk; i++)
{
wqlist[i].Wuqi(WNA[i], i, WDI[i], NAI[i], WBI[i]);
}
}
public static void clean(string s)
{
mode = 1;
clilin.a = 0; clilin.b = 0; clilin.c = 0;
bback = tmpji;
sendtext = s;
}
public static void setmode(int mo, pfux fun, string s)
{
bback = fun;
mode = mo;
sendtext = s;
}
public static string tostr(int[] tmp)//int[]转string,从0开始
{
string s = "";
for (int i = 0; i < tmp.Length; i++)
{
s += tmp[i].ToString()+"\n";
}
return s;
}
public static void toint(string s,ref int[] tmp)//string转int[],从0开始
{
string[] ss = s.Split('\n');
for(int i = 0; i < ss.Length-1; i++)
{
int.TryParse(ss[i],out tmp[i]);
}
}
}
class xiaobin
{//士员类
public int
gongji,//攻击
fanci,//反刺
xue,//血量
gjcishu,//攻击次数
shecheng,//射程
dun,//护盾
lingjcs,//临时攻击次数
dianshu,//点数
xixue,//吸血
boolpojia,//破甲
paishu,//排数
qianfeng,//前锋
boolji,//沉默
bihu,//庇护
dianji,//电击
bian,//编号
a,
b,
c,
maxxue,//血量上限
yuan,//怨念
ji,//上阵
hui;//怒气
public int[] tmp = new int[10];//临时数组
public string name;//名字
public void Xiaobin(string n, int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9, int i10, int i11, int i12, int i13, int i14, int i15, int i16, int i17, int f1, int f2, int f3)
{
//加载函数
name = n;
gongji = i1;
fanci = i2;
xue = i3;
gjcishu = i4;
shecheng = i5;
dun = i6;
lingjcs = i7;
dianshu = i8;
xixue = i9;
boolpojia = i10;
paishu = i11;
qianfeng = i12;
boolji = i13;
bihu = i14;
dianji = i15;
bian = i16;
maxxue = i17;
yuan = f1;
ji = f2;
hui = f3;
}
public xiaobin()
{//构造函数
name = "";
gongji = 0;
fanci = 0;
xue = 0;
gjcishu = 0;
shecheng = 0;
dun = 0;
lingjcs = 0;
dianshu = 0;
xixue = 0;
boolpojia = 0;
paishu = 0;
qianfeng = 0;
boolji = 0;
bihu = 0;
dianji = 0;
bian = 0;
maxxue = 0;
for (int i = 0; i < 10; i++)
{
tmp[i] = 0;
}
yuan = 0;
ji = 0;
hui = 0;
return;
}
public xiaobin copy()
{
xiaobin tmp = new xiaobin();
tmp.name = name;
tmp.gongji = gongji;
tmp.fanci = fanci;
tmp.xue = xue;
tmp.gjcishu = gjcishu;
tmp.shecheng = shecheng;
tmp.dun = dun;
tmp.lingjcs = lingjcs;
tmp.dianshu = dianshu;
tmp.xixue = xixue;
tmp.boolpojia = boolpojia;
tmp.paishu = paishu;
tmp.qianfeng = qianfeng;
tmp.boolji = boolji;
tmp.bihu = bihu;
tmp.dianji = dianji;
tmp.bian = bian;
tmp.maxxue = maxxue;
tmp.yuan = yuan;
tmp.ji = ji;
tmp.hui = hui;
tmp.tmp = this.tmp;
tmp.a = a;
tmp.b = b;
tmp.c = c;
return tmp;
}
public void yuannian()
{//怨念绑定
common.F1[yuan](a, b, c);
return;
}
public void jineng()
{// 上阵绑定
common.F2[ji](a, b, c);
return;
}
public void huihe()
{//怒气绑定
common.F3[hui](a, b, c);
return;
}
}
class fashu
{//法术类
public string name;//名字
public int
dianshu,//点数
bian;//编号
public common.pfux p;//使用
public fashu()
{//构造函数
name = "";
p = common.tmpfa;
dianshu = 0;
bian = 0;
return;
}
public void Fashu(string n, common.pfux tmpp, int d, int b)
{//加载函数
name = n;
p = tmpp;
dianshu = d;
bian = b;
}
public void use()
{//使用函数
p(0, 0, 0);
return;
}
public fashu copy()
{
fashu tmp = new fashu();
tmp.name = name;
tmp.p = p;
tmp.dianshu = dianshu;
tmp.bian = bian;
return tmp;
}
};
class wuqi
{//武器类
public int
naiju,//耐久
dianshu,//点数
bian,//编号
p;//使用
public string name;//名字
public wuqi()
{//构造函数
name = "武器:空";
p = 0;
dianshu = 0;
naiju = 0;
bian = 0;
return;
}
public void Wuqi(string n, int tmpp, int d, int na, int b)
{//加载函数
name = n;
p = tmpp;
dianshu = d;
naiju = na;
bian = b;
}
public void use()
{//使用函数
common.WU[p](0, 0, 0);
return;
}
public wuqi copy()
{
wuqi tmp = new wuqi();
tmp.name = name;
tmp.p = p;
tmp.dianshu = dianshu;
tmp.bian = bian;
tmp.naiju = naiju;
return tmp;
}
};
class abc
{//坐标三元组
public int a, b, c;
public abc(int aa, int bb, int cc)
{