mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-11 18:00:34 +00:00
Add +1 charge for Orb of Love on Valentine's day.
Minor date-based easter egg, small enough to not impact gameplay notably.
This commit is contained in:
parent
4394502e3e
commit
465ec66760
9
orbs.cpp
9
orbs.cpp
@ -5,7 +5,9 @@
|
|||||||
* \brief Implementation of various Orb effects, and their properties such as default and maximum charges
|
* \brief Implementation of various Orb effects, and their properties such as default and maximum charges
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <ctime>
|
||||||
#include "hyper.h"
|
#include "hyper.h"
|
||||||
|
|
||||||
namespace hr {
|
namespace hr {
|
||||||
|
|
||||||
EX bool orbused[ittypes], lastorbused[ittypes];
|
EX bool orbused[ittypes], lastorbused[ittypes];
|
||||||
@ -1602,6 +1604,12 @@ EX eItem targetRangedOrb(cell *c, orbAction a) {
|
|||||||
return itNone;
|
return itNone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isValentines() {
|
||||||
|
const time_t now = time(NULL);
|
||||||
|
const struct tm *datetime = localtime(&now);
|
||||||
|
return datetime->tm_mon == 1 && datetime->tm_mday == 14;
|
||||||
|
}
|
||||||
|
|
||||||
EX int orbcharges(eItem it) {
|
EX int orbcharges(eItem it) {
|
||||||
switch(it) {
|
switch(it) {
|
||||||
case itRevolver: //pickup-key
|
case itRevolver: //pickup-key
|
||||||
@ -1611,6 +1619,7 @@ EX int orbcharges(eItem it) {
|
|||||||
case itOrbDiscord:
|
case itOrbDiscord:
|
||||||
return inv::on ? 46 : 23;
|
return inv::on ? 46 : 23;
|
||||||
case itOrbLove:
|
case itOrbLove:
|
||||||
|
return isValentines() ? 31 : 30;
|
||||||
case itOrbUndeath:
|
case itOrbUndeath:
|
||||||
case itOrbSpeed: //"pickup-speed");
|
case itOrbSpeed: //"pickup-speed");
|
||||||
case itOrbInvis:
|
case itOrbInvis:
|
||||||
|
Loading…
Reference in New Issue
Block a user