diff options
| -rw-r--r-- | .gitignore | 4 | ||||
| -rw-r--r-- | bloodfields.stage | 2 | ||||
| -rw-r--r-- | default.bld | 11 | ||||
| -rw-r--r-- | sml-help.sml | 18 | ||||
| -rw-r--r-- | src/options.cpp | 25 | ||||
| -rw-r--r-- | support/vim/syntax/stage.vim | 2 |
6 files changed, 53 insertions, 9 deletions
| @@ -6,3 +6,7 @@ stage*.zip | |||
| 6 | *.o | 6 | *.o |
| 7 | *.win_o | 7 | *.win_o |
| 8 | libbu++ | 8 | libbu++ |
| 9 | libgats | ||
| 10 | src/datafiles.cpp | ||
| 11 | src/datafiles.h | ||
| 12 | *.dll | ||
diff --git a/bloodfields.stage b/bloodfields.stage index bfef7ba..861fdb7 100644 --- a/bloodfields.stage +++ b/bloodfields.stage | |||
| @@ -98,7 +98,7 @@ function mkEnemy() | |||
| 98 | global.enemy = global.enemyTypes[eid]; | 98 | global.enemy = global.enemyTypes[eid]; |
| 99 | 99 | ||
| 100 | mod = player.level; | 100 | mod = player.level; |
| 101 | if mod > count(global.enemyMods) then | 101 | if mod > count(global.enemyMods) - 1 then |
| 102 | { | 102 | { |
| 103 | mod = count(global.enemyMods); | 103 | mod = count(global.enemyMods); |
| 104 | } | 104 | } |
diff --git a/default.bld b/default.bld index b35ee6a..6f9feeb 100644 --- a/default.bld +++ b/default.bld | |||
| @@ -10,7 +10,7 @@ if exists("src/parser.tab.cpp") then | |||
| 10 | 10 | ||
| 11 | action "default" | 11 | action "default" |
| 12 | { | 12 | { |
| 13 | build: ["src/version.h", "stage"]; | 13 | build: ["src/version.h", "src/datafiles.h", "stage"]; |
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | target "src/version.h" | 16 | target "src/version.h" |
| @@ -41,6 +41,15 @@ target "src/version.h" | |||
| 41 | } | 41 | } |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | target "src/datafiles.h" | ||
| 45 | { | ||
| 46 | input ["sml-help.sml"]; | ||
| 47 | profile "build" | ||
| 48 | { | ||
| 49 | execute("bin2cpp -d src -f deflate sml-help.sml"); | ||
| 50 | } | ||
| 51 | } | ||
| 52 | |||
| 44 | CC="g++"; | 53 | CC="g++"; |
| 45 | target "stage" | 54 | target "stage" |
| 46 | { | 55 | { |
diff --git a/sml-help.sml b/sml-help.sml new file mode 100644 index 0000000..74ac686 --- /dev/null +++ b/sml-help.sml | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | SML - STAGE Markup Language help[break][break] | ||
| 2 | SML has two types of tags, unary tags stand on their own and are fenced by | ||
| 3 | square brackets like \[break]. Putting a \[braek] in anywhere will add a | ||
| 4 | paragraph break. This is the only way to insert a newline manually, as SML will | ||
| 5 | reformat your text to fit the available space automatically. | ||
| 6 | [break] | ||
| 7 | There are also binary tags, which contain text and let you change the formatting | ||
| 8 | in a variety of ways. For example, you can set the [yellow>color of some | ||
| 9 | text<yellow]. Binary tags start with \[tagname> and end with \<tagname]. | ||
| 10 | [break][break] | ||
| 11 | Color tags:[break] | ||
| 12 | \[green>[green>Green<green]\<green] [break] | ||
| 13 | \[red>[red>Red<red]\<red] [break] | ||
| 14 | \[yellow>[yellow>Yellow<yellow]\<yellow] [break] | ||
| 15 | \[blue>[blue>Blue<blue]\<blue] [break] | ||
| 16 | \[magenta>[magenta>Magenta<magenta]\<magenta] [break] | ||
| 17 | \[cyan>[cyan>Cyan<cyan]\<cyan] [break] | ||
| 18 | \[white>[white>White<white]\<white] | ||
diff --git a/src/options.cpp b/src/options.cpp index 93a29bc..3fff4dc 100644 --- a/src/options.cpp +++ b/src/options.cpp | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include <bu/sio.h> | 11 | #include <bu/sio.h> |
| 12 | #include <gats/gatsstream.h> | 12 | #include <gats/gatsstream.h> |
| 13 | #include <gats/types.h> | 13 | #include <gats/types.h> |
| 14 | #include "datafiles.h" | ||
| 14 | 15 | ||
| 15 | #include <bu/deflate.h> | 16 | #include <bu/deflate.h> |
| 16 | 17 | ||
| @@ -108,7 +109,7 @@ int Options::smlTest( Bu::Array<Bu::String> aArgs ) | |||
| 108 | fIn.close(); | 109 | fIn.close(); |
| 109 | 110 | ||
| 110 | SmlNode *pRoot = SmlNode::parse( sContent ); | 111 | SmlNode *pRoot = SmlNode::parse( sContent ); |
| 111 | sio << *pRoot << sio.nl; | 112 | // sio << *pRoot << sio.nl; |
| 112 | 113 | ||
| 113 | try | 114 | try |
| 114 | { | 115 | { |
| @@ -130,12 +131,24 @@ int Options::smlTest( Bu::Array<Bu::String> aArgs ) | |||
| 130 | 131 | ||
| 131 | int Options::smlHelp( Bu::Array<Bu::String> aArgs ) | 132 | int Options::smlHelp( Bu::Array<Bu::String> aArgs ) |
| 132 | { | 133 | { |
| 133 | Bu::File fIn("sml-help.sml.gz", Bu::File::Read ); | 134 | Bu::String sContent = Datafiles::getString("sml-help.sml"); |
| 134 | Bu::Deflate dIn( fIn ); | 135 | SmlNode *pRoot = SmlNode::parse( sContent ); |
| 135 | char buf[4096]; | 136 | |
| 136 | buf[dIn.read( buf, 4096 )] = '\0'; | 137 | try |
| 137 | printf("%s\n", buf ); | 138 | { |
| 139 | InterfacePlugger &ip = InterfacePlugger::getInstance(); | ||
| 140 | Interface *pIface = ip.instantiate( sInterface ); | ||
| 141 | pIface->display( pRoot ); | ||
| 142 | ip.destroy( pIface ); | ||
| 143 | } | ||
| 144 | catch( Bu::HashException &e ) | ||
| 145 | { | ||
| 146 | sio << "No such interface found." << sio.nl; | ||
| 147 | } | ||
| 148 | |||
| 149 | delete pRoot; | ||
| 138 | 150 | ||
| 151 | exit( 0 ); | ||
| 139 | return 0; | 152 | return 0; |
| 140 | } | 153 | } |
| 141 | 154 | ||
diff --git a/support/vim/syntax/stage.vim b/support/vim/syntax/stage.vim index 6009d80..313760f 100644 --- a/support/vim/syntax/stage.vim +++ b/support/vim/syntax/stage.vim | |||
| @@ -19,7 +19,7 @@ syn keyword Statement setup enter | |||
| 19 | syn keyword Todo TODO FIXME XXX | 19 | syn keyword Todo TODO FIXME XXX |
| 20 | syn keyword Type function command situation game global player option | 20 | syn keyword Type function command situation game global player option |
| 21 | syn keyword Constant null true false | 21 | syn keyword Constant null true false |
| 22 | syn keyword Builtins display goto exists delete exit return random integer float string debugString keys join | 22 | syn keyword Builtins display goto exists delete exit return random integer float string debugString keys join count |
| 23 | 23 | ||
| 24 | syn cluster CommentGroup contains=Todo | 24 | syn cluster CommentGroup contains=Todo |
| 25 | 25 | ||
