The Cathedral of Attnam

Changes

Jump to navigation Jump to search
751 bytes added ,  00:43, 11 September 2014
Created page with "{{code}} IsXmas checks to see whether the current day is either Christmas or Christmas Eve. <pre> truth game::IsXMas() // returns true if date is christmaseve or day { time_..."
{{code}}

IsXmas checks to see whether the current day is either Christmas or Christmas Eve.
<pre>
truth game::IsXMas() // returns true if date is christmaseve or day
{
time_t Time = time(0);
struct tm* TM = localtime(&Time);
return (TM->tm_mon == 11 && (TM->tm_mday == 24 || TM->tm_mday == 25));
}
</pre>

== Use ==
Currently IsXmas is only used to give the player a gift of a [[banana]] when they start the game:
<pre>
if(IsXMas())
{
item* Present = banana::Spawn();
Player->GetStack()->AddItem(Present);
ADD_MESSAGE("Atavus is happy today! He gives you %s.", Present->CHAR_NAME(INDEFINITE));
}
</pre>

IsXmas could be easily used to modify other events in game though, such as spawning christmas lights in Attnam or similar.
Moderator
952

edits

Navigation menu