Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion client/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,35 @@ import Wrapper from "./components/Wrapper/Wrapper";
// remove tap delay, essential for MaterialUI to work properly
injectTapEventPlugin();

// let Item = require("./Objects/ItemBuilder");
// let Creature = require("./Objects/CreatureBuilder");
// let Room = require("./Objects/RoomBuilder");
// let newGameData = {
// moveCount: 0,
// player: {
// location: ["two"],
// equipment: {
// wielded: undefined,
// head: undefined,
// body: undefined,
// arms: undefined,
// legs: undefined
// },
// inventory: [Item.cellPhone],
// stats: {
// health: 100,
// attack: 0,
// defense: 3
// },
// options: {
// verbose: true,
// }
// },
// room: Room,
// creatures: [Creature.cat, Creature.minotaur],
// textBuffer: []
// };

class App extends Component {

state = {
Expand Down Expand Up @@ -131,7 +160,8 @@ class App extends Component {
<Link to="/signup">Sign up</Link>
</div>
)}
<PropsRoute exact path="/game" component={GamePage}
<PropsRoute exact path="/game" component={GamePage}
// gameData={newGameData}
toggleAuthenticateStatus={this.toggleAuthenticateStatus}
handleQuitButton={this.handleQuitButton.bind(this)}
handleLoginButton={this.handleLoginButton}
Expand Down
49 changes: 49 additions & 0 deletions client/src/Objects/CreatureBuilder.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

function Creature(
location, shortName, lookDesc, keywords, health, attack, defense, script, attitude, doing
) {
this.location = location;
this.shortName = shortName;
this.lookDesc = lookDesc;
this.keywords = keywords;
this.health = health;
this.attack = attack;
this.defense = defense;
this.script = script;
this.attitude = attitude;
this.doing = doing;
this.inventory = [];
}

let cat = new Creature(
"two", // location
"small cat", // shortName
"A small gray and white cat. She seems supremely uninterested in your presence.", // lookDesc
["cat", "kitty", "kitten", "pussy", "animal"], // keywords
100, // health
40, // attack
50, // defense
["moveRandom"], // script
"wander", // attitude
" wandering around.", // currently doing
);
cat.dumb = true;

let minotaur = new Creature(
"five", // location
"Minotaur", // shortName
"Rather large and muscle-bound, but an otherwise typical bull-headed man, with that oh-so-common look of rage and bloodshed in its eyes. Those eyes are focused on you, by the way.", // lookDesc
["beast", "minotaur", "monster"], // keywords
40, // health
10, // attack
8, // defense
["moveRandom"], // script
"wander", // attitude
"stomping around.", // currently doing
);
minotaur.blind = false;

module.exports = {
cat: cat,
minotaur: minotaur
}
97 changes: 81 additions & 16 deletions client/src/Objects/ItemBuilder.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,93 @@
const Item = require("./ItemConstructor.js");

// const throwThis = (shortName) => {
// return {
// actionMessage: "You hurl the "+shortName+" with all your might. It makes a satisfying crunch, but has little other effect.",
// disappears: false
// }
// }
// Items
function Item(
// arguments here
shortName, lookDesc, keywords, startingLoc
) {
// properties here
this.shortName = shortName; // short name
this.lookDesc = lookDesc; // long description
this.keywords = keywords; // synonyms and keywords
this.startingLoc = startingLoc;
}

let cellPhone = new Item(
0, // itemId
"cell phone", // shortName
"Your cell phone is a top-of-the-line Noxia Grunt 9, and has a whole ton of fun and useful apps. Too bad the battery is dead. Maybe you shouldn't have vlogged the entire Chauffr ride.", // longDesc
"Your cell phone is a top-of-the-line Noxia Grunt 9, and has a whole ton of fun and useful apps. Too bad the battery is dead. Maybe you shouldn't have vlogged the entire Chauffr ride.", // lookDesc
["cell", "phone", "noxia", "grunt", "cellphone"], // keywords
1, // invSize
false, // wear
undefined, // value
["playerInventory"] // starting location
);
cellPhone.takeable = true;
cellPhone.invSize = 1;

let brick = new Item(
"brick", // shortName
"A dusty brick of stone.", // longDesc
["brick"], // keywords
["two"] // starting location
);
brick.takeable = true;
brick.invSize = 5;
brick.value = 2;

let bust = new Item(
"bust",
"A roughly-carved sculpture of an unknown gentleman. The unusually flat cranium does not assist any pretense of wisdom. There was once a name carved beneath the visage, but it has been scratched out.",
["bust", "sculpture", "head"],
["two"]
);
bust.feature = true;

let sword = new Item(
"rusty sword",
"This once-noble weapon was clearly the armament of a mighty warrior, but has since been laid low by the elements. It still has some heft to it, though. (And, you notice, the words 'Made in Pakistan' stamped on the pommel.",
["sword", "rusty", "blade"],
["three"]
);
sword.takeable = true;
sword.invSize = 10;
sword.wear = "wielded";
sword.value = 10;

let glowingWall = new Item(
"glowing wall",
"A fine marble wall with swirls of minerals and a distinct shimmer.",
["wall", "glowing"],
["six", "seven"]
)
glowingWall.feature = true;

let gate = new Item(
"gate",
"It's a pretty nasty looking thing, like it was repurposed from some old torture device.",
["gate", "iron"],
["seven", "eight"]
)
gate.feature = true;

let tail = new Item(
"tail",
"It is long and tapered, like an iguana's, but much fuzzier.",
["tail"],
["cat"]
)
tail.feature = true;

let horns = new Item(
"horns",
"The gracefully swept horns look freshly sharpened.",
["horns"],
["minotaur"]
)
horns.feature = true;

module.exports = {
cellPhone: cellPhone,
brick: brick,
bust: bust,
sword: sword,
glowingWall: glowingWall,
tail: tail,
horns: horns
}


// // In this module:

// var MyObjectOrSomeCleverName = require("./my_object.js");
Expand Down
41 changes: 0 additions & 41 deletions client/src/Objects/ItemConstructor.js

This file was deleted.

Loading