Commit 57449c95 authored by 赤子奈落's avatar 赤子奈落

refresh super button state and fix forced effects response error

parent 9b6126ec
...@@ -352,41 +352,6 @@ public class CardSelectionHandler : MonoBehaviour ...@@ -352,41 +352,6 @@ public class CardSelectionHandler : MonoBehaviour
bool sendable = false; bool sendable = false;
switch (core.currentMessage) switch (core.currentMessage)
{ {
//case GameMessage.SelectSum:
// if (selected == ES_max)
// sendable = true;
// var selectedLevel = 0;
// for (var x = 0; x < core.cardsMustBeSelected.Count; x++)
// selectedLevel += core.cardsMustBeSelected[x].levelForSelect_1;
// for (var x = 0; x < core.cardsSelected.Count; x++)
// selectedLevel += core.cardsSelected[x].levelForSelect_1;
// if (core.ES_overFlow)
// {
// if (selectedLevel >= core.ES_level)
// sendable = true;
// }
// else
// {
// if (selectedLevel == core.ES_level) sendable = true;
// }
// selectedLevel = 0;
// for (var x = 0; x < core.cardsMustBeSelected.Count; x++)
// selectedLevel += core.cardsMustBeSelected[x].levelForSelect_2;
// for (var x = 0; x < core.cardsSelected.Count; x++) selectedLevel += core.cardsSelected[x].levelForSelect_2;
// if (core.ES_overFlow)
// {
// if (selectedLevel >= core.ES_level)
// sendable = true;
// }
// else
// {
// if (selectedLevel == core.ES_level)
// sendable = true;
// }
// if (core.cardsSelectable.Count == 0)
// sendable = true;
// break;
case GameMessage.SelectCard: case GameMessage.SelectCard:
if (selected >= ES_min) if (selected >= ES_min)
sendable = true; sendable = true;
...@@ -411,6 +376,12 @@ public class CardSelectionHandler : MonoBehaviour ...@@ -411,6 +376,12 @@ public class CardSelectionHandler : MonoBehaviour
else else
sendable = false; sendable = false;
break; break;
case GameMessage.SelectChain:
if (selected >= 1)
sendable = true;
else
sendable = false;
break;
} }
if (exitable) if (exitable)
...@@ -430,11 +401,6 @@ public class CardSelectionHandler : MonoBehaviour ...@@ -430,11 +401,6 @@ public class CardSelectionHandler : MonoBehaviour
button_confirm_label.color = new Color(0.2f, 0.25f, 0f, 1f); button_confirm_label.color = new Color(0.2f, 0.25f, 0f, 1f);
} }
//Debug.LogFormat("{3}, selected: {0}, ES_min: {1}, ES_max: {2}", selected, ES_min, ES_max, core.currentMessage);
if (core.currentMessage != GameMessage.SortCard) if (core.currentMessage != GameMessage.SortCard)
{ {
if (selected >= ES_max) if (selected >= ES_max)
......
...@@ -190,10 +190,10 @@ public class Shortcuts : MonoBehaviour ...@@ -190,10 +190,10 @@ public class Shortcuts : MonoBehaviour
} }
Time.timeScale = timescale; Time.timeScale = timescale;
//if (message != Program.I().ocgcore.currentMessage) if (message != Program.I().ocgcore.currentMessage)
//{ {
// message = Program.I().ocgcore.currentMessage; message = Program.I().ocgcore.currentMessage;
// Debug.Log(message); Debug.Log(message);
//} }
} }
} }
This diff is collapsed.
...@@ -714,7 +714,7 @@ public class gameCard : OCGobject ...@@ -714,7 +714,7 @@ public class gameCard : OCGobject
Program.I().new_ui_cardList.hide(); Program.I().new_ui_cardList.hide();
} }
private void ES_exit_clicked() public void ES_exit_clicked()
{ {
clicked = false; clicked = false;
if (highlightOn) if (highlightOn)
...@@ -777,53 +777,6 @@ public class gameCard : OCGobject ...@@ -777,53 +777,6 @@ public class gameCard : OCGobject
else else
buttons[i].show(vector_of_begin + new Vector3(SortLine(i, buttons.Count, 180 * Screen.height / 1080f), 150f * Screen.height / 1080f, 0f)); buttons[i].show(vector_of_begin + new Vector3(SortLine(i, buttons.Count, 180 * Screen.height / 1080f), 150f * Screen.height / 1080f, 0f));
} }
//if (opMonsterWithBackGroundCard)
//{
// var vector_of_begin = Vector3.zero;
// if ((p.position & (uint)CardPosition.Attack) > 0)
// vector_of_begin = gameObject_face.transform.position + new Vector3(0, 0, -2f);
// else
// vector_of_begin = gameObject_face.transform.position + new Vector3(0, 0, -1.5f);
// vector_of_begin = Program.I().main_camera.WorldToScreenPoint(vector_of_begin);
// for (var i = 0; i < buttons.Count; i++)
// buttons[i].show(vector_of_begin - i * new Vector3(0, 65f * 0.7f * Screen.height / 1080f) - new Vector3(0, 20f * 0.7f * Screen.height / 1080f));
// return;
//}
//if (condition == gameCardCondition.floating_clickable)
//{
// var vector_of_begin = gameObject_face.transform.position + new Vector3(0, 1, 1.732f);
// vector_of_begin = Program.I().main_camera.WorldToScreenPoint(vector_of_begin);
// for (var i = 0; i < buttons.Count; i++)
// buttons[i].show(vector_of_begin + i * new Vector3(0, 65f * 0.7f * Screen.height / 1080f) + new Vector3(0, 35f * 0.7f * Screen.height / 1080f));
// return;
//}
//if (condition == gameCardCondition.verticle_clickable)
//{
// if (VerticleCollider == null)
// {
// Vector3 vector_of_begin;
// if ((p.position & (uint)CardPosition.Attack) > 0)
// vector_of_begin = gameObject_face.transform.position + new Vector3(0, 0, 2);
// else
// vector_of_begin = gameObject_face.transform.position + new Vector3(0, 0, 1.5f);
// vector_of_begin = Program.I().main_camera.WorldToScreenPoint(vector_of_begin);
// for (var i = 0; i < buttons.Count; i++)
// buttons[i].show(vector_of_begin + i * new Vector3(0, 65f * 0.7f * Screen.height / 1080f) + new Vector3(0, 35f * 0.7f * Screen.height / 1080f));
// }
// else
// {
// var h = loaded_verticalDrawingK * 0.618f;
// var vector_of_begin = Vector3.zero;
// var l = 0.5f * game_object_verticle_drawing.transform.localScale.y * (h - 0.5f);
// vector_of_begin = game_object_verticle_drawing.transform.position + new Vector3(0, l, l * 1.732f);
// vector_of_begin = Program.I().main_camera.WorldToScreenPoint(vector_of_begin);
// for (var i = 0; i < buttons.Count; i++)
// buttons[i].show(vector_of_begin + i * new Vector3(0, 65f * 0.7f * Screen.height / 1080f) + new Vector3(0, 35f * 0.7f * Screen.height / 1080f));
// }
//}
} }
private void ES_excited_handler_event_cookie_card_bed() private void ES_excited_handler_event_cookie_card_bed()
......
...@@ -2820,6 +2820,7 @@ public class Ocgcore : ServantWithCardDescription ...@@ -2820,6 +2820,7 @@ public class Ocgcore : ServantWithCardDescription
{ {
card.set_code(code); card.set_code(code);
card.prefered = true; card.prefered = true;
card.ES_exit_clicked();
var eff = new Effect(); var eff = new Effect();
eff.ptr = (i << 16) + 0; eff.ptr = (i << 16) + 0;
eff.desc = desc; eff.desc = desc;
...@@ -2904,6 +2905,7 @@ public class Ocgcore : ServantWithCardDescription ...@@ -2904,6 +2905,7 @@ public class Ocgcore : ServantWithCardDescription
if (card != null) if (card != null)
{ {
card.set_code(code); card.set_code(code);
card.ES_exit_clicked();
btn = new gameButton((i << 16) + 0, InterString.Get("通常召唤@ui"), superButtonType.summon); btn = new gameButton((i << 16) + 0, InterString.Get("通常召唤@ui"), superButtonType.summon);
card.add_one_button(btn); card.add_one_button(btn);
card.Highlight(true, false, false); card.Highlight(true, false, false);
...@@ -3497,17 +3499,19 @@ public class Ocgcore : ServantWithCardDescription ...@@ -3497,17 +3499,19 @@ public class Ocgcore : ServantWithCardDescription
if (handle_flag == 3) if (handle_flag == 3)
{ {
//处理强制发动的卡 //处理强制发动的卡
cardsWaitToSend.Clear();
for (var i = 0; i < chainCards.Count; i++) for (var i = 0; i < chainCards.Count; i++)
{ {
if ((chainCards[i].p.location & (uint)CardLocation.Onfield) > 0) if ((chainCards[i].p.location & (uint)CardLocation.Onfield) > 0)
chainCards[i].add_one_decoration(Program.I().mod_ocgcore_decoration_chain_selecting, 4, Vector3.zero, "chain_selecting"); chainCards[i].add_one_decoration(Program.I().mod_ocgcore_decoration_chain_selecting, 4, Vector3.zero, "chain_selecting");
chainCards[i].forSelect = true; chainCards[i].forSelect = true;
chainCards[i].currentFlash = gameCard.flashType.Active; chainCards[i].currentFlash = gameCard.flashType.Active;
cardsWaitToSend.Add(chainCards[i]);
} }
//RMSshow_yesOrNo("autoForceChainHandler", InterString.Get("[?],@n自动处理强制发动的卡?", ES_hint),
// new messageSystemValue {value = "yes", hint = "yes"}, RMSshow_yesOrNo("autoForceChainHandler", InterString.Get("[?],@n自动处理强制发动的卡?", ES_hint),
// new messageSystemValue {value = "no", hint = "no"}); new messageSystemValue {value = "yes", hint = "yes"},
Program.I().cardSelection.show(chainCards, true, 1, 1, InterString.Get("[?],@n请选择需要发动的强制效果。", ES_hint)); new messageSystemValue {value = "no", hint = "no"});
if (condition == Condition.record) Sleep(60); if (condition == Condition.record) Sleep(60);
} }
...@@ -8384,6 +8388,8 @@ public class Ocgcore : ServantWithCardDescription ...@@ -8384,6 +8388,8 @@ public class Ocgcore : ServantWithCardDescription
} }
} }
public List<gameCard> cardsWaitToSend = new List<gameCard>();
public override void ES_RMS(string hashCode, List<messageSystemValue> result) public override void ES_RMS(string hashCode, List<messageSystemValue> result)
{ {
base.ES_RMS(hashCode, result); base.ES_RMS(hashCode, result);
...@@ -8422,7 +8428,11 @@ public class Ocgcore : ServantWithCardDescription ...@@ -8422,7 +8428,11 @@ public class Ocgcore : ServantWithCardDescription
} }
} }
if (result[0].value == "no") autoForceChainHandler = autoForceChainHandlerType.afterClickManDo; if (result[0].value == "no")
{
autoForceChainHandler = autoForceChainHandlerType.afterClickManDo;
Program.I().cardSelection.show(cardsWaitToSend, false, 1, 1, InterString.Get("[?],@n请选择需要发动或处理的强制效果,或者选择快速效果发动。", ES_hint));
}
} }
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment