Fishing seasons
This commit is contained in:
@@ -17,8 +17,7 @@
|
|||||||
"bite": [
|
"bite": [
|
||||||
20,
|
20,
|
||||||
40
|
40
|
||||||
],
|
]
|
||||||
"loot_table": "bworld:gameplay/fishing"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"format_version": 1,
|
||||||
|
"loot_table": {
|
||||||
|
"pools": [
|
||||||
|
{
|
||||||
|
"entries": [
|
||||||
|
{
|
||||||
|
"item": "bworld:salmon",
|
||||||
|
"weight": 60
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"format_version": 1,
|
||||||
|
"loot_table": {
|
||||||
|
"pools": [
|
||||||
|
{
|
||||||
|
"entries": [
|
||||||
|
{
|
||||||
|
"item": "bworld:cod",
|
||||||
|
"weight": 60
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"format_version": 1,
|
||||||
|
"loot_table": {
|
||||||
|
"pools": [
|
||||||
|
{
|
||||||
|
"entries": [
|
||||||
|
{
|
||||||
|
"item": "bworld:cod",
|
||||||
|
"weight": 60
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"item": "bworld:salmon",
|
||||||
|
"weight": 25
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -628,8 +628,6 @@ interface FishingRodParams {
|
|||||||
wait: [number, number];
|
wait: [number, number];
|
||||||
// ticks it stays on the hook before it gets away
|
// ticks it stays on the hook before it gets away
|
||||||
bite: [number, number];
|
bite: [number, number];
|
||||||
// what's caught, a loot table
|
|
||||||
loot_table: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Cast {
|
interface Cast {
|
||||||
@@ -706,7 +704,12 @@ function register_fishing(ctx: ServerContext) {
|
|||||||
const cast = casts.get(player.id);
|
const cast = casts.get(player.id);
|
||||||
if (cast) {
|
if (cast) {
|
||||||
if (cast.escape_at !== undefined) {
|
if (cast.escape_at !== undefined) {
|
||||||
const loot = ctx.loot.roll(params.loot_table, { position: cast.position, player, tool: rod });
|
const season = ctx.world.season_at(
|
||||||
|
cast.hook.position.x,
|
||||||
|
cast.hook.position.z,
|
||||||
|
);
|
||||||
|
const loot_table = `bworld:gameplay/fishing_${season}`;
|
||||||
|
const loot = ctx.loot.roll(loot_table, { position: cast.position, player, tool: rod });
|
||||||
for (const item of loot) player.give_item(item.id, item.count, item.data);
|
for (const item of loot) player.give_item(item.id, item.count, item.data);
|
||||||
}
|
}
|
||||||
stop(player, player.id);
|
stop(player, player.id);
|
||||||
|
|||||||
Reference in New Issue
Block a user