kory75 / CharacterSheetGenerator

Ultimate character sheet generator project. All in one files with random generator, saving and printing.
3 stars 2 forks source link

Create character.js #6

Closed hevesg closed 10 years ago

hevesg commented 10 years ago

Please check. Character Class with basic methods (base)

hevesg commented 10 years ago

Agree. Shall we go with Angular then? However we should also use extra scripts (ex the one above). And also:

(Sorry for keep on closing and opening the conversation Github is a brand new game for me)

kory75 commented 10 years ago

At this point I don't have time to learn a new framework. ;) I working on the Paranoia one I use jQuery and bootstraps. It would be great if you guys can pick one like Warhammer Fantasy or 40K and there you could show me this AngularJS stuff there. I want to create the paranoia one as basic demo, to demonstrate the Required Functionality. To set up a standard in functionality (not the tech). I don't mind to rewrite this later. I try to use minimal file number while keeping it sane.

We can work out a common library in the mean time.

kory75 commented 10 years ago

Library: Class: Storage Functions: Load, Save, New, Delete

Class: Dice Functions: RandomRoll(diceType) RandomRolls(array diceTypes)

Class: Sheet Build, Update

kory75 commented 10 years ago

I looked into storing data in XML. Like Attribute names and Skill names, equipment, but it will not work from filesystem. Because permission problems (Not the values but the fields itself to build the character sheet)

kory75 commented 10 years ago

AngularJS looks good, I will catch up on it in the mean time. :)

kory75 commented 10 years ago

I have created a new file Paranoia2ndv2.html as a placeholder for the angularJS version. Please, add any angularJS stuff here, not the first version.

hevesg commented 10 years ago

Dice question: Which shall it be?

kory75 commented 10 years ago

We should break it two levels

1.) Handles 1 dice roll Dice.roll(['1d20'])

2.) Handles combination of dices an integers. (calls Dice.roll ) Dice.sumRolls(['1d20','+1','3d6','-2'])

hevesg commented 10 years ago

The last one seems a bit tricky. Let me think...

kory75 commented 10 years ago

I think the first one is tricky. ;)

The second one is only simple sum function Dice.sumRolls(new_rolls){ result = 0; new_rolls.forEach (function(one_roll){ result = result + Dice.roll(one_roll); }); return result }

kory75 commented 10 years ago

Dice.roll() should handle integers '-1' or dice rolls "d6" or multiple dice rolls "2d10" 1 a) Dice.roll('-1'); returns: -1

1b) Dice.roll('d6'); returns: 1 to 6

1c) Dice.roll('2d10'); returns 2 to 20 [possible to call recursively itself Dice.roll('d10')+Dice.roll('d10') ]

1C is may not needed at all as we can do: Dice.sumRolls(['d10','d10']);

hevesg commented 10 years ago

Tricky I mean that it might be a better solution just to use one function as this: Dice.roll('d20+2+3d5-1') What do you think?

kory75 commented 10 years ago

If one call is easier for you that is fine.

I would make the following: Dice.roll('d10'); Dice.roll('1'); Dice.roll('-2'); and Dice.sumRolls(array dices);

But I like to break it down to small chunks ;)

reyrodrigez commented 10 years ago

let's move this conversation over to an issue: https://github.com/kory75/CharacterSheetGenerator/issues/7 :v: