From 2f1c213d6d5aed8ae7b4659bd82d710f5b19623a Mon Sep 17 00:00:00 2001
From: GeneralGuy4872
Date: Fri, 20 Sep 2019 17:50:43 -0500
Subject: [PATCH] push commit from localhost
---
README.md | 86 ++++--
src/dependencies.ini | 206 ++++++++++++++
...tension_parser.h => dummy_extensionlang.h} | 0
src/game_default_header.h | 1 +
src/iwannaflycurses.messy | 260 ++++++++++--------
src/paths.h | 7 +
src/questdialogs/scene.nfo | 13 +
7 files changed, 432 insertions(+), 141 deletions(-)
create mode 100644 src/dependencies.ini
rename src/extensionlanguage/{dummy_extension_parser.h => dummy_extensionlang.h} (100%)
create mode 100644 src/game_default_header.h
create mode 100644 src/paths.h
create mode 100644 src/questdialogs/scene.nfo
diff --git a/README.md b/README.md
index 98c8546..c9bfe9b 100644
--- a/README.md
+++ b/README.md
@@ -16,36 +16,64 @@ Iwannafly
=========
*roguelike game with plugin interface written in C useing minimal propagating dependencies*
-Prerequisits
-------------
+Dependencies:
+(listed by file to be distro-independent)
+
+Build Deps:
+- sh
+- cc
+- ld
+- awk
maybe?
+- flex
+- byacc
+- make
+
+Depends (libraries by header):
+- \
+- \
+- \
+- \
+- \
+- \
+- \
+- \
+- \
+- \
+- \
+- \
+- \
+- \
+- \
+- \
+- \
+- \
+- \
+- \
+- \
+- \
+- \
+- \
+- \
+- \
+
+Recommends:
+- xterm
, unicode, color
+- /usr/share/fonts/X11/misc/6x13.*
+ aka -Misc-Fixed-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO10646-1
+
+Dev Suggests:
+- m4
+- gpp
+- awk
+- emacs
|| vim
+
+Doc Depends:
+- man
-Libraries:
-- stdlib.h
-- stdio.h
-- stdbool.h
-- stdint.h
-- math.h
-- limits.h
-- time.h
-- string.h
-- ctype.h
-- uchar.h
-- dlfcn.h
-- unistd.h
-- signal.h
-- locale.h
-- regex.h
-- glob.h
-- sys/types.h
-- sys/ioctl.h
-- fcntl.h
-- sys/stat.h
-- libtar.h
-- zlib.h
-- libbz2.h
-- ncursesw/ncurses.h
-- menu.h
-- forms.h
+Doc Recommends:
+- some browser foo
+- some texinfo foo
+- xdvi
Obfuscated C
------------
diff --git a/src/dependencies.ini b/src/dependencies.ini
new file mode 100644
index 0000000..e484f4e
--- /dev/null
+++ b/src/dependencies.ini
@@ -0,0 +1,206 @@
+;dependencies that are implicitly fufilled by inheritance are not shown
+;cross-calling of source is marked with depends
+;calling of shared libraries is marked extern
+;#include is marked includes or from
+;incompatible headers are marked conflicts
+
+[main.h]
+from=main.c
+conflicts=dummy.h
+
+[main.c]
+output=libiwannafly_ncurses.xso
+includes=main.h
+includes=util.c
+includes=greedy.c
+includes=mapgen.c
+includes=version_extensionlang.h
+includes=version_runcommander.h
+includes=version_midibasic.h
+
+[util.c]
+from=main.c
+depends=main.h
+
+[dummy.h]
+from=game_default.h
+conflicts=main.h
+
+[astar.c]
+from=greedy.c
+
+[dijkstra.c]
+from=greedy.c
+
+[greedy.h]
+from=greedy.c
+depends=main.h
+
+[greedy.c]
+from=main.c
+depends=util.c
+includes=greedy.h
+includes=ai.c
+includes=dijkstra.c
+includes=astar.c
+
+[mapgen.h]
+from=mapgen.c
+depends=main.h
+depends=greedy.h
+
+[mapgen.c]
+from=main.h
+depends=util.c
+includes=mapgen.h
+depends=greedy.c
+
+[ai.c]
+from=greedy.c
+
+[extensionlang.lex]
+from=extensionlang.c
+from=extensionlang_wrapper.c
+
+[extensionlang.y]
+from=extensionlang.c
+from=extensionlang_wrapper.c
+
+[extensionlang.h]
+from=extensionlang.c
+from=extensionlang_wrapper.c
+conflicts=dummy_extensionlang.h
+conflicts=version_extensionlang.h
+
+[extensionlang_wrapper.c]
+output=libiwannafly_ncurses_extensionlangi.so
+includes=extensionlang.lex
+includes=extensionlang.y
+includes=extensionlang.h
+
+[extensionlang.c]
+output=libiwannafly_ncurses_extensionlangc.o
+includes=extensionlang.lex
+includes=extensionlang.y
+includes=extensionlang.h
+
+[dummy_extensionlang.h]
+from=game_default_exec.c
+from=game_default_new.c
+from=game_default_editor.c
+conflicts=extensionlang.h
+conflicts=version_extensionlang.h
+
+[version_extensionlang.h]
+conflicts=extensionlang.h
+conflicts=dummy_extensionlang.h
+
+[runcommander.lex]
+from=runcommander.c
+
+[runcommander.y]
+from=runcommander.c
+
+[runcommander.h]
+from=runcommander.c
+conflicts=dummy_runcommander.h
+conflicts=version_runcommander.h
+
+[runcommander.c]
+output=libiwannafly_ncurses_runcommander.so
+includes=runcommander.lex
+includes=runcommander.y
+includes=runcommander.h
+
+[dummy_runcommander.h]
+conflicts=runcommander.h
+conflicts=version_runcommander.h
+
+[version_runcommander.h]
+conflicts=runcommander.h
+conflicts=dummy_runcommander.h
+
+[midibasic.lex]
+
+[midibasic.y]
+
+[midibasic.h]
+conflicts=version_midibasic.h
+
+[midibasic.c]
+output=libiwannafly_midibasic.o
+includes=midibasic.lex
+includes=midibasic.y
+includes=midibasic.h
+
+[version_midibasic.h]
+conflicts=midibasic.h
+
+[game_default.c]
+includes=game_default.h
+extern=libiwannafly_ncurses.so
+
+[game_default.h]
+includes=dummy.h
+
+[game_default_exec.c]
+output=iwannafly_ncurses_default.o
+includes=game_default.c
+includes=dummy_extensionlang.h
+extern=iwannafly_ncurses_extensionlangi.so
+
+[game_default_new.c]
+output=iwannafly_ncurses_default_newgame.o
+includes=game_default.c
+includes=dummy_runcommander.h
+extern=libiwannafly_ncurses_runcommander.so
+includes=dummy_extensionlang.h
+extern=iwannafly_ncurses_extensionlangi.so
+
+[game_default_editor.c]
+output=iwannafly_ncurses_default_editor.o
+includes=game_default.c
+includes=dummy_extensionlang.h
+extern=iwannafly_ncurses_extensionlangi.so
+
+
+
+[libiwannafly_ncurses.so]
+src=main.c
+ld=T
+x=NIL
+
+[libiwannafly_ncurses_runcommander.so]
+src=runcommander.c
+ld=T
+x=NIL
+
+[libiwannafly_ncurses_extensionlangi.so]
+src=extensionlang_wrapper.c
+ld=T
+x=NIL
+
+[libiwannafly_ncurses_extensionlangc.o]
+src=extensionlang.c
+ld=NIL
+x=T
+
+[libiwannafly_midibasic.o]
+src=midibasic.c
+ld=NIL
+x=T
+
+[iwannafly_ncurses_default.o]
+src=game_default_exec.c
+ld=NIL
+x=T
+
+[iwannafly_ncurses_default_newgame.o]
+src=game_default_new.c
+ld=NIL
+x=T
+
+[iwannafly_ncurses_default_editor.o]
+src=game_default_editor.c
+ld=NIL
+x=T
diff --git a/src/extensionlanguage/dummy_extension_parser.h b/src/extensionlanguage/dummy_extensionlang.h
similarity index 100%
rename from src/extensionlanguage/dummy_extension_parser.h
rename to src/extensionlanguage/dummy_extensionlang.h
diff --git a/src/game_default_header.h b/src/game_default_header.h
new file mode 100644
index 0000000..d355a7f
--- /dev/null
+++ b/src/game_default_header.h
@@ -0,0 +1 @@
+const char* GAMEDIR = "default/"
diff --git a/src/iwannaflycurses.messy b/src/iwannaflycurses.messy
index 6b9c4c0..3cfbe26 100644
--- a/src/iwannaflycurses.messy
+++ b/src/iwannaflycurses.messy
@@ -1,6 +1,6 @@
#error NOT READY FOR COMPILATION
/* to preserve the file history,
- * this file will eventually become main.h or main.c.
+ * this file will eventually become main.h, main.c, or util.c
*
* the bulk of it's contents, however, will be moved.
*
@@ -32,7 +32,9 @@
* with this library. if you don't know what "obfuscated" C is, look at the original
* unix v7 source of ye old bourne shell for the definative example.
*
- * the engine should be compiled as a shared object and placed in LD_LOAD_PATH.
+ * the engine should be compiled as a shared object, and installed according to the
+ * values set in paths.h
+ *
* a game compiled for the engine should obey the following conventions:
* - it should provide the bulk of it's functions in a shared library in a private
* application directory
@@ -45,11 +47,6 @@
* - the game itself
* - a seperate program for generating a new savefile
* - a savefile editor
- * the savefile editor may be independent, or linked to the game and new savefile generator,
- * in which case those should be executable shared libraries
- * (the default game invents the xso file extension to denote an eXecutable Shared Object).
- * the effect is that short sessions should have small memory footprints, because they only load
- * a few of the modular libraries, but long marathon-like sessions could be huge.
*
* enviromental requirements:
* - UTF-8 terminal of at least 25*80 characters
@@ -57,8 +54,9 @@
* it is a raster font; monospaced raster fonts are more uniform in width than the majority of vector so-called "monospaced" fonts;
* it is unicode, having a wide range of characters; and
* it is extreamly common, being the default font for the linux console, xterm, and urxvt)
- * - Color, Dim, Bold, Italic, Underline, Reverse, Blink, Invisible text effects
- * (ncurses will take care of this)
+ * - ANSI SGR escape codes and 16 colors outside of NCurses
+ * The engine will recognise the term enviroment and can sent xterm-style OSC strings if they are supported as well
+ * - NCurses with support for A_BOLD, A_ITALIC, A_UNDERLINE, A_DIM, A_BLINK, A_REVERSE, A_INVIS, 8 colors, and 64 color pairs
* - Full Keyboard
* (most keyboard layouts with all ASCII characters *should*
* work, but only QWERTY (US-ANSI) was used in design because
@@ -98,6 +96,13 @@
*
* while the API functions have a simple enough calling convention,
* there is no garuntee that the code underneath is not hundreds of lines long.
+ * the sequence to bring the engine up is:
+ *
+ * termcheck()
+ * enginesplash(name of game,game version,story revision)
+ *
+ * promptload()
+ * engineloop()
*
* the middle layer, or the guts, is where the engine actually happens, and
* it isn't pretty. if you want to change how the game works,
@@ -112,7 +117,7 @@
* formatted. the following are/will be considered part of this layer:
* - anything underneath a call to a parser
* - what goes on inside of the midi threads
- * - the raw calls to the compression libraries
+ * - the code underneath the savefile handling calls
*
* The API should always be backwards-compatable with all versions, from beta to doomsday.
* The Guts may have breaking changes between MAJOR versions, but not otherwise.
@@ -123,11 +128,10 @@
* but is a good start.
*
* an s-expression extension language interpreter will be provided
- * for the API, implemented using flex/byacc;
- *
- * one might use the Generic C Preprocessor or M4 to aid in writing stand-alone
- * plugins, but these are not built into the language itself and are not avalible
- * on the CLI as a result
+ * for the API, implemented using flex/byacc; one might use the
+ * Generic C Preprocessor or M4 to aid in writing stand-alone
+ * plugins, but these are not built into the language itself
+ * and are not avalible on the CLI as a result
*
* an runcontrol-file interpreter will be writen this way as well,
* to be used by the new savefile generator. it will have syntax
@@ -136,6 +140,11 @@
* lastly, a nonstructured language will be provided for defining midi streams
* in a human readable format.
*
+ * At some point in the far future, once the engine has reached Beta,
+ * a complementery Tileset version of the engine will be created using
+ * the X Toolkit, XPixMap, and the Athena Widgets, while retaining the
+ * mostly the same API.
+ *
* GPLv2 or later, All Wrongs Reserved
*/
@@ -183,10 +192,25 @@
#ifndef OK
#define OK 0
#endif
+
#ifndef ERR
-#define ERR ~0 //not zero
+#define ERR -1
+#endif
+
+#ifndef EOF
+#error now you're just TRYING to break stuff...
#endif
+#ifndef NULL
+#warning ... ...wh ... ... how??
+#define NULL ((void*)0)
+#endif
+
+#define TRUE true
+#define FALSE false
+#define T true
+#define NIL ((intptr_t)0) /*should be false and NULL equivilant, might be kept even if the others are purged*/
+
mvaddch16(int x,int y,char16_t raw) {
const wchar_t wch = raw;
mvaddnwstr(13,16,&wch,1);
@@ -215,6 +239,8 @@ addnwstr(&wch,1);
#define BGCOLORS 8
#define FGCOLORS 8
char16_t TILDEWIDE = setwidetilde()
+#define BLINKY "\033[5m_\033[25m"
+char* TERM
/*VERSION*/
#define ENGINE_VERSION "Prealpha"
@@ -235,15 +261,6 @@ char16_t TILDEWIDE = setwidetilde()
#ifndef MIDI_TYPE
#define MIDI_TYPE "MISSING"
#endif
-#ifndef GAME_NAME
-#define GAME_NAME "MISSING"
-#endif
-#ifndef GAME_VERSION
-#define GAME_VERSION "MISSING"
-#endif
-#ifndef STORY_REV
-#define STORY_REV "MISSING"
-#endif
/*FUNCTION MACROS*/
#define BACKGROUND 010
@@ -429,7 +446,7 @@ char* text
* } Rune; //not needed
*/
-uint mainh__roll (num,side,low)
+uint util__roll (num,side,low)
uchar num; //number of dice to roll
uchar side; //sides on each die
bool low; //low number on each die
@@ -444,7 +461,7 @@ return accum;
}
//XdN is (X,N,0), XDN is (X,N,1)
-sshort mainh__bonus (num)
+sshort util__bonus (num)
uchar num;
{
sshort accum;
@@ -456,7 +473,7 @@ for (uchar n = 0;n 2 selections are processed as the ∪ of (X nCr 2) seperate ⌖.
- */
struct aligntyp:
good : b1
evil : b1
@@ -1009,8 +1041,8 @@ noevil : b1
nolaw : b1
nochaos : b1
/* used as a mask.
- * starting alignment must be one of the high nibble (✥ if one or more than 2 are selected, ⌖ ║2║1 if exactly 2 are selected, true neutral ║1║1 if none are selected).
- * alignment may NEVER enter any of the low nibble, marked "no" (✥ always, overrides whitelist).
+ * starting alignment must be one of the high nibble (those bit flags | true neutral if more than 1 is selected.)
+ * alignment may NEVER enter any of the low nibble, marked "no"
*
* there are other ways that alignment masks may be specified,
* all of which have finer grained control.
@@ -1103,7 +1135,7 @@ ptrtab mon1table
* and non polymorphable by placing them on the low or high tables
*/
enum mon2_enum
-stabs mon2stabs = {...
+stabs mon2stabs = {"grue", ...
/*$FA*/, "Justice"/*not invincible*/, "Retribution"/*not invincible*/, "Justice"/*invincible*/, "Retribution"/*invincible*/, "Death"};
ptrtab mon2table
@@ -1121,7 +1153,7 @@ ptrtab mon2table
* E: , stalker,
* e: floating eye,
* F: turkey, rooster, chicken, peacock, duck, goose, swan, albatross, gull, dodo,
- * f: panther, lion, tiger, manticore, cat, lynx, bobcat, displacer beast,
+ * f: panther, lion, tiger, manticore, cat, lynx, bobcat,
* G: ghost, banshee, revenent, barrow wight,
* g: gremlin, gargoyle, winged gargoyle,
* H: giant, cyclops,
@@ -1730,7 +1762,7 @@ uchar fly : 2 //0 = never had wings, 1 = slow falling, 2 = cannot gain altitude,
/* damage = MAX( incoming-defense , 0 )
*
- * polyshock = -abs(base.hplvl-poly.hplvl) * !mainh__roll(1,20,0)
+ * polyshock = -abs(base.hplvl-poly.hplvl) * !util__roll(1,20,0)
* ⎧if n < -HPMAX : Instakill (deathmessage: miscalculated a crucial equivilant-exchange parameter,hath choose...poorly)
* ⎪if n = -HPMAX : Stoning
* ⎨if -HPMAX < n < 0 : abs(n) Damage (deathmessage: could not withstand the cost of transmutation)
@@ -2238,21 +2270,22 @@ to avoid confusion, by default the player always uses a unique character: ☻
an UNDERLINE is a shadow
-) is a sword or dagger. ⍏ are polearms. \ is a staff. ¦ is a club. : is a mace. ℓ is a whip. ⦅ is a bow. ⇤ is an arrow. ⍖ is a writing instrument.
+note: unicode symbols are (mostly) used be their appearence, not by their meaning
+) is a sword or dagger. ⍏ are polearms. \ is a staff. ¦ is a club. : is a mace. ℓ is a whip. ( is a bow. ⇤ is an arrow. ⍖ is a writing instrument.
⟦ is armor. [ is clothing. ] is a shield. ⟧ are cannons or greeves. % is meat. ⊞ is food (don't shoot it). $ is gold. ¢ is copper.
-⌘ is a misc item. ↧ is a digging tool. ⌥ is a key or lockpick. ♫ is a lyre. ƒ is a violin. ♪ is a different music instrument.
+? is a misc item. ✥ is a shurkin. ↧ is a digging tool. ⌥ is a key or lockpick. ♫ is a lyre. ƒ is a violin. ♪ is a different music instrument.
¿ are potions (fragile). ∫ is a scroll. ⊒ is a book. ∩ is a tablet. ° is a ring. º is a bracelet. ª is an amulet. ^ is a crown.
/ is a wand. ♮ is a ladder. ⋎ is a fountain or gyser. ⍾ is a bell. ⎋ is a clockface. ♠ ♣ ‡ are trees. ⋏ is fire. ♜ is a pedestal.
-∿ is shallow liquid. ≈ is deep liquid's surface. ∬ is a waterfall. ~ is a liquid (as seen while submerged).
+∿ is shallow liquid. ≈ is deep liquid's surface. ∬ is a waterfall. ~ is a liquid (as seen while submerged). ≣ is a staircase.
⌁ is electricity. * is ice. ⎈ spider web. ⌬ beehive. ↥ are spikes. ⎙ ⍝ ⎍ ∎ ⎅ are tombstones or signs. ␥ is glass.
-? is invisible. ! is trouble. ⌑ is a light source. ⌸ is a door. ⍯ is a locked door. ⎕ is an open door. = is a gate. ≠ is a locked gate.
+! is trouble. ⌑ is a light source. ⌸ is a door. ⍯ is a locked door. ⎕ is an open door. = is a gate. ≠ is a locked gate. ∷ is an open gate.
• is a boulder. . is a rock. ⁂ is a rockslide. ◇ is a gemstone. ◊ is a giant magic crystal. ⑆ are footprints.
-∪ is a sink. ⏍ is a chest. ↯ (cyan) is the thunderbolt. ∅ is a spacetime anomaly (do not touch). < > are level stairs.
-← ↑ → ↓ ↖ ↗ ↘ ↙ are flying projectiles. ⇐ ⇑ ⇒ ⇓ ⇖ ⇗ ⇘ ⇙ are cannons (the kind that goes boom).
-# █ ▓ ▒ ░ ▞ ▚ (etc) are thick walls or floor. ≋ is a cloud (no walking; keep your head out of them). ≣ is a staircase.
+∪ is a sink. ⏍ is a chest. ↯ (cyan) is the thunderbolt. ∅ is a spacetime anomaly (do not touch). < > are level stairs. ⌘ is home.
+← ↑ → ↓ ↖ ↗ ↘ ↙ are flying projectiles. ⇐ ⇑ ⇒ ⇓ ⇖ ⇗ ⇘ ⇙ are ballistae. ✪ is a rune. ː ⍽ are traps.
+# █ ▓ ▒ ░ ▞ ▚ (etc) are thick walls or floor. ≋ is a cloud (do not walk on them; keep your head out of them).
˜ ␣ are holes. ' is a stalagtite or icicle. , is a plant. ; is a grain or sunflower (impassable).
box drawings are low walls or columns. ⑉ ⋮ are iron bars. · is an ember or star. ` ´ ˇ are flower petals.
-✪ is a rune. ː ⍽ are traps. ¬ (blinking) is stale air (unbreathable). ≃ is stagnent water (unbreathable). ☣ ‽ is gas.
+¬ (blinking) is stale air (unbreathable). ≃ is stagnent water (unbreathable). ☣ ‽ is gas.
" deliminates text.
⍰ is a missingno.
@@ -2261,7 +2294,7 @@ but any truly monospace font should render their relative sizes correctly;
if the font is only pretending to be monospace (like the default github font),
you'll have bigger issues of non-uniform characters warping and tearing
the world's projection grid. it is for this reason that the recommended font
-is a raster one.
+is a raster one, as raster fonts tend to be more uniform.
box drawings:
╒╤╕ ╔╦╗
@@ -2276,19 +2309,19 @@ A_INVIS is not able to be seen
A_REVERSE video is a magic spell's area of effect
A_UNDERLINE is the shadow of an entity
-text that is catted from an nfo file, or otherwise printed using stdio, will not be restricted to ncurses formatting,
-and will use the full range of ANSI+AIX SGR escape codes
+text that is cat-ed from an nfo file, or otherwise printed using stdio, will not be restricted to ncurses formatting,
+and will use the full range of ANSI SGR escape codes
rune symbols
◬ air, ⍫ earth, △ fire, ▽ water, ⍰ missingno
-※ ice, ↯ (yellow) electricity, ♤ metal, π nature
+※ ice, ↯ (yellow) electricity, ♤ metal, ♻ nature
☣ status effect, ‽ stoning, ∅ entropy
☼ light, ☽ dark, § polymorph, ↹ planer
♥ healing
magic AOE symbols
≋ air, • earth, ⋏ fire, ≈ water
-* ice, ⌁ electricity, $ metal, ♠ nature
+* ice, ⌁ electricity, ↥ metal, ♠ nature
☣ status effect, ‽ stoning, ∅ entropy
⌑ light, ⎈ dark, § polymorph
@@ -2296,8 +2329,8 @@ directional symbols:
←, ↑, →, ↓, ↖, ↗, ↘, ↙, direction in XY;
! far side; ↧, ↥, direction in Z;
↹ different plane;
-◬, ⍫, △, ▽, ※, ↯, ♤, π, ☼, ☽, ∅, inner planes;
-LG, NG, CG, LN, CN, LE, NE, CE, TN, U, ☠, outer planes;
+◬, ⍫, △, ▽, ※, ↯, ♤, ♻, ☼, ☽, ∅, inner planes;
+LG, NG, CG, LN, CN, LE, NE, CE, TN, ×, ☠, outer planes;
STYLE GUIDE:
the following nonstandard punctuation may be used in dialouge (list not exaustive) : ‽ explosive disbelief ⸮ rhetorical .ˢ sarcasm ♪ playful ♥ careing ♩♯ taunt ↯ explosive anger ☠ foul oath
@@ -2476,7 +2509,7 @@ mapscrollargs NOSCROLL = {0,0,0,false,false}
mapscrollargs args
{
BREAKCURSES
-printf("\033]0;%s: loading...\a",GAMENAME);
+if (IS_XTERM) {printf("\033]2;IWannaFlyCurses - %s: loading...\033\\",GAMENAME);}
printf("loading...");
fflush(stdout);
FIXCURSES
@@ -2551,7 +2584,7 @@ FIRST = !(visited)
ROOM.visited = true
BREAKCURSES
-printf("\033]0;%s: %i°%c, %i°%c, %i\a",GAMENAME,abs(WORLD.lat),WORLD.lat > 0 ? 'N' : (WORLD.lat < 0 ? 'S' : ' '),WORLD.lon > 0 ? 'E' : ((WORLD.lon < 0) && !(WORLD.lon == -180) ? 'W' : ' '),WORLD.dep - 100);
+if (IS_XTERM) {printf("\033]2;IWannaFlyCurses - %s: %i°%c, %i°%c, %i\033\\",GAMENAME,abs(WORLD.lat),WORLD.lat > 0 ? 'N' : (WORLD.lat < 0 ? 'S' : ' '),WORLD.lon > 0 ? 'E' : ((WORLD.lon < 0) && !(WORLD.lon == -180) ? 'W' : ' '),WORLD.dep - 100);
FIXCURSES
render();
}
@@ -2819,58 +2852,60 @@ for (;count != 0;count--) {
* add shadows
*/
-/*pseudocode*/enginehook() {
- printf(RESET);
- printf(" \033[1;95m~~ IWANNAFLY ROGUELIKE ENGINE ~~\033[m\n\033[97m engine version: %s\n rules revision: %s\n API revision: %s\n savefile version: %s\nextension parser version: %s\n runcommander version: %s\n midibasic version: %s\n midi backend type: %s\n\n \033[96m - %s -\033[m\n\033[97m game version: %s\nstory revision: %s\n\n\033[37mCompiled on %s\n\033m\a",ENGINE_VERSION,RULES_VERSION,API_VERSION,SAVE_VERSION,EXT_PARSE_VERSION,RUNCOM_VERSION,MIDIBAS_VERSION,MIDI_TYPE,GAME_NAME,GAME_VERSION,STORY_REV,__DATE__);
- fflush(stdout);
- sleep(4);
- printf(RESET);
- printf("\033[1;32m\tCopyright (C) 2019 \"GeneralGuy4872\"\n\n\tThis program is free software; you can redistribute it and/or\n\tmodify it under the terms of the GNU General Public License\n\tas published by the Free Software Foundation; either version 2\n\tof the License, or (at your option) any later version.\n\n\tThis program is distributed in the hope that it will be useful,\n\tbut WITHOUT ANY WARRANTY; without even the implied warranty of\n\tMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\tGNU General Public License for more details.\n\n\tYou should have received a copy of the GNU General Public License\n\talong with this program. If not, see \n\t\033[m\033[4;94mhttps://www.gnu.org/licenses/\033[m\033[1;32m.\a");
- fflush(stdout);
- sleep(4);
- printf(RESET);
- printf("\033[92mLibraries linked:\nNCurses by Zeyd M Ben-Halim,\n Eric S. Raymond,\n Thomas E Dickey\n and the Free Software Foundation\nLibTar by Mark D. Roth\nZlib by Jean-loup Gaully and Mark Adler\nLibBZip2 by Julian Steward\n");
- fflush(stdout);
- sleep(4);
- printf(RESET);
- printf("\033[92mAlgorithems Implemented:\nDijkstra's Algorithem\nPrim's Algorithem\nKruskal's Algorithem and Kruskal's Reverse Algorithem\nBorůvka's Algorithm\nRolling Dice\nSierpiński Attractor\nPerlin Noise\a");
- fflush(stdout);
- sleep(4);
- printf(RESET);
- printf("\033[95mContains compositions by Beethoven, Bach, and Vivaldi\a");
- fflush(stdout);
- sleep(4);
- printf(RESET);
- printf("\033c\033[2J\033[0H\033[5m_\a");
- fflush(stdout);
- sleep(4);
- printf(RESET);
- printf("\033[1;3;96mLong ago, in times of myth...\a");
- fflush(stdout);
- sleep(4);
- printf(RESET);
- printf("\033[93mA great storm descended upon the land. A storm so terrible that even those who\ndwelled beyond the veil feared it's power. It threatened to destroy all the\nrealms, and all seemed powerless to stop it.\a");
- fflush(stdout);
- sleep(4);
- printf(RESET);
- printf("\033[93mHowever, the heros of the world, aided by the masters of the elements and the\nguardians of the planes, sealed the darkness away for one million years, in the\nvoid of the unworthy.\a");
- fflush(stdout);
- sleep(4);
- printf(RESET);
- printf("\033[93mToday, the seals are fading, and the storm is rising again..."); //...okay, it's the story of every JRPG ever, but the story of the 3D game didn't have a wide enough scope. I'll write more later, when I'm in that mindset.
- fflush(stdout);
- sleep(4);
- printf(RESET);
- printf("\033c\033[2J\033[0H\033[5m_\a");
- fflush(stdout);
- sleep(4);
- printf(RESET);
- printf("\033[3mSo it begins...\a\033[23m\033[m\n");
- fflush(stdout);
- sleep(4);
- do_intro_movie();
- loadfile();
- engineloop();
+termcheck() {
+TERM = getenv("TERM");
+if (strstr(TERM,"xterm") != NULL) {
+ IS_XTERM = true
+ }
+
+
+/*pseudocode*/enginesplash(GAME_NAME,GAME_VERSION,STORY_REV)
+const char* GAME_NAME GAME_VERSION STORY_REV
+{
+ if (IS_XTERM = true) {
+ printf("\033]1;IWannaFlyCurses\033\\");
+ printf("\033]2;IWannaFlyCurses - %s\033\\",GAMENAME);
+ }
+printf(RESET);
+printf(" \033[1;95m~~ IWANNAFLY ROGUELIKE ENGINE ~~\033[m\n\033[97m engine version: %s\n rules revision: %s\n API revision: %s\n savefile version: %s\nextension parser version: %s\n runcommander version: %s\n midibasic version: %s\n midi backend type: %s\n\n \033[96m - %s -\033[m\n\033[97m game version: %s\nstory revision: %s\n\n\033[37mCompiled on %s\n\033m\a",ENGINE_VERSION,RULES_VERSION,API_VERSION,SAVE_VERSION,EXT_PARSE_VERSION,RUNCOM_VERSION,MIDIBAS_VERSION,MIDI_TYPE,GAME_NAME,GAME_VERSION,STORY_REV,__DATE__);
+fflush(stdout);
+sleep(4);
+printf(RESET);
+printf("\033[1;32m\tEngine Copyright (C) 2019- \"GeneralGuy4872\"\n\n\tThis program is free software; you can redistribute it and/or\n\tmodify it under the terms of the GNU General Public License\n\tas published by the Free Software Foundation; either version 2\n\tof the License, or (at your option) any later version.\n\n\tThis program is distributed in the hope that it will be useful,\n\tbut WITHOUT ANY WARRANTY; without even the implied warranty of\n\tMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\tGNU General Public License for more details.\n\n\tYou should have received a copy of the GNU General Public License\n\talong with this program. If not, see \n\t\033[m\033[4;94mhttps://www.gnu.org/licenses/\033[m\033[1;32m.\a");
+fflush(stdout);
+sleep(4);
+printf(RESET);
+printf("\033[92mLibraries linked:\nNCurses by Zeyd M Ben-Halim,\n Eric S. Raymond,\n Thomas E Dickey\n and the Free Software Foundation\nLibTar by Mark D. Roth\nZlib by Jean-loup Gaully and Mark Adler\nLibBZip2 by Julian Steward\n");
+fflush(stdout);
+sleep(4);
+printf(RESET);
+printf("\033[92mAlgorithems Implemented:\nDijkstra's Algorithem\nPrim's Algorithem\nKruskal's Algorithem and Kruskal's Reverse Algorithem\nBorůvka's Algorithm\nRolling Dice\nSierpiński Attractor\nPerlin Noise\a");
+fflush(stdout);
+sleep(4);
+}
+
+main() {
+termcheck();
+enginesplash("Default Game","Prealpha","Rough Draft");
+printf(RESET);printf(BLINKY);
+fflush(stdout);
+sleep(4);
+printf(RESET);
+file_cat_nocurses(STATIC_PATH"scene.nfo"); //...okay, it's the story of every JRPG ever, but the story of the 3D game didn't have a wide enough scope. I'll write more later, when I'm in that mindset.
+printf("\a");
+fflush(stdout);
+sleep(4);
+printf(RESET);printf(BLINKY);
+fflush(stdout);
+sleep(4);
+printf(RESET);
+puts("\033[3mSo it begins...\033[23m\a");
+fflush(stdout);
+sleep(4);
+do_intro_movie();
+promptload();
+engineloop();
+}
/*blackbox*/exitengine()
/* at exit:
@@ -2930,7 +2965,8 @@ char buffer[BUFFERMAX]
char* buffer
BREAKCURSES
-puts("name:")
+printf("name")
+puts(BLINKY)
fgets(buffer,BUFFERMAX - 1,stdin)
output = calloc(stringlen(buffer),sizeof(char))
strcpy(output,buffer)
diff --git a/src/paths.h b/src/paths.h
new file mode 100644
index 0000000..0c0dba7
--- /dev/null
+++ b/src/paths.h
@@ -0,0 +1,7 @@
+#define STATIC_PATH "/usr/lib/games/iwannaflycurses/"
+#define VAR_PATH "/var/games/iwannaflycurses/"
+#define GLOBAL_PATH "/etc/iwannaflycurses.d/"
+#define SHARE_PATH "/usr/share/games/iwannaflycurses/"
+#define DOC_PATH "/usr/share/doc/iwannaflycurses/"
+#define GAMES_PATH "/usr/games/iwannaflycurses/"
+#define DOT_PATH "~/.iwannaflycurses/"
diff --git a/src/questdialogs/scene.nfo b/src/questdialogs/scene.nfo
new file mode 100644
index 0000000..c095c39
--- /dev/null
+++ b/src/questdialogs/scene.nfo
@@ -0,0 +1,13 @@
+[3;36mLong ago, in times of myth…[23;0m
+
+[93mA [1;3mGreat Storm[21;22;23;24m descended upon the land.
+A storm so terrible that even those who [3mdwelled beyond the veil[23m
+feared it's power. it threatened to destroy [3mall the realms[23m, and
+all seemed powerless to stop it.
+
+However, the [3mheros of the world[23m, aided by the [3mmasters of the
+elements[23m and the [3mguardians of the planes[23m, sealed the storm
+away for one million years, in the [3mvoid of the unworthy[23m.
+
+Today, there is a [1;3mgreat disturbance[21;22;23;24m in magic,
+as the seals fade and the storm rises again…[23;0m