-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fomorian/Razorback construction and Events #125
Changes from 1 commit
3d78ff7
d5499f2
b61d0cd
7b7cda0
dd10bd2
cb6b80c
658e157
fde711a
d8e0f4b
bb1b8d1
bc88b3d
9b7653e
a47c012
6a86c7c
9e34fbe
55ac182
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
'use strict'; | ||
|
||
const BaseEmbed = require('./BaseEmbed.js'); | ||
|
||
/** | ||
* Generates daily deal embeds | ||
*/ | ||
class ConstructionEmbed extends BaseEmbed { | ||
/** | ||
* @param {Genesis} bot - An instance of Genesis | ||
* @param {Construction} constructionProgress - The current construction information | ||
* @param {string} platform - The platform the event is for | ||
*/ | ||
constructor(bot, constructionProgress, platform) { | ||
super(); | ||
|
||
this.color = 0xff6961; | ||
this.fields = [{ | ||
name: `[${platform}] Construction Status:`, | ||
value: '```' + | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expected indentation of 6 spaces but found 8. (indent) |
||
`Razorback: ${construction.razorbackProgress}` + | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'construction' is not defined. (no-undef) |
||
`Fomorian: ${construction.fomorianProgress}` + | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'construction' is not defined. (no-undef) |
||
`Unknown: ${construction.unknwonProgress}` + | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'construction' is not defined. (no-undef) |
||
'```' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing trailing comma. (comma-dangle) |
||
}]; | ||
} | ||
} | ||
|
||
module.exports = ConstructionEmbed; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,34 @@ | ||
'use strict'; | ||
|
||
const BaseEmbed = require('./BaseEmbed.js'); | ||
|
||
/** | ||
* Generates fissure embeds | ||
*/ | ||
class EventEmbed extends BaseEmbed { | ||
/** | ||
* @param {Genesis} bot - An instance of Genesis | ||
* @param {Array.<Event>} events - The fissures to be included in the embed | ||
*/ | ||
constructor(bot, events) { | ||
super(); | ||
|
||
if (events.length < 2) { | ||
this.title = 'Worldstate - Events'; | ||
this.description = 'Events'; | ||
} | ||
|
||
if (events.length > 1) { | ||
this.fields = events.map(e => ({ | ||
name: `${e.description}`, | ||
value: `Takes place on: ${e.concurrentNodes.join(', ')}\nRewards: ${e.rewards.join(', ')}`, | ||
})); | ||
} else if (events.length === 0) { | ||
this.fields = { | ||
name: 'Currently no events', | ||
value: '_ _', | ||
}; | ||
} else { | ||
const e = events[0]; | ||
this.title = 'Event! '; | ||
this.description = `${e.description} against ${e.faction}`; | ||
this.fields = [ | ||
{ | ||
name: 'Rewards', | ||
value: e.rewards.join('\n'), | ||
inline: true, | ||
}, | ||
{ | ||
name: 'Nodes', | ||
value: `${e.concurrentNodes.join('\n')}\n${e.node ? e.node : ''}\n${e.victimNode ? e.victimNode : ''}`, | ||
inline: true, | ||
}, | ||
]; | ||
this.footer.text = e.toolTip ? e.toolTip : this.footer.text; | ||
} | ||
|
||
this.color = events.length > 2 ? 0x00ff00 : 0xff0000; | ||
this.thumbnail = { | ||
url: 'https://i.imgur.com/EfIRu6v.png', | ||
}; | ||
} | ||
} | ||
|
||
module.exports = EventEmbed; | ||
'use strict'; | ||
|
||
const BaseEmbed = require('./BaseEmbed.js'); | ||
|
||
/** | ||
* Generates daily deal embeds | ||
*/ | ||
class EventEmbed extends BaseEmbed { | ||
/** | ||
* @param {Genesis} bot - An instance of Genesis | ||
* @param {Event} event - The deal to be included in the embed | ||
* @param {string} platform - The platform the event is for | ||
*/ | ||
constructor(bot, event, platform) { | ||
super(); | ||
|
||
this.color = 0xfdec96; | ||
|
||
if (event) { | ||
this.title = `[${platform}] ${event.description}`; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expected indentation of 6 spaces but found 8. (indent) |
||
this.fields = []; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expected indentation of 6 spaces but found 8. (indent) |
||
|
||
if (event.victimNode) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expected indentation of 6 spaces but found 8. (indent) |
||
this.fields.push({name: '_ _', value: `Defend ${event.victimNode} by attacking the ${event.faction} at ${event.node}.` }); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expected indentation of 10 spaces but found 12. (indent) |
||
} | ||
this.fields.push({ name: 'Rewards', value: event.rewards.map(reward => reward.asString).join('; ') }); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expected indentation of 6 spaces but found 8. (indent) |
||
this.fields.push({ name: 'Completion Score', value: String(event.maximumScore) }); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expected indentation of 6 spaces but found 8. (indent) |
||
} else { | ||
this.title = 'No Current Events'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expected indentation of 6 spaces but found 8. (indent) |
||
} | ||
} | ||
} | ||
|
||
module.exports = EventEmbed; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 6 spaces but found 8. (indent)