Переглянути джерело

more balance

tags/v0.1.10
Big Bad Waffle 6 роки тому
джерело
коміт
82008a53c1
16 змінених файлів з 209 додано та 76 видалено
  1. BIN
     
  2. BIN
     
  3. +1
    -1
      src/client/ui/templates/characters/template.html
  4. +1
    -1
      src/client/ui/templates/createCharacter/template.html
  5. +1
    -1
      src/client/ui/templates/login/template.html
  6. +7
    -1
      src/server/components/extensions/socialCommands.js
  7. +21
    -12
      src/server/components/reputation.js
  8. +13
    -0
      src/server/config/factions/hostile.js
  9. +3
    -3
      src/server/config/maps/cave/zone.js
  10. +1
    -1
      src/server/config/maps/estuary/map.json
  11. +126
    -17
      src/server/config/maps/estuary/zone.js
  12. +1
    -1
      src/server/config/spells.js
  13. +1
    -1
      src/server/mods/class-necromancer/index.js
  14. +0
    -2
      src/server/world/instancer.js
  15. +0
    -2
      src/server/world/mobBuilder.js
  16. +33
    -33
      src/server/world/randomMap.js


+ 1
- 1
src/client/ui/templates/characters/template.html Переглянути файл

@@ -1,5 +1,5 @@
<div class="uiCharacters">
<img class="logo" src="images/logo_4.png"ii alt="">
<img class="logo" src="images/logo_0.png"ii alt="">
<div class="left">
<div class="character">loading characters...</div>
</div>


+ 1
- 1
src/client/ui/templates/createCharacter/template.html Переглянути файл

@@ -1,5 +1,5 @@
<div class="uiCreateCharacter">
<img class="logo" src="images/logo_4.png" alt="">
<img class="logo" src="images/logo_0.png" alt="">
<div class="box-left">
<div class="left">
<input type="text" class="el textbox txtName" placeholder="name" maxlength="12">


+ 1
- 1
src/client/ui/templates/login/template.html Переглянути файл

@@ -1,5 +1,5 @@
<div class="uiLogin">
<img class="logo" src="images/logo_4.png" alt="">
<img class="logo" src="images/logo_0.png" alt="">
<div class="right">
<div class="label">username</div>
<input type="text" class="el textbox txtUsername" placeholder="username">


+ 7
- 1
src/server/components/extensions/socialCommands.js Переглянути файл

@@ -230,6 +230,9 @@ define([
var safe = config.safe;
delete config.safe;

var eq = config.eq;
delete config.eq;

var item = generator.generate(config);

if (safe) {
@@ -255,7 +258,10 @@ define([
if (spritesheet)
item.spritesheet = spritesheet;

this.obj.inventory.getItem(item);
var newItem = this.obj.inventory.getItem(item);

if (eq)
this.obj.equipment.equip(newItem.id);
},

getGold: function (amount) {


+ 21
- 12
src/server/components/reputation.js Переглянути файл

@@ -52,10 +52,14 @@ define([

getTier: function (factionId) {
var faction = this.list.find(l => l.id == factionId);
if (!faction)
return 3;
else
return faction.tier;
if (!faction) {
this.discoverFaction(factionId);
faction = this.list.find(l => l.id == factionId);
}

return (faction || {
tier: 3
}).tier;
},

canEquipItem: function (item) {
@@ -155,6 +159,9 @@ define([
var fullSync = (this.factions[factionId] == null);
var blueprint = this.getBlueprint(factionId);

if (!blueprint)
return;

this.list.push({
id: factionId,
rep: blueprint.initialRep,
@@ -163,14 +170,16 @@ define([

var tier = blueprint.tiers[this.calculateTier(factionId)].name.toLowerCase();

this.obj.instance.syncer.queue('onGetMessages', {
id: this.obj.id,
messages: [{
class: 'q4',
message: 'you are now ' + tier + ' with ' + blueprint.name,
type: 'rep'
}]
}, [this.obj.serverId]);
if (!blueprint.noGainRep) {
this.obj.instance.syncer.queue('onGetMessages', {
id: this.obj.id,
messages: [{
class: 'q4',
message: 'you are now ' + tier + ' with ' + blueprint.name,
type: 'rep'
}]
}, [this.obj.serverId]);
}

this.syncFaction(factionId, fullSync);
},


+ 13
- 0
src/server/config/factions/hostile.js Переглянути файл

@@ -0,0 +1,13 @@
define([

], function (

) {
return {
id: 'hostile',

initialRep: -10000,

noGainRep: true
};
});

+ 3
- 3
src/server/config/maps/cave/zone.js Переглянути файл

@@ -42,7 +42,7 @@ module.exports = {
range: 2,
selfCast: 0.2,
statMult: 1,
damage: 0.225,
damage: 0.325,
element: 'arcane',
cdMax: 5,
particles: {
@@ -119,7 +119,7 @@ module.exports = {
range: 2,
selfCast: 0.2,
statMult: 1,
damage: 0.2,
damage: 0.45,
element: 'arcane',
cdMax: 5,
particles: {
@@ -212,7 +212,7 @@ module.exports = {
range: 6,
selfCast: 0.25,
statMult: 1,
damage: 0.15,
damage: 0.55,
element: 'arcane',
cdMax: 8,
particles: {


+ 1
- 1
src/server/config/maps/estuary/map.json
Різницю між файлами не показано, бо вона завелика
Переглянути файл


+ 126
- 17
src/server/config/maps/estuary/zone.js Переглянути файл

@@ -5,14 +5,14 @@ module.exports = {
resources: {},
mobs: {
default: {
faction: 2,
faction: 'hostile',
grantRep: {
gaekatla: 15
},

regular: {
hpMult: 1.5,
dmgMult: 2,
hpMult: 4,
dmgMult: 2.2,

drops: {
chance: 45,
@@ -22,44 +22,153 @@ module.exports = {
}
},
'giant gull': {
level: 6,
level: 15,
questItem: {
name: 'Gull Feather',
sprite: [0, 0]
}
},
'fanged rabbit': {
level: 7
level: 15
},
'ghastly toad': {
level: 8
level: 16
},
'overgrown beaver': {
level: 16
},
'huge flamingo': {
level: 9,
level: 17,
questItem: {
name: 'Gull Feather',
name: 'Flamingo Feather',
sprite: [0, 0]
}
},
'overgrown beaver': {
level: 10
},
'ironskull goat': {
level: 10
},
'king gator': {
level: 12
level: 18
},
"m'ogresh": {
level: 12,
isChampion: true,
level: 20,
grantRep: {
gaekatla: 120
},
regular: {
hpMult: 10,
dmgMult: 3,

drops: {
chance: 100,
rolls: 3,
magicFind: [2000, 125]
}
},
spells: [{
type: 'melee',
range: 2,
animation: 'basic'
}, {
type: 'warnBlast',
range: 2,
animation: 'basic',
statMult: 0.01,
particles: {
color: {
start: ['c0c3cf', '929398'],
end: ['929398', 'c0c3cf']
},
scale: {
start: {
min: 4,
max: 10
},
end: {
min: 0,
max: 4
}
},
speed: {
start: {
min: 2,
max: 16
},
end: {
min: 0,
max: 8
}
},
lifetime: {
min: 1,
max: 1
},
spawnType: 'circle',
spawnCircle: {
x: 0,
y: 0,
r: 12
},
randomScale: true,
randomSpeed: true,
chance: 0.075,
randomColor: true
}
}, {
statMult: 0.2,
type: 'projectile',
row: 5,
col: 4,
shootAll: true,
particles: {
color: {
start: ['a24eff', '7a3ad3'],
end: ['7a3ad3', '533399']
},
scale: {
start: {
min: 2,
max: 12
},
end: {
min: 0,
max: 6
}
},
lifetime: {
min: 2,
max: 4
},
alpha: {
start: 0.7,
end: 0
},
speed: {
start: {
min: 4,
max: 24
},
end: {
min: 0,
max: 12
}
},
startRotation: {
min: 0,
max: 360
},
rotationSpeed: {
min: 0,
max: 360
},
randomScale: true,
randomColor: true,
randomSpeed: true,
chance: 0.55,
spawnType: 'circle',
spawnCircle: {
x: 0,
y: 0,
r: 8
}
}
}]
}
},


+ 1
- 1
src/server/config/spells.js Переглянути файл

@@ -59,7 +59,7 @@ define([
},
lifetime: {
min: 1,
max: 4
max: 2
},
alpha: {
start: 0.8,


+ 1
- 1
src/server/mods/class-necromancer/index.js Переглянути файл

@@ -153,7 +153,7 @@ define([
manaCost: 5,
range: 9,
random: {
damage: [100, 380],
damagePercent: [100, 380],
hpPercent: [40, 60]
}
};


+ 0
- 2
src/server/world/instancer.js Переглянути файл

@@ -365,7 +365,6 @@ define([
obj.y = spawnPos.y;
}

obj.instance.spawners.scale(obj.stats.values.level);
obj.instance.questBuilder.obtain(obj);

if (obj.player)
@@ -516,7 +515,6 @@ define([
obj.y = spawnPos.y;

instance.questBuilder.obtain(obj);
obj.instance.spawners.scale(obj.stats.values.level);
}

process.send({


+ 0
- 2
src/server/world/mobBuilder.js Переглянути файл

@@ -160,8 +160,6 @@ define([
spell: true
});
rune.eq = true;
if (i == 0)
rune.spell.cdMult = 5;
mob.inventory.getItem(rune);
}



+ 33
- 33
src/server/world/randomMap.js Переглянути файл

@@ -1,6 +1,6 @@
define([

], function(
], function (

) {
return {
@@ -15,7 +15,7 @@ define([

bounds: [0, 0, 0, 0],

generate: function(instance) {
generate: function (instance) {
this.rooms = [];
this.exitAreas = [];
this.tileMappings = {};
@@ -38,7 +38,7 @@ define([
}
},

isValidDungeon: function() {
isValidDungeon: function () {
var endRooms = this.rooms.filter(r => r.connections.length == 0);
var endDistanceReached = endRooms.find(r => r.distance == this.maxDistance, this);

@@ -48,7 +48,7 @@ define([
var valid = true;

endRooms
.forEach(function(r) {
.forEach(function (r) {
if (r.distance < this.minDistance)
valid = false;
else if (r.distance > this.maxDistance)
@@ -58,8 +58,8 @@ define([
return valid;
},

setupTemplates: function(map) {
this.templates.forEach(function(r, typeId) {
setupTemplates: function (map) {
this.templates.forEach(function (r, typeId) {
if (r.properties.mapping)
return;

@@ -77,7 +77,7 @@ define([
rotate: !!k
}, r);

flipped.exits.forEach(function(e) {
flipped.exits.forEach(function (e) {
var direction = JSON.parse(e.properties.exit);

if (flipped.flipX) {
@@ -101,7 +101,7 @@ define([
e.properties.exit = JSON.stringify(direction);
});

flipped.objects.forEach(function(o) {
flipped.objects.forEach(function (o) {
if (flipped.flipX)
o.x = r.x + r.width - (o.x - r.x) - 1;
if (flipped.flipY)
@@ -125,7 +125,7 @@ define([
}
}, this);

this.templates.forEach(function(r) {
this.templates.forEach(function (r) {
var rotate = r.rotate;
var w = rotate ? r.height : r.width;
var h = rotate ? r.width : r.height;
@@ -151,12 +151,12 @@ define([
});
},

generateMappings: function(map) {
generateMappings: function (map) {
var oldMap = map.oldMap;

this.templates
.filter(r => r.properties.mapping)
.forEach(function(m) {
.forEach(function (m) {
var x = m.x;
var y = m.y;
var w = m.width;
@@ -189,7 +189,7 @@ define([
}, this);
},

buildMap: function(instance, startRoom) {
buildMap: function (instance, startRoom) {
var w = this.bounds[2] - this.bounds[0];
var h = this.bounds[3] - this.bounds[1];

@@ -214,7 +214,7 @@ define([
this.spawnObjects(instance, startRoom);
},

fillGaps: function(instance) {
fillGaps: function (instance) {
var map = instance.map.clientMap.map;
var oldMap = instance.map.oldMap;
var w = map.length;
@@ -248,7 +248,7 @@ define([
}
},

randomizeTile: function(tile, floorTile, gapMapping) {
randomizeTile: function (tile, floorTile, gapMapping) {
var mapping = gapMapping ? this.gapMappings[tile] : this.tileMappings[tile];
if (!mapping)
return tile;
@@ -264,7 +264,7 @@ define([
return tile;
},

drawRoom: function(instance, room) {
drawRoom: function (instance, room) {
var map = instance.map.clientMap.map;
var template = room.template;
var collisionMap = instance.map.clientMap.collisionMap;
@@ -288,7 +288,7 @@ define([
continue;
} else {
//Remove objects from this position since it falls in another room
template.objects.spliceWhere(function(o) {
template.objects.spliceWhere(function (o) {
var ox = o.x - template.x + room.x;
var oy = o.y - template.y + room.y;
return ((ox == x) && (oy == y));
@@ -298,11 +298,11 @@ define([
var didCollide = collisionMap[x][y];
if (collides) {
if (didCollide) {
var isExitTile = this.exitAreas.find(function(e) {
var isExitTile = this.exitAreas.find(function (e) {
return (!((x < e.x) || (y < e.y) || (x >= e.x + e.width) || (y >= e.y + e.height)));
});
if (isExitTile) {
var isThisExit = template.oldExits.find(function(e) {
var isThisExit = template.oldExits.find(function (e) {
var ex = room.x + (e.x - template.x);
var ey = room.y + (e.y - template.y);
return (!((x < ex) || (y < ey) || (x >= ex + e.width) || (y >= ey + e.height)));
@@ -321,7 +321,7 @@ define([
}
}

template.oldExits.forEach(function(e) {
template.oldExits.forEach(function (e) {
this.exitAreas.push({
x: room.x + (e.x - template.x),
y: room.y + (e.y - template.y),
@@ -333,14 +333,14 @@ define([
room.connections.forEach(c => this.drawRoom(instance, c), this);
},

spawnObjects: function(instance, room) {
spawnObjects: function (instance, room) {
var template = room.template;
var spawners = instance.spawners;
var spawnCd = instance.map.mapFile.properties.spawnCd;

var collisionMap = instance.map.clientMap.collisionMap;

template.objects.forEach(function(o) {
template.objects.forEach(function (o) {
o.x = o.x - template.x + room.x;
o.y = o.y - template.y + room.y;

@@ -354,7 +354,7 @@ define([
room.connections.forEach(c => this.spawnObjects(instance, c), this);
},

buildRoom: function(template, connectTo, templateExit, connectToExit, isHallway) {
buildRoom: function (template, connectTo, templateExit, connectToExit, isHallway) {
var room = {
x: 0,
y: 0,
@@ -397,13 +397,13 @@ define([
return room;
},

setupConnection: function(fromRoom, isHallway) {
setupConnection: function (fromRoom, isHallway) {
if (fromRoom.template.exits.length == 0)
return true;

var fromExit = fromRoom.template.exits.splice(this.randInt(0, fromRoom.template.exits.length), 1)[0];
var exitDirection = JSON.parse(fromExit.properties.exit);
var templates = this.templates.filter(function(t) {
var templates = this.templates.filter(function (t) {
if (
(t.properties.mapping) ||
(!!t.properties.hallway != isHallway) ||
@@ -415,7 +415,7 @@ define([
)
return false;
else {
var isValid = t.exits.some(function(e) {
var isValid = t.exits.some(function (e) {
var direction = JSON.parse(e.properties.exit);
return ((direction[0] == -exitDirection[0]) && (direction[1] == -exitDirection[1]));
});
@@ -429,7 +429,7 @@ define([
if ((isValid) && (fromRoom.distance + 1 == this.maxDistance)) {
//If there is an exit available, rather use that
if (!t.properties.end) {
var endsAvailable = this.templates.filter(function(tt) {
var endsAvailable = this.templates.filter(function (tt) {
if (!tt.properties.end)
return false;
else if (!~~tt.properties.maxOccur)
@@ -454,7 +454,7 @@ define([

var template = extend(true, {}, templates[this.randInt(0, templates.length)]);

var templateExit = template.exits.filter(function(e) {
var templateExit = template.exits.filter(function (e) {
var direction = JSON.parse(e.properties.exit);
return ((direction[0] == -exitDirection[0]) && (direction[1] == -exitDirection[1]));
});
@@ -472,7 +472,7 @@ define([
return true;
},

offsetRooms: function(room) {
offsetRooms: function (room) {
var bounds = this.bounds;
var dx = (this.bounds[0] < 0) ? -bounds[0] : 0;
var dy = (this.bounds[1] < 0) ? -bounds[1] : 0;
@@ -482,21 +482,21 @@ define([
this.bounds = [bounds[0] + dx, bounds[1] + dy, bounds[2] + dx, bounds[3] + dy];
},

performOffset: function(room, dx, dy) {
performOffset: function (room, dx, dy) {
room.x += dx;
room.y += dy;

room.connections.forEach(c => this.performOffset(c, dx, dy), this);
},

updateBounds: function(room) {
updateBounds: function (room) {
this.bounds[0] = Math.min(this.bounds[0], room.x);
this.bounds[1] = Math.min(this.bounds[1], room.y);
this.bounds[2] = Math.max(this.bounds[2], room.x + room.template.width);
this.bounds[3] = Math.max(this.bounds[3], room.y + room.template.height);
},

doesCollide: function(room, ignore) {
doesCollide: function (room, ignore) {
for (var i = 0; i < this.rooms.length; i++) {
var r = this.rooms[i];
if (r == ignore)
@@ -515,8 +515,8 @@ define([
return false;
},

randInt: function(min, max) {
randInt: function (min, max) {
return ~~(Math.random() * (max - min)) + min;
}
};
});
});

Завантаження…
Відмінити
Зберегти