@@ -1,6 +1,6 @@ | |||
define([ | |||
'js/rendering/renderer' | |||
], function( | |||
], function ( | |||
renderer | |||
) { | |||
var scale = 40; | |||
@@ -8,6 +8,9 @@ define([ | |||
var auras = { | |||
reflectDamage: 0, | |||
stealth: 1, | |||
regenHp: 9, | |||
regenMana: 10, | |||
swiftness: 11, | |||
holyVengeance: 8, | |||
rare: 16 | |||
}; | |||
@@ -25,14 +28,14 @@ define([ | |||
effects: [], | |||
init: function(blueprint) { | |||
init: function (blueprint) { | |||
var sprite = this.obj.sprite; | |||
this.effects = this.effects | |||
.filter(function(e) { | |||
.filter(function (e) { | |||
return (auras[e] != null); | |||
}, this) | |||
.map(function(e) { | |||
.map(function (e) { | |||
return { | |||
name: e, | |||
sprite: renderer.buildObject({ | |||
@@ -47,13 +50,13 @@ define([ | |||
} | |||
}, this); | |||
}, | |||
extend: function(blueprint) { | |||
extend: function (blueprint) { | |||
if (blueprint.addEffects) { | |||
blueprint.addEffects = blueprint.addEffects | |||
.filter(function(e) { | |||
.filter(function (e) { | |||
return (auras[e] != null); | |||
}) | |||
.map(function(e) { | |||
.map(function (e) { | |||
return { | |||
name: e, | |||
sprite: renderer.buildObject({ | |||
@@ -71,8 +74,8 @@ define([ | |||
this.effects.push.apply(this.effects, blueprint.addEffects || []); | |||
} | |||
if (blueprint.removeEffects) { | |||
blueprint.removeEffects.forEach(function(r) { | |||
var effect = this.effects.find(function(e) { | |||
blueprint.removeEffects.forEach(function (r) { | |||
var effect = this.effects.find(function (e) { | |||
return (e.name == r); | |||
}); | |||
@@ -84,14 +87,14 @@ define([ | |||
sprite: effect.sprite | |||
}); | |||
this.effects.spliceFirstWhere(function(e) { | |||
this.effects.spliceFirstWhere(function (e) { | |||
return (e.name == r); | |||
}); | |||
}, this); | |||
} | |||
}, | |||
update: function() { | |||
update: function () { | |||
this.alpha += this.alphaDir; | |||
if ((this.alphaDir > 0) && (this.alpha >= this.alphaMax)) { | |||
this.alpha = this.alphaMax; | |||
@@ -112,15 +115,15 @@ define([ | |||
useAlpha /= (this.alphaMax - this.alphaCutoff); | |||
} | |||
this.effects.forEach(function(e) { | |||
this.effects.forEach(function (e) { | |||
e.sprite.alpha = useAlpha; | |||
e.sprite.x = x; | |||
e.sprite.y = y; | |||
}, this); | |||
}, | |||
destroy: function() { | |||
this.effects.forEach(function(e) { | |||
destroy: function () { | |||
this.effects.forEach(function (e) { | |||
renderer.destroyObject({ | |||
layerName: 'effects', | |||
sprite: e.sprite | |||
@@ -128,4 +131,4 @@ define([ | |||
}); | |||
} | |||
}; | |||
}); | |||
}); |
@@ -100,6 +100,8 @@ define([ | |||
spellNumber = 1; | |||
else if (number == 3) | |||
spellNumber = 2; | |||
else if (number == 4) | |||
spellNumber = 3; | |||
if (spellNumber == -1) | |||
return; | |||
@@ -3,7 +3,7 @@ define([ | |||
'html!ui/templates/buffs/template', | |||
'css!ui/templates/buffs/styles', | |||
'html!ui/templates/buffs/templateBuff' | |||
], function( | |||
], function ( | |||
events, | |||
template, | |||
styles, | |||
@@ -11,6 +11,9 @@ define([ | |||
) { | |||
var icons = { | |||
stunned: [4, 0], | |||
regenHp: [3, 1], | |||
regenMana: [4, 1], | |||
swiftness: [5, 1], | |||
stealth: [7, 0], | |||
reflectDamage: [2, 1], | |||
holyVengeance: [4, 0] | |||
@@ -21,12 +24,12 @@ define([ | |||
icons: {}, | |||
postRender: function() { | |||
this.onEvent('onGetBuff', this.onGetBuff.bind(this)); | |||
postRender: function () { | |||
this.onEvent('onGetBuff', this.onGetBuff.bind(this)); | |||
this.onEvent('onRemoveBuff', this.onRemoveBuff.bind(this)); | |||
}, | |||
onGetBuff: function(buff) { | |||
onGetBuff: function (buff) { | |||
var icon = icons[buff.type]; | |||
if (!icon) | |||
return; | |||
@@ -36,20 +39,21 @@ define([ | |||
var html = templateBuff; | |||
var el = $(html).appendTo(this.el) | |||
.find('.inner') | |||
.css({ | |||
background: 'url(../../../images/statusIcons.png) ' + imgX + 'px ' + imgY + 'px' | |||
}); | |||
this.icons[buff.id] = el; | |||
this.icons[buff.id] = el.parent(); | |||
}, | |||
onRemoveBuff: function(buff) { | |||
onRemoveBuff: function (buff) { | |||
var el = this.icons[buff.id]; | |||
if (!el) | |||
return; | |||
el.remove(); | |||
delete this.icons[buff.id]; | |||
} | |||
} | |||
}); | |||
}); |
@@ -6,10 +6,17 @@ | |||
top: 104px; | |||
.icon { | |||
width: 32px; | |||
height: 32px; | |||
background: url('../../../images/statusIcons.png') 0px 0px; | |||
width: 40px; | |||
height: 40px; | |||
padding: 4px; | |||
background-color: fade(@blackD, 75%); | |||
margin-right: 16px; | |||
float: left; | |||
.inner { | |||
width: 32px; | |||
height: 32px; | |||
background: url('../../../images/statusIcons.png') 0px 0px; | |||
} | |||
} | |||
} | |||
} |
@@ -1 +1,3 @@ | |||
<div class="icon buff"></div> | |||
<div class="icon buff"> | |||
<div class="inner"></div> | |||
</div> |
@@ -6,7 +6,7 @@ | |||
border: 5px solid @blackB; | |||
text-align: center; | |||
width: 474px; | |||
height: 534px; | |||
height: 622px; | |||
> .heading { | |||
color: @white; | |||
@@ -61,7 +61,7 @@ | |||
height: 440px; | |||
} | |||
.left, .right, .itemList, .runes { | |||
.left, .right, .itemList, .runes, .tools { | |||
width: 96px; | |||
padding: 8px; | |||
@@ -88,12 +88,14 @@ | |||
&[slot="neck"] .icon { background-position: -64px -448px; } | |||
&[slot="chest"] .icon { background-position: -128px -448px; } | |||
&[slot="hands"] .icon { background-position: -192px -448px; } | |||
&[slot="finger"] .icon { background-position: -256px -448px; } | |||
&[slot="finger-1"] .icon { background-position: -256px -448px; } | |||
&[slot="finger-2"] .icon { background-position: -256px -448px; } | |||
&[slot="waist"] .icon { background-position: -320px -448px; } | |||
&[slot="legs"] .icon { background-position: -384px -448px; } | |||
&[slot="feet"] .icon { background-position: -448px -448px; } | |||
&[slot="trinket"] .icon { background-position: -448px -384px; } | |||
&[slot="twoHanded"] .icon { background-position: -384px -384px; } | |||
&[slot="mainHand"] .icon { background-position: -384px -384px; } | |||
&[slot="offHand"] .icon { background-position: -192px -384px; } | |||
&[slot="tool"] .icon { background-position: -256px -384px; } | |||
&[slot^="rune"] .icon { background-position: -320px -384px; } | |||
} | |||
@@ -141,7 +143,7 @@ | |||
.stats { | |||
width: 100%; | |||
padding-top: 16px; | |||
height: calc(440px - 80px); | |||
height: calc(440px - 88px); | |||
.stat { | |||
height: 22px; | |||
@@ -174,7 +176,7 @@ | |||
} | |||
} | |||
.runes { | |||
.runes, .tools { | |||
width: 100%; | |||
height: 80px; | |||
@@ -187,6 +189,12 @@ | |||
} | |||
} | |||
} | |||
.tools { | |||
clear: both; | |||
margin-bottom: 8px; | |||
padding-left: calc(50% - 40px); | |||
} | |||
} | |||
.itemList { | |||
@@ -26,7 +26,11 @@ | |||
<div class="icon"></div> | |||
<div class="info"></div> | |||
</div> | |||
<div class="slot" slot="finger"> | |||
<div class="slot" slot="finger-1"> | |||
<div class="icon"></div> | |||
<div class="info"></div> | |||
</div> | |||
<div class="slot" slot="finger-2"> | |||
<div class="icon"></div> | |||
<div class="info"></div> | |||
</div> | |||
@@ -34,16 +38,22 @@ | |||
<div class="middle"> | |||
<div class="stats"> | |||
</div> | |||
<div class="tools"> | |||
<div class="slot" slot="tool"> | |||
<div class="icon"></div> | |||
<div class="info"></div> | |||
</div> | |||
</div> | |||
<div class="runes"> | |||
<div class="slot" slot="rune-0"> | |||
<div class="icon"></div> | |||
<div class="info"></div> | |||
</div> | |||
<div class="slot" slot="tool"> | |||
<div class="slot" slot="rune-1"> | |||
<div class="icon"></div> | |||
<div class="info"></div> | |||
</div> | |||
<div class="slot" slot="rune-1"> | |||
<div class="slot" slot="rune-2"> | |||
<div class="icon"></div> | |||
<div class="info"></div> | |||
</div> | |||
@@ -66,7 +76,11 @@ | |||
<div class="icon"></div> | |||
<div class="info"></div> | |||
</div> | |||
<div class="slot" slot="twoHanded"> | |||
<div class="slot" slot="mainHand"> | |||
<div class="icon"></div> | |||
<div class="info"></div> | |||
</div> | |||
<div class="slot" slot="offHand"> | |||
<div class="icon"></div> | |||
<div class="info"></div> | |||
</div> | |||
@@ -2,7 +2,7 @@ define([ | |||
'js/system/events', | |||
'html!ui/templates/hud/template', | |||
'css!ui/templates/hud/styles' | |||
], function( | |||
], function ( | |||
events, | |||
template, | |||
styles | |||
@@ -12,17 +12,17 @@ define([ | |||
stats: null, | |||
postRender: function() { | |||
postRender: function () { | |||
this.onEvent('onGetStats', this.onGetStats.bind(this)); | |||
this.onEvent('onGetPortrait', this.onGetPortrait.bind(this)); | |||
}, | |||
onGetStats: function(stats) { | |||
onGetStats: function (stats) { | |||
this.stats = stats; | |||
this.build(); | |||
}, | |||
onGetPortrait: function(portrait) { | |||
onGetPortrait: function (portrait) { | |||
var spritesheet = portrait.spritesheet || '../../../images/portraitIcons.png'; | |||
var x = portrait.x * -64; | |||
@@ -35,7 +35,7 @@ define([ | |||
}); | |||
}, | |||
build: function() { | |||
build: function () { | |||
var stats = this.stats; | |||
var boxes = this.find('.statBox'); | |||
@@ -44,13 +44,15 @@ define([ | |||
stats.hp / stats.hpMax, | |||
stats.mana / stats.manaMax, | |||
stats.xp / stats.xpMax | |||
].forEach(function(s, i) { | |||
].forEach(function (s, i) { | |||
boxes.eq(i).find('div:first-child').width(Math.max(0, Math.min(100, ~~(s * 100))) + '%'); | |||
}); | |||
this.find('.statManaReserve').width(Math.max(0, Math.min(100, ~~(stats.manaReservePercent * 100))) + '%'); | |||
boxes.eq(0).find('.text').html(Math.floor(stats.hp) + '/' + ~~stats.hpMax); | |||
boxes.eq(1).find('.text').html(Math.floor(stats.mana) + '/' + ~~stats.manaMax); | |||
boxes.eq(2).find('.text').html('level: ' + stats.level); | |||
} | |||
} | |||
}); | |||
}); |
@@ -43,6 +43,15 @@ | |||
height: 100%; | |||
} | |||
.statManaReserve { | |||
position: absolute; | |||
right: 0%; | |||
top: 0px; | |||
left: auto; | |||
height: 100%; | |||
background-color: @grayC; | |||
} | |||
.text { | |||
position: absolute; | |||
left: 0px; | |||
@@ -90,4 +99,4 @@ | |||
} | |||
} | |||
} | |||
} | |||
} |
@@ -9,6 +9,7 @@ | |||
</div> | |||
<div class="statBox"> | |||
<div class="statMana"></div> | |||
<div class="statManaReserve"></div> | |||
<div class="text"></div> | |||
</div> | |||
<div class="statBox"> | |||
@@ -16,4 +17,4 @@ | |||
<div class="text"></div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> |
@@ -7,7 +7,7 @@ define([ | |||
'css!ui/templates/party/styles', | |||
'html!ui/templates/party/templateInvite', | |||
'html!ui/templates/party/templatePartyMember' | |||
], function( | |||
], function ( | |||
events, | |||
client, | |||
globals, | |||
@@ -23,7 +23,7 @@ define([ | |||
invite: null, | |||
party: null, | |||
postRender: function() { | |||
postRender: function () { | |||
this.onEvent('onGetInvite', this.onGetInvite.bind(this)); | |||
this.onEvent('onGetParty', this.onGetParty.bind(this)); | |||
this.onEvent('onPartyDisband', this.onPartyDisband.bind(this)); | |||
@@ -33,22 +33,22 @@ define([ | |||
this.onEvent('onGetPartyStats', this.onGetPartyStats.bind(this)); | |||
}, | |||
onGetConnectedPlayer: function(msg) { | |||
onGetConnectedPlayer: function (msg) { | |||
var party = this.party; | |||
if (!party) | |||
return; | |||
if (!(msg instanceof Array)) | |||
msg = [ msg ]; | |||
msg = [msg]; | |||
msg.forEach(function(m) { | |||
msg.forEach(function (m) { | |||
if (party.indexOf(m.id) == -1) | |||
return; | |||
var zone = m.zone; | |||
if (m.id == window.player.serverId) { | |||
party.forEach(function(p) { | |||
var player = globals.onlineList.find(function(o) { | |||
party.forEach(function (p) { | |||
var player = globals.onlineList.find(function (o) { | |||
return (o.id == p) | |||
}); | |||
@@ -70,7 +70,7 @@ define([ | |||
}, this); | |||
}, | |||
onGetPartyStats: function(id, stats) { | |||
onGetPartyStats: function (id, stats) { | |||
var party = this.party; | |||
if (!party) | |||
return; | |||
@@ -94,12 +94,12 @@ define([ | |||
} | |||
}, | |||
onPartyDisband: function() { | |||
onPartyDisband: function () { | |||
this.find('.party .list') | |||
.empty(); | |||
}, | |||
onGetParty: function(party) { | |||
onGetParty: function (party) { | |||
// Destroy invite frame if you join a party | |||
if (this.invite) | |||
this.destroyInvite(); | |||
@@ -111,11 +111,11 @@ define([ | |||
if (!party) | |||
return; | |||
party.forEach(function(p) { | |||
party.forEach(function (p) { | |||
if (p == window.player.serverId) | |||
return; | |||
var player = globals.onlineList.find(function(o) { | |||
var player = globals.onlineList.find(function (o) { | |||
return (o.id == p) | |||
}); | |||
var name = player ? player.name : 'unknown'; | |||
@@ -134,7 +134,7 @@ define([ | |||
el.addClass('differentZone'); | |||
//Find stats | |||
var memberObj = objects.objects.find(function(o) { | |||
var memberObj = objects.objects.find(function (o) { | |||
return (o.serverId == p); | |||
}); | |||
if ((memberObj) && (memberObj.stats)) | |||
@@ -142,7 +142,7 @@ define([ | |||
}, this); | |||
}, | |||
showContext: function(charName, id, e) { | |||
showContext: function (charName, id, e) { | |||
events.emit('onContextMenu', [{ | |||
text: 'whisper', | |||
callback: events.emit.bind(events, 'onDoWhisper', charName) | |||
@@ -158,11 +158,11 @@ define([ | |||
return false; | |||
}, | |||
onGetInvite: function(sourceId) { | |||
onGetInvite: function (sourceId) { | |||
if (this.invite) | |||
this.destroyInvite(); | |||
var sourcePlayer = globals.onlineList.find(function(o) { | |||
var sourcePlayer = globals.onlineList.find(function (o) { | |||
return (o.id == sourceId) | |||
}); | |||
@@ -182,7 +182,7 @@ define([ | |||
}; | |||
}, | |||
destroyInvite: function(e) { | |||
destroyInvite: function (e) { | |||
if (e) { | |||
if ($(e.target).hasClass('btnAccept')) | |||
this.acceptInvite(); | |||
@@ -192,16 +192,18 @@ define([ | |||
this.invite.el.remove(); | |||
this.invite = null; | |||
events.emit('onUiHover', false); | |||
}, | |||
acceptInvite: function() { | |||
acceptInvite: function () { | |||
client.request({ | |||
cpn: 'social', | |||
method: 'acceptInvite', | |||
id: this.invite.fromId | |||
}); | |||
}, | |||
declineInvite: function() { | |||
declineInvite: function () { | |||
client.request({ | |||
cpn: 'social', | |||
method: 'declineInvite', | |||
@@ -212,18 +214,18 @@ define([ | |||
}); | |||
}, | |||
removeFromParty: function(id) { | |||
removeFromParty: function (id) { | |||
client.request({ | |||
cpn: 'social', | |||
method: 'removeFromParty', | |||
data: id | |||
}); | |||
}, | |||
leaveParty: function() { | |||
leaveParty: function () { | |||
client.request({ | |||
cpn: 'social', | |||
method: 'leaveParty' | |||
}); | |||
} | |||
} | |||
}); | |||
}); |
@@ -4,7 +4,7 @@ define([ | |||
'css!ui/templates/spells/styles', | |||
'html!ui/templates/spells/templateSpell', | |||
'html!ui/templates/spells/templateTooltip' | |||
], function( | |||
], function ( | |||
events, | |||
template, | |||
styles, | |||
@@ -16,7 +16,7 @@ define([ | |||
spells: null, | |||
postRender: function() { | |||
postRender: function () { | |||
this.onEvent('onGetSpells', this.onGetSpells.bind(this)); | |||
this.onEvent('onGetSpellCooldowns', this.onGetSpellCooldowns.bind(this)); | |||
this.onEvent('onGetStats', this.onGetStats.bind(this)); | |||
@@ -24,7 +24,7 @@ define([ | |||
setInterval(this.update.bind(this), 100); | |||
}, | |||
onGetSpells: function(spells) { | |||
onGetSpells: function (spells) { | |||
this.el.empty(); | |||
this.spells = spells; | |||
@@ -57,7 +57,7 @@ define([ | |||
} | |||
}, | |||
onShowTooltip: function(el, spell) { | |||
onShowTooltip: function (el, spell) { | |||
var pos = el.offset(); | |||
pos = { | |||
x: pos.left + 56, | |||
@@ -66,16 +66,20 @@ define([ | |||
var cd = ~~((spell.cdMax * 350) / 1000); | |||
var values = Object.keys(spell.values).filter(function(v) { | |||
var values = Object.keys(spell.values).filter(function (v) { | |||
return ((v != 'damage') && (v != 'healing')); | |||
}).map(function(v) { | |||
}).map(function (v) { | |||
return v + ': ' + spell.values[v]; | |||
}).join('<br />'); | |||
var manaCost = spell.manaCost; | |||
if (spell.manaReserve) | |||
manaCost = ~~(spell.manaReserve.percentage * 100) + '% reserved'; | |||
var tooltip = templateTooltip | |||
.replace('$NAME$', spell.name) | |||
.replace('$DESCRIPTION$', spell.description) | |||
.replace('$MANA$', spell.manaCost) | |||
.replace('$MANA$', manaCost) | |||
.replace('$CD$', cd) | |||
.replace('$VALUES$', values) | |||
.replace('$ELEMENT$', spell.element); | |||
@@ -90,17 +94,17 @@ define([ | |||
events.emit('onShowTooltip', tooltip, el[0], pos, 200, false, true, this.el.css('z-index')); | |||
}, | |||
onHideTooltip: function(el) { | |||
onHideTooltip: function (el) { | |||
events.emit('onHideTooltip', el[0]); | |||
}, | |||
onGetSpellCooldowns: function(options) { | |||
onGetSpellCooldowns: function (options) { | |||
var spell = this.spells[options.spell]; | |||
spell.ttl = options.cd; | |||
spell.ttlStart = +new Date; | |||
}, | |||
onGetStats: function(stats) { | |||
onGetStats: function (stats) { | |||
var mana = stats.mana; | |||
var spells = this.spells; | |||
@@ -117,7 +121,7 @@ define([ | |||
} | |||
}, | |||
update: function() { | |||
update: function () { | |||
var spells = this.spells; | |||
if (!spells) | |||
return; | |||
@@ -149,4 +153,4 @@ define([ | |||
} | |||
} | |||
} | |||
}); | |||
}); |
@@ -197,6 +197,8 @@ define([ | |||
for (var i = 0; i < eLen; i++) { | |||
var effect = effects[i]; | |||
if (effect == checkEffect) { | |||
if (effect.destroy) | |||
effect.destroy(); | |||
this.syncRemove(effect.id, effect.type, noMsg || effect.noMsg); | |||
effects.splice(i, 1); | |||
return; | |||
@@ -300,6 +300,20 @@ define([ | |||
if (!isAuto) | |||
this.sendAnnouncement('Insufficient mana to cast spell'); | |||
success = false; | |||
} else if (spell.manaReserve) { | |||
var mana = this.obj.stats.values.mana; | |||
var reserve = spell.manaReserve; | |||
if (reserve.percentage) { | |||
if (!spell.active) { | |||
if (1 - this.obj.stats.values.manaReservePercent < reserve.percentage) { | |||
this.sendAnnouncement('Insufficient mana to cast spell'); | |||
success = false; | |||
} else | |||
this.obj.stats.addStat('manaReservePercent', reserve.percentage); | |||
} else | |||
this.obj.stats.addStat('manaReservePercent', -reserve.percentage); | |||
} | |||
} else if (spell.range != null) { | |||
//Distance Check | |||
var fromX = this.obj.x; | |||
@@ -11,6 +11,9 @@ define([ | |||
values: { | |||
mana: 10, | |||
manaMax: 10, | |||
manaReservePercent: 0, | |||
hp: 5, | |||
hpMax: 5, | |||
xpTotal: 0, | |||
@@ -104,6 +107,11 @@ define([ | |||
if (((this.obj.mob) && (!this.obj.follower)) || (this.dead)) | |||
return; | |||
var values = this.values; | |||
var manaMax = values.manaMax; | |||
manaMax -= (manaMax * values.manaReservePercent); | |||
var regen = { | |||
success: true | |||
}; | |||
@@ -111,7 +119,6 @@ define([ | |||
if (!regen.success) | |||
return; | |||
var values = this.values; | |||
var isInCombat = (this.obj.aggro.list.length > 0); | |||
if (this.obj.follower) { | |||
isInCombat = (this.obj.follower.master.aggro.list.length > 0); | |||
@@ -122,7 +129,7 @@ define([ | |||
var regenHp = 0; | |||
var regenMana = 0; | |||
regenMana = (values.manaMax / 200) + (values.regenMana / 200); | |||
regenMana = (manaMax / 200) + (values.regenMana / 200); | |||
if (!isInCombat) | |||
regenHp = values.hpMax / 100; | |||
@@ -139,7 +146,7 @@ define([ | |||
this.obj.syncer.setObject(false, 'stats', 'values', 'hp', values.hp); | |||
} | |||
if (values.mana < values.manaMax) { | |||
if (values.mana < manaMax) { | |||
values.mana += regenMana; | |||
//Show others what mana is? | |||
var onlySelf = true; | |||
@@ -148,8 +155,8 @@ define([ | |||
this.obj.syncer.setObject(onlySelf, 'stats', 'values', 'mana', values.mana); | |||
} | |||
if (values.mana > values.manaMax) { | |||
values.mana = values.manaMax; | |||
if (values.mana > manaMax) { | |||
values.mana = manaMax; | |||
if (this.obj.player) | |||
onlySelf = false; | |||
this.obj.syncer.setObject(onlySelf, 'stats', 'values', 'mana', values.mana); | |||
@@ -8,21 +8,20 @@ define([ | |||
amount: 1, | |||
update: function () { | |||
this.obj.stats.getHp({ | |||
amount: this.amount, | |||
threatMult: 0 | |||
}, this.caster); | |||
init: function () { | |||
this.obj.stats.addStat('regenHp', this.amount * 3); | |||
}, | |||
events: { | |||
init: function () { | |||
destroy: function () { | |||
this.obj.stats.addStat('regenHp', -(this.amount * 3)); | |||
}, | |||
}, | |||
update: function () { | |||
destroy: function () { | |||
}, | |||
events: { | |||
} | |||
} | |||
}; | |||
}); |
@@ -0,0 +1,27 @@ | |||
define([ | |||
], function ( | |||
) { | |||
return { | |||
type: 'regenMana', | |||
amount: 1, | |||
init: function () { | |||
this.obj.stats.addStat('regenMana', this.amount); | |||
}, | |||
destroy: function () { | |||
this.obj.stats.addStat('regenMana', -this.amount); | |||
}, | |||
update: function () { | |||
}, | |||
events: { | |||
} | |||
}; | |||
}); |
@@ -0,0 +1,27 @@ | |||
define([ | |||
], function ( | |||
) { | |||
return { | |||
type: 'swiftness', | |||
amount: 1, | |||
init: function () { | |||
this.obj.stats.addStat('sprintChance', this.amount); | |||
}, | |||
destroy: function () { | |||
this.obj.stats.addStat('sprintChance', -this.amount); | |||
}, | |||
update: function () { | |||
}, | |||
events: { | |||
} | |||
}; | |||
}); |
@@ -341,10 +341,22 @@ define([ | |||
animation: 'raiseStaff' | |||
}, { | |||
name: 'Innervation', | |||
description: 'Grants an aura that regenerates hp for you and your party members.', | |||
type: 'innervation', | |||
description: 'Grants an aura that regenerates hp for you and your allies.', | |||
type: 'aura', | |||
spellType: 'aura', | |||
icon: [3, 3] | |||
}, { | |||
name: 'Tranquility', | |||
description: 'Grants an aura that regenerates mana for you and your allies.', | |||
type: 'aura', | |||
spellType: 'aura', | |||
icon: [3, 4] | |||
}, { | |||
name: 'Swiftness', | |||
description: 'Grants an aura that grants increased movement speed to you and your allies.', | |||
type: 'aura', | |||
spellType: 'aura', | |||
icon: [3, 5] | |||
} | |||
]; | |||
@@ -4,10 +4,10 @@ define([ | |||
) { | |||
return { | |||
type: 'innervation', | |||
type: 'aura', | |||
cdMax: 0, | |||
manaCost: 5, | |||
manaCost: 0, | |||
duration: 10, | |||
@@ -31,9 +31,21 @@ define([ | |||
this.updateInactive(); | |||
}, | |||
unlearn: function () { | |||
this.updateInactive(); | |||
}, | |||
onAfterSimplify: function (values) { | |||
delete values.effects; | |||
}, | |||
updateActive: function () { | |||
var o = this.obj; | |||
var amount = (o.stats.values.hpMax / 100) * this.values.percentage; | |||
var amount = 0; | |||
if (this.name == 'Innervation') | |||
amount = (o.stats.values.hpMax / 100) * this.values.regenPercentage; | |||
else | |||
amount = this.values.regenPercentage || this.values.chance; | |||
var party = o.social.party || []; | |||
var members = [o.serverId, ...party]; | |||
@@ -46,8 +58,12 @@ define([ | |||
var effect = effects[m]; | |||
var obj = objects.find(o => (o.serverId === m)); | |||
if (!obj) | |||
if (!obj) { | |||
if (effect) | |||
delete effects[m]; | |||
return; | |||
} | |||
var distance = Math.max(Math.abs(o.x - obj.x), Math.abs(o.y - obj.y)); | |||
if (distance > range) { | |||
@@ -63,7 +79,7 @@ define([ | |||
return; | |||
effects[obj.serverId] = obj.effects.addEffect({ | |||
type: 'regenHp', | |||
type: this.effect, | |||
amount: amount, | |||
caster: this.obj, | |||
ttl: -1 | |||
@@ -76,18 +92,19 @@ define([ | |||
var effects = this.effects; | |||
var objects = o.instance.objects.objects; | |||
Object.keys(effects).forEach(function (o) { | |||
Object.keys(effects).forEach(function (m) { | |||
var effect = effects[m]; | |||
if (!effect) | |||
return; | |||
var obj = objects.find(o => (o.serverId === m)); | |||
var obj = objects.find(o => (o.serverId == m)); | |||
if (!obj) { | |||
delete effects[m]; | |||
return; | |||
} | |||
obj.effects.removeEffect(effect); | |||
delete effects[m]; | |||
}, this); | |||
} | |||
}; |
@@ -166,13 +166,41 @@ define([ | |||
statMult: 0.0205, | |||
element: 'physical', | |||
manaReserve: { | |||
percent: true, | |||
amount: 50 | |||
percentage: 0.25 | |||
}, | |||
cdMax: 10, | |||
auraRange: 9, | |||
effect: 'regenHp', | |||
random: { | |||
percentage: [1, 3] | |||
regenPercentage: [1, 3] | |||
} | |||
}, | |||
'tranquility': { | |||
statType: ['int'], | |||
statMult: 0.0205, | |||
element: 'holy', | |||
manaReserve: { | |||
percentage: 0.25 | |||
}, | |||
cdMax: 10, | |||
auraRange: 9, | |||
effect: 'regenMana', | |||
random: { | |||
regenPercentage: [2, 5] | |||
} | |||
}, | |||
'swiftness': { | |||
statType: ['dex'], | |||
statMult: 0.0205, | |||
element: 'fire', | |||
manaReserve: { | |||
percentage: 0.5 | |||
}, | |||
cdMax: 10, | |||
auraRange: 9, | |||
effect: 'swiftness', | |||
random: { | |||
chance: [5, 10] | |||
} | |||
} | |||
/*, | |||