]> hydra-www.ietfng.org Git - acmetensortoys-ctfws-android/commitdiff
Add handbook activity
authorNathaniel Wesley Filardo <nwfilardo@gmail.com>
Tue, 30 Oct 2018 22:37:48 +0000 (22:37 +0000)
committerNathaniel Wesley Filardo <nwfilardo@gmail.com>
Sat, 17 Nov 2018 01:12:45 +0000 (01:12 +0000)
26 files changed:
mobile/build.gradle
mobile/src/main/AndroidManifest.xml
mobile/src/main/assets/hand.html [new file with mode: 0644]
mobile/src/main/assets/handico/belts.png [new file with mode: 0644]
mobile/src/main/assets/handico/capture.png [new file with mode: 0644]
mobile/src/main/assets/handico/flags.png [new file with mode: 0644]
mobile/src/main/assets/handico/glyphs.png [new file with mode: 0644]
mobile/src/main/assets/handico/jail.png [new file with mode: 0644]
mobile/src/main/assets/handico/judges.png [new file with mode: 0644]
mobile/src/main/assets/handico/meta.png [new file with mode: 0644]
mobile/src/main/assets/handico/players.png [new file with mode: 0644]
mobile/src/main/assets/handico/potions.png [new file with mode: 0644]
mobile/src/main/assets/handico/setup.png [new file with mode: 0644]
mobile/src/main/assets/handico/sportsmanship.png [new file with mode: 0644]
mobile/src/main/assets/handico/teams_territories.png [new file with mode: 0644]
mobile/src/main/assets/handico/terms.png [new file with mode: 0644]
mobile/src/main/assets/handico/wands.png [new file with mode: 0644]
mobile/src/main/assets/handico/white.png [new file with mode: 0644]
mobile/src/main/assets/handord.txt [new file with mode: 0644]
mobile/src/main/java/com/acmetensortoys/ctfwstimer/HandbookActivity.java [new file with mode: 0644]
mobile/src/main/java/com/acmetensortoys/ctfwstimer/MainActivity.java
mobile/src/main/res/drawable/hand_tab_div.xml [new file with mode: 0644]
mobile/src/main/res/layout/activity_handbook.xml [new file with mode: 0644]
mobile/src/main/res/menu/mainmenu.xml
mobile/src/main/res/values/dimens.xml
mobile/src/main/res/values/strings.xml

index 08cdfcd4abc33f0d4e4fbfd54ccbb5eb3c190586..e858977a7666992dfb692145cde1868496debdbc 100644 (file)
@@ -66,4 +66,6 @@ dependencies {
     }
 
     testImplementation 'junit:junit:4.12'
+    implementation 'com.android.support:recyclerview-v7:28.0.0'
+    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
 }
index b1fde30b7f49651f227d117e0d44344a8dd508b3..069bcd95afeaff86c8b8ac7704fffb46b5f6f663 100644 (file)
             android:name=".MainService"
             android:enabled="true"
             android:exported="false" />
+
+        <activity android:name=".HandbookActivity"
+            android:label="@string/app_name_hand">
+        </activity>
     </application>
 
 </manifest>
\ No newline at end of file
diff --git a/mobile/src/main/assets/hand.html b/mobile/src/main/assets/hand.html
new file mode 100644 (file)
index 0000000..2b150fc
--- /dev/null
@@ -0,0 +1,505 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+
+
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8"><title>Capture the Flag with Stuff</title>
+
+<style type="text/css">
+
+p
+{
+   text-indent: -2.5em;
+   margin-top: 1pt;
+   margin-bottom: 2pt;
+   margin-left: 3.5em;
+}
+
+h2, .h2
+{
+   font-size: 14pt;
+   color: #000000;
+}
+
+h3, .h3
+{
+   font-size: 11pt;
+   color: #000000;
+   margin-left: 0.5em;
+}
+</style></script></head><body>
+
+<html>
+       <head>
+               <title>Capture the Flag with Stuff</title>
+       </head>
+       <body bgcolor="#ffffff" text="#000000" link="#ff4000" alink="#ffde2a" vlink="#da3700" topmargin="0" leftmargin="0" bottommargin="0" rightmargin="0">
+
+<h2> I. Base Rules </h2>
+
+<h3> I.@. <a name="meta"/> Meta </h3>
+<p> I.@.1. When rules in this document conflict, the later rule takes
+  precedence. </p>
+<p class="subrulec1"> I.@.1.a. E.g. I.C.4 states that a captor may not capture, while
+V.D.2 states that <span class="change">a player wearing Doc Arnold's Belt
+of Many Places at Once may capture multiple times.</span> </p>
+<p> I.@.2. The judges may choose to change the rules or add or remove stuff into
+the game. Any such rules or stuff changes must be clearly explained before
+the start of the game in which those changes are to be introduced. </p>
+
+<h3> I.A. <a name="teams_territories"/> Teams and Territories </h3>
+<p> I.A.1. The game consists of two teams, red and yellow. Team membership is
+indicated by colored bands, worn on the upper arm or head, which must be
+visible at all times. </p>
+<p> I.A.2. Each team has a home territory. One team's is Wean, the other's is Doherty.
+The teams should swap territories after each game. The territory is defined
+as the space inside the building, with the doors closed, or as defined by
+the judges in the case of ambiguity. Where there is a chamber between two
+sets of doors, the chamber is included in the building. </p>
+<p> I.A.3. Certain areas such as labs, clusters, and any normally
+inaccessible or otherwise restricted areas are forbidden. No player may
+enter these areas at any time during the game. </p>
+<p> I.A.4. All areas which are neither a team's home territory nor
+forbidden are neutral. There must always be at least ten feet of neutral
+territory between opposing teams' home territories. </p>
+<p> I.A.5. A player is considered to be in a team's territory if any
+part of their body is in the team's territory. If a player is in no
+team's territory, they are in neutral territory. Magic items have no
+effect on players who are in neutral territory. </p>
+
+<h3> I.B. <a name="players"/> Players </h3>
+<p> I.B.1. A player is any person playing the game. </p>
+<p> I.B.2. A teammate is a member of the same team. </p>
+<p> I.B.3. An enemy is a player who is not a teammate. </p>
+<p> I.B.4. A player may be normal, ethereal, captive, captor, prisoner,
+interrogation victim, or stunned. </p>
+<p> I.B.5. A normal player is in the default state described in these rules. </p>
+<p> I.B.6. An ethereal player may not use, drop, or pick up magic items,
+is not affected by magic items, may not capture, and may not be
+captured. A player must use jazz hands to signal ethereality. </p>
+<p> I.B.7. A captive is a player who has been captured (see ).
+Captives may not move or touch enemy flags and may not use or drop
+   magic items (except for the Ninja Potion; see ). </p>
+<p> I.B.8. A captor is a player who has captured another player (see
+). Captors must lead their captives to the jail (see ),
+but are otherwise normal players. </p>
+<p> I.B.9. A prisoner is a player who was a captive, but has touched the Glyph of Jail
+(see ). </p>
+<p> I.B.10. An interrogation victim is a prisoner who has been given truth serum
+by the jailer (see ).  They may not use magic items, but otherwise act
+identically to a prisoner except where specified. </p>
+<p> I.B.11. A stunned player must immediately sit on the floor in the territory in which they were
+stunned until the stun wears off. The time they are stunned is measured from
+when they sit down, not when the stunning effect occurred. If they are captured
+while stunned, they become unstunned. A player may not be stunned again while
+stunned. Stunned players may not capture. </p>
+<p> I.B.12. Only normal players and captors can be stunned. </p>
+<p class="subrulec1"> I.B.12.a. If John Mackey changes a player's major during the game, the player is
+stunned for one minute. </p>
+
+<h3> I.C. <a name="capture"/> Capture and Imprisonment </h3>
+<p> I.C.1. If a player touches an enemy when both are in the first
+player's home territory, they may choose to capture the enemy. At this
+point, the enemy becomes a captive. </p>
+<p class="subrulec1"> I.C.1.a. As capture is optional, captors are encouraged to notify their
+captives of this action ("Gotcha" is a good choice). </p>
+<p> I.C.2. A player, when captured, must immediately drop any flags they are carrying at
+the spot where they were captured. </p>
+<p> I.C.3.  A captive or prisoner must give up any non-concealable items upon
+request of the captor or a teammate of the captor. Concealable items need not
+be given up unless the enemy asking for them knows that the player has the
+item. </p>
+<p> I.C.4.  A captor must lead their captive directly to their team's Glyph
+of Jail (see ) at a reasonable speed. They cannot make any more
+captures until their captive has entered jail by touching the Glyph of
+Jail or another prisoner in the jail.  Once this
+occurs, the captor is again a normal player, and the captive becomes a
+prisoner. </p>
+<p> I.C.5. If a captor is stunned, their captive becomes a normal player. </p>
+<p> I.C.6. Prisoners may use magic items. </p>
+
+<h3> I.D. <a name="jail"/> Jail </h3>
+<p> I.D.1. Each team has a jail, designated by the Glyph of Jail. </p>
+<p class="subrulec1"> I.D.1.a. Whenever possible, the Glyph of Jail in Doherty will be placed on floor A,
+near the staircase closest to the main lobby, and the Glyph of Jail in Wean
+will be placed on floor 6, near room 6220 at the end of the 6200 corridor. </p>
+<p> I.D.2. One player on each team may take on the role of jailer by
+wearing the team's Jailer Fedora. The jailer is a normal player except
+as described in the remainder of this section. The jailer may at any
+time transfer the fedora to a teammate, who becomes jailer, or
+remove it, leaving no jailer. </p>
+<p class="subrulec1"> I.D.2.a. In particular, if the jailer is captured or stunned, the jail
+remains functional; prisoners are not released (although any interrogation
+in progress is ended). </p>
+<p> I.D.3. A player may not move the opposing team's fedora except to drop
+it. </p>
+<p> I.D.4. The prisoners must form one or more chains, with each player
+touching the Glyph of Jail either directly or through a chain of other
+prisoners. </p>
+<p> I.D.5. If there is a jailer, they may relax the requirement to form chains. </p>
+<p class="subrulec1"> I.D.5.a. Typically, the jail is at the end of a hall, and prisoners are allowed to
+sit around in the vicinity of the jail. </p>
+<p> I.D.6.  Every fifteen minutes, starting from the beginning of play,
+all prisoners are released from all jails. Released prisoners must
+return to their home territories at reasonable speed, by the most
+direct route. Prisoners released in this manner are ethereal until they
+re-enter their home territories. </p>
+<p> I.D.7. A player in a normal state not carrying a flag may touch a prisoner
+in another team's jail. As long as freeing the prisoner does not break a
+chain leading back to the jail, the prisoner is freed. Both players are
+ethereal and must return to their home territory as after a jailbreak (see I.D.6);
+they need not remain together. </p>
+<p> I.D.8. The jailer has a supply of Truth Serum, which they may use by
+poking a prisoner in the shoulder with a pinky finger. The prisoner
+then becomes an interrogation victim. </p>
+<p> I.D.9. The jailer may then ask the victim up to six yes/no
+questions, and the victim may lie no more than once. The victim may
+answer "I don't know" if they really don't know, but then the question
+doesn't count against the six. </p>
+<p> I.D.10. Upon completion of questioning, the victim is freed from jail
+and must return to their home territory as after a jailbreak (see I.D.6).
+Questioning is complete when the victim answers the sixth question, if
+the jailer decides they are done with this victim, if the victim is
+freed, at jailbreak, if there is no jailer, or if the jailer leaves line of
+sight of the victim. </p>
+<p> I.D.11. There may be at most one truth serum victim in each jail. </p>
+
+<h3> I.E. <a name="setup"/> Initial Setup and Game Completion </h3>
+<p> I.E.1. At the beginning of the game, there is a setup period of
+fifteen minutes. This time should be used for the placement of flags
+and glyphs, and distribution of magic items. No player may enter enemy
+territory during this period. Magic items have no effect during this
+time. </p>
+<p> I.E.2. The game begins at the end of the set up period and ends after one
+hour, or when there remains only one team with uncaptured flags. </p>
+
+<h3> I.F. <a name="terms"/> Additional Terms </h3>
+<p> I.F.1. Cooldown: This is a property of certain items. An item with
+cooldown may not be activated again for one minute after its use. This
+requirement may be suspended by the singing of a number of verses from
+a song determined before the game begins; the item is then usable after
+singing that song. </p>
+<p> I.F.2.  Concealment: Potions may be concealed, meaning they need not
+be visible. All other game items must be visible at all times. A
+captive is not required to give up a concealed item unless their captor
+asks for it specifically and knows that they have the item. </p>
+<p class="subrulec1"> I.F.2.a. Potions cannot be used while concealed. </p>
+<p> I.F.3. Dispelling: A dispelled item has no magical effects. </p>
+<p> I.F.4. Field of View: The field of view is the extent of the observable world that
+is visible to the player at any given moment. </p>
+<p> I.F.5. Line of Sight: A player is within line of sight of an item or event
+if they can rotate themself to bring it into their field of view. </p>
+<p> I.F.6. See: A player sees an item or event if it passes within their field of
+view and they can recognize it. </p>
+<p> I.F.7. Sacrificial: <span class="change">Red items are sacrificial.</span> These items may
+only be activated in enemy territory, must be dropped upon use, and may not
+be picked up or moved when in enemy territory. </p>
+<p> I.F.8. Whap: A player is whapped by a wand if it hits them at approximately the same
+time the wand bearer shouts the key word. </p>
+<p class="subrulec1"> I.F.8.a. As wands are fairly soft, whapping a player on the head counts but is discouraged. </p>
+<p> I.F.9. Key Words/Phrases: Some items have a key word or phrase used to
+activate them.  This phrase must be said entirely in the territory where the
+activation occurs, and the action occurs upon completion of the phrase. </p>
+<p> I.F.10. Knowledge: knowledge of an opponent's concealable items, as referenced in
+rules I.C.3 and I.F.2, means that they have not had a chance to dispose of
+that item since the last time you saw it in their possession. </p>
+
+<h3> I.G. <a name="flags"/> Flags </h3>
+<p> I.G.1. Flags are large pieces of cloth or felt. Each team has three or more flags. </p>
+<p> I.G.2. Flags must be placed during the initial setup time, and their
+placement must be supervised by a judge. They must be placed no higher
+than six feet above the floor; the flag must be clearly visible from most
+angles; flags must be placed no more than one flag per
+hallway or corridor. If the flag is placed inside a container, there
+must be an obvious way to remove the flag in one smooth motion. </p>
+<p> I.G.3. No flag may ever exist in an area with fewer than two exits,
+unless it is being carried. If a flag is dropped in an area with only
+one exit, a judge must move it the shortest possible distance to a
+valid location. </p>
+<p> I.G.4. Any magic items a player is carrying are dispelled if they are
+carrying a flag, and remain dispelled for one minute after the player
+gives up the item or drops the flag. </p>
+<p> I.G.5. Each flag will be assigned a point value at the beginning of the game by the
+head judge. </p>
+<p class="subrulec1"> I.G.5.a. Judges may or may not inform the players of these values on a per-game basis. </p>
+<p> I.G.6.  The winner of the game is the team with the most points. The point values of
+each flag must be set such that the team with the most flags has the most points. </p>
+<p class="subrulec1"> I.G.6.a. If the point system is set differently than specified in I.G.6, the players
+must be informed of this fact before the set up of the game in which this takes place. </p>
+<p> I.G.7. A player who brings a flag to the judges room earns for their
+team the number of points associated with the flag. The flag is then
+out of play for the remainder of the game. </p>
+
+<h3> I.H. <a name="judges"/> Judges </h3>
+<p> I.H.1. Judges are indicated by blue or silver headbands, and are responsible for
+keeping the game running smoothly. </p>
+<p> I.H.2. The head judge is the final arbiter and scorekeeper, and should remain in the
+judges' room, which is Wean Hall 8427 unless otherwise specified. </p>
+<p> I.H.3. An assistant head judge should reside at each team's jail. </p>
+<p> I.H.4. Each team should also have at least 1 roaming judge. The total number of
+roaming judges is up to the head judge, and based on the number of players. </p>
+<p class="subrulec1"> I.H.4.a. Roaming judges’ responsibility is to resolve conflicts or perform other
+duties required of them. </p>
+<p> I.H.5. Judges should attempt to resolve disputes fairly and find outcomes agreeable
+to both sides. In all cases, the judge's decision is final. </p>
+
+<h2> II. Glyphs </h2>
+
+<h3> II.A. <a name="glyphs"/> General </h3>
+<p> II.A.1. Glyphs are large sheets of paper or poster-board marked with a spell. </p>
+<p> II.A.2. Each glyph is owned by a particular team, indicated by the coloring of the glyph. </p>
+<p> II.A.3. A glyph must be taped to a wall in the owning team's territory or side
+ of a door that would be in the owning team's territory if it were closed. </p>
+<p class="subrulec1"> II.A.3.a. Once placed, all glyphs are considered part of the owning team’s territory. </p>
+<p> II.A.4. A glyph affects all normal players on opposing teams in its owning team's
+  territory. </p>
+<p> II.A.5. A glyph may not be placed within ten feet of a flag.  If a flag is dropped
+  within ten feet of a dispellable glyph, the glyph is dispelled for as long as
+  the flag remains, and for one minute after. </p>
+<p> <span class="change">II.A.6. A glyph may not be placed such that any part of it is more than 6 feet off
+  the ground.</span> </p>
+
+<h3> II.B.  Glyph of Jail </h3>
+<p> II.B.1. The Glyph of Jail is indicated by the word "Jail". </p>
+<p> II.B.2. The Glyph of Jail defines the Jail, as described by section . </p>
+<p> II.B.3. The Glyph of Jail cannot be dispelled. </p>
+
+<h3> II.C. Glyph of Entrancement </h3>
+<p> II.C.1. The Glyph of Entrancement is indicated by the word "Gotcha". </p>
+<p> II.C.2. A player who sees the Glyph of Entrancement is stunned for one minute. </p>
+
+<h3> II.D. Glyph of the Disgusting Doorknob </h3>
+<p> II.D.1. The Glyph of the Disgusting Doorknob is indicated by the word "Yukko". </p>
+<p> II.D.2. If a Glyph of the Disgusting Doorknob is on a door, a player may not
+open the door or prevent it from closing by interacting with the side of
+the door the Glyph is on. If the Glyph is mounted on one of a set of doors,
+all doors are affected. </p>
+<p class="subrulec1"> II.D.2.a. The Glyph of Disgusting Doorknob affects players in neutral territory. </p>
+<p> II.D.3. The counting of exits for purposes of flag placement is unaffected by
+this glyph. </p>
+<p> II.D.4. If a Glyph of the Disgusting Doorknob is mounted next to the
+buttons controlling an elevator, no affected player may push any of the
+buttons or prevent the elevator doors from closing. </p>
+<p> II.D.5. Any player must be able to exit to neutral territory without opening any
+door from a side affected by a Glyph of the Disgusting Doorknob or activating
+any stuff. No player can be completely trapped by this glyph. </p>
+
+<h3> II.E. Glyph of Alarm </h3>
+<p> II.E.1. The Glyph of Alarm is indicated by the word "Alarm". </p>
+<p> II.E.2. A player who sees the Glyph of Alarm must shout or sing
+"Alarm" or another phrase as loudly as possible for one minute or
+until they are captured or returns to neutral space. </p>
+
+<h3> II.F.  Glyph of Recharge </h3>
+<p> <span class="change">II.F.1. The Glyph of Recharge is indicated by the word "Recharge".</span> </p>
+<p> <span class="change">II.F.2. A player may recharge a white colored magical item (see ) by holding it
+  to a Glyph of Recharge for a period of 10 seconds.</span> </p>
+<p class="subrulec1"> <span class="change">II.F.2.a. A player may use any Glyph of Recharge in either territory.</span> </p>
+
+<h2> III.  Potions </h2>
+
+<h3> III.A. <a name="potions"/> General </h3>
+<p> III.A.1. Potions are small pieces of foam wrapped in colored tape. </p>
+<p> III.A.2. Potions are concealable. </p>
+
+<h3> III.B.  Ninja Potion of Magic Smoke </h3>
+<p> III.B.1. The Ninja Potion of Magic Smoke is red, <span class="change">and thus</span> sacrificial. </p>
+<p> III.B.2. To activate this item a captive throws this potion onto the ground and yells
+as loudly as possible "Poof, I am a Ninja!". All enemy players who hear this
+and are within line of sight of the user are stunned for ten seconds. </p>
+<p class="subrulec1"> III.B.2.a. This includes enemy players within line of sight in all
+territories. Players in neutral territory are unaffected, as they are
+immune to all stuff. </p>
+
+<h3> III.C. Potion of Wait... There's a Key at the Bottom of This </h3>
+<p> III.C.1. The Potion of Wait... There's a Key at the Bottom of This is green and has cooldown. </p>
+<p> III.C.2. To activate this potion, a player must bonk themself on the head
+with this potion and use one of the key words "Lolt", "Jube", or "Key". </p>
+<p> III.C.3. A stunned player, once they are sitting, may use this potion to unstun
+themself and return to a normal state. </p>
+<p> III.C.4. A prisoner may use this potion to free themself from jail and return to a normal state. </p>
+
+<h3> III.D. Potion of Mind Control </h3>
+<p> III.D.1. The Potion of Mind Control is blue. </p>
+<p> III.D.2. <span class="change">To use this potion, a player must capture an enemy player while
+  using the key word "obey". The enemy becomes the player's captive,
+  and must be handed this potion immediately. </p>
+<p> <span class="change">III.D.3. A player may capture two people simultaneously with one invocation
+  of the potion's ability. They must be simultaneously tagged when the
+  player says "obey". Both enemies become the player's captive.</span> </p>
+<p> III.D.4. <span class="change">Captive(s)</span> who <span class="change">are</span> handed this potion must proceed directly to jail as if
+  escorted by the captor, clearly displaying the potion to any members of the
+  captor's team they encounter. </p>
+<p class="subrulec1"> III.D.4.a. <span class="change">Player(s)</span> controlled by the Potion of Mind Control <span class="change">are</span> still
+  <span class="change">captive(s)</span>. They may not be stunned, and they ignore opponents' glyphs. </p>
+<p class="subrulec1"> III.D.4.b. No player may take the Potion of Mind Control from <span class="change">captive(s)</span> being
+  controlled by it, even if they know they have it. </p>
+<p class="subrulec1"> III.D.4.c. If the Potion of Mind Control is dispelled, the <span class="change">captive(s)</span> under its control
+  <span class="change">are</span> freed. </p>
+<p> III.D.5. A captor who uses the Potion of Mind Control <span class="change">becomes</span> a normal
+  player <span class="change">after handing off the potion</span>. They do not have to escort the
+  <span class="change">captive(s)</span> to jail. </p>
+<p> III.D.6. The <span class="change">captive(s)</span> may not proceed to jail by a route that is less
+  than direct, in an effort to explore for flags or for any other
+  reason. </p>
+<p class="subrulec1"> <span class="change">III.D.6.a. If two players were captured, they are controlled by the same
+  potion and must stay together.</span> </p>
+<p> <span class="change">III.D.7. This potion may be activated while concealed.</span> </p>
+
+<h2> IV.  Wands </h2>
+
+<h3> IV.A. <a name="wands"/> General </h3>
+<p> IV.A.1. Wands are eighteen-inch lengths of foam rubber. </p>
+<p> IV.A.2. The effect of a wand is activated by whapping a person or glyph and shouting
+the key word. </p>
+<p> IV.A.3. Each use of the key word invokes at most one wand on one subject. </p>
+
+<h3> IV.B.  Wand of Vengeance </h3>
+<p> IV.B.1. The Wand of Vengeance has key word "Toast", and is red, <span class="change">and
+thus</span> sacrificial. </p>
+<p> IV.B.2. A normal player may whap an enemy in the enemy's home territory.
+The user captures the enemy, and both players become ethereal.  The user
+must lead the enemy back to their jail as directly as possible at reasonable
+speed. </p>
+<p> IV.B.3. Upon entry into the user's home territory, the user becomes a captor and the
+enemy becomes a captive. </p>
+
+<h3> IV.C. Wand of Stun </h3>
+<p> IV.C.1. The Wand of Stun has key word "Stun", and is green and has cooldown. </p>
+<p> IV.C.2. Any player whapped with this wand is stunned for one minute. </p>
+
+<h3> IV.D. Wand of Dispel </h3>
+<p> IV.D.1. The Wand of Dispel has key word "Dispel", and is blue and has cooldown. </p>
+<p> IV.D.2. If a player is whapped with the wand of dispel, all magic items they are
+carrying are dispelled for one minute. </p>
+<p> IV.D.3. If two players simultaneously use this wand on each other,
+all items carried by both players are dispelled for one minute. </p>
+<p> IV.D.4. A dispellable glyph which is whapped by the Wand of Dispel is dispelled for
+one minute. </p>
+
+<h2> V.  Belts </h2>
+
+<h3> V.A. <a name="belts"/> General </h3>
+<p> V.A.1. A belt is a long sash of cloth or felt. </p>
+<p> V.A.2. To be used, a belt must be tied around a player's waist. </p>
+<p> V.A.3. A belt can be worn by at most one player. </p>
+<p> V.A.4. A player can wear at most one belt. </p>
+
+<h3> V.B. Andy Warhol's Belt of Pop Occultism </h3>
+<p> V.B.1. Andy Warhol's Belt of Pop Occultism is red, <span class="change">and thus</span> sacrificial. </p>
+<p> V.B.2. To activate this belt, the wearer must yell as loudly as
+possible some phrase to be determined by the judges before the start of
+the game. Upon activation, all enemy players within line of sight of
+the user are stunned for one minute. </p>
+<p class="subrulec1"> V.B.2.a. Since the belt is sacrificial, the user must also drop the belt. </p>
+
+<h3> V.C. Goombah's Belt of Humiliating Protection </h3>
+<p> V.C.1. Goombah's Belt of Humiliating Protection is green. </p>
+<p> V.C.2. This belt is activated by starting to skip and loudly sing "Yankee Doodle".
+While singing and skipping continues, the belt is in use, and the wearer is
+immune to capture and stun. </p>
+<p> V.C.3. Any number of teammates may share the protection of this belt
+by holding hands with the wearer, either directly or through a chain of
+teammates, as long as all teammates in the chain are skipping and
+singing along. </p>
+<p> V.C.4. If any player in the chain is dispelled, all items carried by all members of the chain are dispelled. </p>
+<p class="subrulec1"> V.C.4.a. In particular, the Goombah's belt is dispelled. </p>
+<p> V.C.5. This belt does not function in elevators. </p>
+
+<h3> V.D. Doc Arnold's Belt of Many Places at Once </h3>
+<p> <span class="change">V.D.1. Doc Arnold's Belt is blue.</span> </p>
+<p> <span class="change">V.D.2.  A player wearing Doc Arnold's Belt may have up
+    to three captives at once. They may attempt to capture further
+    captives beyond their first.</span> </p>
+<p> <span class="change">V.D.3. Once any captures have been made, the player must lead the captives
+    directly to jail as normal. On their way, the player may deviate from
+    their route only in the manner described below in
+    V.D.4.</span> </p>
+<p> <span class="change">V.D.4.  While wearing Doc Arnold's belt, a captor with at
+    most two captives may use the key phrase "I'LL BE BACH." If they do, each
+    captive of that captor must remain stationary for as long as the
+    captor remains within their line of sight, and for a period of 10
+    seconds thereafter. If the captor wearing the belt is outside of a
+    captive's line of sight for a period of 10 seconds while using
+    this effect, that captive is freed and becomes a normal player.
+    This effect ends after one minute, or when the wearer resumes
+    taking captives directly to jail, whichever occurs first.</span> </p>
+<p class="subrulec1"> <span class="change">V.D.4.a. A captor wearing Doc Arnold's belt may not use the key phrase
+    again if they have not brought a new captive back to their waiting
+    captive(s) since the last time they used the key phrase.</span> </p>
+<p> <span class="change">V.D.5. If the belt is dispelled, all of its wearer's captives except the
+    first are freed. If two captives were captured at the same time,
+    the captor may choose which one to keep.</span> </p>
+
+<h2> VI. White Magic Items </h2>
+
+<h3> VI.A. <a name="white"/> White Magic Items </h3>
+<p> <span class="change">VI.A.1. A white magic item is white.</span> </p>
+<p> <span class="change">VI.A.2. A white magic item must be charged to be used.</span> </p>
+<p class="subrulec1"> <span class="change">VI.A.2.a. All white magic items are charged at the start of the game</span> </p>
+<p> <span class="change">VI.A.3. White magic items come in potion, wand, and belt types.</span> </p>
+<p> <span class="change">VI.A.4. Each white magic item can be used as though it were a magic item of
+  the same type of any other color, and is activated by invoking the
+  keyword and action of that item.</span> </p>
+<p class="subrulec1"> <span class="change">VI.A.4.a. A white potion may be activated as any potion defined in , a
+    white wand as any wand defined in , and a white belt as any belt
+    defined in .</span> </p>
+<p> <span class="change">VI.A.5. A white magic item is always white. During its activation, it gains
+  the color of the magic item which was invoked, and follows all rules
+  of that magic item.</span> </p>
+<p class="subrulec1"> <span class="change">VI.A.5.a. In order to activate a white magic item, you must be in a valid
+    player state and location for activating that color and type of magic
+    item</span> </p>
+<p class="subrulec1"> <span class="change">VI.A.5.b. For example, if a white wand is used to invoke a Wand of
+    Vengeance , you must be in enemy territory, and the white wand is
+    sacrificial.</span> </p>
+<p> <span class="change">VI.A.6. After the activation of a white magic item, it becomes discharged
+  and loses the color of the invoked item.</span> </p>
+<p class="subrulec1"> <span class="change">VI.A.6.a. If a white magic item touches the ground, it becomes discharged.</span> </p>
+<p> <span class="change">VI.A.7. In order to recharge a white magic item, a player must hold it to
+  either a Glyph of Recharge (see ) or their own
+  Glyph of Jail (see ) for a period of ten seconds.</span> </p>
+
+<h2> VII. Sportsmanship </h2>
+
+<h3> VII.A. <a name="sportsmanship"/> Physicality </h3>
+<p> VII.A.1. Players may not physically impede or block other players, either with their
+bodies or with objects. </p>
+<p class="subrulec1"> VII.A.1.a. This includes actions like preventing elevators from
+moving. Breakage of this rule is grounds to eject you from the game. </p>
+<p> VII.A.2. You may not change official timekeeping watches. </p>
+<p> VII.A.3. You may not fabricate or replicate game items. </p>
+
+<h3> VII.B. Lies </h3>
+<p> VII.B.1. Although lies and deceit are part of the game, there are several things you
+may not conceal, obfuscate, or lie about. </p>
+<p> VII.B.2. You may not lie about whether you're in the game. </p>
+<p> VII.B.3. You may not lie about which team you're on. </p>
+<p> VII.B.4. You may not lie about the status of the game. </p>
+<p class="subrulec1"> VII.B.4.a. For example, whether the game has started or ended. </p>
+<p> VII.B.5. You may not lie about what non-concealable items you have. </p>
+<p> VII.B.6. You may not lie about cooldown, dispel, <span class="change">or charge</span> status of items. </p>
+<p> VII.B.7. You may not lie about any player's status. </p>
+<p> VII.B.8. You may not make jazz hands unless you are ethereal. </p>
+<p> VII.B.9. You may not display a Potion of Mind Control in enemy territory unless you
+are a captive under its control. </p>
+<p> VII.B.10. You may not imitate the activation or use of an item without the intent of
+using it. </p>
+
+<h2 style="font-size: 16pt;"> 0. Respect: Above all, don't be a jackass. </h2>
+
+                                                               <br>
+                                                               <hr size="2" color="#000000">
+                                                               <div class="small">
+                                                                       <p>
+                                                                               Copyright &copy; <a href="mailto:exec@cmukgb.org">The Carnegie Mellon KGB</a>.<br>
+                                                                       </p>
+                                                               </div>
+                                                       </td>
+                                               </tr>
+                                       </table>
+                               </td>
+                               <td id="background_right" width="50%"></td>
+                       </tr>
+               </table>
+       </body>
+</html>
diff --git a/mobile/src/main/assets/handico/belts.png b/mobile/src/main/assets/handico/belts.png
new file mode 100644 (file)
index 0000000..f6fbed1
Binary files /dev/null and b/mobile/src/main/assets/handico/belts.png differ
diff --git a/mobile/src/main/assets/handico/capture.png b/mobile/src/main/assets/handico/capture.png
new file mode 100644 (file)
index 0000000..73fcf10
Binary files /dev/null and b/mobile/src/main/assets/handico/capture.png differ
diff --git a/mobile/src/main/assets/handico/flags.png b/mobile/src/main/assets/handico/flags.png
new file mode 100644 (file)
index 0000000..ee4b703
Binary files /dev/null and b/mobile/src/main/assets/handico/flags.png differ
diff --git a/mobile/src/main/assets/handico/glyphs.png b/mobile/src/main/assets/handico/glyphs.png
new file mode 100644 (file)
index 0000000..d793c95
Binary files /dev/null and b/mobile/src/main/assets/handico/glyphs.png differ
diff --git a/mobile/src/main/assets/handico/jail.png b/mobile/src/main/assets/handico/jail.png
new file mode 100644 (file)
index 0000000..96f4bb6
Binary files /dev/null and b/mobile/src/main/assets/handico/jail.png differ
diff --git a/mobile/src/main/assets/handico/judges.png b/mobile/src/main/assets/handico/judges.png
new file mode 100644 (file)
index 0000000..39c7f67
Binary files /dev/null and b/mobile/src/main/assets/handico/judges.png differ
diff --git a/mobile/src/main/assets/handico/meta.png b/mobile/src/main/assets/handico/meta.png
new file mode 100644 (file)
index 0000000..e37faec
Binary files /dev/null and b/mobile/src/main/assets/handico/meta.png differ
diff --git a/mobile/src/main/assets/handico/players.png b/mobile/src/main/assets/handico/players.png
new file mode 100644 (file)
index 0000000..3fe924e
Binary files /dev/null and b/mobile/src/main/assets/handico/players.png differ
diff --git a/mobile/src/main/assets/handico/potions.png b/mobile/src/main/assets/handico/potions.png
new file mode 100644 (file)
index 0000000..310ad59
Binary files /dev/null and b/mobile/src/main/assets/handico/potions.png differ
diff --git a/mobile/src/main/assets/handico/setup.png b/mobile/src/main/assets/handico/setup.png
new file mode 100644 (file)
index 0000000..f9c946b
Binary files /dev/null and b/mobile/src/main/assets/handico/setup.png differ
diff --git a/mobile/src/main/assets/handico/sportsmanship.png b/mobile/src/main/assets/handico/sportsmanship.png
new file mode 100644 (file)
index 0000000..5f292c3
Binary files /dev/null and b/mobile/src/main/assets/handico/sportsmanship.png differ
diff --git a/mobile/src/main/assets/handico/teams_territories.png b/mobile/src/main/assets/handico/teams_territories.png
new file mode 100644 (file)
index 0000000..7fef007
Binary files /dev/null and b/mobile/src/main/assets/handico/teams_territories.png differ
diff --git a/mobile/src/main/assets/handico/terms.png b/mobile/src/main/assets/handico/terms.png
new file mode 100644 (file)
index 0000000..1ff2729
Binary files /dev/null and b/mobile/src/main/assets/handico/terms.png differ
diff --git a/mobile/src/main/assets/handico/wands.png b/mobile/src/main/assets/handico/wands.png
new file mode 100644 (file)
index 0000000..f774240
Binary files /dev/null and b/mobile/src/main/assets/handico/wands.png differ
diff --git a/mobile/src/main/assets/handico/white.png b/mobile/src/main/assets/handico/white.png
new file mode 100644 (file)
index 0000000..7e53a80
Binary files /dev/null and b/mobile/src/main/assets/handico/white.png differ
diff --git a/mobile/src/main/assets/handord.txt b/mobile/src/main/assets/handord.txt
new file mode 100644 (file)
index 0000000..d433cff
--- /dev/null
@@ -0,0 +1,14 @@
+meta
+teams_territories
+players
+capture
+jail
+setup
+terms
+flags
+judges
+glyphs
+potions
+wands
+belts
+sportsmanship
diff --git a/mobile/src/main/java/com/acmetensortoys/ctfwstimer/HandbookActivity.java b/mobile/src/main/java/com/acmetensortoys/ctfwstimer/HandbookActivity.java
new file mode 100644 (file)
index 0000000..7a5f0a4
--- /dev/null
@@ -0,0 +1,132 @@
+package com.acmetensortoys.ctfwstimer;
+
+import android.content.res.AssetManager;
+import android.graphics.BitmapFactory;
+import android.graphics.drawable.BitmapDrawable;
+import android.graphics.drawable.Drawable;
+import android.graphics.drawable.VectorDrawable;
+import android.net.Uri;
+import android.support.annotation.NonNull;
+import android.support.v4.content.ContextCompat;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.support.v7.widget.DividerItemDecoration;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.util.Log;
+import android.util.TypedValue;
+import android.view.View;
+import android.view.ViewGroup;
+import android.webkit.WebView;
+import android.widget.Button;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.List;
+
+public class HandbookActivity extends AppCompatActivity {
+
+    private class HandbookAdapter extends RecyclerView.Adapter<HandbookAdapter.MyVH> {
+
+        class MyVH extends RecyclerView.ViewHolder {
+            Button b;
+            MyVH(Button b) {
+                super(b);
+                this.b = b;
+            }
+        }
+
+        final String[] fns;
+        final View.OnClickListener ocl;
+
+        HandbookAdapter(String[] fns, View.OnClickListener ocl) {
+            this.fns = fns;
+            this.ocl = ocl;
+        }
+
+
+
+        @Override
+        public MyVH onCreateViewHolder(ViewGroup parent, int tipe) {
+            Button b = new Button(HandbookActivity.this, null, R.style.Widget_AppCompat_Button_Borderless);
+            b.setOnClickListener(ocl);
+            return new MyVH(b);
+        }
+
+        @Override
+        public void onBindViewHolder(MyVH vh, int pos) {
+            try {
+                InputStream is = getAssets().open("handico/" + fns[pos] + ".png");
+                Drawable d = BitmapDrawable.createFromStream(is, fns[pos]);
+                vh.b.setBackground(d);
+            } catch (IOException ignored) {
+                String ch = fns[pos];
+                int ix = ch.indexOf('-');
+                if (ix >= 0) { ch = ch.substring(ix); }
+                vh.b.setText(ch);
+            }
+        }
+
+        @Override
+        public int getItemCount() {
+            return fns.length;
+        }
+    }
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        Log.d("CtFwSHandbook", "onCreate");
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_handbook);
+
+        final WebView wv = findViewById(R.id.hand_wv);
+
+        final String[] sections;
+        try {
+            InputStream is = getAssets().open("handord.txt", AssetManager.ACCESS_STREAMING);
+            BufferedReader br = new BufferedReader(new InputStreamReader(is));
+            List<String> lines = new ArrayList<>();
+            String line;
+            while ((line = br.readLine()) != null) {
+                lines.add(line);
+            }
+            sections = lines.toArray(new String[0]);
+
+            final RecyclerView rv = findViewById(R.id.hand_tabs);
+            rv.setHasFixedSize(true);
+
+            LinearLayoutManager lm = new LinearLayoutManager(this);
+            rv.setLayoutManager(lm);
+
+            Drawable divdr = ContextCompat.getDrawable(this, R.drawable.hand_tab_div);
+            if (divdr != null) {
+                DividerItemDecoration divde = new DividerItemDecoration(rv.getContext(),
+                        lm.getOrientation());
+                divde.setDrawable(divdr);
+                rv.addItemDecoration(divde);
+            }
+
+            final View.OnClickListener ocl = new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    int ix = rv.getChildAdapterPosition(v);
+                    Log.d("CtFwSHandbook", "onClick avix=" + ix);
+                    if (ix != RecyclerView.NO_POSITION) {
+                        Log.d("CtFwSHandbook" , "onClick avs=" + sections[ix]);
+                        wv.loadUrl("file:///android_asset/hand.html#" + sections[ix]);
+                    }
+                }
+            };
+
+            RecyclerView.Adapter a = new HandbookAdapter(sections, ocl);
+            rv.setAdapter(a);
+        } catch (IOException ioe) {
+            Log.d("CtFwSHandbook", "IOException?", ioe);
+        }
+
+        wv.loadUrl("file:///android_asset/hand.html");
+    }
+}
index 2720b3eb287e7b89ab98e98381a2d948af2776f6..ae0e198683ae802537c9e278d8854e231dd6c5e8 100644 (file)
@@ -209,6 +209,9 @@ public class MainActivity extends AppCompatActivity {
     @Override
     public boolean onOptionsItemSelected(MenuItem mi) {
         switch(mi.getItemId()) {
+            case R.id.menu_hand:
+                startActivity(new Intent(this, HandbookActivity.class));
+                return true;
             case R.id.menu_reconn:
                 if (mSrvBinder != null) {
                     mSrvBinder.connect(true);
diff --git a/mobile/src/main/res/drawable/hand_tab_div.xml b/mobile/src/main/res/drawable/hand_tab_div.xml
new file mode 100644 (file)
index 0000000..fb8e136
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <size android:height="@dimen/hand_tab_div_size" android:width="@dimen/hand_tab_div_size"/>
+    <solid android:color="@android:color/transparent"/>
+</shape>
\ No newline at end of file
diff --git a/mobile/src/main/res/layout/activity_handbook.xml b/mobile/src/main/res/layout/activity_handbook.xml
new file mode 100644 (file)
index 0000000..cd08b3b
--- /dev/null
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:id="@+id/cl"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <WebView
+        android:id="@+id/hand_wv"
+        android:layout_width="0dp"
+        android:layout_height="0dp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toStartOf="@+id/hand_guide1"
+        app:layout_constraintHorizontal_chainStyle="packed"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintVertical_bias="0.0">
+
+    </WebView>
+
+    <android.support.constraint.Guideline
+        android:id="@+id/hand_guide1"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:orientation="vertical"
+        app:layout_constraintGuide_percent="0.85" />
+
+    <android.support.v7.widget.RecyclerView
+        android:id="@+id/hand_tabs"
+        android:layout_width="0dp"
+        android:layout_height="0dp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintHorizontal_bias="0.0"
+        app:layout_constraintStart_toEndOf="@+id/hand_guide1"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintVertical_bias="0.0" />
+
+</android.support.constraint.ConstraintLayout>
\ No newline at end of file
index f64919f8042798b29ee8879fe385127cfdfe3bb4..a88af04a7a128551a5f0a56bc7a2552c8936550b 100644 (file)
@@ -1,7 +1,14 @@
 <?xml version="1.0" encoding="utf-8"?>
-<menu xmlns:app="http://schemas.android.com/apk/res-auto"
+<menu xmlns:tools="http://schemas.android.com/tools"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:android="http://schemas.android.com/apk/res/android">
 
+    <item
+        android:id="@+id/menu_hand"
+        android:icon="@android:drawable/ic_menu_directions"
+        android:title="@string/menutext_handbook"
+        android:visible="true"
+        app:showAsAction="ifRoom" />
     <item
         android:id="@+id/menu_reconn"
         android:checkable="false"
index 47c82246738c4d056e8030d3a259206f42e8e15d..974ec000bd9ebdf1490b4f068d051c9fad6e1c40 100644 (file)
@@ -2,4 +2,6 @@
     <!-- Default screen margins, per the Android Design guidelines. -->
     <dimen name="activity_horizontal_margin">16dp</dimen>
     <dimen name="activity_vertical_margin">16dp</dimen>
+
+    <dimen name="hand_tab_div_size">4dp</dimen>
 </resources>
index 1c3640ebd39fc2ec934e26c9dfc0d498b68bd5ff..59eaa5b5e43fad221066ccf6ef1b99d022f5880b 100644 (file)
@@ -2,6 +2,7 @@
     <string name="server_default">tcp://ctfws-mqtt.acmetensortoys.com:1883</string>
 
     <string name="app_name">CMUKGB CtFwS Timer</string>
+    <string name="app_name_hand">CMUKGB CtFwS Handbook</string>
 
     <string name="ctfws_gameend">Game\nEnd</string>
     <string name="ctfws_gamestart">Game\nStart</string>
@@ -38,6 +39,7 @@
     <string name="notify_jailbreak">Jailbreak %1$d of %2$d</string>
 
     <string name="menutext_about">About</string>
+    <string name="menutext_handbook">Handbook</string>
     <string name="menutext_prf">Settings</string>
     <string name="menutext_quit">Quit</string>
 
         ]]>
     </string>
     <string name="menutext_reconn">Reconnect</string>
+    <string name="hand_err"><![CDATA[
+        <center>
+          Terribly sorry, something has gone wrong.  Please try loading the
+          <a href="http://www.cmukgb.org/activities/ctfws.php">official rules</a>.
+        </center>
+        ]]>
+    </string>
 </resources>