How to use o2 - 10 common examples

To help you get started, we’ve selected a few o2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Laboralphy / h5-raycaster-lab / servers / mw / node_modules / mwgame / Effects / PhysicalDamage.js View on Github external
var O2 = require('o2');
var Damage = require('./Damage.js');

// Effet de dégât
var ADV_Effect_PhysicalDamage = O2.extendClass(Damage, {
	
	__construct: function(n) {
		O2.parent(this, n);
		this.removeTag('curse');
	},
});

module.exports = ADV_Effect_PhysicalDamage;
github Laboralphy / h5-raycaster-lab / servers / mw / node_modules / mwgame / Effects / Immortal.js View on Github external
var O2 = require('o2');
var Effect = require('./Abstract/Effect.js');

// Effet de cécité
var ADV_Effect_Immortal = O2.extendClass(Effect, {
	
	__construct: function() {
		O2.parent(this, 'Immortal', 'bless');
	},
	
	cast: function(ep) {
		this.getTarget().getSoul().setBonus('immortal', 1);
	},

	
	expire: function(ep) {
		this.getTarget().getSoul().setBonus('immortal', -1);
	}
});

module.exports = ADV_Effect_Immortal;
github Laboralphy / h5-raycaster-lab / servers / mw / node_modules / mwgame / Thinkers / SpellMissileThinker.js View on Github external
var O2 = require('o2');
var MissileThinker = require('./MissileThinker.js');

var SpellMissileThinker = O2.extendClass(MissileThinker, {
});

module.exports = SpellMissileThinker;
github Laboralphy / h5-raycaster-lab / servers / mw / node_modules / mwgame / Items / pot_slowness.js View on Github external
var O2 = require('o2');
var CONST = require('../data/consts.js');
var Effect = require('../Effects.js');
var Potion = require('./Abstract/Potion.js');

/**
 * Potion de lenteur :
 * reduit la vitesse de déplacement de 33%.
 * et la cadence de tir de 40%
 * c'est tres stupide de boire cette potion
 */
var PotionSlowness = O2.extendClass(Potion, {
	drink: function(ctx) {
		var eSlow = new Effect.Speed(-33);
		eSlow.setDuration(CONST.EFFECT_DURATION_MEDIUM);
		var eCD = new Effect.Cooldown(40);
		eCD.setDuration(CONST.EFFECT_DURATION_MEDIUM);
		ctx.effects = [eSlow, eCD];
	}
});

module.exports = PotionSlowness;
github Laboralphy / h5-raycaster-lab / servers / mw / node_modules / mwgame / Items / scr_magnet.js View on Github external
var O2 = require('o2');
var CONST = require('../data/consts.js');
var Effect = require('../Effects.js');
var Scroll = require('./Abstract/Scroll.js');

/**
 * Scroll of Magnet :
 */
var ScrollMagnet = O2.extendClass(Scroll, {
	read: function(ctx) {
		var eMagnet = new Effect.Magnet(2);
		eMagnet.setDuration(CONST.EFFECT_DURATION_SHORT);
		this.curse(eMagnet);
	}
});

module.exports = ScrollMagnet;
github Laboralphy / h5-raycaster-lab / servers / mw / node_modules / mwgame / Effects / Luck.js View on Github external
__construct: function(nLevel) {
		O2.parent(this, 'Luck', nLevel > 0 ? 'bless' : 'curse');
		this.setLevel(nLevel);
	},
github Laboralphy / h5-raycaster-lab / servers / mw / node_modules / mwgame / Effects / Magnet.js View on Github external
__construct: function(nPower) {
		O2.parent(this, 'Magnet', nPower <= 0 ? 'bless' : 'curse');
		this.setLevel(nPower);
	},
github Laboralphy / h5-raycaster-lab / servers / mw / node_modules / mwgame / Effects / Power.js View on Github external
__construct: function(nPower) {
		O2.parent(this, 'Power', nPower > 0 ? 'bless' : 'curse');
		this.setLevel(nPower);
	},
github Laboralphy / h5-raycaster-lab / servers / mw / node_modules / mwgame / Effects / Defense.js View on Github external
__construct: function(nLevel) {
		O2.parent(this, 'Defense', nLevel > 0 ? 'bless' : 'curse');
		this.setLevel(nLevel);
	},
github Laboralphy / h5-raycaster-lab / servers / mw / node_modules / mwgame / Effects / Cooldown.js View on Github external
__construct: function(value) {
		O2.parent(this, 'Cooldown', value > 0 ? 'curse' : 'bless');
		this.setLevel(value);
	},

o2

Node.js module export for o2.js JavaScript Framework

MIT
Latest version published 12 years ago

Package Health Score

45 / 100
Full package analysis

Popular o2 functions