Browse Source

Add rules for campaign

master
Josh Gordon 4 years ago
parent
commit
78761bf979
  1. 46
      app/dungeon.py
  2. 4
      app/routes.py
  3. 347
      app/templates/campaign_info.html
  4. 1
      app/templates/marches.html

46
app/dungeon.py

@ -21,6 +21,8 @@ WALL_COLOR = np.array([255,255,255]) #white
FLOOR_COLOR = np.array([40,100,100]) #brown
GRID_COLOR = np.array([0,0,50]) #red
NUM_ITR = 8
def randomColor():
b = randint(0,255)
g = randint(0,255)
@ -317,10 +319,53 @@ def genGridDungeonB64(gSizeX,gSizeY,mScale,imScale,numCells=None):
enc = base64.b64encode(buf)
return enc
#params are pixel size
def genCaveDungeonB64(pSizeX,pSizeY):
im=np.random.randint(2,size=(pSizeX,pSizeY)).astype(np.float32)*255
#im = 1-np.random.randint(10,size=(pSizeX,pSizeY))//8
#im = im.astype(np.float32)*255
#kernel = np.ones((2,2))
#im = cv2.erode(im,kernel,iterations=1)
def getNeighborCount(x,y):
print(x,y)
count = 0
for dx in [-1,0,1]:
for dy in [-1,0,1]:
rx = x+dx
ry = y+dy
if (dx == 0 and dy == 0) or rx < 0 or ry < 0 or rx >= pSizeX or ry >= pSizeY:
continue
count += im[rx,ry]/255
print(count)
return count
for i in range(NUM_ITR):
newim = im.copy()
for x in range(pSizeX):
for y in range(pSizeY):
c = getNeighborCount(x,y)
if c >= 5 and newim[x,y] == 0:
newim[x,y] = 1
if c <= 2 and newim[x,y] == 1:
newim[x,y] = 0
im = newim
cv2.imshow("Itr " + str(i),im)
cv2.waitKey(0)
cv2.imwrite("generated_dungeon.png",im)
#s = genGridDungeonB64(10,10,8,24)
#print(s)
if len(sys.argv) > 1:
if "cave" in sys.argv:
genCaveDungeonB64(64,64)
sys.exit(0)
g = Grid(GRID_SIZE,GRID_SIZE)
g.addCell()
g.addCell()
@ -338,6 +383,7 @@ if len(sys.argv) > 1:
if "color" in sys.argv:
cv2.imwrite("colored_dungeon.png",im)
#drawFlow(im,g)
cv2.imshow("flow",im)
im,mask = canonicalize(im)
drawn = drawGrid(im,mask)

4
app/routes.py

@ -185,5 +185,9 @@ def genDungeon():
def about():
return render_template('about.html')
@app.route("/campaign_info")
def campaign_info():
return render_template('campaign_info.html')
if __name__ == "__main__":
app.run()

347
app/templates/campaign_info.html

@ -0,0 +1,347 @@
{% extends "base.html" %}
{% block style %}
<link rel="stylesheet" type="text/css" href="/static/style.css">
<link href="https://fonts.googleapis.com/css?family=IBM+Plex+Mono|IBM+Plex+Sans|IBM+Plex+Sans+Condensed" rel="stylesheet">
<style>
li {
text-align: left;
}
ul > li {
margin-left: 10%;
}
table {
margin-left: auto;
margin-right: auto;
}
</style>
{% endblock %}
{% block content %}
<h3><a href="/marches">West Marches</a></h3>
<h2>Intro</h2>
<p>
A thousand years in the past, the land of Lorind was home to a sprawling empire the scale of which had never been seen before. The civilization had tamed nature and constructed citadelic cities from coast to coast.
As it is fated to do, the metaphorical shit wound up its steaming fist and hit the fan.
We don't know what happened to them. We rely on ancient documents and our own observations about the surrounding area to gather information.
Unfortunately, our records are spotty and our spotters certainly do not set records.
That's where you come in.
Your task is to make the first large scale expedition effort to explore the continent and gather information.
We'll provide you food, water, and housing, as well as try to construct any materials and equipment you need, but once you leave the city walls you'll be on your own.
<br>
<br>
Leaving the town is dangerous. We can't promise you you'll make it back in one piece.
What's most important to keep in mind is that if anyone can do this, it's you.
</p>
<h2>Goals</h2>
<p>The world has become uncivilized, and your job is to reverse that trend and reestablish a great civilization over Lorind.</p>
<ul>
<li><p>Explore a continent of wilderness and fill out your map</p></li>
<li><p>Deal with major threats to civilization in each area to make it safe</p></li>
<li><p>Establish military presence and construct settlements to civilize areas</p></li>
<li><p>Uncover the history of the ancient empire and figure out how it fell</p></li>
</ul>
<p>If all areas are civilized and the mystery is solved, you will have beaten the campaign. This is unlikely to occur.</p>
<h2>Rules</h2>
<p>The following rules exist on top of Dungeons and Dragons 5th edition</p>
<ul>
<li><p>Players start at level one, and level up by earning xp</p>
<ul>
<li><p>xp is earned per session, and is evenly distributed among the present players</p></li>
<li><p>There are more ways to get xp than killing things. XP is earned by solving problems; it just so happens that "oh crap that thing is trying to kill us" is a very common problem.</p></li>
<li><p>xp can be gained during downtime, see the <a href="#dtimeActions">downtime actions</a> rule</p></li>
</ul>
</li>
<li><p>All damage except for afflictions with a specified duration (disease, curse, death, etc.) is healed upon staying in a civilized area for a week.</p></li>
<li><p>Teleportation and other such means of instant travel can start from anywhere but can only target a permanent teleportation circle.</p>
<p>A Gate is required to teleport into the wilderness.</p>
<p>Short range teleportation such as misty step and dimension door are unaffected by this rule.</p>
</li>
<li><p>After each session, each player will write up a log (~1 paragraph, can be longer) detailing what their character did/discovered on the mission.</p>
<p>Once the log is written, said player will have one inspiration to use next mission.</p>
</li>
<li><p>Every location on the map has an (x,y) coordinate, and travel time is computed using the <a href="#travel">travel time</a> table. (Distance metric is L2 for the two people who will ask)</p>
<p>For every day traveled, each player will need food and water. If these are not acquired, one exhaustion level is gained.</p>
<p>If travelling slowly, the party can either forage or move stealthily<p>
<ul>
<li><p>If the party chooses to forage, have a player with the highest survival skill make a check against the <a href="#forTable">foraging dc</a> table. If the check passes, they find enough food and water for 1d6+proficiency people. If the check passes by 5 or more, enough food and water is found for 6+proficency people.<p></li>
<li><p>If the party chooses to move stealthily, have each player make a stealth check, and use the average value against any perception check on the party as they travel.</p></li>
</ul>
</li>
<li><p>A game session will be structured in five parts:</p>
<ol>
<li><p><strong>Planning</strong>: A group of 4-6 players agree on a mission and find a time with the DM to run it</p></li>
<li><p><strong>Travel</strong>: The party travels to their destination, advancing world time and dealing with issues that arrive en route (random encounters, adverse conditions, unexpected geographic updates, etc)</p></li>
<li><p><strong>Action</strong>: A normal D&amp;D game occurs</p></li>
<li><p><strong>Return</strong>: The party returns to a civilized area. This is similar to the travel part but less eventful.</p></li>
<li><p><strong>Bookkeeping</strong>: Loot is divided, xp is awarded, and logs are written. Total world time advanced is announced.</p></strong>
</ol>
<p>Planning will take place electronically, however the rest of the parts will be in person.</p>
</li>
<li><p>When time advances and the character is not going on the mission, they can participate in a downtime activity</p>
<p>Time advances when players set out on a mission, when all players agree to wait, and one in game day per day.</p>
<p>Downtime actions allowed are as follows:</p>
<ul id="dtimeActions">
<li><p><strong>Work</strong>: You gain 2d8 times your proficiency bonus gold for each day worked</p></li><!-- This might need balancing -->
<li><p><strong>Study Trade</strong>: You gain proficiency in a tool for every two weeks of downtime. You can learn up to your int mod number of tools this way.</p></li>
<li><p><strong>Study Language</strong>: You learn a language in an amount of time dependent on the language acquisition table. You can learn up to your int mod number of languages this way.</p></li>
<li><p><strong>Craft Item</strong>: You use tools you are proficient in to create an item. This takes (the item's price divided by 50) days, and costs half the price. Magic items cannot be obtained this way.</p></li>
<li><p><strong>Train</strong>: You practice your fighting to gain xp. You gain (xp to get from your level to next level)/20 xp per day, up to a maximum per downtime session of the xp gained in the last excursion by the party.</p></li>
<li><p><strong>Custom</strong>: Do whatever. Talk it over with the DM.</p></li>
</ul>
<p>Remember, downtime lets you accumulate resources, but it also gives your enemies time to act. There are forces at work in this world you have not even discovered yet.</p>
</li>
<li><p>Areas of the map will exist in one of three states:</p>
<ul>
<li><p><strong>Wild</strong>: The start state. Random encounters occur, and the area is unfit for civilized presence.</p></li>
<li><p><strong>Safe</strong>: Large scale conflicts have been resolved, and a military presence has been established.</p></li>
<li><p><strong>Civilized</strong>: A settlement has been founded and a road constructed leading back to civilization.</p></li>
</ul>
<p>All areas start off Wild except for Santa Ignucia, which is Civilized.</p>
</li>
<li><p>Construction can be ordered by the party and will progress during downtime. There are five types of construction:</p>
<ul>
<li><p><strong>Military</strong>: Has a sphere of influence and a combat rating. Within the radius travelable in the specific time, the military will prevent encounters that give less xp than its combat rating. If all encounters for an area are prevented, the area is made Safe. Can be constructed anywhere; see the <a href="#milCon">military construction</a> table.<p></li>
<li><p><strong>Settlement</strong>: Civilizes an area and will provide the players with supplies and lodging. Can be built within a military sphere of influence in a Safe area. A settlement costs 10000 gold to build and takes 3 days + travel time to set up. See the <a href="#setCon">settlement construction</a> table for upgrades.<p></li>
<li><p><strong>Road</strong>: Reduces travel time and connects settlements to civilization. Can be built at 1/10th travel speed for 20 gold per mile in any Safe area.<p></li>
<li><p><strong>Bridge</strong>: Can be built in a Safe area. See the <a href="#bridgeCon">bridge construction</a> table.<p></li>
<li><p><strong>Custom</strong>: Build a something. Talk to the DM about it.<p></li>
</ul>
</li>
</ul>
<h2>Tables</h2>
<h4>Travel time table</h4>
<table id="travel">
<tr>
<th>Pace</th>
<th>Miles per Hour</th>
<th>Hours traveled</th>
<th>Exhaustion Con Check DC</th>
</tr>
<tr>
<td>Slow</td>
<td>2<br></td>
<td>8</td>
<td>-</td>
</tr>
<tr>
<td>Standard</td>
<td>3<br></td>
<td>8</td>
<td>-</td>
</tr>
<tr>
<td>Quick</td>
<td>4</td>
<td>8</td>
<td>10</td>
</tr>
<tr>
<td>Grueling</td>
<td>4</td>
<td>12</td>
<td>15</td>
</tr>
<tr>
<td>Inhumane</td>
<td>4</td>
<td>16</td>
<td>20</td>
</tr>
<tr>
<td>Difficult Terrain (Swamp, Jungle, etc.)</td>
<td>x 1/2</td>
<td>-</td>
<td>-</td>
</tr>
<tr>
<td>Very Difficult Terrain (Mountain, Volcano, etc.)</td>
<td>x 1/4</td>
<td>-</td>
<td>-</td>
</tr>
<tr>
<td>Adverse weather (Desert, Tundra, etc.)</td>
<td>-</td>
<td>-</td>
<td>+2 (min 12)</td>
</tr>
</table>
<h4>Foraging dc table</h4>
<table id="forTable">
<tr>
<th>Amount of food</th>
<th>DC</th>
</tr>
<tr>
<td>Abundant</td>
<td>10</td>
</tr>
<tr>
<td>Normal</td>
<td>14</td>
</tr>
<tr>
<td>Scarce</td>
<td>18</td>
</tr>
<tr>
<td>Winter</td>
<td>+2</td>
</tr>
<tr>
<td>Summer</td>
<td>-2</td>
</tr>
</table>
<h4>Language acquisition table</h4>
<table id="langAc">
<tr>
<th>Language Difficulty</th>
<th>Time Required To Learn (Days)</th>
</tr>
<tr>
<td>Well Known (Halfling, Elvish, Dwarven, etc.) </td>
<td>14</td>
</tr>
<tr>
<td>Foreign (Draconic, Giant, Orc, etc.)</td>
<td>28</td>
</tr>
<tr>
<td>Otherworldly (Deep Speech, Celestial, Abyssal, etc.)</td>
<td>56</td>
</tr>
<tr>
<td>Friendly with native speaker</td>
<td>x 1/2</td>
</tr>
<tr>
<td>Access to large corpus of language</td>
<td>x 3/4</td>
</tr>
</table>
<h4>Military construction table</h4>
<table id="milCon">
<tr>
<th>Military Building</th>
<th>Sphere of Influence</th>
<th>Cost to Buld</th>
<th>Combat Rating</th>
</tr>
<tr>
<td>Camp</td>
<td>8 hours</td>
<td><br>1000 gold</td>
<td>2000 xp</td>
</tr>
<tr>
<td>Outpost<br></td>
<td>16 hours</td>
<td>2000 gold</td>
<td>5500 xp</td>
</tr>
<tr>
<td>Keep</td>
<td>24 hours</td>
<td>3000 gold</td>
<td>8500 xp</td>
</tr>
<tr>
<td>Castle</td>
<td>32 hours</td>
<td>4000 gold</td>
<td>12000 xp</td>
</tr>
<tr>
<td>Fortress</td>
<td>40 hours</td>
<td>5000 gold</td>
<td>18000 xp</td>
</tr>
<tr>
<td>Citadel</td>
<td>48 hours</td>
<td>6000 gold</td>
<td>25500 xp</td>
</tr>
</table>
<h4>Settlement construction table</h4>
<table id="setCon">
<tr>
<th>Building Type</th>
<th>Cost</th>
<th>Effect</th>
</tr>
<tr>
<td>Stables<br></td>
<td>1000 gold</td>
<td>Can purchase and store mounts. +25% sphere of influence to nearest military building.</td>
</tr>
<tr>
<td>Mason Workshop</td>
<td>2000 gold</td>
<td>Construct buildings and roads to and from this settlement twice as fast. Provides 200 gold per week towards construction in income.</td>
</tr>
<tr>
<td>School</td>
<td>5000 gold<br></td>
<td>Doubles income from this settlement.</td>
</tr>
<tr>
<td>Blacksmith Workshop</td>
<td>3000 gold</td>
<td>Can purchase weapons and armor. +50% combat rating to nearest military building. Provides 300 gold per week towards construction in income.</td>
</tr>
<tr>
<td>Farm</td>
<td>1000 gold</td>
<td>Provides 100 gold per week towards construction in income.</td>
</tr>
<tr>
<td>Temple</td>
<td>4000 gold</td>
<td>Can purchase healing potions and casts of remove curse and restoration.</td>
</tr>
<tr>
<td>Alchemy Tower</td>
<td>4000 gold</td>
<td>Purchase alchemical items. Provides 400 gold per week towards construction in income.</td>
</tr>
<tr>
<td>Hospital</td>
<td>6000 gold</td>
<td>Heal to full HP in one day when staying in this settlement.</td>
</tr>
</table>
<h4>Bridge construction table</h4>
<table id="bridgeCon">
<tr>
<th>Bridge Size</th>
<th>Time to Build</th>
<th>Cost<br></th>
</tr>
<tr>
<td>Small (stream, gap &lt; 40 feet)</td>
<td>3 days</td>
<td>500 gold<br></td>
</tr>
<tr>
<td>Medium (wide river, chasm)</td>
<td>10 days<br></td>
<td>2000 gold</td>
</tr>
<tr>
<td>Large (lake, canyon, crater)</td>
<td>24 days<br></td>
<td>5000 gold</td>
</tr>
</table>
<a class="topLink" href="#">Scroll to Top</a>
{% endblock %}

1
app/templates/marches.html

@ -6,6 +6,7 @@
<li><a href="marches/worlds/{{w}}">{{w}}</a></li>
{% endfor %}
</ul>
<h2><a href="/campaign_info">The Campaign</a><h2>
<h2>How to join</h2>
<p>There are four ways to join COSI West Marches.</p>
<ol>

Loading…
Cancel
Save