It is currently 19 Apr 2024, 15:32
   
Text Size

[fixed]Medomai the Ageless

Moderators: BAgate, drool66, Aswan jaguar, gmzombie, stassy, CCGHQ Admins

[fixed]Medomai the Ageless

Postby Korath » 11 Dec 2015, 20:25

Medomai the Ageless isn't even sort of correct:
  1. If you cast a Time Walk before combat, it can't attack that turn or in the extra one.
  2. If you don't control it when the extra-turn effect is created - either it hasn't been cast yet, or an opponent has control, or it's been Mirrorweave'd into some other creature, or you blink it with something like Flicker afterwards - it can attack during the extra turn. (Unless summoning sick, of course, so give it haste or get control back before the extra turn begins or whatever.)
  3. If you don't have an upkeep (from Eon Hub or Gibbering Descent) and get an extra turn effect, it can never attack again.

No screenshot because Windows is being uncooperative, sorry, and my savegame wouldn't work for anyone else; but it looks like it's been broken the same way the entire time since its introduction in PtT.
Last edited by drool66 on 04 Jul 2020, 03:44, edited 5 times in total.
Reason: fixed
User avatar
Korath
DEVELOPER
 
Posts: 3707
Joined: 02 Jun 2013, 05:57
Has thanked: 496 times
Been thanked: 1106 times

Re: [confirmed]Medomai the Ageless

Postby Gargaroz » 12 Apr 2016, 13:47

Did the "fx_generic_903" legacy card was translated in C?
What exactly it does when the "STATUS_TIMEWALK" is detected at EOT?
If I understand that, I could add a TRAP which tells us if we're in an extra turn.
----
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
Gargaroz
Programmer
 
Posts: 7097
Joined: 06 Nov 2009, 11:11
Has thanked: 82 times
Been thanked: 595 times

Re: [confirmed]Medomai the Ageless

Postby Korath » 12 Apr 2016, 14:17

The relevant part of fx_generic_903() looks like:
Code: Select all
  if (inst->token_status & STATUS_TIMEWALK)
    {
      if (event == EVENT_CAN_SKIP_TURN && time_walk_flag == -1)
        time_walk_flag = player;

      if (event == EVENT_CLEANUP && !dword_4EF1B8) // This gets checked in the wrong order - EVENT_CLEANUP is set in order by card index, not timestamp, and the timewalk effect with the *newest* timestamp needs to be the one that takes precedence
        {
          dword_4EF1B8 |= 1 << player;
          inst->token_status &= ~STATUS_PERMANENT;
        }
    }
The heavy lifting is done in the main game loop in start_duel():
Code: Select all
  while (!dword_786768 && !is_anyone_dead())
    {
      if (dword_4EF1B8)
        {
          // There's an extra turn
          if (dword_4EF1B8 & 1)  // human gets extra turn
            {
              dword_4EF1B8 = 0;
              if (whose_turn == 1)
                time_walk_flag = -1;
              switch_phase(0);  // "run_turn()" is a better name for this function
              time_walk_flag = -1;
            }
          else  // ai gets extra turn
            {
              dword_4EF1B8 = 0;
              if (whose_turn == 0)
                time_walk_flag = -1;
              switch_phase(1);
              time_walk_flag = -1;
            }
        }
      else
        {
          // non-extra turn
          switch_phase(whose_turn);
          whose_turn = 1 - whose_turn;
        }
    }
See fx_generic_for_exe() in shandalar/effects.cpp and run_game() in shandalar/engine.cpp for how I fixed it there.
User avatar
Korath
DEVELOPER
 
Posts: 3707
Joined: 02 Jun 2013, 05:57
Has thanked: 496 times
Been thanked: 1106 times

Re: [fixed]Medomai the Ageless

Postby drool66 » 04 Jul 2020, 03:44

Fixed all in f9d99b7c2 ("Fix Medomai the Ageless extra turns", 2020-07-03)
User avatar
drool66
Programmer
 
Posts: 1163
Joined: 25 Nov 2010, 22:38
Has thanked: 186 times
Been thanked: 267 times


Return to Archived Reports

Who is online

Users browsing this forum: No registered users and 57 guests

cron

Who is online

In total there are 57 users online :: 0 registered, 0 hidden and 57 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 57 guests

Login Form