From 465ec667607854b3bda2b1edced3fd413d419f93 Mon Sep 17 00:00:00 2001 From: Ammon Smith Date: Mon, 14 Feb 2022 18:06:19 -0500 Subject: [PATCH 1/3] Add +1 charge for Orb of Love on Valentine's day. Minor date-based easter egg, small enough to not impact gameplay notably. --- orbs.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/orbs.cpp b/orbs.cpp index df0a4714..091756fc 100644 --- a/orbs.cpp +++ b/orbs.cpp @@ -5,7 +5,9 @@ * \brief Implementation of various Orb effects, and their properties such as default and maximum charges */ +#include #include "hyper.h" + namespace hr { EX bool orbused[ittypes], lastorbused[ittypes]; @@ -1602,6 +1604,12 @@ EX eItem targetRangedOrb(cell *c, orbAction a) { 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) { switch(it) { case itRevolver: //pickup-key @@ -1611,6 +1619,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: From 83372e7dea6afa41499c314088502c97b1e8bfc0 Mon Sep 17 00:00:00 2001 From: Ammon Smith Date: Mon, 14 Feb 2022 18:11:49 -0500 Subject: [PATCH 2/3] Add explanatory comment. The 0-indexed month value may be confusing. --- orbs.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/orbs.cpp b/orbs.cpp index 091756fc..32ab6fac 100644 --- a/orbs.cpp +++ b/orbs.cpp @@ -1607,6 +1607,9 @@ EX eItem targetRangedOrb(cell *c, orbAction a) { bool isValentines() { const time_t now = time(NULL); const struct tm *datetime = localtime(&now); + + // 0-indexed tm_mon, 1-index tm_mday + // So this is February (2nd month), and the 14th day. return datetime->tm_mon == 1 && datetime->tm_mday == 14; } From 7bd50b5068c858c8f39910b8a4fa07fae8d84b20 Mon Sep 17 00:00:00 2001 From: Ammon Smith Date: Tue, 15 Feb 2022 18:22:56 -0500 Subject: [PATCH 3/3] Add missing "ed". --- orbs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orbs.cpp b/orbs.cpp index 32ab6fac..749a8f53 100644 --- a/orbs.cpp +++ b/orbs.cpp @@ -1608,7 +1608,7 @@ bool isValentines() { const time_t now = time(NULL); const struct tm *datetime = localtime(&now); - // 0-indexed tm_mon, 1-index tm_mday + // 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; }