Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
fergusq committed Nov 16, 2014
0 parents commit 707c0aa
Show file tree
Hide file tree
Showing 82 changed files with 7,407 additions and 0 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Copyright (c) 2011 stravant
Copyright (c) 2014 Iikka Hauhio

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
all: clear classes

clear:
echo "" >build/game/joku.class
rm build/*/*.class

classes:
javac -sourcepath src -cp build src/game/TestApp.java -d build

build/game/WMain.class: src/game/WMain.java
javac -sourcepath src src/game/WMain.java -d build

nightfall.jar: build/game/WMain.class
jar cvf nightfall.jar -C build/ .
1 change: 1 addition & 0 deletions build/res/AgentData.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Binary file added build/res/AgentTurnDone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions build/res/BattleData.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
1 change: 1 addition & 0 deletions build/res/MessageData.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
14 changes: 14 additions & 0 deletions build/res/NodeData.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"nodes" : [
{
"name" : "game/main",
"title" : "Root node",
"desc" : "ROOT",
"image" : "NodeHQ.png",
"pos" : [ 0, 0 ],
"warez" : [],
"status" : "open"
}
],
"links" : []
}
Binary file added build/res/NodeHQ.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/res/NodePharmHaus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions build/res/SaveData.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"inventory" : {
"agents" : [],
"credits" : 0
},
"defeated" : [
"game/main"
]
}
Binary file added build/res/TileCredit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/res/TileOverlayMod.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/res/TileOverlayMove.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/res/TileOverlayMoveTo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/res/TileOverlayMoveToDown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/res/TileOverlayMoveToLeft.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/res/TileOverlayMoveToRight.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/res/TileOverlayMoveToUp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/res/TileOverlayNeg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/res/TileOverlayPos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/res/TileOverlaySel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/res/TileOverlaySel2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/res/TileOverlayUpload.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/res/scroll-down.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/res/scroll-left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/res/scroll-right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/res/scroll-up.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions jarplay.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<html>
<body>
<applet archive="nightfall.jar" code="game/TestApp.class" width=1000 height=600></applet>
</body>
</html>
5 changes: 5 additions & 0 deletions play.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<html>
<body>
<applet codebase="build" code="game/TestApp.class" width=300 height=300></applet>
</body>
</html>
20 changes: 20 additions & 0 deletions play.jnlp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+"
href="play.jnlp">
<information>
<title>Nightfall</title>
<vendor>Iikka</vendor>
</information>
<resources>
<!-- Application Resources -->
<j2se version="1.7+"
href="http://java.sun.com/products/autodl/j2se"/>
<jar href="nightfall.jar" />

</resources>
<security>
<all-permissions/>
</security>
<applet-desc main-class="game.TestApp" name="Nightfall" width="1000" height="600">
</applet-desc>
</jnlp>
252 changes: 252 additions & 0 deletions ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,252 @@
<html>
<head>
<title>Java-nightfall Data File Reference</title>
</head>
<body>

<h1>Java-nightfall Reference</h1>

<h2>NodeData.json</h2>

<table border=1>
<tr><th colspan=4 style="padding:10px;">Root Node</th></tr>
<tr><th>Name</th><th>Value</th><th>Default value</th><th>Description</th></tr>
<tr><td>"nodes"</td>
<td><tt>[</tt><i>node...</i><tt>]</tt></td><td><b>REQUIRED</b></td>
<td>The list of nodes</td></tr>
<tr><td>"links"</td>
<td><tt>[[</tt><i>nodename</i><tt>,</tt> <i>nodename</i><tt>]<i>...</i>]</tt></td><td><b>REQUIRED</b></td>
<td>A list of links between nodes</td></tr>

<tr><th colspan=4 style="padding:10px;">node</th></tr>
<tr><th>Name</th><th>Value</th><th>Default value</th><th>Description</th></tr>
<tr><td>"name"</td>
<td><i>string</i></td><td><b>REQUIRED</b></td>
<td>The name used to indentify node in the code</td></tr>
<tr><td>"title"</td>
<td><i>string</i></td><td><b>REQUIRED</b></td>
<td>The name of the node shown to the user</td></tr>
<tr><td>"desc"</td>
<td><i>string</i></td><td><b>REQUIRED</b></td>
<td>The description of the node</td></tr>
<tr><td>"image"</td>
<td><i>string</i></td><td><b>REQUIRED</b></td>
<td>The icon of the node</td></tr>
<tr><td>"pos"</td>
<td><tt>[</tt><i>integer</i><tt>,</tt> <i>integer</i><tt>]</tt></td><td><b>REQUIRED</b></td>
<td>The position of the node</td></tr>
<tr><td>"battle"</td>
<td><i>string</i></td><td><b>REQUIRED IF "warez" IS NOT PRESENT</b></td>
<td>The databattle</td></tr>
<tr><td>"warez"</td>
<td><tt>[</tt><i>item...</i><tt>]</tt></td><td><b>REQUIRED IF "battle" IS NOT PRESENT</b></td>
<td>The list of warez items</td></tr>
<tr><td>"status"</td>
<td><tt>"unknown"</tt>, <tt>"visible"</tt> or <tt>"open"</tt></td><td><tt>"unknown"</tt></td>
<td>The status of the node</td></tr>

<tr><th colspan=4 style="padding:10px;">item</th></tr>
<tr><th>Name</th><th>Value</th><th>Default value</th><th>Description</th></tr>
<tr><td>"agent"</td>
<td><i>string</i></td><td><b>REQUIRED</b></td>
<td>The name of the agent</td></tr>
<tr><td>"value"</td>
<td><i>integer</i></td><td><b>REQUIRED</b></td>
<td>The value of the item</td></tr>
</table>

<h2>BattleData.json</h2>

<b>The root node is a list</b>
<br/>
<table border=1>
<tr><th colspan=4 style="padding:10px;">battle</th></tr>
<tr><th>Name</th><th>Value</th><th>Default value</th><th>Description</th></tr>
<tr><td>"name"</td>
<td><i>string</i></td><td><b>REQUIRED</b></td>
<td>The name used to indentify battle in the code</td></tr>
<tr><td>"size"</td>
<td><tt>[</tt><i>integer</i><tt>,</tt> <i>integer</i><tt>]</tt></td><td><b>REQUIRED</b></td>
<td>The size of the battle</td></tr>
<tr><td>"uploads"</td>
<td><tt>[</tt><tt>[</tt><i>integer</i><tt>,</tt> <i>integer</i><tt>]</tt><i>...</i><tt>]</tt></td><td><b>REQUIRED</b></td>
<td>The list of upload slot locations</td></tr>
<tr><td>"units"</td>
<td><tt>[</tt><i>unit...</i><tt>]</tt></td><td><b>REQUIRED</b></td>
<td>The list of enemy units</td></tr>
<tr><td>"credits"</td>
<td><tt>[</tt><i>credit...</i><tt>]</tt></td><td><b>REQUIRED</b></td>
<td>The list of credit slots</td></tr>
<tr><td>"reward"</td>
<td><i>integer</i></td><td><tt>0</tt></td>
<td>The credit bonus</td></tr>

<tr><th colspan=4 style="padding:10px;">unit</th></tr>
<tr><th>Name</th><th>Value</th><th>Default value</th><th>Description</th></tr>
<tr><td>"name"</td>
<td><i>string</i></td><td><b>REQUIRED</b></td>
<td>The name of the agent</td></tr>
<tr><td>"pos"</td>
<td><tt>[</tt><i>integer</i><tt>,</tt> <i>integer</i><tt>]</tt></td><td><b>REQUIRED</b></td>
<td>The position of the agent</td></tr>

<tr><th colspan=4 style="padding:10px;">credit</th></tr>
<tr><th>Name</th><th>Value</th><th>Default value</th><th>Description</th></tr>
<tr><td>"amount"</td>
<td><i>integer</i></td><td><b>REQUIRED</b></td>
<td>The amount</td></tr>
<tr><td>"pos"</td>
<td><tt>[</tt><i>integer</i><tt>,</tt> <i>integer</i><tt>]</tt></td><td><b>REQUIRED</b></td>
<td>The position of the agent</td></tr>
</table>

<h2>MessageData.json</h2>

<b>The root node is a list</b>
<br/>
<table border=1>
<tr><th colspan=4 style="padding:10px;">message</th></tr>
<tr><th>Name</th><th>Value</th><th>Default value</th><th>Description</th></tr>
<tr><td>"name"</td>
<td><i>string</i></td><td><b>REQUIRED</b></td>
<td>The name used to indentify message in the code</td></tr>
<tr><td>"title"</td>
<td><i>string</i></td><td><b>REQUIRED</b></td>
<td>The title of the message</td></tr>
<tr><td>"text"</td>
<td><i>string</i></td><td><b>REQUIRED</b></td>
<td>The content of the message</td></tr>
<tr><td>"image"</td>
<td><i>string</i></td><td><b>REQUIRED</b></td>
<td>The avatar of the sender</td></tr>
<tr><td>"show after"</td>
<td><i>event</i></td><td><b>NOT REQUIRED</b></td>
<td>Show the message after this event</td></tr>
<tr><td>"buttons"</td>
<td><tt>[</tt><i>button...</i><tt>]</tt></td><td><b>REQUIRED</b></td>
<td>Buttons</td></tr>

<tr><th colspan=4 style="padding:10px;">event</th></tr>
<tr><th>Name</th><th>Value</th><th>Default value</th><th>Description</th></tr>
<tr><td>"event"</td>
<td><tt>"victory"</tt>,<br/><tt>"defeat"</tt><br/>or <tt>"newgame"</tt></td><td><b>REQUIRED</b></td>
<td>A victory event is fired when players wins a level and a defeat level when a level is lost. The newgame event is fired on the very first time the player opens the game.</td></tr>
<tr><td>"battle"</td>
<td><i>string</i></td><td><b>REQUIRED IF THE EVENT IS "victory" OR "defeat"</b></td>
<td>The databattle player wins or loses</td></tr>

<tr><th colspan=4 style="padding:10px;">button</th></tr>
<tr><th>Name</th><th>Value</th><th>Default value</th><th>Description</th></tr>
<tr><td>"text"</td>
<td><i>string</i></td><td><b>REQUIRED</b></td>
<td>The text</td></tr>
<tr><td>"onclick"</td>
<td><tt>[</tt><i>action...</i><tt>]</tt></td><td><b>REQUIRED</b></td>
<td>A list of actions</td></tr>

<tr><th colspan=4 style="padding:10px;">action</th></tr>
<tr><th>Name</th><th>Value</th><th>Default value</th><th>Description</th></tr>
<tr><td>"action"</td>
<td><tt>"close"</tt>,<br/>
<tt>"show message"</tt>,<br/>
<tt>"open databattle"</tt>,<br/>
<tt>"open node"</tt>,<br/>
<tt>"set visible"</tt>,<br/>
<tt>"give agent"</tt><br/>
or <tt>"give credit"</tt></td><td><b>REQUIRED</b></td>
<td>The name of the action.
<ul><li>"close" closes the message window.</li>
<li>"show message" opens a new message.</li>
<li>"open databattle" opens a databattle (node, if present, is not marked defeated in victory).</li>
<li>"open node" opens a databattle in a node.</li>
<li>"set visible" sets a node visible, but not playable.</li>
<li>"give agent" gives a new agent to the player.</li>
<li>"give credit" gives some credit to the player.</li></ul></td></tr>
<tr><td>"name"</td>
<td><i>string</i></td><td><b>REQUIRED IF THE ACTION IS "show message", "open databattle", "open node", "set visible" OR "give agent"</b></td>
<td>The name of the message, databattle, node or agent.</td></tr>
<tr><td>"amount"</td>
<td><i>integer</i></td><td><b>REQUIRED IF THE ACTION IS "give credit"</b></td>
<td>The amount credit given.</td></tr>
</table>

<h2>AgentData.json</h2>

<b>The root node is a list</b>
<br/>
<table border=1>
<tr><th colspan=4 style="padding:10px;">agent</th></tr>
<tr><th>Name</th><th>Value</th><th>Default value</th><th>Description</th></tr>
<tr><td>"name"</td>
<td><i>string</i></td><td><b>REQUIRED</b></td>
<td>The name used to indentify message in the code</td></tr>
<tr><td>"desc"</td>
<td><i>string</i></td><td><b>REQUIRED</b></td>
<td>The description</td></tr>
<tr><td>"color"</td>
<td><tt>"rrggbb"</tt></td><td><b>REQUIRED</b></td>
<td>The color of the agent</td></tr>
<tr><td>"thumb"</td>
<td><i>string</i></td><td><b>REQUIRED</b></td>
<td>The agent icon</td></tr>
<tr><td>"move"</td>
<td><i>integer</i></td><td><b>REQUIRED</b></td>
<td>The speed of the agent.</td></tr>
<tr><td>"size"</td>
<td><i>integer</i></td><td><b>REQUIRED</b></td>
<td>The max size of the agent.</td></tr>
<tr><td>"abilities"</td>
<td><tt>[</tt><i>ability...</i><tt>]</tt></td><td><b>REQUIRED</b></td>
<td>The abilities</td></tr>

<tr><th colspan=4 style="padding:10px;">ability</th></tr>
<tr><th>Name</th><th>Value</th><th>Default value</th><th>Description</th></tr>
<tr><td>"source"</td>
<td><tt>"BasicAttack"</tt>,<br/>
<tt>"SelfHarmingAttack"</tt>,<br/>
<tt>"ExpandTail"</tt>,<br/>
<tt>"ModifyProperties"</tt><br/>
or <tt>"ModifyGrid"</tt></td><td><b>REQUIRED</b></td>
<td>The ability source.
<ul><li>"BasicAttack" a basic attack.</li>
<li>"SelfHarmingAttack" an attack wich harms both the targent and the agent.</li>
<li>"ExpandTail" expands the tail of the target.</li>
<li>"ModifyProperties" modifies the max size and the move speed of the target.</li>
<li>"ModifyGrid" Adds or deletes sectors.</li></ul></td></tr>
<tr><td>"params"</td>
<td><i>sourceparams</i></td><td><b>REQUIRED</b></td>
<td>A list of parameters to the source.</td></tr>

<tr><th colspan=4 style="padding:10px;">sourceparams</th></tr>
<tr><th>Name</th><th>Value</th><th>Default value</th><th>Description</th></tr>
<tr><td>"name"</td>
<td><i>string</i></td><td><b>REQUIRED</b></td>
<td>The name</td></tr>
<tr><td>"desc"</td>
<td><i>string</i></td><td><b>REQUIRED</b></td>
<td>The description</td></tr>
<tr><td>"range"</td>
<td><i>integer</i></td><td><b>REQUIRED</b></td>
<td>The range of the ability.</td></tr>
<tr><td>"minsize"</td>
<td><i>integer</i></td><td><b>REQUIRED</b></td>
<td>The min size required to perform.</td></tr>
<tr><td>"self damage"</td>
<td><i>integer</i></td><td><b>REQUIRED IF THE ABILITY IS NOT "BasicAttack"</b></td>
<td>The damage to the performer.</td></tr>
<tr><td>"damage"</td>
<td><i>integer</i></td><td><b>REQUIRED IF THE ABILITY IS "BasicAttack" OR "SelfHarmingAttack"</b></td>
<td>The damage to the target.</td></tr>
<tr><td>"move"</td>
<td><i>integer</i></td><td><b>REQUIRED IF THE ABILITY IS "ModifyProperties"</b></td>
<td>The change of the move speed.</td></tr>
<tr><td>"rsize"</td>
<td><i>integer</i></td><td><b>REQUIRED IF THE ABILITY IS "ModifyProperties"</b></td>
<td>The change of the max size.</td></tr>
<tr><td>"type"</td>
<td><tt>true</tt> or <tt>false</tt></td><td><b>REQUIRED IF THE ABILITY IS "ModifyGrid"</b></td>
<td>True adds sectors and false removes sectors.</td></tr>
</table>

</body>
</html>
Loading

0 comments on commit 707c0aa

Please sign in to comment.