mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-30 00:12:56 +00:00
have part of the random encoutner generator working, should move over to flux before continuing
This commit is contained in:
@@ -1,47 +0,0 @@
|
||||
module.exports = {
|
||||
goblin : {
|
||||
hp : 40,
|
||||
mov: 30,
|
||||
cr : 0.25,
|
||||
ac : 13,
|
||||
attr : {
|
||||
str : 8,
|
||||
con : 8,
|
||||
dex : 8,
|
||||
int : 8,
|
||||
wis : 8,
|
||||
cha : 8
|
||||
},
|
||||
attacks : {
|
||||
dagger : {
|
||||
atk : "1d20-5",
|
||||
dmg : "1d4+5",
|
||||
type : "pierce",
|
||||
notes : "Super cool"
|
||||
},
|
||||
bow : {
|
||||
atk : "1d20+2",
|
||||
dmg : "6d6",
|
||||
rng : "30"
|
||||
}
|
||||
},
|
||||
spells : {
|
||||
fireball: {
|
||||
dmg : "6d6",
|
||||
uses : 4
|
||||
},
|
||||
"healing bolt" : {
|
||||
heal : "2d8+4",
|
||||
uses : 6
|
||||
}
|
||||
},
|
||||
abilities : {
|
||||
"pack tactics" : "Does a thing"
|
||||
},
|
||||
items : ['healing_potion', 'healing_potion', 'ring']
|
||||
},
|
||||
|
||||
"Goat Slime" : {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ var Encounter = React.createClass({
|
||||
reward : '',
|
||||
enemies : [],
|
||||
players : '',
|
||||
index : {},
|
||||
unique : {},
|
||||
|
||||
monsterManual : {}
|
||||
};
|
||||
@@ -109,8 +109,7 @@ var Encounter = React.createClass({
|
||||
var reward;
|
||||
if(this.props.reward){
|
||||
reward = <div className='reward'>
|
||||
<i className='fa fa-trophy' />
|
||||
{this.props.reward}
|
||||
<i className='fa fa-trophy' /> Rewards: {this.props.reward}
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
@@ -7,13 +7,18 @@
|
||||
&>.info{
|
||||
|
||||
margin-left: 10px;
|
||||
padding-bottom : 10px;
|
||||
border-bottom: 1px solid #ddd;
|
||||
h1{
|
||||
font-size: 2em;
|
||||
font-weight: 800;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
p{
|
||||
margin-left: 10px;
|
||||
font-size: 0.8em;
|
||||
line-height: 1.5em;
|
||||
max-width: 600px;
|
||||
}
|
||||
.reward{
|
||||
font-size: 0.8em;
|
||||
|
||||
@@ -44,7 +44,7 @@ var encounters = [
|
||||
|
||||
];
|
||||
|
||||
var defaultMonsterManual = require('./defaultMonsterManual.js');
|
||||
var defaultMonsterManual = require('naturalCrit/defaultMonsterManual.js');
|
||||
|
||||
var attrMod = function(attr){
|
||||
return Math.floor(attr/2) - 5;
|
||||
@@ -101,13 +101,8 @@ var NaturalCrit = React.createClass({
|
||||
|
||||
renderSelectedEncounter : function(){
|
||||
var self = this;
|
||||
var selectedEncounter = _.find(this.state.encounters, function(encounter){
|
||||
return encounter.name == self.state.selectedEncounter;
|
||||
});
|
||||
|
||||
|
||||
|
||||
if(this.state.selectedEncounterIndex != null && selectedEncounter != null){
|
||||
if(this.state.selectedEncounterIndex != null && this.state.encounters[this.state.selectedEncounterIndex]){
|
||||
var selectedEncounter = this.state.encounters[this.state.selectedEncounterIndex]
|
||||
return <Encounter
|
||||
key={selectedEncounter.name}
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
var _ = require('lodash');
|
||||
|
||||
|
||||
|
||||
|
||||
var rewards = ['goat sac', '10 gold', '100 gold', '101 gold', 'curved horn', 'wand of wand creation',
|
||||
'bag of hand-holding', '1 copper', 'true friendship',
|
||||
]
|
||||
|
||||
|
||||
|
||||
|
||||
module.exports = function(){
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -4,6 +4,9 @@ var cx = require('classnames');
|
||||
|
||||
var JSONFileEditor = require('naturalCrit/jsonFileEditor/jsonFileEditor.jsx');
|
||||
|
||||
var GetRandomEncounter = require('naturalCrit/randomEncounter.js');
|
||||
|
||||
|
||||
var Encounters = React.createClass({
|
||||
getDefaultProps: function() {
|
||||
return {
|
||||
@@ -26,6 +29,10 @@ var Encounters = React.createClass({
|
||||
this.props.onRemoveEncounter(encounterIndex);
|
||||
},
|
||||
|
||||
addRandomEncounter : function(){
|
||||
this.props.onJSONChange(this.props.encounters.length, GetRandomEncounter());
|
||||
},
|
||||
|
||||
|
||||
renderEncounters : function(){
|
||||
var self = this;
|
||||
@@ -58,7 +65,7 @@ var Encounters = React.createClass({
|
||||
<h3>
|
||||
<i className='fa fa-flag' /> Encounters
|
||||
<button className='addEncounter'>
|
||||
<i className='fa fa-plus' />
|
||||
<i className='fa fa-plus' onClick={this.addRandomEncounter}/>
|
||||
</button>
|
||||
</h3>
|
||||
{this.renderEncounters()}
|
||||
|
||||
Reference in New Issue
Block a user