-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathInform ATTACK.i7x
More file actions
1380 lines (1024 loc) · 57 KB
/
Inform ATTACK.i7x
File metadata and controls
1380 lines (1024 loc) · 57 KB
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
Version 5/140908 of Inform ATTACK by Victor Gijsbers begins here.
"Inform ATTACK: the Inform Advanced Turn-based TActical Combat Kit"
"GPL 3 licenced"
Volume - Introduction
Include version 5/131204 of Inform ATTACK Core by Victor Gijsbers.
[Include Plurality by Emily Short.] [Deprecated with Inform 6L02.]
Section - Saying combat numbers
[ See manual section 2.1.2 ]
[ This variable determines whether we see numerical output. ]
The numbers boolean is a truth state variable. The numbers boolean is true.
Checking the numbers boolean is an action out of world. Understand "numbers" as checking the numbers boolean.
Carry out checking the numbers boolean (this is the standard checking the numbers boolean rule):
say "Combat-related numbers will be [if the numbers boolean is true]displayed[otherwise]hidden[end if].".
Switching the numbers off is an action out of world. Understand "numbers off" as switching the numbers off.
Carry out switching the numbers off (this is the standard switching the numbers off rule):
now the numbers boolean is false;
say "You will no longer see combat-related numbers.".
Switching the numbers on is an action out of world. Understand "numbers on" as switching the numbers on.
Carry out switching the numbers on (this is the standard switching the numbers on rule):
now the numbers boolean is true;
say "You will now see combat-related numbers.".
Section - The After reporting rules
[ The reporting rules are supposed to have the last word, but in Inform ATTACK sometimes that's just not acceptable. The After reporting rules allow us to get another word in. Like the After rules, they are shared for all (non out of world) actions. ]
The after reporting rules are a rulebook.
A specific action-processing rule (this is the after reporting stage rule):
if action in world is true:
abide by the after reporting rules.
Section - New verbs
To lunge is a verb.
To miss is a verb.
Volume - The Main System
[The Main System covers the basics of combat, and creates rulebooks for all other systems to fit into.]
Book - Dressing up the Person Class
[ These adjectives will make reporting attacks a lot easier! ]
Definition: a person is a pc rather than an npc if it is the player.
Chapter - Looting
[To make looting possible.]
The can't take people's possessions rule is not listed in any rulebook.
Check an actor taking (this is the can't take living people's possessions rule):
let the local ceiling be the common ancestor of the actor with the noun;
let H be the not-counting-parts holder of the noun;
while H is not nothing and H is not the local ceiling:
if H is an alive person:
if the actor is the player:
say "[regarding the noun][Those] [seem] to belong to [the H]." (A);
let H be the not-counting-parts holder of H;
After examining a dead person (this is the give list of possession on dead person rule):
if the number of things carried by the noun is at least one:
say "On the [if the noun is plural-named]bodies[otherwise]body[end if] of [the noun] you also see [list of things carried by the noun with indefinite articles].".
Chapter - Health
A person has a number called permanent health. [The maximum you can regain with healing.]
When play begins (this is the set permanent health to initial health rule):
repeat with the patient running through people:
now the permanent health of the patient is the health of the patient;
[We set the permanent health of each individual to the health it has at the beginning of the game. If we wish any character to start the game wounded or super-healthy, we will have to manually override this process.]
To restore the health of (patient - a person):
now the health of the patient is the permanent health of the patient.
To fully heal (patient - a person):
if the permanent health of the patient is greater than the health of the patient:
restore the health of the patient.
[The healed amount is a number that varies. The healed amount is usually 0.]
To heal (patient - a person) for (health - a number) health:
let the health dummy be the permanent health of the patient minus the health of the patient;
if health is less than the health dummy:
now the health dummy is health;
if the health dummy is less than 0:
now the health dummy is 0;
increase the health of the patient by the health dummy;
[now the healed amount is the health dummy.] [For storage.]
Chapter - Basic Combat Stats
[Melee is a measure of fighting prowess. Higher melee means higher chance to hit.]
A person has a number called melee. The melee of a person is usually 0.
[Defence is a measure of fighting prowess. Higher defence means less chance to get hit.]
A person has a number called defence. The defence of a person is usually 7.
Book - Weapons
Chapter - The weapon kind
A weapon is a kind of thing.
[ A readied weapon is one that is not just carried by the actor, but actually in use. ]
A weapon can be readied. A weapon is usually not readied.
After printing the name of a readied weapon while taking inventory (this is the readied inventory listing rule):
say " (readied)".
[ The damage die is the die size used to calculate damage. Base damage dealt by the weapon is 1d(damage die) + weapon damage bonus. So a standard weapon deals 1d6 damage; a weapon with a damage die of 0 and a weapon damage bonus of 5 always deals 5 damage, and so on. Negative damage die is counted as 0, but negative weapon damage bonus is possible. ]
A weapon has a number called the damage die. The damage die of a weapon is usually 6.
A weapon has a number called the weapon damage bonus. The weapon damage bonus of a weapon is usually 0.
A weapon has a number called the dodge bonus. The dodge bonus of a weapon is usually 0.
A weapon has a number called the parry-against bonus. The parry-against bonus is usually 0.
A weapon has a number called the parry-with bonus. The parry-with bonus is usually 0.
Section - Weapon attack bonus
A weapon has a number called the weapon attack bonus. The weapon attack bonus of a weapon is usually 0.
An attack modifier rule (this is the weapon attack bonus rule):
let n be the weapon attack bonus of the global attacker weapon;
if the numbers boolean is true:
if n is greater than 0:
say " + ", n, " ([the global attacker weapon] bonus)[run paragraph on]";
if n is less than 0:
say " - ", 0 minus n, " ([the global attacker weapon] penalty)[run paragraph on]";
increase the attack strength by n.
Chance to win rule (this is the CTW attack bonus from weapon rule):
increase the chance-to-win by the weapon attack bonus of the chosen weapon.
Section - Natural weapons
A natural weapon is a kind of weapon.
A natural weapon is part of every person.
A natural weapon is usually privately-named.
The description of a natural weapon is usually "Clenched fists, kicking feet--that kind of stuff."
The damage die of a natural weapon is usually 3. The dodge bonus of a natural weapon is usually 0. The parry-against bonus of a natural weapon is usually 0. The parry-with bonus of a natural weapon is usually -2.
Does the player mean readying a natural weapon:
it is very unlikely.
Definition: a weapon is artificial if it is not a natural weapon.
Section - Making sure a weapon is always readied
To ready natural weapons:
repeat with X running through all alive persons enclosed by the location:
if X encloses no readied weapon:
let item be a random natural weapon part of X;
now item is readied.
To unready natural weapons:
repeat with X running through all alive persons enclosed by the location:
if X encloses at least two readied weapons:
let item be a random natural weapon part of X;
now item is not readied.
When play begins (this is the ready weapons for everyone rule):
repeat with X running through all alive persons:
if X encloses no readied weapon:
if X carries at least one weapon:
let item be a random weapon carried by X;
now item is readied;
otherwise:
let item be a random natural weapon part of X;
now item is readied.
A starting the combat round rule (this is the ready natural weapons rule):
ready natural weapons;
unready natural weapons.
Section - Unreadying weapons
After dropping a readied weapon (this is the unready on dropping rule):
now the noun is not readied;
continue the action.
After putting on a readied weapon (this is the unready on putting on rule):
now the noun is not readied;
continue the action.
After inserting into a readied weapon (this is the unready on inserting rule):
now the noun is not readied;
continue the action.
Book - Combat Round
Chapter - The hitting action
The global attacker is a person variable.
The global defender is a person variable.
The global attacker weapon is a weapon variable.
The global defender weapon is a weapon variable.
The attack strength is a number variable.
The attack damage is a number variable.
[ The old system has been converted into an action. Instead of the old entry point system we now have:
1: does attacking begin?
add check an actor hitting rules
2: preliminary results of attacking
add first carry out an actor hitting rules
3-6: basic attack roll, apply the attack modifiers, calculate results of the attack roll, show results of the attack roll
these have been combined into the attack modifier rules
7: did the attack hit?
changed to first contact rules
8: immediate results of hitting
add contact rules
9-10: rolling the die for damage, modifying the damage
these have been combined into the damage modifier rules
11-12: calculating the final damage, showing the damage
these have been combined into the damage multiplier rules
13: pre-prose-generation effects
add after an actor hitting rules
14: reporting the results of the blow
the flavour rules have been changed to report an actor hitting rules
15: aftereffects
unchanged
16: remove temporary circumstances
changed to after an actor hitting rules
17: final report
Gone. Could add last aftereffects or last after reporting rules
]
Hitting is an action applying to one visible thing.
The specification of the hitting action is "When you attack Inform ATTACK must wait for a reaction from the target. In order to handle the resulting combat event the attacking action actually stores a new hitting action in the Table of Delayed Actions.".
[ Reset the variables ]
Setting action variables for hitting (this is the reset hitting variables rule):
now the global attacker is the actor;
now the global defender is the noun;
ready natural weapons;
now the global attacker weapon is a random readied weapon enclosed by the actor;
now the global defender weapon is a random readied weapon enclosed by the noun;
have the actor start pressing the noun;
now the attack strength is 0;
now the attack damage is 0;
Section - Checking that the hit can still occur
[ As a result of various reactions, it may no longer be possible to hit ]
First check an actor hitting (this is the stop hitting if either combatant is missing rule):
if the location of the global attacker is not the location or the location of the global defender is not the location:
stop the action;
First check an actor hitting (this is the stop hitting if either combatant is dead rule):
if the global attacker is dead or the global defender is dead:
stop the action;
Section - Calculating the attack roll
The attack modifier rules are a rulebook.
Carry out an actor hitting (this is the consider the attack modifier rules rule):
follow the attack modifier rules;
First attack modifier rule (this is the standard attack roll rule):
now the attack strength is a random number between 1 and 10;
if the numbers boolean is true:
say "[italic type]Rolling ", the attack strength, "[run paragraph on]".
An attack modifier rule (this is the melee attack bonus rule):
let the attacker's melee be the melee of the global attacker;
if the numbers boolean is true and the attacker's melee is not 0:
if the the attacker's melee is greater than 0:
say " + ", the attacker's melee, " (inherent bonus)[run paragraph on]";
otherwise:
say " - ", 0 minus the attacker's melee, " (inherent penalty)[run paragraph on]";
increase the attack strength by the attacker's melee;
Last attack modifier rule (this is the standard show results of the attack roll rule):
if the numbers boolean is true:
say " = ", the attack strength, ", [run paragraph on]";
Section - Whether the attack hits
The contact rules are a rulebook.
Carry out an actor hitting (this is the abide by the contact rules rule):
abide by the contact rules.
First contact rule (this is the standard whether the attack hit rule):
if the attack strength is greater than the defence of the global defender:
if the numbers boolean is true:
say "[the global attacker] beat[s] [regarding the global defender][possessive] defence rating of ", the defence of the global defender, ".";
otherwise:
if the numbers boolean is true:
say "[the global attacker] [do] not overcome [regarding the global defender][possessive] defence rating of ", the defence of the global defender, "[roman type].";
rule fails;
Section - Dealing damage
The damage modifier rules are a rulebook.
The damage multiplier rules are a rulebook.
Carry out an actor hitting (this is the consider the damage modifier rules rule):
follow the damage modifier rules;
First damage modifier rule (this is the standard damage roll rule):
unless damage die of the global attacker weapon is less than 1:
now the attack damage is a random number between 1 and the damage die of the global attacker weapon;
increase the attack damage by weapon damage bonus of the global attacker weapon; [1d(damage die) + WDB]
if the numbers boolean is true:
say "[The global attacker] deal[s] ", the attack damage, "[run paragraph on]".
Carry out an actor hitting (this is the consider the damage multiplier rules rule):
follow the damage multiplier rules;
Last damage multiplier rule (this is the can't deal negative damage rule):
if the attack damage is less than 0:
now the attack damage is 0;
Last damage multiplier rule (this is the standard show the attack damage dealt rule):
if the numbers boolean is true:
say " = [bold type]", the attack damage, " damage[roman type][italic type], ";
[no damage]
if the the attack damage is less than 1:
say "allowing [the global defender] to escape unscathed.[run paragraph on]";
otherwise:
[non-fatal]
if the the attack damage is less than the health of the global defender:
say "wounding [the global defender] to ", health of the global defender minus the attack damage, " health.[run paragraph on]" ;
[fatal]
otherwise:
say "killing [the name of the global defender].[run paragraph on]";
say "[roman type][paragraph break]";
Carry out an actor hitting (this is the subtract damage from health rule):
decrease the health of the global defender by the attack damage;
Section - Report hitting
Report an actor hitting an alive person (this is the basic flavour rule):
if the attack damage is greater than 0:
say "[The global attacker] hit[s] [the global defender].[run paragraph on]";
otherwise:
say "[The global attacker] [miss] [the global defender].[run paragraph on]";
Report an actor hitting a dead pc (this is the basic fatal player flavour rule):
say "You are killed by [the global attacker].[run paragraph on]";
Report an actor hitting a dead npc (this is the basic fatal flavour rule):
say "[The global attacker] kill[s] [the name of the global defender].[run paragraph on]";
Report the player hitting a dead pc (this is the report player suicide rule):
say "Your attack ends your own life.";
rule succeeds;
Section - Aftereffects
The aftereffects rules is a rulebook.
After reporting an actor hitting (this is the consider the aftereffects rules rule):
if the player is alive:
follow the aftereffects rules;
An aftereffects rule when the global defender is dead (this is the unready weapons of dead person rule):
now all readied weapons enclosed by the global defender are not readied;
An aftereffects rule (this is the modify initiative based on combat results rule):
if the attack damage is greater than 0:
decrease the initiative of the global defender by 2;
otherwise:
decrease the initiative of the global attacker by 2;
Book - Flow
Chapter - Offensive and Defensive Flow
A person has a number called offensive flow. The offensive flow of a person is usually 0.
A person has a number called defensive flow. The defensive flow of a person is usually 0.
An attack modifier rule (this is the offensive flow attack modifier rule):
let n be offensive flow of the global attacker;
if the numbers boolean is true:
unless n is 0:
if n > 0:
say " + ", n, " (offensive flow)[run paragraph on]";
if n < 0:
let m be (0 - n);
say " - ", m, " (offensive flow)[run paragraph on]";
increase the attack strength by n;
An attack modifier rule (this is the defensive flow attack modifier rule):
let n be defensive flow of the global defender;
if the numbers boolean is true:
unless n is 0:
if n > 0:
say " - ", n, " (defensive flow)[run paragraph on]";
if n < 0:
let m be (0 - n);
say " + ", m, " (defensive flow)[run paragraph on]";
decrease the attack strength by n;
Rule for damage modifier (this is the offensive flow damage modifier rule):
let bonus be offensive flow of the global attacker;
if the numbers boolean is true:
unless the bonus is 0:
say " + ", the bonus, " (offensive flow)[run paragraph on]";
increase the attack damage by the bonus.
[Rule for damage modifier (this is the defensive flow damage modifier rule):
let bonus be defensive flow of the global defender;
if the numbers boolean is true:
unless the bonus is 0:
say " - ", the bonus, " (defensive flow)[run paragraph on]";
decrease the attack damage by the bonus.]
An aftereffects rule (this is the lose flow when hit rule):
if the attack damage is greater than 0 and the global defender is alive:
now offensive flow of global defender is 0;
now defensive flow of global defender is 0.
After an actor hitting (this is the lose flow after unsuccessfully attacking rule):
unless the attack strength is greater than the defence of the global defender:
now the offensive flow of the global attacker is 0;
now the defensive flow of the global attacker is 0;
continue the action;
To up the offensive flow of (guy - a person):
unless offensive flow of guy is 3:
increase offensive flow of guy by 1;
let n be (3 - offensive flow of guy);
if defensive flow of guy > n:
now defensive flow of guy is n.
To up the defensive flow of (guy - a person):
unless defensive flow of guy is 3:
increase defensive flow of guy by 1;
let n be (3 - defensive flow of guy);
if offensive flow of guy > n:
now offensive flow of guy is n.
Definition: a person (called the guy) is flowing if (offensive flow of guy > 0) or (defensive flow of guy > 0).
This is the everyone loses flow when combat status is peace rule:
if combat status is peace:
repeat with guy running through flowing people:
now offensive flow of guy is 0;
now defensive flow of guy is 0.
The everyone loses flow when combat status is peace rule is listed before the business as usual rule in the combat round rules.
Book - Standard Combat Actions
Chapter - Readying
Readying is an action applying to one visible thing.
Understand "ready [thing]" as readying. Understand "wield [thing]" and "use [weapon]" as readying.
Does the player mean readying a readied weapon: it is unlikely.
Check readying (this is the cannot ready what is already readied rule):
if the noun is readied and the noun is enclosed by the player:
take no time;
say "You are already wielding [the noun]." instead.
Check readying (this is the cannot ready what is not a weapon rule):
if the noun is not a weapon:
take no time;
say "You can only ready weapons." instead.
First carry out an actor readying (this is the implicit taking when readying rule):
if the actor does not enclose the noun:
try the actor taking the noun.
Carry out an actor readying (this is the carry out readying when enclosing rule):
if the actor encloses the noun:
now the noun is readied.
Last carry out an actor readying (this is the unready all other weapons rule):
if the noun is readied:
repeat with item running through things enclosed by the actor:
if the item is not the noun and the item is readied:
now the item is not readied.
Last report an actor readying (this is the standard report readying rule):
if the noun is readied:
say "[The actor] [ready] [the noun].";
otherwise:
if the actor encloses the noun:
say "[The actor] fool[s] around with [the noun], but fail[s] to ready it.";
otherwise:
say "[The actor] attempt[s] to ready [the noun], but cannot get a hold on it.".
Chapter - Unreadying
Unreadying is an action applying to one visible thing.
Understand "unready [thing]" as unreadying. Understand "unwield [thing]" as unreadying.
Does the player mean unreadying a readied weapon: it is very likely.
Check unreadying (this is the can only unready what is readied rule):
unless the noun is a readied weapon enclosed by the actor:
take no time;
say "You are not wielding that." instead.
Carry out an actor unreadying:
now the noun is not readied;
say "You unwield [the noun].";
if the player encloses no readied weapon:
let item be a random natural weapon part of the player;
now item is readied.
Chapter - Attacking
The block attacking rule is not listed in any rulebook.
Understand "a [thing]" as attacking.
Does the player mean attacking a dead person:
it is unlikely.
Does the player mean attacking a person opposed by the player:
it is very likely.
Check attacking when the noun is not a person (this is the only attack persons rule):
take no time;
say "Things are not your enemies." instead.
Check attacking a dead person (this is the only attack the living rule):
take no time;
say "[The noun] is already dead." instead.
Check attacking the player (this is the do not kill yourself rule):
take no time;
say "You are not that desperate!" instead.
A check attacking rule (this is the do not attack friendly people rule):
if the faction of the player is the faction of the noun:
take no time;
say "[The noun] is your friend, not your enemy!" instead.
A check attacking rule (this is the do not attack neutral people rule):
if the player does not oppose the noun:
take no time;
say "[The noun] is not your enemy." instead.
Check attacking when the player is at-React (this is the cannot attack as reaction rule):
take no time;
say "Attacking is an action, not a reaction." instead.
Carry out an actor attacking (this is the standard carry out an actor attacking rule):
choose a blank row in the Table of Delayed Actions;
now the Action speed entry is 10;
now the Action to take entry is the action of the actor hitting the noun;
now the combat state of the noun is at-React;
Report an npc attacking (this is the standard report an actor attacking rule):
say "[The actor] [lunge] towards [the noun].[paragraph break]".
Chapter - Concentrating
Concentrating is an action applying to nothing. Understand "concentrate" and "c" and "co" as concentrating.
A person has a number called concentration. The concentration of a person is usually 0.
Check concentrating when the concentration of the player is 3 (this is the do not concentrate when at maximum rule):
take no time;
say "You are already maximally concentrated." instead;
First carry out an actor concentrating (this is the standard concentrating improves initiative rule):
increase the initiative of the actor by the concentration of the actor.
Carry out an actor concentrating (this is the standard carry out concentrating rule):
increase the concentration of the actor by 1;
if the concentration of the actor is greater than 3:
now the concentration of the actor is 3;
Report an actor concentrating (this is the standard concentrating prose rule):
say "[The actor] concentrate[s], and [are]";
if the concentration of the actor is:
-- 1:
say " now mildly concentrated.";
-- 2:
say " now quite concentrated.";
-- 3:
say " now maximally concentrated.";
An attack modifier rule (this is the concentration attack modifier rule):
let the bonus be 0;
if the concentration of the actor is:
-- 0:
make no decision;
-- 1:
now the bonus is 2;
-- 2:
now the bonus is 4;
-- 3:
now the bonus is 8;
if the numbers boolean is true:
say " + ", the bonus, " (concentration)[run paragraph on]";
increase the attack strength by the bonus;
Rule for damage modifier (this is the concentration damage modifier rule):
let the bonus be 0;
if the concentration of the actor is:
-- 2:
now the bonus is 2;
-- 3:
now the bonus is 4;
-- otherwise:
make no decision;
if the numbers boolean is true:
say " + ", the bonus, " (concentration)[run paragraph on]";
increase the attack damage by the bonus;
An aftereffects rule (this is the lose concentration when hit rule):
if the attack damage is greater than 0 and the global defender is alive:
let the global defender lose concentration.
After an actor hitting (this is the lose concentration after attacking rule):
now the concentration of the global attacker is 0;
continue the action;
[ Losing concentration ]
To let (the defender - a person) lose concentration:
if the concentration of the defender > 0:
now the concentration of the defender is 0;
follow the lose concentration prose rules for the defender;
The lose concentration prose rules are a person based rulebook.
Last lose concentration prose rule for a person (called P) (this is the standard lose concentration prose rule):
if P is the player:
say "You lose your [bold type]concentration[roman type]!";
otherwise:
say "[The P] loses [bold type]concentration[roman type]!";
Chance to win rule (this is the CTW concentration bonus rule):
if the concentration of the running AI is:
-- 1:
increase the chance-to-win by 2;
-- 2:
increase the chance-to-win by 4;
-- 3:
increase the chance-to-win by 8;
Carry out an actor going (this is the lose concentration on going rule):
now the concentration of the actor is 0.
This is the everyone loses concentration when combat status is peace rule:
if combat status is peace:
if concentration of the player is not 0:
now concentration of the player is 0;
say "You relax your concentration.";
repeat with guy running through alive people:
now concentration of guy is 0.
The everyone loses concentration when combat status is peace rule is listed before the business as usual rule in the combat round rules.
Chapter - Parrying
Parrying is an action applying to nothing. Understand "parry" and "p" and "pa" as parrying.
A person can be at parry. A person is usually not at parry.
Check parrying (this is the cannot parry when not reacting rule):
if the combat state of the player is not at-React:
take no time;
say "You parry, but there is no attack." instead.
[Carry out an actor parrying (this is the parrying changes initiative rule):
increase the initiative of the actor by 1.]
Carry out an actor parrying (this is the standard carry out parrying rule):
now the actor is at parry.
Report an actor parrying (this is the standard parry prose rule):
say "[The actor] strike[s] up a defensive pose.".
An attack modifier rule (this is the parry defence bonus rule):
if the global defender is at parry:
decrease attack strength by 2;
if the numbers boolean is true:
say " - 2 (defender parrying)[run paragraph on]";
let n be parry-against bonus of the global attacker weapon;
decrease attack strength by n;
if the numbers boolean is true:
if n is greater than 0:
say " - ", n, " (parrying against [the global attacker weapon])[run paragraph on]";
if n is less than 0:
now n is (0 - n);
say " + ", n, " (parrying against [the global attacker weapon])[run paragraph on]";
now n is parry-with bonus of the global defender weapon;
decrease attack strength by n;
if the numbers boolean is true:
if n is greater than 0:
say " - ", n, " (parrying with [the global defender weapon])[run paragraph on]";
if n is less than 0:
now n is (0 - n);
say " + ", n, " (parrying with [the global defender weapon])[run paragraph on]";
Last after reporting an actor hitting (this is the no longer at parry after the attack rule):
now the global defender is not at parry;
continue the action;
Chance to win rule (this is the CTW parry bonus rule):
let n be the parry-against bonus of the chosen weapon;
let item be a random readied weapon enclosed by the chosen target;
increase n by parry-with bonus of item;
increase n by 2;
if the best defence is less than n:
now the best defence is n.
An aftereffects rule (this is the gain offensive flow from parrying rule):
if the attack damage is 0 and the global defender is at parry:
up the offensive flow of global defender.
Chapter - Dodging
Dodging is an action applying to nothing. Understand "dodge" and "do" as dodging.
A person can be at dodge. A person is usually not at dodge.
Check dodging (this is the cannot dodge when not reacting rule):
if the combat state of the player is not at-React:
take no time;
say "You dodge, but there is no attack." instead.
Carry out an actor dodging (this is the standard carry out dodging rule):
now the actor is at dodge.
Report an actor dodging (this is the standard dodge prose rule):
say "[The actor] get[s] ready for quick evasive maneuvers.".
An attack modifier rule (this is the dodge defence bonus rule):
if the global defender is at dodge:
decrease attack strength by 2;
if the numbers boolean is true:
say " - 2 (defender dodging)[run paragraph on]";
let n be dodge bonus of global attacker weapon;
decrease the attack strength by n;
if the numbers boolean is true:
if n is greater than 0:
say " - ", n, " ([the global attacker weapon] dodge bonus)[run paragraph on]";
if n is less than 0:
now n is (0 - n);
say " + ", n, " ([the global attacker weapon] dodge penalty)[run paragraph on]";
Chance to win rule (this is the CTW dodge bonus rule):
let n be (2 + (dodge bonus of the chosen weapon));
if the best defence is less than n:
now the best defence is n.
After reading a command (this is the d might mean dodge rule):
if the player is at-React and the player's command matches "d":
say "[italic type](Perhaps you wanted to dodge? The abbreviation for that is 'do'.)[roman type][paragraph break]".
Last after reporting an actor hitting (this is the no longer at dodge after the attack rule):
now the global defender is not at dodge;
continue the action;
An aftereffects rule (this is the gain defensive flow from dodging rule):
if the attack damage is 0 and the global defender is at dodge:
up the defensive flow of global defender.
Section - Rolling
Rolling is an action applying to nothing. Understand "roll" as rolling.
A person can be at-roll. A person is usually not at-roll.
Check rolling (this is the cannot roll when not reacting rule):
if the combat state of the player is not at-React:
take no time;
say "You roll, but there is no attack." instead.
Carry out an actor rolling:
now the actor is at-roll.
Report an actor rolling (this is the standard roll prose rule):
say "[The actor] roll[s] into the thick of combat.".
[An attack modifier rule (this is the roll defence bonus rule):
if the global defender is at-roll:
let n be dodge bonus of global attacker weapon;
decrease the attack strength by n;
if the numbers boolean is true:
if n is greater than 0:
say " - ", n, " ([the global attacker weapon] dodge bonus)[run paragraph on]";
if n is less than 0:
now n is (0 - n);
say " + ", n, " ([the global attacker weapon] dodge penalty)[run paragraph on]";]
Last after reporting an actor hitting (this is the no longer at roll after the attack rule):
now the global defender is not at-roll;
continue the action;
An aftereffects rule (this is the switch to offensive flow after rolling rule):
if the attack damage is 0 and the global defender is at-roll:
now offensive flow of the global defender is (offensive flow of the global defender + defensive flow of the global defender);
now defensive flow of the global defender is 0;
up the offensive flow of global defender.
Section - Blocking
Blocking is an action applying to nothing. Understand "block" as blocking.
A person can be at-block. A person is usually not at-block.
Check blocking (this is the cannot block when not reacting rule):
if the combat state of the player is not at-React:
take no time;
say "You block, but there is no attack." instead.
Carry out an actor blocking:
now defensive flow of actor is (offensive flow of actor + defensive flow of actor);
now offensive flow of actor is 0;
now the actor is at-block.
Report an actor blocking (this is the standard block prose rule):
say "[The actor] attempt[s] to block the incoming attack.".
[No special defense bonus. Kerkerkruip adds a shield-related rule here.]
Last after reporting an actor hitting (this is the no longer at block after the attack rule):
now the global defender is not at-block;
continue the action;
An aftereffects rule (this is the gain random flow from blocking rule):
if the attack damage is 0 and the global defender is at-block:
if a random chance of 1 in 2 succeeds:
if a random chance of 1 in 2 succeeds:
up the defensive flow of global defender;
otherwise:
up the offensive flow of the global defender.
Section - Expose
Exposing is an action applying to nothing. Understand "expose" as exposing.
A person can be at-expose. A person is usually not at-expose.
Check exposing (this is the cannot expose when not reacting rule):
if the combat state of the player is not at-React:
take no time;
say "You expose yourself, but there is no attack." instead.
Carry out an actor exposing:
now the actor is at-expose.
Report an actor exposing (this is the standard expose prose rule):
say "[The actor] stand[s] ready to receive the attack.".
An attack modifier rule (this is the expose defence penalty rule):
if the global defender is at-expose:
increase the attack strength by 20;
if the numbers boolean is true:
say " + 20 (defender exposing)[run paragraph on]";
Last after reporting an actor hitting (this is the no longer at expose after the attack rule):
now the global defender is not at-expose;
continue the action;
Book - Artificial Intelligence
[ Our standard AI works in three stages.
First, we choose a person to attack--if we were to attack.
In the second stage, we choose a weapon.
In the third stage, we decide whether to attack or whether to do something else--like concentrating, dodging, readying a weapon, and so on.
These choices are made by a series of rulebooks which alter the weighting of each potential target/weapon/action.
Inform ATTACK Core has the base rules - we now add combat specific ones. ]
Section - Target selection rules
An AI target selection rule for a person (called target) (this is the prefer the severely wounded rule):
if the health of the target times 2 is less than the permanent health of the target:
increase the Weight by 2;
if the health of the target times 4 is less than the permanent health of the target:
increase the Weight by 5;
An AI target selection rule for a person (called target) (this is the prefer concentrated people rule):
increase the Weight by the concentration of the target;
if the concentration of the target is 3:
increase the Weight by 2;
An AI target selection rule for a person (called target) (this is the prefer those with good weapons rule):
let item be a random readied weapon enclosed by the target;
increase the Weight by the damage die of the item divided by 2;
An AI target selection rule for a person (called target) (this is the do not prefer good parriers rule):
let item be a random readied weapon enclosed by the running AI;
let item2 be a random readied weapon enclosed by the target;
let n be dodge bonus of item;
let m be parry-against bonus of item + parry-with bonus of item2;
if m > n:
now n is m;
decrease the Weight by n;
[The following rule makes the actor prefer people with low defence, unless he is concentrated, in which case he prefers people with high defence. Reason: if you managed to become concentrated, you should use that bonus against otherwise tough opponents.]
An AI target selection rule for a person (called target) (this is the do not prefer high defence unless concentrated rule):
let n be the defence of the target minus the melee of the running AI;
if n is less than 0:
now n is 0;
let m be the concentration of running AI minus 1;
[Negative if concentration = 0; 0 is concentration is 1; positive if concentration is 2 or 3.]
increase the Weight by n times m;
Section - Selecting a weapon
Table of AI Weapon Options
Weapon Weapon weight
a weapon a number
with 10 blank rows
The AI weapon selection rules are a weapon based rulebook producing a number.
The AI weapon selection rulebook has a number called the Weight.
The chosen weapon is a weapon variable.
A Standard AI rule for a person (called P) (this is the select a weapon rule):
[ Only the natural weapon ]
if exactly one weapon is enclosed by P:
now the chosen weapon is a random weapon enclosed by P;
[ If there is one non-natural weapon choose it ]
otherwise if exactly two weapons are enclosed by P:
now the chosen weapon is a random artificial weapon enclosed by P;
otherwise:
blank out the whole of the Table of AI Weapon Options;
repeat with X running through all weapons enclosed by the P:
let weight be the number produced by the AI weapon selection rules for X;
choose a blank Row in the Table of AI Weapon Options;
now the Weapon entry is X;
now the Weapon weight entry is weight;
sort the Table of AI Weapon Options in random order;
sort the Table of AI Weapon Options in reverse Weapon weight order;
#if debug and showing weightings;
repeat through Table of AI Weapon Options:
say "[Weapon weight entry]: [Weapon entry][line break]";
#endif debug and showing weightings;
choose row 1 in the Table of AI Weapon Options;
now the chosen weapon is the Weapon entry;
Section - Standard weapon selection rules
[ These rules are dependent on the W, and not whether they are being run for the attacker or the defender. Use the running AI variable if you need to know whose weapon it is. ]