1 import { GraphicEntityModule } from './entity-module/GraphicEntityModule.js';
2 import { ToggleModule } from './toggle-module/ToggleModule.js';
4 export const gameName = 'Castle-Troll';
6 export const playerColors = [
8 '#22a1e4' // curious blue
11 export const modules = [
16 function trollCase(string) {
17 return string.split('')
18 .map(c => c < 64 ? c : String.fromCharCode(c.charCodeAt(0) ^ (32 * (Math.floor(2*Math.random())))))
22 function trollToggle(toggle, title, def) {
24 obj['toggle'] = toggle;
25 obj['title'] = trollCase(title);
27 for (var i = 3; i < arguments.length; i += 2) {
28 obj['values'][trollCase(arguments[i])] = arguments[i+1];
31 if (def == undefined) {
32 if (values.length > 2) {
33 obj['default'] = values.length * Math.floor(2 * Math.random());
36 obj['default'] = Math.random() < 0.5;
39 return ToggleModule.defineToggle(obj);
42 export const options = [
43 trollToggle('verboseTrolling', 'Verbose Trolling', true,
44 'on', true, 'off', false),
45 trollToggle('debug', 'Detroll Mode', false,
46 'on', true, 'off', false)