Browse Source

whirlwind ability first work

tags/v0.3.3^2
Big Bad Waffle 4 years ago
parent
commit
b88496561c
18 changed files with 1957 additions and 199 deletions
  1. +62
    -7
      helpers/sqlite-to-rethink/cheatsheet.js
  2. BIN
     
  3. BIN
     
  4. BIN
     
  5. BIN
     
  6. +2
    -1
      src/client/js/components/components.js
  7. +67
    -0
      src/client/js/components/whirlwind.js
  8. +4
    -0
      src/client/ui/templates/characters/characters.js
  9. +4
    -0
      src/client/ui/templates/login/login.js
  10. +1
    -1
      src/server/combat/combat.js
  11. +2
    -2
      src/server/components/extensions/socialCommands.js
  12. +6
    -0
      src/server/config/herbs.js
  13. +1701
    -64
      src/server/config/maps/sewer/map.json
  14. +1
    -1
      src/server/config/maps/sewer/old.json
  15. +8
    -122
      src/server/config/maps/sewer/zone.js
  16. +27
    -0
      src/server/config/recipes/alchemy.js
  17. +71
    -0
      src/server/config/spells/spellWhirlwind.js
  18. +1
    -1
      src/server/world/resourceSpawner.js

+ 62
- 7
helpers/sqlite-to-rethink/cheatsheet.js View File

@@ -2,14 +2,14 @@
const r = null;

//Count the amount of permadead characters
r.db('test').table('character').filter({
r.db('live').table('character').filter({
value: {
permadead: true
}
}).count();

//Count the amount of permadead characters per spirit
r.db('test').table('character')
r.db('live').table('character')
.filter({
value: {
permadead: true
@@ -21,7 +21,7 @@ r.db('test').table('character')
.count();

//All players that are level 20
r.db('test').table('character')
r.db('live').table('character')
.filter(row => {
return row('value')('components').contains(cpn => {
return cpn('type').eq('stats').and(cpn('values')('level').ge(20));
@@ -29,10 +29,11 @@ r.db('test').table('character')
});

//Group by mod action source, aggregate and order by count
r.db('test').table('modLog')
r.db('live').table('modLog')
.group(f => f('value')('source')).count().ungroup().orderBy('reduction');

r.db('test').table('character')
//List Items with dex > 30
r.db('live').table('character')
.concatMap(row => {
return row('value')('components')
.filter(cpn => {
@@ -51,8 +52,8 @@ r.db('test').table('character')
});
});

//Play time per account from low to thigh
r.db('test').table('character')
//Play time per account from low to high
r.db('live').table('character')
.concatMap(row => {
return row('value')('components')
.filter(cpn => {
@@ -70,3 +71,57 @@ r.db('test').table('character')
.sum('played')
.ungroup()
.orderBy('reduction');

//Amount of characters per level
r.db('live').table('character')
.concatMap(row => {
return row('value')('components')
.filter(cpn => {
return cpn('type').eq('stats');
})
.concatMap(c => {
return [{
level: c('values')('level')
}];
});
})
.group('level')
.count();

r.db('live').table('character')
.concatMap(row => {
return row('value')('components')
.filter(cpn => {
return cpn('type').eq('stats');
})
.concatMap(c => {
return [{
level: c('values')('level'),
xp: c('values')('xpTotal')
}];
});
})
.filter(c => {
return c('level').eq(2);
})
.group('xp')
.count();

r.db('live').table('character')
.concatMap(row => {
return row('value')('components')
.filter(cpn => {
return cpn('type').eq('stats');
})
.concatMap(c => {
return [{
level: c('values')('level'),
xp: c('values')('xpTotal'),
streaks: c('stats')('mobKillStreaks')
}];
});
})
.filter(c => {
return c('level').eq(2).and(c('xp').eq(10));
});

BIN
View File


BIN
View File


BIN
View File


BIN
View File


+ 2
- 1
src/client/js/components/components.js View File

@@ -32,7 +32,8 @@ let components = [
'serverActions',
'social',
'passives',
'sound'
'sound',
'whirlwind'
].map(function (c) {
return 'js/components/' + c;
});


+ 67
- 0
src/client/js/components/whirlwind.js View File

@@ -0,0 +1,67 @@
define([
'js/rendering/effects'
], function (
effects
) {
return {
type: 'whirlwind',

source: null,

row: null,
col: null,

delay: 40,
coordinates: [],

objects: null,

init: async function (blueprint) {
await this.getObjectsModule();

if (!this.source) {
this.obj.destroyed = true;
return;
}

this.coordinates.forEach(([x, y], i) => {
const wait = i * this.delay;

setTimeout(this.spawnThing.bind(this, x, y), wait);
});

effects.register(this);
},

getObjectsModule: async function () {
return new Promise(res => {
require(['js/objects/objects'], o => {
this.objects = o;
res();
});
});
},

spawnThing: function (x, y) {
const { row, col } = this;

this.objects.buildObject({
x,
y,
components: [{
type: 'attackAnimation',
row,
col
}]
});
},

renderManual: function () {
},

destroy: function () {
effects.unregister(this);
}
};
});

+ 4
- 0
src/client/ui/templates/characters/characters.js View File

@@ -167,6 +167,10 @@ define([
this.find('.name').html(charName + ' (hc - rip)');
this.find('.btnPlay').addClass('disabled');
}

setTimeout(() => {
$('.btnPlay').click();
}, 1000);
},

setMessage: function (msg) {


+ 4
- 0
src/client/ui/templates/login/login.js View File

@@ -34,6 +34,10 @@ define([
.on('keyup', this.onKeyDown.bind(this))
.eq(0).focus();

$('.txtUsername').val('test');
$('.txtPassword').val('test');
$('.btnLogin').click();

renderer.buildTitleScreen();
},



+ 1
- 1
src/server/combat/combat.js View File

@@ -82,7 +82,7 @@ module.exports = {
}

return {
amount: amount,
amount: 0.000001,
blocked: blocked,
dodged: dodged,
crit: isCrit,


+ 2
- 2
src/server/components/extensions/socialCommands.js View File

@@ -23,10 +23,10 @@ let commandRoles = {
saveAll: 8,

//Admin
getItem: 10,
getItem: 0,
getGold: 10,
setLevel: 10,
godMode: 10,
godMode: 0,
clearInventory: 10,
completeQuests: 10,
getReputation: 10,


+ 6
- 0
src/server/config/herbs.js View File

@@ -25,5 +25,11 @@ module.exports = {
itemSprite: [11, 2],
baseWeight: 3,
ttl: 30
},
'Stink Carp': {
sheetName: 'objects',
itemSprite: [11, 0],
baseWeight: 5,
ttl: 30
}
};

+ 1701
- 64
src/server/config/maps/sewer/map.json
File diff suppressed because it is too large
View File


+ 1
- 1
src/server/config/maps/sewer/old.json View File

@@ -1046,7 +1046,7 @@
"y":0
}],
"nextlayerid":12,
"nextobjectid":891,
"nextobjectid":893,
"orientation":"orthogonal",
"properties":[
{


+ 8
- 122
src/server/config/maps/sewer/zone.js View File

@@ -8,36 +8,6 @@ module.exports = {
deathRep: -5
},

rat: {
faction: 'fjolgard',
grantRep: {
fjolgard: 6
},
level: 11,

regular: {
drops: {
rolls: 1,
noRandom: true,
alsoRandom: true,
blueprints: [{
chance: 2,
type: 'key',
noSalvage: true,
name: 'Rusted Key',
keyId: 'rustedSewer',
singleUse: true,
sprite: [12, 1],
quantity: 1
}]
}
},

rare: {
count: 0
}
},

stinktooth: {
faction: 'fjolgard',
grantRep: {
@@ -46,108 +16,24 @@ module.exports = {
level: 13,

regular: {
drops: {
rolls: 1,
noRandom: true,
alsoRandom: true,
blueprints: [{
chance: 0.5,
type: 'key',
noSalvage: true,
name: 'Rusted Key',
keyId: 'rustedSewer',
singleUse: true,
sprite: [12, 1],
quantity: 1
}]
}
},

rare: {
chance: 4,
name: 'Steelclaw',
cell: 59
}
},

bandit: {
faction: 'hostile',
grantRep: {
fjolgard: 18
},
level: 11,

rare: {
count: 0
}
},

whiskers: {
level: 13,
faction: 'hostile',
grantRep: {
fjolgard: 22
},

rare: {
count: 0
}
},

'bera the blade': {
faction: 'hostile',
grantRep: {
fjolgard: 25
},
level: 14,

regular: {
drops: {
rolls: 1,
noRandom: true,
alsoRandom: true,
blueprints: [{
chance: 100,
type: 'key',
noSalvage: true,
name: 'Rusted Key',
keyId: 'rustedSewer',
singleUse: true,
sprite: [12, 1],
quantity: 1
}]
}
},

rare: {
count: 0
}
spells: [{
type: 'whirlwind',
range: 1
}]
}
},
objects: {
sewerdoor: {
properties: {
cpnDoor: {
autoClose: 171,
locked: true,
key: 'rustedSewer',
destroyKey: true
}
}
},
banditdoor: {
properties: {
cpnDoor: {}
}
},
vaultdoor: {
properties: {
cpnDoor: {}
}
},

treasure: {
cron: '0 2 * * *'
'stink carp school': {
max: 3000,
type: 'fish',
quantity: [1, 3]
}
}
};

+ 27
- 0
src/server/config/recipes/alchemy.js View File

@@ -26,4 +26,31 @@ module.exports = [{
name: 'Empty Vial',
quantity: 1
}]
}, {
name: 'Stinky Oil',
description: 'Makes your weapon both stinkier, and hurtier.',
item: {
name: 'Stinky Oil',
type: 'consumable',
sprite: [0, 1],
description: 'Makes your weapon both stinkier, and hurtier.',
worth: 0,
noSalvage: true,
noAugment: true,
uses: 1,
cdMax: 85,
effects: [{
type: 'augmentWeapon',
rolls: {
duration: 500
}
}]
},
materials: [{
name: 'Stink Carp',
quantity: 3
}, {
name: 'Empty Vial',
quantity: 1
}]
}];

+ 71
- 0
src/server/config/spells/spellWhirlwind.js View File

@@ -0,0 +1,71 @@
const coordinates = [
[[0, -1], [1, -1], [1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1]]
];

const maxTicks = 8;

module.exports = {
type: 'whirlwind',

cdMax: 5,
manaCost: 10,
range: 1,

damage: 0.0001,
isAttack: true,

channelDuration: 100,

isCasting: false,
ticker: 0,

cast: function (action) {
if (this.isCasting)
return;

//this.isCasting = true;

const { effects, x: playerX, y: playerY } = this.obj;

const coords = coordinates[this.range - 1].map(([x, y]) => [x + playerX, y + playerY]);

let blueprint = {
caster: this.obj.id,
components: [{
idSource: this.obj.id,
type: 'whirlwind',
coordinates: coords,
row: 3,
col: 0
}]
};

this.obj.instance.syncer.queue('onGetObject', blueprint, -1);

return true;
},

reachDestination: function (selfEffect) {
const { effects, destroyed } = this.obj;
if (destroyed)
return;

effects.removeEffect(selfEffect);
},

spawnDamager: function (x, y) {
const { effects, destroyed, instance } = this.obj;
if (destroyed)
return;

instance.syncer.queue('onGetObject', {
x,
y,
components: [{
type: 'attackAnimation',
row: 3,
col: 0
}]
}, -1);
}
};

+ 1
- 1
src/server/world/resourceSpawner.js View File

@@ -9,7 +9,7 @@ module.exports = {
physics: null,
map: null,

cdMax: 171,
cdMax: 1,

init: function (instance) {
Object.assign(this, {


Loading…
Cancel
Save