Skip to content

Commit

Permalink
event cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
KhafraDev committed Dec 26, 2023
1 parent fa13d00 commit 3204237
Showing 1 changed file with 13 additions and 189 deletions.
202 changes: 13 additions & 189 deletions src/Event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ interface HolidayData {
name: string
color: string
url: string
everyYear: boolean
start: string
end: string
/** Time in days */
notice: number
event: boolean
buffs: {
Expand All @@ -33,12 +33,11 @@ interface HolidayData {

// Editing the event is here
// can change the basic game balance by setting default to event: true, but cannot stack events
const events: Record<string, HolidayData> = {
default: {
const events: HolidayData[] = [
{
name: 'fuck is this shit for?',
color: 'white',
url: '',
everyYear: true,
start: '1/1/2001 00:00:00',
end: '12/31/2099 23:59:59',
notice: 0,
Expand All @@ -57,14 +56,13 @@ const events: Record<string, HolidayData> = {
}
},
// Last active event
last: {
{
name: 'Quarksmas 2023',
color: '#a31f34',
url: 'https://www.youtube.com/watch?v=eVH5DABrBQ0',
everyYear: false,
start: '12/25/2023 00:00:00',
end: '01/01/2024 00:00:00',
notice: 20,
notice: 2,
event: true,
buffs: {
quark: 0.69,
Expand All @@ -80,158 +78,12 @@ const events: Record<string, HolidayData> = {
ambrosiaLuck: 0.3,
oneMind: 0.03
}
},
khafra: {
name: 'Thanks for Boosting the Discord',
color: 'var(--green-text-color)', //Plat please use var color instead for any of these (darkorchid, orchid, darkcyan, red, maroon, orangered, crimson, gray, green, lightseagreen)
url: 'https://www.youtube.com/watch?v=iYYRH4apXDo',
everyYear: false,
start: '12/07/2022 00:00:00',
end: '12/08/2022 23:59:59',
notice: 20,
event: true,
buffs: {
quark: .2,
globalSpeed: 0,
ascensionSpeed: 0,
antSacrifice: 0,
offering: 0,
obtainium: 0,
octeract: 0,
powderConversion: 0,
goldenQuark: 0,
oneMind: 0
}
}
/*next: {
name: 'Derpmas 2022: Daily Extravaganza!',
color: 'white',
url: 'https://www.youtube.com/watch?v=A6-vc-R9np8',
everyYear: false,
start: '12/25/2022 00:00:00',
end: '01/01/2023 23:59:59',
notice: 30,
event: true,
buffs: {
quark: 0,
globalSpeed: 0,
ascensionSpeed: 0,
antSacrifice: 0,
offering: 0,
obtainium: 0,
octeract: 0,
powderConversion: 0,
goldenQuark: 0,
oneMind: 0.05
}
}*/
// Event example
/*
newyear: {
name: '&#127881; New Year Event! &#127881;',
color: 'yellow',
url: '',
everyYear: true,
start: '12/31/2001 00:00:00',
end: '01/02/2001 23:59:59',
notice: 3,
event: true,
buffs: {
quark: 1,
ascensionSpeed: 2,
globalSpeed: 2
}
},
spring: {
name: '&#127800; Spring Event! &#127800;',
color: 'pink',
url: '',
everyYear: true,
start: '04/01/2001 00:00:00',
end: '04/02/2001 23:59:59',
notice: 3,
event: true,
buffs: {
quark: 1,
ascensionScore: 0.5,
antSacrifice: 1
}
},
summer: {
name: '&#9728 Summer Event! &#9728',
color: 'lightgoldenrodyellow',
url: '',
everyYear: true,
start: '07/01/2001 00:00:00',
end: '07/02/2001 23:59:59',
notice: 3,
event: true,
buffs: {
quark: 1,
ascensionSpeed: 1,
obtainium: 2
}
},
autumn: {
name: '&#127810; Autumn Event! &#127810;',
color: 'tomato',
url: '',
everyYear: true,
start: '10/01/2001 00:00:00',
end: '10/02/2001 23:59:59',
notice: 3,
event: true,
buffs: {
quark: 1,
cubes: 1,
offering: 2
}
},
winter: {
name: '&#10052 Winter Event! &#10052',
color: 'lightblue',
url: '',
everyYear: true,
start: '02/01/2001 00:00:00',
end: '02/02/2001 23:59:59',
notice: 3,
event: true,
buffs: {
quark: 1,
powderConversion: 2,
globalSpeed: 2
}
},
birthday: {
name: '&#127874; Synergism Birthday! &#127874;',
color: 'white',
url: '',
everyYear: true,
start: '01/05/2001 00:00:00',
end: '01/05/2001 23:59:59',
notice: 3,
event: true,
buffs: {
quark: 1,
goldenQuark: 1,
cubes: 1,
powderConversion: 1,
ascensionSpeed: 1,
globalSpeed: 1,
ascensionScore: 1,
antSacrifice: 1,
offering: 1,
obtainium: 1
}
}
*/
}
]

let nowEvent = events.default
let nowEvent = events[0]

export const getEvent = (): HolidayData => {
return nowEvent
}
export const getEvent = () => nowEvent

export const eventCheck = () => {
if (!player.dayCheck) {
Expand All @@ -244,31 +96,15 @@ export const eventCheck = () => {
// Disable the event if there is any fraud, such as setting a device clock in the past
/* TODO: Figure out why some people get tagged for cheating even when they are playing legitimately
I have temporarily disabled the checks. */
nowEvent = events.default
nowEvent = events[0]

//if (now.getTime() >= player.dayCheck.getTime()) {
// Update currently valid events
for (const e in events) {
const event = events[e]
if (event.name !== 'default' && event.event) {
for (const event of events) {
if (event.event) {
start = new Date(event.start)
end = new Date(event.end)
if (event.everyYear) {
const nowFullYear = now.getFullYear()
start = new Date(event.start)
end = new Date(event.end)
start.setFullYear(nowFullYear)
end.setFullYear(nowFullYear)
if (start.getTime() > end.getTime()) {
end.setFullYear(nowFullYear + 1)
}
if (now.getTime() >= start.getTime() - 31536000000 && now.getTime() <= end.getTime() - 31536000000) {
start.setFullYear(start.getFullYear() - 1)
end.setFullYear(end.getFullYear() - 1)
}
if (now.getTime() >= end.getTime() + 86400000) {
continue
}
} else if (now.getTime() >= end.getTime() + 86400000) {
if (now.getTime() >= end.getTime() + 86400000) {
continue
}
if (now.getTime() >= start.getTime() - event.notice * 86400000 && now.getTime() <= end.getTime()) {
Expand All @@ -286,18 +122,6 @@ export const eventCheck = () => {
if (nowEvent.event) {
start = new Date(nowEvent.start)
end = new Date(nowEvent.end)
if (nowEvent.everyYear) {
const nowFullYear = now.getFullYear()
start.setFullYear(nowFullYear)
end.setFullYear(nowFullYear)
if (start.getTime() > end.getTime()) {
end.setFullYear(nowFullYear + 1)
}
if (now.getTime() >= start.getTime() - 31536000000 && now.getTime() <= end.getTime() - 31536000000) {
start.setFullYear(start.getFullYear() - 1)
end.setFullYear(end.getFullYear() - 1)
}
}
G.isEvent = now.getTime() >= start.getTime() && now.getTime() <= end.getTime()
let buffs = ''
for (let i = 0; i < eventBuffType.length; i++) {
Expand Down

0 comments on commit 3204237

Please sign in to comment.