Skip to content
This repository has been archived by the owner on Jul 27, 2020. It is now read-only.

Commit

Permalink
push commit
Browse files Browse the repository at this point in the history
  • Loading branch information
GeneralGuy4872 committed Dec 21, 2019
1 parent f35782e commit 46e21e0
Show file tree
Hide file tree
Showing 43 changed files with 2,006 additions and 1,580 deletions.
4 changes: 3 additions & 1 deletion src/NotesOnCompiling
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ that this would be a pessimization in most of my use cases.

files that do not require access to a global variable will
use the linker; files that do will use preprocessor transclusion
via a .ch file
via a .ch file. the paradigm of existing functions needs to
be changed to switch from calling globals explicitly to passing
them at invocation as development continues.

all details are subject to change, based on compiler tinkering.
5 changes: 3 additions & 2 deletions src/baserender.messy
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ enttyp__normalrender (int yzindex,int cullplane) {
struct enttyp * next_ent_ptr = ROOM->ent_ptr;
while (next_ent_ptr != NULL) {
if (raycast__visabledefault(next_ent_ptr->pos,cullplane) {
basentyp * basentity = &((montable[next_ent_ptr->race[0]->table])[next_ent_ptr->race[0]->race]);
basentyp * basentity = &(montable[next_ent_ptr->race[0]->table][next_ent_ptr->race[0]->race]);
baseclasstyp * baseclass = next_ent_ptr->class.notnull ? &(classtable[next_ent_ptr->class.role][next_ent_ptr->class.class][next_ent_ptr->class.mastery]) : NULL;
char16_t this_sprite;
attr_t this_attr;
if (CAMERA.align) {
Expand All @@ -29,7 +30,7 @@ enttyp__normalrender (int yzindex,int cullplane) {
}
maskset(z,y,x,ROOM->collisionmap.ents,true);
if (CAMERA.dingbats) {
enttyp__wingrender(next_ent_ptr,basentity,yzindex,cullplane);
enttyp__wingrender(next_ent_ptr,basentity,baseclass,yzindex,cullplane);
enttyp__sleeprender(next_ent_ptr,basentity,yzindex,cullplane);
}
raycast__dropshadow(next_ent_ptr->pos);
Expand Down
1 change: 1 addition & 0 deletions src/class_cleric.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"healer","cleric","priest","druid","alchemist","scholar","white mage","seer"
1 change: 1 addition & 0 deletions src/class_fighter.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"fighter","knight","paladin","valkyrie","viking","samuri","ranger","monk"
1 change: 1 addition & 0 deletions src/class_magic_user.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"magic-user","wizard","illusionist","enchanter","black mage","red mage","psion","necromancer"
1 change: 1 addition & 0 deletions src/class_rogue.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"changeling","rogue","thief","pirate","ninja","assasin","tourist","ronan"
35 changes: 26 additions & 9 deletions src/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,29 @@

#define ROOM_STACK_MAX 40

#define ROOM_UP 02
#define ROOM_DOWN 03
#define ROOM_NORTH 04
#define ROOM_SOUTH 05
#define ROOM_EAST 06
#define ROOM_WEST 07
#define ROOM_UPSTAIR 012
#define ROOM_DOWNSTAIR 013
#define ROOM_MIRROR 01
#define ROOM_NORTH 0
#define ROOM_SOUTH 1
#define ROOM_WEST 2
#define ROOM_EAST 3
#define ROOM_DOWN 4
#define ROOM_UP 5
#define ROOM_DOWNSTAIR 6
#define ROOM_UPSTAIR 7

#define CAMERA_DEFAULT 0 //0000
#define CAMERA_UP 2 //?010
#define CAMERA_DOWN 3 //?011
#define CAMERA_LEFT 4 //?100
#define CAMERA_RIGHT 5 //?101
#define CAMERA_PGUP 6 //?110
#define CAMERA_PGDN 7 //?111
#define CAMERA_FLAT 8 //1???
//CAMERA_DEFAULT | CAMERA_FLAT must be corner-case handled to be 0xF instead of invalid value 0x8

#define BUFFER_MAX 512
#define FLOPPYSIZE 1474560
#define DRUMSIZE 16384
#define BGCOLORS 8
#define FGCOLORS 8

#define SQRT3 1.732050807568877293528
61 changes: 61 additions & 0 deletions src/food.messydata
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
foods (* = uses meta)
hardtak tortilla cornmeal cornbread
flour cheese wine bread
mead ale scotch ethenol
grapes fig date plum
apple banana apricot papaya
orange pear pinapple coconut
kiwi dragonfruit durin peach
grapefruit lemon lime citron
spinach artichoke asparagus bamboo
cucumbers zuccini pickles squash
carrot corn potato celery
brocoli lettuce cabbage kale
cauliflower raddish turnip beets
rhubarb pumpkin avacodo jalapenos
beans greenbeans tomato eggplant
blackolives greenolives garlic onions
watercress chives ketchup mustard
parsly sage rosmary thyme
basil oregano allspice nutmeg
salt bellpeppers peppercorns redpepper
vanillabean cinnimonstick cocoabean sugarbeet
walnut pecan cashew peanut
sunflowerseed pistachio almond chestnuts
cranberrys blueberrys raspberry blackberry
strawberry cherry peppermint pawpaw
sugarcane syrup* molasses honey
seseme poppy fennel eyeofnewt
mushroom* truffel penecillin yeast
barly wheat rye rice
ginger sasafrass blueraspberries bubbles
geletin starch creamoftartar bakingpowder
vinager bakingsoda calciumhydroxide hemlock
popcorn nachos cookies milk*
pasta(uncooked) pasta ramen(uncooked) ramen*
dumplings(uncooked) dumplings* tofu(uncooked) tofu
meatballs marinara alfredosauce parmisian
lasagnia* pizza* spaghetti alfredo
spaghetti&meatballs ramen&dumplings chickenalfredo brocllialfredo
guacamole nachos* chili salsa
pie* cake* soda* chips
salad* hotdog* hamburger* fries
vanilla cinnimon chocolate sugar
cocoapowder cocoabutter cocoaliquor fudge
egg fat* caramel butterscotch
sourcream butter/shortening* mayo dressing*
pie* pie_alamode* englishfruitcake bread*
cake* pancake* waffle* stackofpancakes*
frozenpancake frozenwaffle flavoredmilk* juice*
roast* gravy foo&gravy* foo_chicken*
bakedpotato loadedbakedpotato mashpotatos tatties&neeps
sunnysideup overeasy scrambled hardboiled
bacon* sausage* jerky* spam
nutbrittle* trailmix rasin* peanutbuttersandwich*
baconlettucetomatosandwich clubsandwich fingersandwich* coldcutsandwich*
milkshake* icecream* sorbet* icecreamfloat*
icecreamcone* banannasplit neopolitan rockyroad
gumdrop* hardcandy* candycane filledchocolate*
jelly* jam* preserves* peanutbutter
icecube snow ember blacksoup
broth* stew* ration mistake
1 change: 1 addition & 0 deletions src/gemstones.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"jet","sapphire","emerald","turquoise","ruby","amythest","heliodor","diamond"
6 changes: 3 additions & 3 deletions src/greedy/astar.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ forever {
case 1 : step = 1; break;
case 2 : step = diagonal2; break;
case 3 : step = diagonal3; break;
default : goto(skip);
default : goto(_skip);
}
if (
!(( ((abs(xdiff) + abs(ydiff) + abs(zdiff)) > 1) && args.ortho)
(current->x + xdiff < MAX_X) &&
(current->x + xdiff0) &&
(current->y + ydiff < MAX_Y) &&
(current->x + xdiff0) &&
(current->z + zdiff < CEILING) &&
(current->z + zdiff < OLDCEILING) &&
(current->z + zdiff0) &&
(!(datakeeper.grid[COORDSUB(current->z + zdiff,current->y + ydiff,current->x + xdiff)].obs)) && (
((datakeeper.grid[COORDSUB(current->z + zdiff,current->y + ydiff,current->x + xdiff)].runningdist) > (datakeeper.grid[COORDSUB(current->z,current->y,current->x)].runningdist + step)) ||
Expand Down Expand Up @@ -113,7 +113,7 @@ forever {
}
}

skip:
_skip:
if (((current->x == pointb.x) && (current->y == pointb.y) && (current->z == pointb.z)) && !args.indecisive) {goto(breakout)}
}

Expand Down
2 changes: 1 addition & 1 deletion src/greedy/dijkstra.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ forever {
(current->x + xdiff0) &&
(current->y + ydiff < MAX_Y) &&
(current->x + xdiff0) &&
(current->z + zdiff activeroom->ceiling) &&
(current->z + zdiff < OLDCEILING) &&
(current->z + zdiff0) &&
(!(datakeeper.grid[COORDSUB(current->z + zdiff,current->y + ydiff,current->x + xdiff)].obs)) && (
((datakeeper.grid[COORDSUB(current->z + zdiff,current->y + ydiff,current->x + xdiff)].runningdist) > (datakeeper.grid[COORDSUB(current->z,current->y,current->x)].runningdist + step)) ||
Expand Down
24 changes: 24 additions & 0 deletions src/legend.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"truthseeker",
"sword of justice",
"excalibur",
"thunderbolt",
"sickle of chaos",
"stormbringer",
"devilfork",
"staff of tyrants",
"deathscyth",
"sunray",
"nightedge",
"staff of merlin",
"flame's edge",
"tesla's mace",
"stormgale",
"frostpike",
"trident of the seas",
"staff of the forest",
"quake hammer",
"bow of fire",
"bow of ice",
"bow of darkness",
"bow of void",
"bow of dawn"
36 changes: 0 additions & 36 deletions src/macro.h
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
/*TYPES*/
//ensure size names work on all systems
#define uint unsigned int
#define uchar unsigned char
#define ushort unsigned short
#define ulong unsigned long
#define 8BITPTR uint8_t

#define ≥ >=
#define ≤ <=
#define forever for (;;)
#define END return 0;}

/* syntactic sugar for macros that are actually tailcalls
* such macros contain a return or this macro
*/
#define tailcall(X) X

#ifndef EOF
#error now you're just TRYING to break stuff...
#endif
Expand All @@ -30,13 +19,6 @@
#define FALSE false
#define False false

/*ENVIROMENTALS*/
#define BUFFER_MAX 512
#define FLOPPYSIZE 1474560
#define DRUMSIZE 16384
#define BGCOLORS 8
#define FGCOLORS 8

/*VERSION*/
#define ENGINE_VERSION "Prealpha"
#define RULES_VERSION "Prealpha"
Expand All @@ -57,28 +39,10 @@
#define MIDI_TYPE "MISSING"
#endif

#define CAMERA_UP 9
#define CAMERA_DOWN 1
#define CAMERA_LEFT 014
#define CAMERA_RIGHT 4
#define CAMERA_PGUP 012
#define CAMERA_PGDN 2
#define CAMERA_XY 0xE
#define CAMERA_XZ 013
#define CAMERA_YZ 0xD

#define SCROLL_NORTH 3
#define SCROLL_SOUTH 2
#define SCROLL_EAST 4
#define SCROLL_WEST 5
#define SCROLL_UP 7
#define SCROLL_DOWN 6

/*FUNCTION MACROS*/
#define BACKGROUND 010
#define BALTERNOCT(X,Y,Z) ((sgn(Z) * 9) + (sgn(Y) * 3) + sgn(X))
#define COORDSUB(Z,Y,X) ((MAX_Y * Z) + (MAX_X * Y) + X)
#define SWAP(X,Y) {if (X != Y) {intptr_t sWaPtEmPoRaRy = X;Y = X;X = sWaPtEmPoRaRy}}\

// kludge so that stdio and ncurses play nice together
#define RESET "\033c\033[2J\033[0H"
Expand Down
Loading

0 comments on commit 46e21e0

Please sign in to comment.