@@ -415,52 +415,44 @@ define([ | |||
if (!hLen) | |||
return false; | |||
let player = window.player; | |||
let px = player.x; | |||
let py = player.y; | |||
let hidden = false; | |||
for (let i = 0; i < hLen; i++) { | |||
let h = hiddenRooms[i]; | |||
let outsideHider = ( | |||
x < h.x || | |||
x >= h.x + h.width || | |||
y < h.y || | |||
y >= h.y + h.height | |||
); | |||
if (outsideHider) | |||
continue; | |||
let inHider = physics.isInPolygon(x, y, h.area); | |||
if (!inHider) | |||
continue; | |||
const { player: { x: px, y: py } } = window; | |||
const isVisible = hiddenRooms.every(h => { | |||
if (h.discovered) | |||
return true; | |||
const { x: hx, y: hy, width, height, area } = h; | |||
//Is the tile outside the hider | |||
if ( | |||
x < hx || | |||
x >= hx + width || | |||
y < hy || | |||
y >= hy + height | |||
) | |||
return true; | |||
//Is the tile inside the hider | |||
if (!physics.isInPolygon(x, y, area)) | |||
return true; | |||
//Is the player outside the hider | |||
if ( | |||
px < hx || | |||
px >= hx + width || | |||
py < hy || | |||
py >= hy + height | |||
) | |||
return false; | |||
outsideHider = ( | |||
px < h.x || | |||
px >= h.x + h.width || | |||
py < h.y || | |||
py >= h.y + h.height | |||
); | |||
if (outsideHider) { | |||
hidden = true; | |||
continue; | |||
} | |||
inHider = physics.isInPolygon(px, py, h.area); | |||
if (inHider) | |||
//Is the player inside the hider | |||
if (!physics.isInPolygon(px, py, area)) | |||
return false; | |||
hidden = true; | |||
} | |||
return hidden; | |||
return true; | |||
}); | |||
return !isVisible; | |||
}, | |||
updateSprites: function () { | |||
@@ -59,9 +59,7 @@ module.exports = (cpnInv, ownerName, killSource) => { | |||
let blueprints = blueprint.blueprints; | |||
for (let i = 0; i < blueprints.length; i++) { | |||
let drop = blueprints[i]; | |||
if ((blueprint.chance) && (~~(Math.random() * 100) >= blueprint.chance * dropEvent.chanceMultiplier)) | |||
continue; | |||
else if ((drop.maxLevel) && (drop.maxLevel < killSource.stats.values.level)) | |||
if ((drop.maxLevel) && (drop.maxLevel < killSource.stats.values.level)) | |||
continue; | |||
else if ((drop.chance) && (~~(Math.random() * 100) >= drop.chance * dropEvent.chanceMultiplier)) | |||
continue; | |||
@@ -23,11 +23,11 @@ module.exports = { | |||
regular: { | |||
drops: { | |||
chance: 30, | |||
rolls: 1, | |||
noRandom: true, | |||
alsoRandom: true, | |||
blueprints: [{ | |||
chance: 30, | |||
name: 'Digested Crystal', | |||
quality: 0, | |||
quest: true, | |||
@@ -97,11 +97,11 @@ module.exports = { | |||
regular: { | |||
drops: { | |||
chance: 30, | |||
rolls: 1, | |||
noRandom: true, | |||
alsoRandom: true, | |||
blueprints: [{ | |||
chance: 35, | |||
name: 'Digested Crystal', | |||
quality: 0, | |||
quest: true, | |||
@@ -543,10 +543,10 @@ module.exports = { | |||
regular: { | |||
drops: { | |||
chance: 100, | |||
rolls: 1, | |||
noRandom: true, | |||
blueprints: [{ | |||
chance: 100, | |||
maxLevel: 2, | |||
name: 'Family Heirloom', | |||
quality: 1, | |||
@@ -667,11 +667,11 @@ module.exports = { | |||
faction: 'hostile', | |||
regular: { | |||
drops: { | |||
chance: 200, | |||
rolls: 1, | |||
noRandom: true, | |||
alsoRandom: true, | |||
blueprints: [{ | |||
chance: 3, | |||
name: 'Eagle Feather', | |||
material: true, | |||
sprite: [0, 0], | |||
@@ -1,3 +1,21 @@ | |||
const balance = { | |||
rat: { | |||
clawChance: 3 | |||
}, | |||
stinktooth: { | |||
runestoneChance: 10, | |||
recipeChance: 3, | |||
shankChance: 0.1 | |||
}, | |||
bandit: { | |||
keyChance: 1 | |||
}, | |||
bera: { | |||
recipeChance: 3, | |||
keyChance: 3 | |||
} | |||
}; | |||
module.exports = { | |||
name: 'Sewer', | |||
level: [11, 13], | |||
@@ -5,7 +23,7 @@ module.exports = { | |||
resources: { | |||
Stinkcap: { | |||
type: 'herb', | |||
max: 3 | |||
max: 1 | |||
} | |||
}, | |||
@@ -24,23 +42,22 @@ module.exports = { | |||
regular: { | |||
drops: { | |||
chance: 200, | |||
rolls: 1, | |||
noRandom: true, | |||
alsoRandom: true, | |||
blueprints: [{ | |||
chance: balance.rat.clawChance, | |||
name: 'Rat Claw', | |||
material: true, | |||
sprite: [3, 0], | |||
spritesheet: 'images/materials.png' | |||
}, { | |||
chance: 200, | |||
name: 'Muddy Runestone', | |||
material: true, | |||
sprite: [6, 0], | |||
spritesheet: 'images/materials.png' | |||
}] | |||
} | |||
}, | |||
rare: { | |||
name: 'Enraged Rat', | |||
cell: 24 | |||
} | |||
}, | |||
@@ -50,18 +67,19 @@ module.exports = { | |||
fjolgard: 15 | |||
}, | |||
level: 13, | |||
cron: '*/10 * * * *', | |||
regular: { | |||
hpMult: 10, | |||
dmgMult: 3, | |||
drops: { | |||
chance: 100, | |||
rolls: 3, | |||
noRandom: true, | |||
alsoRandom: true, | |||
magicFind: [2000, 125], | |||
blueprints: [{ | |||
chance: balance.stinktooth.shankChance, | |||
name: 'Putrid Shank', | |||
level: 13, | |||
quality: 4, | |||
@@ -74,16 +92,22 @@ module.exports = { | |||
effects: [{ | |||
type: 'castSpellOnHit', | |||
rolls: { | |||
i_chance: [20, 60], | |||
i_chance: [5, 20], | |||
spell: 'smokeBomb' | |||
} | |||
}] | |||
}, { | |||
chance: 100, | |||
chance: balance.stinktooth.recipeChance, | |||
type: 'recipe', | |||
name: 'Recipe: Rune of Whirlwind', | |||
profession: 'etching', | |||
teaches: 'runeWhirlwind' | |||
}, { | |||
chance: balance.stinktooth.runestoneChance, | |||
name: 'Muddy Runestone', | |||
material: true, | |||
sprite: [6, 0], | |||
spritesheet: 'images/materials.png' | |||
}] | |||
} | |||
}, | |||
@@ -145,8 +169,25 @@ module.exports = { | |||
}, | |||
level: 11, | |||
regular: { | |||
drops: { | |||
noRandom: true, | |||
alsoRandom: true, | |||
blueprints: [{ | |||
chance: balance.bandit.keyChance, | |||
type: 'key', | |||
noSalvage: true, | |||
name: 'Rusted Key', | |||
keyId: 'rustedSewer', | |||
singleUse: true, | |||
sprite: [12, 1], | |||
quantity: 1 | |||
}] | |||
} | |||
}, | |||
rare: { | |||
count: 0 | |||
name: 'Cutthroat' | |||
} | |||
}, | |||
@@ -181,16 +222,24 @@ module.exports = { | |||
dmgMult: 1.5, | |||
drops: { | |||
chance: 100, | |||
rolls: 1, | |||
noRandom: true, | |||
alsoRandom: true, | |||
blueprints: [{ | |||
chance: 100, | |||
chance: balance.bera.recipeChance, | |||
type: 'recipe', | |||
name: 'Recipe: Rune of Ambush', | |||
profession: 'etching', | |||
teaches: 'runeAmbush' | |||
}, { | |||
chance: balance.bera.keyChance, | |||
type: 'key', | |||
noSalvage: true, | |||
name: 'Rusted Key', | |||
keyId: 'rustedSewer', | |||
singleUse: true, | |||
sprite: [12, 1], | |||
quantity: 1 | |||
}] | |||
} | |||
}, | |||
@@ -207,6 +256,17 @@ module.exports = { | |||
quantity: [6, 12] | |||
}, | |||
sewerdoor: { | |||
properties: { | |||
cpnDoor: { | |||
autoClose: 171, | |||
locked: true, | |||
key: 'rustedSewer', | |||
destroyKey: true | |||
} | |||
} | |||
}, | |||
bubbles: { | |||
components: { | |||
cpnParticles: { | |||
@@ -46,6 +46,39 @@ let cpnSmokePatch = { | |||
} | |||
}; | |||
const particles = { | |||
scale: { | |||
start: { | |||
min: 16, | |||
max: 30 | |||
}, | |||
end: { | |||
min: 8, | |||
max: 14 | |||
} | |||
}, | |||
opacity: { | |||
start: 0.02, | |||
end: 0 | |||
}, | |||
lifetime: { | |||
min: 1, | |||
max: 3 | |||
}, | |||
speed: { | |||
start: 12, | |||
end: 2 | |||
}, | |||
color: { | |||
start: ['fcfcfc', '80f643'], | |||
end: ['c0c3cf', '2b4b3e'] | |||
}, | |||
chance: 0.03, | |||
randomColor: true, | |||
randomScale: true, | |||
blendMode: 'screen' | |||
}; | |||
module.exports = { | |||
type: 'smokeBomb', | |||
@@ -60,6 +93,8 @@ module.exports = { | |||
targetGround: true, | |||
targetPlayerPos: true, | |||
particles: particles, | |||
update: function () { | |||
let selfCast = this.selfCast; | |||
@@ -26,10 +26,10 @@ let config = { | |||
zone: 'estuary' | |||
}, | |||
'Fangs of Fury': { | |||
chance: 0.2, | |||
chance: 0.05, | |||
reward: 'Steelclaw\'s Bite', | |||
setSize: 20, | |||
mobName: 'steelclaw' | |||
mobName: 'stinktooth' | |||
}, | |||
'Tradesman\'s Pride': { | |||
chance: 0.007, | |||
@@ -69,6 +69,7 @@ module.exports = { | |||
try { | |||
this.zone = require('../' + this.path + '/' + this.name + '/zone'); | |||
} catch (e) { | |||
console.log(e); | |||
this.zone = globalZone; | |||
} | |||
events.emit('onAfterGetZone', this.name, this.zone); | |||