Генератор персонажей
This commit is contained in:
parent
2312976058
commit
24165487cc
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
<link rel="stylesheet" href="stylesheets/stylesheet.css" media="screen"/>
|
<link rel="stylesheet" href="stylesheets/stylesheet.css" media="screen"/>
|
||||||
<link rel="stylesheet" href="stylesheets/pygment_trac.css"/>
|
<link rel="stylesheet" href="stylesheets/pygment_trac.css"/>
|
||||||
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
|
<script type="text/javascript" src="http://yandex.st/jquery/2.0.0/jquery.min.js"></script>
|
||||||
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
|
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
|
||||||
<script type="text/javascript" src="javascripts/script.js"></script>
|
<script type="text/javascript" src="javascripts/script.js"></script>
|
||||||
|
|
||||||
|
|
11
chargen.html
Normal file
11
chargen.html
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
---
|
||||||
|
layout: main
|
||||||
|
---
|
||||||
|
<script type="text/javascript" src="javascripts/chargen.js"></script>
|
||||||
|
<link rel="stylesheet" href="stylesheets/chargen.css"/>
|
||||||
|
<div id="wrapper_overview">
|
||||||
|
<div class="group" id="specials"></div>
|
||||||
|
<div class="group" id="derived"></div>
|
||||||
|
<div class="group">Осталось отметить навыков: <div id="skills_to_tag"></div></div>
|
||||||
|
<div id="skills" class="group"></div>
|
||||||
|
</div>
|
|
@ -2,6 +2,9 @@
|
||||||
layout: main
|
layout: main
|
||||||
---
|
---
|
||||||
# Создание персонажа
|
# Создание персонажа
|
||||||
|
|
||||||
|
Для удобства существует [онлайн-генератор](chargen.html) персонажей 1го уровня.
|
||||||
|
|
||||||
## Первичные характеристики
|
## Первичные характеристики
|
||||||
|
|
||||||
Каждая из характеристик может принимать любое значение от 1 до 10 включительно.
|
Каждая из характеристик может принимать любое значение от 1 до 10 включительно.
|
||||||
|
|
177
javascripts/chargen.js
Normal file
177
javascripts/chargen.js
Normal file
|
@ -0,0 +1,177 @@
|
||||||
|
function parameter(id, name, value) {
|
||||||
|
if (typeof value === 'undefined') {
|
||||||
|
value = 5;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
id: id,
|
||||||
|
name: name,
|
||||||
|
value: value,
|
||||||
|
tagged: false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function positive(value) {
|
||||||
|
if (value < 1) return 1;
|
||||||
|
else return value;
|
||||||
|
}
|
||||||
|
var options = {
|
||||||
|
specials: {
|
||||||
|
strength: parameter('strength', 'Сила'),
|
||||||
|
endurance: parameter('endurance', 'Выносливость'),
|
||||||
|
charisma: parameter('charisma', 'Обаяние'),
|
||||||
|
intelligence: parameter('intelligence', 'Интеллект'),
|
||||||
|
agility: parameter('agility', 'Ловкость'),
|
||||||
|
luck: parameter('luck', 'Удача'),
|
||||||
|
},
|
||||||
|
special_points: 5,
|
||||||
|
skills_to_tag: 3,
|
||||||
|
derived: [
|
||||||
|
parameter('action_points','Очки действий', function(specials){
|
||||||
|
return Math.floor(5 + specials.agility.value * 0.5);
|
||||||
|
}),
|
||||||
|
parameter('carry_weight','Максимальный вес, кг', function(specials){
|
||||||
|
return 6 + specials.strength.value * 10;
|
||||||
|
}),
|
||||||
|
parameter('critical_chance','Критический шанс, %', function(specials){
|
||||||
|
return specials.luck.value;
|
||||||
|
}),
|
||||||
|
parameter('hit_points','Очки Здоровья', function(specials){
|
||||||
|
return 15 + specials.strength.value + specials.endurance.value * 2;
|
||||||
|
}),
|
||||||
|
parameter('skill_points','Очки навыков на уровень', function(specials){
|
||||||
|
return 5 + specials.intelligence.value * 2;
|
||||||
|
}),
|
||||||
|
parameter('combat_sequence','Очерёдность в бою', function(specials){
|
||||||
|
return Math.floor(specials.agility.value + (specials.luck.value + specials.strength.value) * 0.5);
|
||||||
|
}),
|
||||||
|
parameter('healing_rate','Скорость лечения', function(specials){
|
||||||
|
return specials.endurance.value + 6;
|
||||||
|
}),
|
||||||
|
parameter('throwing_range','Дальность броска, м', function(specials){
|
||||||
|
return specials.strength.value + 6;
|
||||||
|
}),
|
||||||
|
parameter('poison_resistance','Сопротивление яду, %', function(specials){
|
||||||
|
return specials.endurance.value * 5;
|
||||||
|
}),
|
||||||
|
parameter('armor_class','Базовый класс брони', function(specials){
|
||||||
|
return specials.agility.value;
|
||||||
|
}),
|
||||||
|
parameter('melee_damage','Рукопашный урон', function(specials){
|
||||||
|
return positive(specials.strength.value - 5);
|
||||||
|
})
|
||||||
|
],
|
||||||
|
skills: [
|
||||||
|
parameter('guns','Огнестрельное Оружие', function(specials){
|
||||||
|
return specials.agility.value * 2;
|
||||||
|
}),
|
||||||
|
parameter('archery','Стрельба из лука', function(specials){
|
||||||
|
return 5 + specials.strength.value + specials.agility.value;
|
||||||
|
}),
|
||||||
|
parameter('melee','Холодное оружие', function(specials){
|
||||||
|
return 20 + 2 * (specials.strength.value + specials.agility.value);
|
||||||
|
}),
|
||||||
|
parameter('unarmed','Рукопашный бой', function(specials){
|
||||||
|
return 30 + 2 * (specials.strength.value + specials.agility.value);
|
||||||
|
}),
|
||||||
|
parameter('throwing','Метание', function(specials){
|
||||||
|
return 4 * specials.agility.value;
|
||||||
|
}),
|
||||||
|
parameter('lockpick','Взлом', function(specials){
|
||||||
|
return 10 + specials.agility.value + specials.intelligence.value;
|
||||||
|
}),
|
||||||
|
parameter('first_aid','Медицина', function(specials){
|
||||||
|
return 15 + specials.intelligence.value;
|
||||||
|
}),
|
||||||
|
parameter('repair','Ремонт', function(specials){
|
||||||
|
return 3 * specials.intelligence.value;
|
||||||
|
}),
|
||||||
|
parameter('science','Наука', function(specials){
|
||||||
|
return 4 * specials.intelligence.value;
|
||||||
|
}),
|
||||||
|
parameter('stealth','Скрытность', function(specials){
|
||||||
|
return 3 * specials.agility.value;
|
||||||
|
}),
|
||||||
|
parameter('performance','Выступление', function(specials){
|
||||||
|
return 4 * specials.intelligence.value;
|
||||||
|
}),
|
||||||
|
parameter('survival','Выживание', function(specials){
|
||||||
|
return 2 * (specials.endurance.value + specials.intelligence.value);
|
||||||
|
}),
|
||||||
|
parameter('animal_handling','Обращение с животными', function(specials){
|
||||||
|
return specials.agility.value + specials.strength.value + specials.intelligence.value;
|
||||||
|
}),
|
||||||
|
parameter('driving','Вождение', function(specials){
|
||||||
|
return 2 * (specials.agility.value + specials.endurance.value);
|
||||||
|
})
|
||||||
|
]
|
||||||
|
};
|
||||||
|
function update_derived() {
|
||||||
|
var i = 0;
|
||||||
|
var text = '';
|
||||||
|
jQuery('#derived').empty();
|
||||||
|
jQuery('#skills').empty();
|
||||||
|
for (i = 0; i < options.derived.length; i++) {
|
||||||
|
value = options.derived[i].value(options.specials);
|
||||||
|
jQuery('#derived').append('<div class="parameter"><div class="value" id="' + options.derived[i].id + '"> '+ value + ' </div></div><div class="name">' + options.derived[i].name + '</div>');
|
||||||
|
}
|
||||||
|
for (i = 0; i < options.skills.length; i++) {
|
||||||
|
value = options.skills[i].value(options.specials);
|
||||||
|
if (options.skills[i].tagged) value = value + 15;
|
||||||
|
text = '<div class="row"><div class="parameter"><div class="value" id="' + options.skills[i].id + '"> '+ value + ' </div></div><div class="name">' + options.skills[i].name + '<input type="checkbox" name="' + i + '"';
|
||||||
|
if (options.skills[i].tagged) {
|
||||||
|
text = text + ' checked';
|
||||||
|
}
|
||||||
|
text = text + '></div></div>';
|
||||||
|
jQuery('#skills').append(text);
|
||||||
|
jQuery('#skills_to_tag').text(options.skills_to_tag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
jQuery(document).ready(function () {
|
||||||
|
var i = 0;
|
||||||
|
objects = ['strength', 'endurance', 'charisma', 'intelligence', 'agility', 'luck'];
|
||||||
|
for (i = 0; i < objects.length; i++) {
|
||||||
|
jQuery('#specials').append('<div class="parameter"><a class="decrement" href="#">–</a><div class="value" id="' + options.specials[objects[i]].id + '"> '+ options.specials[objects[i]].value + ' </div><a class="increment" href="#">+</a></div><div class="name">' + options.specials[objects[i]].name + '</div>');
|
||||||
|
}
|
||||||
|
update_derived();
|
||||||
|
jQuery('#skills').on('click', 'input[type=checkbox]', function (event) {
|
||||||
|
if (jQuery(this).is(':checked')) {
|
||||||
|
if (options.skills_to_tag > 0){
|
||||||
|
options.skills_to_tag--;
|
||||||
|
jQuery(this).attr('checked', 'true');
|
||||||
|
} else {
|
||||||
|
event.preventDefault();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
options.skills_to_tag++;
|
||||||
|
jQuery(this).removeAttr('checked');
|
||||||
|
}
|
||||||
|
chosen_skill = jQuery(this).attr('name');
|
||||||
|
options.skills[chosen_skill].tagged = !options.skills[chosen_skill].tagged;
|
||||||
|
update_derived();
|
||||||
|
});
|
||||||
|
jQuery('#specials .increment').click(function () {
|
||||||
|
if (options.special_points == 0) return false;
|
||||||
|
options.special_points--;
|
||||||
|
for (i = 0; i < objects.length; i++) {
|
||||||
|
if (options.specials[objects[i]].id == jQuery(this).siblings(".value").attr('id')) {
|
||||||
|
options.specials[objects[i]].value++;
|
||||||
|
jQuery(this).siblings(".value").text(' '+options.specials[objects[i]].value+' ');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
update_derived();
|
||||||
|
});
|
||||||
|
jQuery('#specials .decrement').click(function () {
|
||||||
|
options.special_points++;
|
||||||
|
for (i = 0; i < objects.length; i++) {
|
||||||
|
if (options.specials[objects[i]].id == jQuery(this).siblings(".value").attr('id')) {
|
||||||
|
options.specials[objects[i]].value--;
|
||||||
|
jQuery(this).siblings(".value").text(' '+options.specials[objects[i]].value+' ');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
update_derived();
|
||||||
|
});
|
||||||
|
});
|
186
stylesheets/chargen.css
Normal file
186
stylesheets/chargen.css
Normal file
|
@ -0,0 +1,186 @@
|
||||||
|
/*
|
||||||
|
Margin, padding, and border resets
|
||||||
|
except for form elements
|
||||||
|
*/
|
||||||
|
body,
|
||||||
|
div,
|
||||||
|
h1,
|
||||||
|
h2,
|
||||||
|
h3,
|
||||||
|
h4,
|
||||||
|
h5,
|
||||||
|
h6,
|
||||||
|
p,
|
||||||
|
blockquote,
|
||||||
|
pre,
|
||||||
|
dl,
|
||||||
|
dt,
|
||||||
|
dd,
|
||||||
|
ol,
|
||||||
|
ul,
|
||||||
|
li,
|
||||||
|
fieldset,
|
||||||
|
form,
|
||||||
|
label,
|
||||||
|
legend,
|
||||||
|
th,
|
||||||
|
td,
|
||||||
|
article,
|
||||||
|
aside,
|
||||||
|
figure,
|
||||||
|
footer,
|
||||||
|
header,
|
||||||
|
hgroup,
|
||||||
|
menu,
|
||||||
|
nav,
|
||||||
|
section {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
Consistency fixes
|
||||||
|
adopted from http://necolas.github.com/normalize.css/
|
||||||
|
*/
|
||||||
|
article,
|
||||||
|
aside,
|
||||||
|
details,
|
||||||
|
figcaption,
|
||||||
|
figure,
|
||||||
|
footer,
|
||||||
|
header,
|
||||||
|
hgroup,
|
||||||
|
nav,
|
||||||
|
section,
|
||||||
|
audio,
|
||||||
|
canvas,
|
||||||
|
video {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
html {
|
||||||
|
height: 100%;
|
||||||
|
-webkit-text-size-adjust: 100%;
|
||||||
|
-ms-text-size-adjust: 100%;
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
min-height: 100%;
|
||||||
|
font-size: 100%;
|
||||||
|
}
|
||||||
|
sub,
|
||||||
|
sup {
|
||||||
|
font-size: 75%;
|
||||||
|
line-height: 0;
|
||||||
|
position: relative;
|
||||||
|
vertical-align: baseline;
|
||||||
|
}
|
||||||
|
sup {
|
||||||
|
top: -0.5em;
|
||||||
|
}
|
||||||
|
sub {
|
||||||
|
bottom: -0.25em;
|
||||||
|
}
|
||||||
|
pre {
|
||||||
|
white-space: pre;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
word-wrap: break-word;
|
||||||
|
}
|
||||||
|
b,
|
||||||
|
strong {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
abbr[title] {
|
||||||
|
border-bottom: 1px dotted;
|
||||||
|
}
|
||||||
|
table {
|
||||||
|
border-collapse: collapse;
|
||||||
|
border-spacing: 0;
|
||||||
|
}
|
||||||
|
a img,
|
||||||
|
img {
|
||||||
|
-ms-interpolation-mode: bicubic;
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
input,
|
||||||
|
textarea,
|
||||||
|
button,
|
||||||
|
select {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 100%;
|
||||||
|
line-height: normal;
|
||||||
|
vertical-align: baseline;
|
||||||
|
}
|
||||||
|
button,
|
||||||
|
html input[type="button"],
|
||||||
|
input[type="reset"],
|
||||||
|
input[type="submit"] {
|
||||||
|
cursor: pointer;
|
||||||
|
-webkit-appearance: button;
|
||||||
|
}
|
||||||
|
input[type="checkbox"],
|
||||||
|
input[type="radio"] {
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
|
-moz-box-sizing: border-box;
|
||||||
|
-o-box-sizing: border-box;
|
||||||
|
-ms-box-sizing: border-box;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
textarea {
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
#wrapper_overview {
|
||||||
|
margin: 1em auto;
|
||||||
|
width: 43.888888888888886em;
|
||||||
|
}
|
||||||
|
.group {
|
||||||
|
margin-top: 18px;
|
||||||
|
width: 21.666666666666668em;
|
||||||
|
}
|
||||||
|
.group .parameter {
|
||||||
|
width: 3.888888888888889em;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
.group .parameter .value {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
.group .name {
|
||||||
|
width: 17.22222222222222em;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
.group .name input {
|
||||||
|
margin-left: 0.5em;
|
||||||
|
}
|
||||||
|
#specials {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
#specials .value,
|
||||||
|
#skills .value {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
#specials .name,
|
||||||
|
#skills .name {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
#derived {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
#derived .value {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
#derived .name {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
.increment,
|
||||||
|
.decrement {
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
#skills {
|
||||||
|
/* checkboxes! */
|
||||||
|
|
||||||
|
}
|
||||||
|
/* Colors */
|
||||||
|
body {
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
a {
|
||||||
|
color: #0000ff;
|
||||||
|
}
|
|
@ -579,3 +579,6 @@ footer .owner p a {
|
||||||
.highlight .vg { color: #008080 } /* Name.Variable.Global */
|
.highlight .vg { color: #008080 } /* Name.Variable.Global */
|
||||||
.highlight .vi { color: #008080 } /* Name.Variable.Instance */
|
.highlight .vi { color: #008080 } /* Name.Variable.Instance */
|
||||||
.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */
|
.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */
|
||||||
|
footer, #container:after {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue