fucked up perms, players db without cryps
This commit is contained in:
parent
38af55aacd
commit
e29842ffc1
@ -22,14 +22,6 @@ exports.up = async knex => {
|
||||
.onDelete('CASCADE');
|
||||
table.index('game');
|
||||
|
||||
// cryp in a game
|
||||
table.uuid('cryp').notNullable()
|
||||
table.foreign('cryp')
|
||||
.references('id')
|
||||
.inTable('cryps')
|
||||
.onDelete('CASCADE');
|
||||
table.index('cryp');
|
||||
|
||||
// account in a game
|
||||
table.uuid('account').notNullable()
|
||||
table.foreign('account')
|
||||
|
||||
0
server/.env
Executable file → Normal file
0
server/.env
Executable file → Normal file
0
server/Cargo.toml
Executable file → Normal file
0
server/Cargo.toml
Executable file → Normal file
0
server/README.md
Executable file → Normal file
0
server/README.md
Executable file → Normal file
24
server/WORKLOG.md
Executable file → Normal file
24
server/WORKLOG.md
Executable file → Normal file
@ -1,18 +1,3 @@
|
||||
Pve needs to be good, not many players early on
|
||||
Randomly generated PVE graph to traverse with scattered rewards
|
||||
|
||||
Two types of XP -> Skill xp and Cryp XP
|
||||
Skill XP allocates points in skill tree
|
||||
Cryp XP allocates points in Cryp passive tree
|
||||
|
||||
Skills can be customised via skill tree
|
||||
|
||||
Cryp obiendience a deteoriating bar (placeholder name)
|
||||
Cryps gain obedience when playing with you in PVE, PVP or using items
|
||||
Obedience drains over time
|
||||
Obedience drains faster when training / missions
|
||||
Having obedience is desirable for getting good rewards
|
||||
|
||||
# Principles
|
||||
* Experience something
|
||||
* Express something
|
||||
@ -62,14 +47,6 @@ skill order defined by cryp/skill speed
|
||||
|
||||
counter -> dmg <-> heal
|
||||
|
||||
immune to status effects
|
||||
|
||||
|
||||
physical, magic, pure dmg?
|
||||
elemental?
|
||||
|
||||
items give skills
|
||||
|
||||
gem td style attr combinations
|
||||
stoney + spikey = jagged
|
||||
|
||||
@ -90,7 +67,6 @@ gem td style attr combinations
|
||||
ghostly
|
||||
|
||||
|
||||
|
||||
* 1: Fighting against human nature is a losing game
|
||||
* 2: Aesthetics matter
|
||||
* 3: Resonance is important
|
||||
|
||||
0
server/src/account.rs
Executable file → Normal file
0
server/src/account.rs
Executable file → Normal file
0
server/src/cryp.rs
Executable file → Normal file
0
server/src/cryp.rs
Executable file → Normal file
32
server/src/game.rs
Executable file → Normal file
32
server/src/game.rs
Executable file → Normal file
@ -592,27 +592,22 @@ pub fn game_get(tx: &mut Transaction, id: Uuid) -> Result<Game, Error> {
|
||||
return Ok(game);
|
||||
}
|
||||
|
||||
/// write a row for every cryp in a team when added to a battle
|
||||
pub fn players_write(team: &Team, game_id: Uuid, tx: &mut Transaction) -> Result<(), Error> {
|
||||
pub fn players_write(account: &Account, game_id: Uuid, tx: &mut Transaction) -> Result<(), Error> {
|
||||
// pve
|
||||
if !team.id.is_nil() {
|
||||
for cryp in &team.cryps {
|
||||
let id = Uuid::new_v4();
|
||||
let id = Uuid::new_v4();
|
||||
|
||||
let query = "
|
||||
INSERT INTO players (id, game, cryp, account)
|
||||
VALUES ($1, $2, $3, $4)
|
||||
RETURNING id, account;
|
||||
";
|
||||
let query = "
|
||||
INSERT INTO players (id, game, account)
|
||||
VALUES ($1, $2, $3)
|
||||
RETURNING id, account;
|
||||
";
|
||||
|
||||
let result = tx
|
||||
.query(query, &[&id, &game_id, &cryp.id, &team.id])?;
|
||||
let result = tx
|
||||
.query(query, &[&id, &game_id, &account.id])?;
|
||||
|
||||
let _returned = result.iter().next().expect("no row written");
|
||||
let _returned = result.iter().next().expect("no row written");
|
||||
|
||||
println!("wrote player entry game:{:?} cryp:{:?} account:{:?}", game_id, cryp.id, team.id);
|
||||
}
|
||||
}
|
||||
println!("wrote player {:?} joined game: {:?}", account.name, game_id);
|
||||
|
||||
return Ok(());
|
||||
}
|
||||
@ -695,7 +690,6 @@ pub fn game_pve(params: GamePveParams, tx: &mut Transaction, account: &Account)
|
||||
|
||||
// persist
|
||||
game_new(&game, tx)?;
|
||||
// players_write(&game.team_by_id(account.id), game_id, tx)?;
|
||||
|
||||
Ok(game)
|
||||
}
|
||||
@ -723,7 +717,7 @@ pub fn game_pvp(params: GamePvpParams, tx: &mut Transaction, account: &Account)
|
||||
|
||||
// persist
|
||||
game_new(&game, tx)?;
|
||||
players_write(&game.team_by_id(account.id), game_id, tx)?;
|
||||
players_write(account, game_id, tx)?;
|
||||
|
||||
Ok(game)
|
||||
}
|
||||
@ -757,7 +751,7 @@ pub fn game_join(params: GameJoinParams, tx: &mut Transaction, account: &Account
|
||||
}
|
||||
|
||||
game_update(&game, tx)?;
|
||||
players_write(&game.team_by_id(account.id), game_id, tx)?;
|
||||
players_write(account, game_id, tx)?;
|
||||
|
||||
Ok(game)
|
||||
}
|
||||
|
||||
0
server/src/main.rs
Executable file → Normal file
0
server/src/main.rs
Executable file → Normal file
0
server/src/net.rs
Executable file → Normal file
0
server/src/net.rs
Executable file → Normal file
0
server/src/rpc.rs
Executable file → Normal file
0
server/src/rpc.rs
Executable file → Normal file
0
server/src/skill.rs
Executable file → Normal file
0
server/src/skill.rs
Executable file → Normal file
Loading…
x
Reference in New Issue
Block a user