Compare commits
No commits in common. "207491583051516bb0a63c6b34018a50cfb04599" and "ac43825c27c9be10e7ac5823b1df61156d2d41ce" have entirely different histories.
2074915830
...
ac43825c27
|
@ -2,12 +2,7 @@
|
||||||
# channel:
|
# channel:
|
||||||
# id: "✧𝓓𝓔𝓥 𝓡𝓸𝓸𝓶✧"
|
# id: "✧𝓓𝓔𝓥 𝓡𝓸𝓸𝓶✧"
|
||||||
# allowColorChanging: true
|
# allowColorChanging: true
|
||||||
# - uri: wss://mppclone.com:8443
|
|
||||||
# channel:
|
|
||||||
# id: "test/fishing"
|
|
||||||
# allowColorChanging: true
|
|
||||||
|
|
||||||
- uri: wss://mppclone.com:8443
|
- uri: wss://mppclone.com:8443
|
||||||
channel:
|
channel:
|
||||||
id: "keller room"
|
id: "test/fishing"
|
||||||
allowColorChanging: true
|
allowColorChanging: true
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
import Command from "@server/commands/Command";
|
|
||||||
|
|
||||||
export const info = new Command(
|
|
||||||
"info",
|
|
||||||
["info"],
|
|
||||||
"Get your own user ID",
|
|
||||||
"info",
|
|
||||||
"command.general.info",
|
|
||||||
async ({ id, command, args, prefix, part, user }) => {
|
|
||||||
return `🌊 Made by Hri7566 | Original created by Brandon Lockaby`;
|
|
||||||
},
|
|
||||||
false
|
|
||||||
);
|
|
|
@ -23,8 +23,6 @@ import { tree } from "./fishing/tree";
|
||||||
import { pick } from "./fishing/pick";
|
import { pick } from "./fishing/pick";
|
||||||
import { fid } from "./util/fid";
|
import { fid } from "./util/fid";
|
||||||
import { chance } from "./util/chance";
|
import { chance } from "./util/chance";
|
||||||
import { info } from "./general/info";
|
|
||||||
import { burger } from "./util/burger";
|
|
||||||
// import { give } from "./inventory/give";
|
// import { give } from "./inventory/give";
|
||||||
|
|
||||||
interface ICommandGroup {
|
interface ICommandGroup {
|
||||||
|
@ -38,7 +36,7 @@ export const commandGroups: ICommandGroup[] = [];
|
||||||
const generalGroup: ICommandGroup = {
|
const generalGroup: ICommandGroup = {
|
||||||
id: "general",
|
id: "general",
|
||||||
displayName: "General",
|
displayName: "General",
|
||||||
commands: [help, color, myid, info]
|
commands: [help, color, myid]
|
||||||
};
|
};
|
||||||
|
|
||||||
commandGroups.push(generalGroup);
|
commandGroups.push(generalGroup);
|
||||||
|
@ -54,7 +52,7 @@ commandGroups.push(fishingGroup);
|
||||||
const inventoryGroup: ICommandGroup = {
|
const inventoryGroup: ICommandGroup = {
|
||||||
id: "inventory",
|
id: "inventory",
|
||||||
displayName: "Inventory",
|
displayName: "Inventory",
|
||||||
commands: [inventory, take, eat, sack, pokemon, yeet, burger /* give */]
|
commands: [inventory, take, eat, sack, pokemon, yeet /* give */]
|
||||||
};
|
};
|
||||||
|
|
||||||
commandGroups.push(inventoryGroup);
|
commandGroups.push(inventoryGroup);
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
import { addBack } from "@server/backs";
|
|
||||||
import Command from "@server/commands/Command";
|
|
||||||
import { getInventory, updateInventory } from "@server/data/inventory";
|
|
||||||
import { addItem } from "@server/items";
|
|
||||||
|
|
||||||
export const burger = new Command(
|
|
||||||
"burger",
|
|
||||||
["burger"],
|
|
||||||
"Get a burger",
|
|
||||||
"burger",
|
|
||||||
"command.util.burger",
|
|
||||||
async ({ id, command, args, prefix, part, user }) => {
|
|
||||||
const burger = {
|
|
||||||
id: "burger",
|
|
||||||
name: "Burger",
|
|
||||||
objtype: "item",
|
|
||||||
emoji: "🍔"
|
|
||||||
};
|
|
||||||
|
|
||||||
const inv = await getInventory(user.inventoryId);
|
|
||||||
if (!inv) return "something has gone *terribly* wrong";
|
|
||||||
|
|
||||||
addItem(inv.items as unknown as IObject[], burger);
|
|
||||||
await updateInventory(inv);
|
|
||||||
|
|
||||||
return "you now have burger";
|
|
||||||
},
|
|
||||||
false
|
|
||||||
);
|
|
|
@ -20,7 +20,7 @@ export async function tick() {
|
||||||
|
|
||||||
let winner =
|
let winner =
|
||||||
Object.values(fishers)[
|
Object.values(fishers)[
|
||||||
Math.floor(Math.random() * Object.values(fishers).length)
|
Math.floor(Math.random() * Object.values(fishers).length)
|
||||||
];
|
];
|
||||||
|
|
||||||
if (!winner) return;
|
if (!winner) return;
|
||||||
|
@ -44,8 +44,7 @@ export async function tick() {
|
||||||
|
|
||||||
if (r < data.chance / 10) {
|
if (r < data.chance / 10) {
|
||||||
// After 60 minutes, reset chance
|
// After 60 minutes, reset chance
|
||||||
if (data.t > Date.now() + 60 * 60000)
|
if (data.t > 60 * 60000) await resetFishingChance(user.id);
|
||||||
await resetFishingChance(user.id);
|
|
||||||
|
|
||||||
stopFishing(
|
stopFishing(
|
||||||
winner.id,
|
winner.id,
|
||||||
|
@ -67,13 +66,7 @@ export async function tick() {
|
||||||
addBack(winner.id, {
|
addBack(winner.id, {
|
||||||
m: "sendchat",
|
m: "sendchat",
|
||||||
channel: winner.channel,
|
channel: winner.channel,
|
||||||
message: `Our good friend @${
|
message: `Our good friend @${user.id} caught a ${size} ${emoji}${animal.name}! ready to ${p}eat or ${p}fish again${winner.autofish ? " (AUTOFISH is enabled)" : ""}`,
|
||||||
user.id
|
|
||||||
} caught a ${size} ${emoji}${
|
|
||||||
animal.name
|
|
||||||
}! ready to ${p}eat or ${p}fish again${
|
|
||||||
winner.autofish ? " (AUTOFISH is enabled)" : ""
|
|
||||||
}`,
|
|
||||||
isDM: winner.isDM,
|
isDM: winner.isDM,
|
||||||
id: winner.userID
|
id: winner.userID
|
||||||
});
|
});
|
||||||
|
@ -164,7 +157,7 @@ export async function getFishingChance(userID: string) {
|
||||||
|
|
||||||
export async function resetFishingChance(userID: string) {
|
export async function resetFishingChance(userID: string) {
|
||||||
const key = `fishingChance~${userID}`;
|
const key = `fishingChance~${userID}`;
|
||||||
// logger.debug("Resetting fishing chance for user " + userID);
|
logger.debug("Resetting fishing chance for user " + userID);
|
||||||
await kvSet(key, {
|
await kvSet(key, {
|
||||||
t: Date.now(),
|
t: Date.now(),
|
||||||
chance: 1
|
chance: 1
|
||||||
|
|
|
@ -7,12 +7,11 @@ import { Logger } from "@util/Logger";
|
||||||
import { loadConfig } from "@util/config";
|
import { loadConfig } from "@util/config";
|
||||||
import { addTickEvent, removeTickEvent } from "@util/tick";
|
import { addTickEvent, removeTickEvent } from "@util/tick";
|
||||||
|
|
||||||
export const locations = loadConfig<TAnyLocation[]>("config/locations.yml", [
|
export const locations = loadConfig<ILocation[]>("config/locations.yml", [
|
||||||
{
|
{
|
||||||
id: "pond",
|
id: "pond",
|
||||||
name: "Pond",
|
name: "Pond",
|
||||||
nearby: ["lake", "river", "sea"],
|
nearby: ["lake", "river", "sea"],
|
||||||
canFish: true,
|
|
||||||
hasSand: true,
|
hasSand: true,
|
||||||
objects: []
|
objects: []
|
||||||
},
|
},
|
||||||
|
@ -20,7 +19,6 @@ export const locations = loadConfig<TAnyLocation[]>("config/locations.yml", [
|
||||||
id: "lake",
|
id: "lake",
|
||||||
name: "Lake",
|
name: "Lake",
|
||||||
nearby: ["pond", "river", "sea"],
|
nearby: ["pond", "river", "sea"],
|
||||||
canFish: true,
|
|
||||||
hasSand: false,
|
hasSand: false,
|
||||||
objects: []
|
objects: []
|
||||||
},
|
},
|
||||||
|
@ -28,7 +26,6 @@ export const locations = loadConfig<TAnyLocation[]>("config/locations.yml", [
|
||||||
id: "river",
|
id: "river",
|
||||||
name: "River",
|
name: "River",
|
||||||
nearby: ["pond", "lake", "sea"],
|
nearby: ["pond", "lake", "sea"],
|
||||||
canFish: true,
|
|
||||||
hasSand: false,
|
hasSand: false,
|
||||||
objects: []
|
objects: []
|
||||||
},
|
},
|
||||||
|
@ -36,7 +33,6 @@ export const locations = loadConfig<TAnyLocation[]>("config/locations.yml", [
|
||||||
id: "sea",
|
id: "sea",
|
||||||
name: "Sea",
|
name: "Sea",
|
||||||
nearby: ["pond", "lake", "river"],
|
nearby: ["pond", "lake", "river"],
|
||||||
canFish: true,
|
|
||||||
hasSand: true,
|
hasSand: true,
|
||||||
objects: []
|
objects: []
|
||||||
}
|
}
|
||||||
|
@ -53,10 +49,9 @@ const logger = new Logger("Places");
|
||||||
|
|
||||||
export function populateSand() {
|
export function populateSand() {
|
||||||
for (const loc of locations) {
|
for (const loc of locations) {
|
||||||
if (!("hasSand" in loc)) continue;
|
|
||||||
if (!loc.hasSand) continue;
|
if (!loc.hasSand) continue;
|
||||||
|
|
||||||
let existing = loc.objects.find((obj: ILocation) => obj.id == "sand");
|
let existing = loc.objects.find(obj => obj.id == "sand");
|
||||||
if (typeof existing !== "undefined") continue;
|
if (typeof existing !== "undefined") continue;
|
||||||
|
|
||||||
loc.objects.push(sand);
|
loc.objects.push(sand);
|
||||||
|
|
|
@ -9,6 +9,9 @@ export const fish: IBehaviorDefinition = {
|
||||||
|
|
||||||
const fish = obj as IFish;
|
const fish = obj as IFish;
|
||||||
|
|
||||||
|
console.log(fish)
|
||||||
|
console.log(fish.rarity);
|
||||||
|
|
||||||
// 50%
|
// 50%
|
||||||
if (r < 0.5) {
|
if (r < 0.5) {
|
||||||
const color = new CosmicColor(
|
const color = new CosmicColor(
|
||||||
|
@ -34,7 +37,7 @@ export const fish: IBehaviorDefinition = {
|
||||||
return {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
shouldRemove: true
|
shouldRemove: true
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,26 +101,9 @@ interface ILocation {
|
||||||
name: string;
|
name: string;
|
||||||
nearby: string[];
|
nearby: string[];
|
||||||
objects: IObject[];
|
objects: IObject[];
|
||||||
|
hasSand: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IFishingLocation extends ILocation {
|
|
||||||
canFish: true;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ISandyLocation extends ILocation {
|
|
||||||
hasSand: true;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface IShopLocation extends ILocation {
|
|
||||||
isShop: true;
|
|
||||||
}
|
|
||||||
|
|
||||||
type TAnyLocation =
|
|
||||||
| ILocation
|
|
||||||
| IFishingLocation
|
|
||||||
| ISandyFishingLocation
|
|
||||||
| IShopLocation;
|
|
||||||
|
|
||||||
interface TFisher {
|
interface TFisher {
|
||||||
id: string;
|
id: string;
|
||||||
userID: string;
|
userID: string;
|
||||||
|
|
Loading…
Reference in New Issue