- 0
-
- 1
-
Brake
+
+
+
+
+ Name: | Alive: | Score: | Ping: |
+
+
+
+
+
+
-
-
-
- Name: | Alive: | Score: | Ping: |
-
-
-
-
-
-
-
diff --git a/scripts/config.js b/scripts/config.js
index 6308a0c..ab6c0d1 100644
--- a/scripts/config.js
+++ b/scripts/config.js
@@ -1,1293 +1,1295 @@
/*
* 3DCycles - A lightcycle game.
* Copyright (C) 2019 Glen Harpring
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/*class Setting
{
constructor(conf)
{
switch(typeof(conf))
{
case "object": this = conf; break;
}
}
push()
{
settings_work[this.name] = this;
settings[this.name] = this.val;
}
}
//new Setting({name:"VERIFY_COLOR_STRICT",val:false}).push();
var settings_work = {};*/
settings = {
VERIFY_COLOR_STRICT: false,
TEXT_BRIGHTEN: false,
TEXT_DARK_HIGHLIGHT: true,
FONT_MIN_R: 0.5, FONT_MIN_G: 0.5, FONT_MIN_B: 0.5,
FONT_MIN_TOTAL: 0.7,
CHAT_LAYER: 0.5,
TEXT_OUT: function(params=undefined){if(params !== undefined) engine.console.style.display=params?"block":"none"; return engine.console.style.display!="none";},
TEXT_OUT_MODE: 1,
FULLSCREEN: function(params=undefined){
if(params !== undefined)
{
var bd = document.body;
if(params)
{
if(bd.requestFullscreen) bd.requestFullscreen();
else if(bd.webkitRequestFullscreen) bd.webkitRequestFullscreen();
else if(bd.mozRequestFullScreen) bd.mozRequestFullScreen();
else if(bd.msRequestFullscreen) bd.msRequestFullscreen();
else alert("Can't go into fullscreen. Please alert nelg with information on what browser you're using.")
}
else
{
if(bd.exitFullscreen) bd.exitFullscreen();
else if(document.webkitExitFullscreen) document.webkitExitFullscreen();
else if(document.mozCancelFullScreen) document.mozCancelFullScreen();
//else if(document.msCancelFullscreen) bd.msCancelFullscreen();
else alert("Can't exit fullscreen. Please alert nelg with information on what browser you're using")
}
}
return Boolean(window.fullScreen || document.mozFullScreen || document.msFullScreen || document.webkitIsFullScreen || window.outerHeight - window.innerHeight <= 1);
},
//CAMERA
CAMERA_FOV: 60,
CAMERA_NEAR_RENDER: 0.001,
CAMERA_FAR_RENDER: 2000,
//GAME
GRID_SIZE: 1,
/*FLOOR_RED: 0.75,
FLOOR_GREEN: 0.75,
FLOOR_BLUE: 0.98,*/
FLOOR_RED: 0.03,
FLOOR_GREEN: 0.266,
FLOOR_BLUE: 0.8,
FLOOR_TEXTURE: "images/textures/floor.png",
/*GRID_SIZE: 2,
FLOOR_RED: 1,
FLOOR_GREEN: 1,
FLOOR_BLUE: 1,
FLOOR_TEXTURE: "images/textures/moviepack_t_r_u_e/floor.png",*/
/*GRID_SIZE: 1,
FLOOR_RED: 0.01,
FLOOR_GREEN: 0.14,
FLOOR_BLUE: 0.35,
FLOOR_TEXTURE: "images/textures/aaold/floor.png",*/
FLOOR_MIRROR: false,
FLOOR_MIRROR_INT: 1,
EXPLOSIONS: true,
HIGH_RIM: false,
LOW_RIM_HEIGHT: 50,
RIM_WALL_RED: 0,
RIM_WALL_GREEN: 0, // 0.533
RIM_WALL_BLUE: 0, // 1
RIM_WALL_ALPHA: 0.9,
RIM_WALL_COLOR_MODE: 3,
RIM_WALL_STRETCH_X: 50,
RIM_WALL_STRETCH_Y: 13.5,
RIM_WALL_WRAP_Y: false,
RIM_WALL_REPEAT_TOP: false,
RIM_WALL_TEXTURE: "images/textures/futurerim.png",
RIM_WALL_DEPTH: true,
RIM_WALL_LOWEST_HEIGHT: 0,
RIM_WALL_BELOW_HEIGHT_COLOR_R: 0,
RIM_WALL_BELOW_HEIGHT_COLOR_G: 0,
RIM_WALL_BELOW_HEIGHT_COLOR_B: 0,
/*RIM_WALL_RED: 1,
RIM_WALL_GREEN: 1,
RIM_WALL_BLUE: 1,
RIM_WALL_ALPHA: 1,
RIM_WALL_COLOR_MODE: 0,
//RIM_WALL_STRETCH_X: 300,
//RIM_WALL_STRETCH_Y: 50,
RIM_WALL_STRETCH_X: 128,
RIM_WALL_STRETCH_Y: 32,
LOW_RIM_HEIGHT: 32,
RIM_WALL_WRAP_Y: false,
RIM_WALL_TEXTURE: "images/textures/moviepack_eddkeefe/rim_wall.png",
RIM_WALL_LOWEST_HEIGHT: 32,
RIM_WALL_BELOW_HEIGHT_COLOR_R: 166/255,
RIM_WALL_BELOW_HEIGHT_COLOR_G: 45/255,
RIM_WALL_BELOW_HEIGHT_COLOR_B: 237/255,//*/
RIM_WALL_RED: 1,
RIM_WALL_GREEN: 1,
RIM_WALL_BLUE: 1,
RIM_WALL_ALPHA: 1,
RIM_WALL_COLOR_MODE: 0,
//RIM_WALL_STRETCH_X: 300,
//RIM_WALL_STRETCH_Y: 50,
RIM_WALL_STRETCH_X: 1536,
RIM_WALL_STRETCH_Y: 32,
LOW_RIM_HEIGHT: 32,
RIM_WALL_WRAP_Y: false,
RIM_WALL_TEXTURE: "images/textures/moviepack_t_r_u_e/movie-rim-wall.png",
RIM_WALL_DEPTH: true,
RIM_WALL_LOWEST_HEIGHT: 32,
/*RIM_WALL_BELOW_HEIGHT_COLOR_R: 188/255,
RIM_WALL_BELOW_HEIGHT_COLOR_G: 206/255,
RIM_WALL_BELOW_HEIGHT_COLOR_B: 250/255,//*/
RIM_WALL_BELOW_HEIGHT_COLOR_R: 0.5,
RIM_WALL_BELOW_HEIGHT_COLOR_G: 0.5,
RIM_WALL_BELOW_HEIGHT_COLOR_B: 0.7,
COLOR_MODE_3_COLORS: "1,0,0;1,1,0;0,1,0;0,1,1;0,0,1;1,0,1",
COLOR_MODE_3_SPEED: 0.2,
ALPHA_BLEND: true,
MENU_RENDER: "img",
REDRAW_MODE: 0,
TARGET_FPS: 1,
MAX_TARGET_FPS: 1000,
//DEDICATED_FPS: Infinity,
DEDICATED_FPS: 40,
GRAB_SENSORS_ON_TURN: true,
CYCLE_SENSORS_RANGE: 100,
GAME_LOOP: 0.5,
TIME_FACTOR: 1,
HUD_MAP: true,
ADMIN_KILL_MESSAGE: true,
//SOUNDS
SOUNDS_INTRO: false,
SOUNDS_EXTRO: false,
SOUNDS_COUNTDOWN: true,
SOUNDS_GO: false,
SOUNDS_ZONES: false,
MUSIC: 0,
//ZONES
ZONE_HEIGHT: 5,
ZONE_SEGMENTS: 11,//arma render only
ZONE_SEG_LENGTH: 0.5,//arma render only
ZONE_ALPHA: 0.7,
ZONE_SPIN_SPEED: 0.05,
ZONE_RENDER_TYPE: 'arma',//cylinder or arma
//player (for armagetron nabs) //can't have people changing these on a server
PLAYER_1: function(val) { if(engine.dedicated) return (settings.PLAYER_1 = "Player 1"); if(typeof(val) != "undefined") {settings.players[0].name=val;} return settings.players[0].name; },
COLOR_R_1: function(r=undefined) { if(engine.dedicated) return (settings.COLOR_R_1=13); return plnumcolors({r:r}) },
COLOR_G_1: function(g=undefined) { if(engine.dedicated) return (settings.COLOR_G_1=13); return plnumcolors({g:g}) },
COLOR_B_1: function(b=undefined) { if(engine.dedicated) return (settings.COLOR_B_1=0); return plnumcolors({b:b}) },
PLAYER_DEL_HIST_PERROUND: true, //what was this?
TIMESTEP_MAX: 0.2,
//debug
DEBUG_EVERYONE_IS_AI: false,
HACK_TURN_LEFT_WHEN_POSSIBLE: 0,
HACK_TURN_RIGHT_WHEN_POSSIBLE: 0,
HACK_TURN_SENSOR_DIST: 5,
CHATBOT_ALWAYS_ACTIVE: false,
//NETWORK
CONNECT_PORT: 8765,
CONNECT_HOST: "armagetron.kevinh.us",
CONNECT_SSL: true,
CYCLE_SMOOTH_TIME: 0.3,
CYCLE_SYNC_INTERVAL: 0.1,
SERVER_PORT: 8765,
SERVER_NAME: "Unnamed Server",
SERVER_DNS: "",
SERVER_SSL_ENABLED: false,
SERVER_SSL_KEY: "",
SERVER_SSL_CERT: "",
};
if(!Detector.webgl)
{
//choose better defaults for the software renderer
settings.HIGH_RIM = false;
settings.LOW_RIM_HEIGHT = 4;
settings.RIM_WALL_TEXTURE = "";
settings.RIM_WALL_DEPTH = false;
settings.ALPHA_BLEND = false;
}
game_settings_default = {
AI_FORCE_BRAKE: false,
//CYCLE
CYCLE_ACCEL: 10,
CYCLE_ACCEL_ENEMY: 1,
CYCLE_ACCEL_OFFSET: 2,
CYCLE_ACCEL_RIM: 0,
CYCLE_ACCEL_SELF: 1,
CYCLE_ACCEL_SLINGSHOT: 1,
CYCLE_ACCEL_TEAM: 1,
CYCLE_ACCEL_TUNNEL: 1,
CYCLE_WALL_NEAR: 6,
CYCLE_BRAKE: 30,
CYCLE_BRAKE_DEPLETE: 1,
CYCLE_BRAKE_REFILL: 0.1,
CYCLE_BOOST: 0,
CYCLE_JUMP: 0.5,
CYCLE_JUMP: 0,
CYCLE_MIDAIR_JUMP: false,
CYCLE_MIDAIR_TURN: false,
CYCLE_WALL_RAMP_ENABLE: true,
CYCLE_DELAY: 0.02,
CYCLE_RUBBER: 5,
CYCLE_RUBBER_TIME: 10,
//CYCLE_RUBBER_TIMEBASED: 0,
CYCLE_RUBBER_MINDISTANCE: 0.03,
CYCLE_RUBBER_MINADJUST: 0.05,
CYCLE_RUBBER_DEPLETE_RIM: true,
CYCLE_RUBBER_DEPLETE_SELF: true,
CYCLE_RUBBER_DEPLETE_ENEMY: true,
CYCLE_SOUND_SPEED: 30,
CYCLE_SPEED: 20,
CYCLE_SPEED_DECAY_ABOVE: 0.1,
CYCLE_SPEED_DECAY_BELOW: 5,
CYCLE_SPEED_MAX: 0,
CYCLE_SPEED_MIN: 0.25,
CYCLE_START_SPEED: 20,
CYCLE_TURN_MEMORY: 3,
CYCLE_TURN_SPEED_FACTOR: 0.95,
WALLS_LENGTH: 600,
//WALLS_LENGTH: 30,
RESPAWN_TIME: -1,
CYCLE_FIRST_SPAWN_PROTECTION: false,
CYCLE_WALL_TIME: 5,
CYCLE_INVULNERABILITY_TIME: -1,
WALLS_STAY_UP_DELAY: 1,
//TEAMS
TEAMS_MAX_PLAYERS: 1,
TEAMS_MIN_PLAYERS: 1,
TEAMS_MAX: 16,
TEAMS_MIN: 4,
//TEAMS_MIN: 2,
TEAM_ALLOW_SHUFFLE_IP: 0,
ALLOW_TEAM_NAME_PLAYER: true,
ALLOW_TEAM_NAME_COLOR: true,
MIN_PLAYERS: 1,
NUM_AIS: 0,
TEAM_NAME_1: "Team Blue", //name of team 1
TEAM_RED_1: 4, //red portion of team 1's color
TEAM_GREEN_1: 8, //green portion of team 1's color
TEAM_BLUE_1: 15, //blue portion of team 1's color
TEAM_NAME_2: "Team Gold", //name of team 2
TEAM_RED_2: 15, //red portion of team 2's color
TEAM_GREEN_2: 15, //green portion of team 2's color
TEAM_BLUE_2: 4, //blue portion of team 2's color
TEAM_NAME_3: "Team Red", //name of team 3
TEAM_RED_3: 15, //red portion of team 3's color
TEAM_GREEN_3: 4, //green portion of team 3's color
TEAM_BLUE_3: 4, //blue portion of team 3's color
TEAM_NAME_4: "Team Green", //name of team 4
TEAM_RED_4: 4, //red portion of team 4's color
TEAM_GREEN_4: 15, //green portion of team 4's color
TEAM_BLUE_4: 4, //blue portion of team 4's color
TEAM_NAME_5: "Team Violet", //name of team 5
TEAM_RED_5: 15, //red portion of team 5's color
TEAM_GREEN_5: 4, //green portion of team 5's color
TEAM_BLUE_5: 15, //blue portion of team 5's color
TEAM_NAME_6: "Team Cyan", //name of team 6
TEAM_RED_6: 4, //red portion of team 6's color
TEAM_GREEN_6: 15, //green portion of team 6's color
TEAM_BLUE_6: 15, //blue portion of team 6's color
TEAM_NAME_7: "Team White", //name of team 7
TEAM_RED_7: 15, //red portion of team 7's color
TEAM_GREEN_7: 15, //green portion of team 7's color
TEAM_BLUE_7: 15, //blue portion of team 7's color
TEAM_NAME_8: "Team Black", //name of team 8
TEAM_RED_8: 8, //red portion of team 8's color
TEAM_GREEN_8: 8, //green portion of team 8's color
TEAM_BLUE_8: 8, //blue portion of team 8's color
//MAP
ARENA_AXES: 4,
STRICT_AXES_SPAWN: true,
RESOURCE_REPOSITORY_CACHE: './cache/resource/',
MAP_FILE: 'Anonymous/polygon/regular/square-1.0.1.aamap.xml',
MAP_ROTATION: "",
ROTATION_TYPE: 0, //1:round, 2:match
RESOURCE_REPOSITORY_SERVER: 'https://www.armanelgtron.tk/armagetronad/resource/',
//RESOURCE_REPOSITORY_BACKUP: 'http://resource.armagetronad.net/resource/',
SIZE_FACTOR: -3,
ARENA_BOUNDARY: -10,
ARENA_BOUNDARY_KILLS: true,
ZONE_ALPHA_SERVER: 1,
//GAME PLAY
GAME_TYPE: 1,
FINISH_TYPE: 2,
LIMIT_ROUNDS: 10,
LIMIT_TIME: 30,
LIMIT_SCORE: 100,
ROUND_WAIT: false,
//SHOOTING
SHOT_THRESH: 2,
//WIN ZONE
WIN_ZONE_DEATHS: false,
WIN_ZONE_EXPANSION: 1,
WIN_ZONE_INITIAL_SIZE: 5,
WIN_ZONE_RANDOMNESS: 0.8,
WIN_ZONE_MIN_LAST_DEATH: 30,
WIN_ZONE_MIN_ROUND_TIME: Infinity, //60
//SPAWN
SPAWN_WINGMEN_SIDE: 2.75362,
SPAWN_WINGMEN_BACK: 2.202896,
//ROUNDLY
ROUND_COMMAND: "",
ROUND_CONSOLE_MESSAGE: "",
ROUND_CENTER_MESSAGE: "",
//TARGET
DEFAULT_TARGET_COMMAND: "",
//TARGET_DECLARE_WINNER: true,
//TARGET_LIFETIME: -1,
TARGET_INITIAL_SCORE: 10,
//TARGET_SCORE_DEPLETE: 2,
//TARGET_SURVIVE_TIME: 10,
};
var sets = Object.keys(game_settings_default);
for(var i=0;i
");
engine.console.print("If no additional arguments, toggles boolean commands between true and false.")
return false;
}
var cmd = split[0].toUpperCase();
if(split.length > 1)
{
var curr = chsetting(cmd,undefined,true), s = 0;
for(var i=0;i 2)
{
cfg.x = s[1]*engine.REAL_ARENA_SIZE_FACTOR; cfg.y = s[2]*engine.REAL_ARENA_SIZE_FACTOR;
if(s.length > 4)
{
cfg.dir = Math.atan2(s[4],s[3]);
if(settings.STRICT_AXES_SPAWN)
{
var deg = (pi(2)/settings.ARENA_AXES);
cfg.dir = Math.round(cfg.dir/deg)*deg;
}
}
}
p.spawn(cfg);
}
},
KILL: function(params)
{
var p = getPlayer(params);
if(p)
{
p.kill();
if(settings.ADMIN_KILL_MESSAGE)
engine.console.print(p.getColoredName()+"0xRESETT has been smitten by an administrator.\n");
}
},
KILL_ALL: function()
{
for(var x=engine.players.length-1;x>=0;--x) if(typeof(engine.players[x]) != "undefined")
{
engine.players[x].kill();
}
},
INCLUDE: function(params,silent=false,callback=undefined)
{
var file = params.replace(/\(.+\)/g,"");
var s = localStorage.getItem(file);
if(s == null && !engine.dedicated)
{
var incfile = settings.RESOURCE_REPOSITORY_CACHE+"../config/"+params;
engine.console.print("Loading CFG from "+incfile+"...\n");
httpGetAsync(incfile,function(txt){loadcfg(txt,silent);if(callback != undefined)callback();});
}
else
{
loadcfg(s,silent); if(callback != undefined)callback();
}
},
SINCLUDE: function(params) { commands.INCLUDE(params,true) },
RINCLUDE: function(params,callback=undefined)
{
var file = params.replace(/\(.+\)/g,"");
var incfile = settings.RESOURCE_REPOSITORY_SERVER+params;
engine.console.print("Downloading CFG from "+incfile+"...\n");
httpGetAsync(incfile,function(txt){loadcfg(txt);if(callback != undefined)callback();});
},
SPAWN_ZONE: function(params)
{
if(params == "")
{
engine.console.print("Usage:\nSPAWN_ZONE SPAWN_ZONE \nSPAWN_ZONE \nSPAWN_ZONE \nSPAWN_ZONE \n");
}
else
{
var zone = {}, args = params.split(" ");
if(args[0] == "n")
{
zone.name = args.slice(0,2)[1];
}
zone.type = args[0];
if(zone.type == "acceleration" || zone.type == "speed")
{
zone.value = args.slice(1,2)[0];
}
zone.x = args[1]*engine.REAL_ARENA_SIZE_FACTOR;
zone.y = args[2]*engine.REAL_ARENA_SIZE_FACTOR;
zone.radius = args[3]*engine.REAL_ARENA_SIZE_FACTOR;
zone.expansion = args[4]*1;
zone.xdir = args[5]*1; zone.ydir = args[6]*1;
zone.bounce = Boolean(parseInt+(args[7]))&&args[7]!="false";
if(args[7] != undefined)
{
zone.color = new THREE.Color(args[7]/15,args[8]/15,args[9]/15);
}
//engine.zones.add(createZone(type,posX,posY,radius,color));
//engine.map.zones.push([type,posX,posY,radius,expansion,value]);
new Zone(zone).spawn();
console.log("new Zone: "+zone);
}
},
SPAWN_WALL: function(params)
{
if(params == "")
{
engine.console.print("Usage:\nSPAWN_WALL \n");
}
else
{
}
},
SET_ZONE_POSITION: function(params)
{
var args = params.split(" ");
for(var x=engine.zones.children.length-1;x>=0;x--)
{
if(x == args[0])
{
engine.zones.children[x].position.x = args[1]*engine.REAL_ARENA_SIZE_FACTOR;
engine.zones.children[x].position.y = args[2]*engine.REAL_ARENA_SIZE_FACTOR;
return true;
}
}
engine.console.print("Invalid zone ID\n");
},
SET_AI_PATH: function(params)
{
var args = params.split(" ");
if(args[0] == "*")
{
}
else
{
var cycle = getPlayer(args.shift());
if(cycle)
{
for(var x=0,len=args.length;x<0;x+=2)
{
cycle.push([args[x],args[x+1]]);
}
}
else
{
engine.console.print("Usage: ...");
}
}
},
CLEAR_AI_POSITION: function(params)
{
},
LIST_ZONES: function(params="")
{
var found = 0;
for(var x=0,len=engine.zones.children.length;x=0;--i)
{
if(sets[i] == setting)
{
var settingFound = false;
for(var i=netChanged.length-1;i>=0;--i)
{
if(netChanged[i][0] == setting) settingFound = true;
}
if(!settingFound) netChanged.push([setting,chsetting("CYCLE_SPEED",undefined,true)]);
return "0xff7f7f"+chsetting(setting,value,false," on server order","0x808080");
}
}
return false;
}
function saveusercfg()
{
var usercfg = "";
for(var i=0;i -1)
{
if(len != 0) print += ", ";
len++; print += sets[i];
}
}
if(len > 0) engine.console.print("Perhaps you meant: "+print+"\n");
}
}
return exec;
}
function mkSettingCallback(setting,stringify=false)
{
if(stringify)
return function(set){return ""+chsetting(setting,set,true)}
else
return function(set){return chsetting(setting,set,true)}
}
function getargs()
{
var s = window.location.hash.replace("#","").split("&");
_GET = {};
for(var i=0,len=s.length;i\n\\n\\n\t\