-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #463 from hanshino/feature/job
新增小遊戲轉職系統
- Loading branch information
Showing
16 changed files
with
1,508 additions
and
320 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"defaultUserIcon": "https://i.imgur.com/SGDoCtd.png", | ||
"app": { | ||
"funds": { | ||
"server": 3000, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
app/migrations/20240120181544_create_minigame_job_table.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
exports.up = async function (knex) { | ||
await knex.schema.createTable("minigame_job", table => { | ||
table.increments("id").primary(); | ||
table.string("key").notNullable().unique(); | ||
table.string("name").notNullable(); | ||
table.string("description").notNullable().comment("職業描述"); | ||
table.integer("class_advancement").notNullable().comment("轉職位階"); | ||
|
||
table.timestamps(true, true); | ||
}); | ||
|
||
return knex | ||
.insert([ | ||
{ | ||
key: "adventurer", | ||
name: "冒險者", | ||
description: "冒險者", | ||
class_advancement: 0, | ||
}, | ||
{ | ||
key: "swordman", | ||
name: "劍士", | ||
description: "劍士是近戰專家,以高生命值和防禦力為優勢,擅長在前線與敵人近距離交戰。", | ||
class_advancement: 1, | ||
}, | ||
{ | ||
key: "thief", | ||
name: "盜賊", | ||
description: "盜賊以靈活性和隱密行動為優勢,能夠在戰場上迅速移動,進行偷襲和情報收集。", | ||
class_advancement: 1, | ||
}, | ||
{ | ||
key: "mage", | ||
name: "法師", | ||
description: "法師是遠距離攻擊者,以元素和魔法為主,雖然生命值較低,但擁有強大的法術威力。", | ||
class_advancement: 1, | ||
}, | ||
]) | ||
.into("minigame_job"); | ||
}; | ||
|
||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
exports.down = function (knex) { | ||
return knex.schema.dropTable("minigame_job"); | ||
}; |
19 changes: 19 additions & 0 deletions
19
app/migrations/20240120183247_add_job_id_to_minigame_level_table.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
exports.up = function (knex) { | ||
return knex.schema.table("minigame_level", table => { | ||
table.integer("job_id").notNullable().comment("職業ID").after("exp").defaultTo(1); | ||
}); | ||
}; | ||
|
||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
exports.down = function (knex) { | ||
return knex.schema.table("minigame_level", table => { | ||
table.dropColumn("job_id"); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.