wlarp

Augmented LARP

User Tools

Site Tools


wlarp:code_snips

Reference Code

Below is ideas for data structure: (not intended to be actual working code)

Characters, Items, Waypoints and Objectives


/*
** ideas in source code form for game variables (definitions)
*/

// list of all players:
// properties-required: name, class, subclass, health, stamina, points, inventory, bound, objectives
var players = [
	{
		name: 'playerName',
		class: 'human',
		subclass: 'hunter',
		health: 100,
		stamina: 100,
		points: 100,
		inventory: [],
		bound: [], // bound properties/items/inventory
		objectives: [],
	},
	{
		name: 'lumberjack',
		class: 'zombie',
		subclass: 'smart',
		health: -100,
		stamina: 100,
		points: 100,
		inventory: [],
		bound: [],
		objectives: [],
	},
];

// items are a special container for holding things not currently inside players inventory
var items = [
	{
		name: 'bread',
		class: 'food',
		restricted: ['human/*', 'elf/*'],
		health_mod: +50,
		stamina_mod: +50,
	},
	{
		name: 'sword',
		class: 'weapon',
		health_mod: -50,
		stamina_mod: -10,
		restricted: ['human/hunter', 'human/warrior'],
	},
	{
		name: 'club',
		class: 'weapon',
		health_mod: -25,
		stamina_mod: -10,
		restricted: ['human/*', 'zombie/*'],
	},
];

// waypoints (locations), list of places TBD how this will interact (possibly QR code?!)
var waypoints = [];

// objectives/tasks/mission:
// (things players do but not actively, could be one-time or replicated "instance")
var objectives = [];

wlarp/code_snips.txt · Last modified: 2017/08/23 11:47 by dx9s