forum.webdiplomacy.net

webDip dev coordination forum / public access todo list
It is currently Thu Aug 17, 2017 9:54 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Fri Jun 01, 2012 4:21 pm 
Offline

Joined: Sat May 05, 2012 12:31 pm
Posts: 61
I was wondering if it would be possible to make it always 'Autumn' and after looking through the code the only thing I could find that specified whether it was spring or autumn is this bit of code in the variant.php:
Code:
  }

   public function turnAsDate($turn) {
      if ( $turn==-1 ) return "Pre-game";
      else return ( $turn % 2 ? "Autumn, " : "Autumn, " ).(floor($turn/2) + 2000);
   }

   public function turnAsDateJS() {
      return 'function(turn) {
         if( turn==-1 ) return "Pre-game";
         else return ( turn%2 ? "Autumn, " : "Autumn, " )+(Math.floor(turn/2) + 2000);


I was wondering if I changed it to this whether it would always be autumn:
Code:
  }

   public function turnAsDate($turn) {
      if ( $turn==-1 ) return "Pre-game";
      else return ( $turn % 2 ? "Autumn, " : "Autumn, " ).(($turn) + 2000);
   }

   public function turnAsDateJS() {
      return 'function(turn) {
         if( turn==-1 ) return "Pre-game";
         else return ( turn%2 ? "Autumn, " : "Autumn, " )+((turn) + 2000);
 


Top
 Profile  
 
PostPosted: Fri Jun 01, 2012 6:17 pm 
Offline

Joined: Wed Jul 29, 2009 10:22 am
Posts: 841
This function just calculates a given turn in a printable format.
If you want to proceed 1 year each turn you could write:

Code:
   public function turnAsDate($turn)
   {
      if ( $turn==-1 ) return "Pre-game";
      else return "Autumn, " .$turn + 2000;
   }


But this does not mean that there is a build phase every turn, it just changes the display of the date.
There would still be a build every 2 turns.

This gets checked in gamemaster\game.php (Line 946)
Code:
if( 0 != ($this->turn % 2) and $this->Members->checkForUnitSCDifference() )
{

This means every 2nd turn change to a "Build" phase and there is a unit <=> SC difference.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group