Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support morphing twin die #41

Open
danlangford opened this issue Jun 3, 2023 · 4 comments
Open

support morphing twin die #41

danlangford opened this issue Jun 3, 2023 · 4 comments
Assignees

Comments

@danlangford
Copy link
Collaborator

A button Gluttony has a morphing twin die

image

however the codebase doesn't allow for it

bmai.cpp:708

  // MORPHING shouldn't be paired with TWIN
  BM_ERROR( (m_properties & (BME_PROPERTY_MORPHING|BME_PROPERTY_TWIN)) != (BME_PROPERTY_MORPHING|BME_PROPERTY_TWIN) );
@danlangford danlangford self-assigned this Jun 3, 2023
@pappde
Copy link
Owner

pappde commented Jul 20, 2023

Don't recall the issue - probably it just wasn't clear what the behavior should be. However, most likely an m(1,5) capturing a 6 would become m(6,6). But what happens if an m(1,5) captures a (2,4)?

Depending on that special case, it seems like this shouldn't be hard to support. In BMC_Die::OnApplyAttackPlayer() there is this code:

	if (HasProperty(BME_PROPERTY_MORPHING))
	{
...
		m_sides_max = m_sides[0] = target->GetDie(_move.m_target)->GetSidesMax();
...
	}

In which case it would look like:

   m_sides_max = 0;
   for (int i=0; i<Dice(); i++)  
      m_sides_max += m_sides[i] = target->GetDie(...)

Also, at least one BM_ASSERT and BM_ERROR to remove.

SECONDARY ISSUE
I see a couple of other Morphing combination restrictions (Turbo, Speed) that may need to be allowed.

@jl8e
Copy link

jl8e commented Jul 21, 2023

IIRC, a morphing twin die doesn't behave any differently from a non-twin morphing die: the morphing die twins and un-twins as needed.

@danlangford
Copy link
Collaborator Author

danlangford commented Jul 21, 2023

@jl8e so m(1,5) capturing a 6 would become m(6). m(1,5) captures a (2,4) and becomes m(2,4)

Is that right ?

@jl8e
Copy link

jl8e commented Jul 24, 2023

yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants