mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-24 17:10:36 +00:00
Merge pull request #301 from ammongit/valentines
Valentine's Easter Egg: Add +1 extra charge to Orb of Love
This commit is contained in:
commit
78049518a5
12
orbs.cpp
12
orbs.cpp
@ -5,7 +5,9 @@
|
||||
* \brief Implementation of various Orb effects, and their properties such as default and maximum charges
|
||||
*/
|
||||
|
||||
#include <ctime>
|
||||
#include "hyper.h"
|
||||
|
||||
namespace hr {
|
||||
|
||||
EX array<bool, ittypes> orbused;
|
||||
@ -1604,6 +1606,15 @@ EX eItem targetRangedOrb(cell *c, orbAction a) {
|
||||
return itNone;
|
||||
}
|
||||
|
||||
bool isValentines() {
|
||||
const time_t now = time(NULL);
|
||||
const struct tm *datetime = localtime(&now);
|
||||
|
||||
// 0-indexed tm_mon, 1-indexed tm_mday
|
||||
// So this is February (2nd month), and the 14th day.
|
||||
return datetime->tm_mon == 1 && datetime->tm_mday == 14;
|
||||
}
|
||||
|
||||
EX int orbcharges(eItem it) {
|
||||
switch(it) {
|
||||
case itRevolver: //pickup-key
|
||||
@ -1613,6 +1624,7 @@ EX int orbcharges(eItem it) {
|
||||
case itOrbDiscord:
|
||||
return inv::on ? 46 : 23;
|
||||
case itOrbLove:
|
||||
return isValentines() ? 31 : 30;
|
||||
case itOrbUndeath:
|
||||
case itOrbSpeed: //"pickup-speed");
|
||||
case itOrbInvis:
|
||||
|
Loading…
Reference in New Issue
Block a user