| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using System;
- using System.Linq;
- public class Permanent
- {
- public Permanent(List<CardSource> cardSources)
- {
- SetCardSources(cardSources);
- }
- public void SetCardSources(List<CardSource> cardSources)
- {
- List<CardSource> newCardSources = cardSources.Clone();
- newCardSources.Reverse();
- foreach (CardSource cardSource in newCardSources)
- {
- AddCardSource(cardSource);
- }
- }
- public FieldCardFrame PermanentFrame
- {
- get
- {
- if (TopCard != null)
- {
- int index = Array.IndexOf(TopCard.Owner.FieldPermanents, this);
- if (0 <= index && index <= TopCard.Owner.fieldCardFrames.Count - 1)
- {
- return TopCard.Owner.fieldCardFrames[index];
- }
- }
- return null;
- }
- }
- public bool oldIsTapped_playCard { get; set; }
- #region Level
- public int Level
- {
- get
- {
- int Level = 0;
- if (TopCard != null)
- {
- Level = TopCard.Level;
- if (!TopCard.HasLevel)
- {
- Level = 1145140;
- }
- #region レベルを変更する効果
- foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players_ForTurnPlayer)
- {
- foreach (Permanent permanent in player.GetFieldPermanents())
- {
- #region 場のパーマネントの効果
- foreach (ICardEffect cardEffect in permanent.EffectList(EffectTiming.None))
- {
- if (cardEffect is IChangePermanentLevelEffect)
- {
- if (cardEffect.CanUse(null))
- {
- Level = ((IChangePermanentLevelEffect)cardEffect).GetPermanentLevel(Level, this);
- }
- }
- }
- #endregion
- }
- #region プレイヤーの効果
- foreach (ICardEffect cardEffect in player.EffectList(EffectTiming.None))
- {
- if (cardEffect is IChangePermanentLevelEffect)
- {
- if (cardEffect.CanUse(null))
- {
- Level = ((IChangePermanentLevelEffect)cardEffect).GetPermanentLevel(Level, this);
- }
- }
- }
- #endregion
- }
- #endregion
- }
- return Level;
- }
- }
- #endregion
- #region Place all evolution sources in the trash
- public IEnumerator DiscardEvoRoots(bool ignoreOverflow = false, bool putToTrash = true)
- {
- List<CardSource> evoRoots = DigivolutionCards.Clone();
- if (!ignoreOverflow)
- {
- yield return ContinuousController.instance.StartCoroutine(new AceOverflowClass(evoRoots).Overflow());
- }
- foreach (CardSource cardSource1 in evoRoots)
- {
- if (putToTrash)
- {
- yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddTrashCard(cardSource1));
- }
- else
- {
- yield return ContinuousController.instance.StartCoroutine(CardObjectController.RemoveFromAllArea(cardSource1));
- }
- }
- }
- #endregion
- #region Whether this permanent has DP
- public bool HasDP
- {
- get
- {
- if (TopCard == null)
- {
- return false;
- }
- if (!IsDigimon)
- {
- return false;
- }
- if (!TopCard.HasDP && TopCard.IsDigiEgg)
- {
- return false;
- }
- #region Effect of not having DP
- foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players)
- {
- foreach (Permanent permanent in player.GetFieldPermanents())
- {
- foreach (ICardEffect cardEffect1 in permanent.EffectList(EffectTiming.None))
- {
- if (cardEffect1 is IDontHaveDPEffect)
- {
- if (cardEffect1.CanUse(null))
- {
- if (((IDontHaveDPEffect)cardEffect1).DontHaveDP(this))
- {
- return false;
- }
- }
- }
- }
- }
- }
- #endregion
- return true;
- }
- }
- #endregion
- #region Base DP
- public int BaseDP
- {
- get
- {
- int BaseDP = 0;
- if (HasDP)
- {
- BaseDP = TopCard.BaseCardDP;
- #region 基礎DPを変更する効果
- List<ICardEffect> cardEffects_ChangeDP = new List<ICardEffect>();
- foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players_ForTurnPlayer)
- {
- foreach (Permanent permanent in player.GetFieldPermanents())
- {
- #region 場のパーマネントの効果
- foreach (ICardEffect cardEffect in permanent.EffectList(EffectTiming.None))
- {
- if (cardEffect is IChangeBaseDPEffect)
- {
- if (cardEffect.CanUse(null))
- {
- if (((IChangeBaseDPEffect)cardEffect).PermanentCondition(this))
- {
- if (((IChangeBaseDPEffect)cardEffect).IsMinusDP())
- {
- if (this.ImmuneFromDPMinus(cardEffect))
- {
- continue;
- }
- }
- if (!TopCard.CanNotBeAffected(cardEffect))
- {
- cardEffects_ChangeDP.Add(cardEffect);
- }
- }
- }
- }
- }
- #endregion
- }
- #region プレイヤーの効果
- foreach (ICardEffect cardEffect in player.EffectList(EffectTiming.None))
- {
- if (cardEffect is IChangeBaseDPEffect)
- {
- if (cardEffect.CanUse(null))
- {
- if (((IChangeBaseDPEffect)cardEffect).PermanentCondition(this))
- {
- if (((IChangeBaseDPEffect)cardEffect).IsMinusDP())
- {
- if (this.ImmuneFromDPMinus(cardEffect))
- {
- continue;
- }
- }
- if (!TopCard.CanNotBeAffected(cardEffect))
- {
- cardEffects_ChangeDP.Add(cardEffect);
- }
- }
- }
- }
- }
- #endregion
- }
- List<ICardEffect> cardEffects_ChangeDP_isUpDown = new List<ICardEffect>();
- List<ICardEffect> cardEffects_ChangeDP_NotIsUpDown = new List<ICardEffect>();
- foreach (ICardEffect cardEffect in cardEffects_ChangeDP)
- {
- if (cardEffect is IChangeBaseDPEffect)
- {
- if (cardEffect.CanUse(null))
- {
- if (((IChangeBaseDPEffect)cardEffect).IsUpDown())
- {
- cardEffects_ChangeDP_isUpDown.Add(cardEffect);
- }
- else
- {
- cardEffects_ChangeDP_NotIsUpDown.Add(cardEffect);
- }
- }
- }
- }
- foreach (ICardEffect cardEffect in cardEffects_ChangeDP_isUpDown)
- {
- if (cardEffect is IChangeBaseDPEffect)
- {
- if (cardEffect.CanUse(null))
- {
- BaseDP = ((IChangeBaseDPEffect)cardEffect).GetDP(BaseDP, this);
- }
- }
- }
- foreach (ICardEffect cardEffect in cardEffects_ChangeDP_NotIsUpDown)
- {
- if (cardEffect is IChangeBaseDPEffect)
- {
- if (cardEffect.CanUse(null))
- {
- BaseDP = ((IChangeBaseDPEffect)cardEffect).GetDP(BaseDP, this);
- }
- }
- }
- #endregion
- if (BaseDP < 0)
- {
- BaseDP = 0;
- }
- }
- return BaseDP;
- }
- }
- #endregion
- #region DP
- public int DP
- {
- get
- {
- int DP = -1;
- if (HasDP)
- {
- DP = BaseDP;
- #region DPを変更する効果
- List<ICardEffect> cardEffects_ChangeDP = new List<ICardEffect>();
- foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players_ForTurnPlayer)
- {
- foreach (Permanent permanent in player.GetFieldPermanents())
- {
- #region 場のパーマネントの効果
- foreach (ICardEffect cardEffect in permanent.EffectList(EffectTiming.None))
- {
- if (cardEffect is IChangeDPEffect)
- {
- if (cardEffect.CanUse(null))
- {
- if (((IChangeDPEffect)cardEffect).PermanentCondition(this))
- {
- if (((IChangeDPEffect)cardEffect).IsMinusDP())
- {
- if (this.ImmuneFromDPMinus(cardEffect))
- {
- continue;
- }
- }
- if (!TopCard.CanNotBeAffected(cardEffect))
- {
- cardEffects_ChangeDP.Add(cardEffect);
- }
- }
- }
- }
- }
- #endregion
- }
- #region プレイヤーの効果
- foreach (ICardEffect cardEffect in player.EffectList(EffectTiming.None))
- {
- if (cardEffect is IChangeDPEffect)
- {
- if (cardEffect.CanUse(null))
- {
- if (((IChangeDPEffect)cardEffect).PermanentCondition(this))
- {
- if (((IChangeDPEffect)cardEffect).IsMinusDP())
- {
- if (this.ImmuneFromDPMinus(cardEffect))
- {
- continue;
- }
- }
- if (!TopCard.CanNotBeAffected(cardEffect))
- {
- cardEffects_ChangeDP.Add(cardEffect);
- }
- }
- }
- }
- }
- #endregion
- }
- List<ICardEffect> cardEffects_ChangeDP_isUpDown = new List<ICardEffect>();
- List<ICardEffect> cardEffects_ChangeDP_NotIsUpDown = new List<ICardEffect>();
- foreach (ICardEffect cardEffect in cardEffects_ChangeDP)
- {
- if (cardEffect is IChangeDPEffect)
- {
- if (cardEffect.CanUse(null))
- {
- if (((IChangeDPEffect)cardEffect).IsUpDown())
- {
- cardEffects_ChangeDP_isUpDown.Add(cardEffect);
- }
- else
- {
- cardEffects_ChangeDP_NotIsUpDown.Add(cardEffect);
- }
- }
- }
- }
- foreach (ICardEffect cardEffect in cardEffects_ChangeDP_isUpDown)
- {
- if (cardEffect is IChangeDPEffect)
- {
- if (cardEffect.CanUse(null))
- {
- DP = ((IChangeDPEffect)cardEffect).GetDP(DP, this);
- }
- }
- }
- foreach (ICardEffect cardEffect in cardEffects_ChangeDP_NotIsUpDown)
- {
- if (cardEffect is IChangeDPEffect)
- {
- if (cardEffect.CanUse(null))
- {
- DP = ((IChangeDPEffect)cardEffect).GetDP(DP, this);
- }
- }
- }
- #endregion
- if (DP < 0)
- {
- DP = 0;
- }
- }
- return DP;
- }
- }
- #endregion
- #region Will it not receive negative DP effect?
- public bool ImmuneFromDPMinus(ICardEffect cardEffect)
- {
- foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players)
- {
- foreach (Permanent permanent in player.GetFieldPermanents())
- {
- foreach (ICardEffect cardEffect1 in permanent.EffectList(EffectTiming.None))
- {
- if (cardEffect1 is IImmuneFromDPMinusEffect)
- {
- if (cardEffect1.CanUse(null))
- {
- if (((IImmuneFromDPMinusEffect)cardEffect1).ImmuneFromDPMinus(this, cardEffect))
- {
- return true;
- }
- }
- }
- }
- }
- foreach (ICardEffect cardEffect1 in player.EffectList(EffectTiming.None))
- {
- if (cardEffect1 is IImmuneFromDPMinusEffect)
- {
- if (cardEffect1.CanUse(null))
- {
- if (((IImmuneFromDPMinusEffect)cardEffect1).ImmuneFromDPMinus(this, cardEffect))
- {
- return true;
- }
- }
- }
- }
- }
- return false;
- }
- #endregion
- #region Can be returned to your hand?
- public bool CannotReturnToHand(ICardEffect cardEffect)
- {
- foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players)
- {
- foreach (Permanent permanent in player.GetFieldPermanents())
- {
- foreach (ICardEffect cardEffect1 in permanent.EffectList(EffectTiming.None))
- {
- if (cardEffect1 is ICannotReturnToHandEffect)
- {
- if (cardEffect1.CanUse(null))
- {
- if (((ICannotReturnToHandEffect)cardEffect1).CannotReturnToHand(this, cardEffect))
- {
- return true;
- }
- }
- }
- }
- foreach (ICardEffect cardEffect1 in player.EffectList(EffectTiming.None))
- {
- if (cardEffect1 is ICannotReturnToHandEffect)
- {
- if (cardEffect1.CanUse(null))
- {
- if (((ICannotReturnToHandEffect)cardEffect1).CannotReturnToHand(this, cardEffect))
- {
- return true;
- }
- }
- }
- }
- }
- }
- return false;
- }
- #endregion
- #region Can be returned to deck?
- public bool CannotReturnToLibrary(ICardEffect cardEffect)
- {
- foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players)
- {
- foreach (Permanent permanent in player.GetFieldPermanents())
- {
- foreach (ICardEffect cardEffect1 in permanent.EffectList(EffectTiming.None))
- {
- if (cardEffect1 is ICannotReturnToLibraryEffect)
- {
- if (cardEffect1.CanUse(null))
- {
- if (((ICannotReturnToLibraryEffect)cardEffect1).CannotReturnToLibrary(this, cardEffect))
- {
- return true;
- }
- }
- }
- }
- foreach (ICardEffect cardEffect1 in player.EffectList(EffectTiming.None))
- {
- if (cardEffect1 is ICannotReturnToLibraryEffect)
- {
- if (cardEffect1.CanUse(null))
- {
- if (((ICannotReturnToLibraryEffect)cardEffect1).CannotReturnToLibrary(this, cardEffect))
- {
- return true;
- }
- }
- }
- }
- }
- }
- return false;
- }
- #endregion
- #region 退化を受けないか
- public bool ImmuneFromDeDigivolve()
- {
- foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players)
- {
- foreach (Permanent permanent in player.GetFieldPermanents())
- {
- foreach (ICardEffect cardEffect1 in permanent.EffectList(EffectTiming.None))
- {
- if (cardEffect1 is IImmuneFromDeDigivolveEffect)
- {
- if (cardEffect1.CanUse(null))
- {
- if (((IImmuneFromDeDigivolveEffect)cardEffect1).ImmuneDeDigivolve(this))
- {
- return true;
- }
- }
- }
- }
- }
- }
- return false;
- }
- #endregion
- #region このパーマネントの持つカードリスト
- public List<CardSource> cardSources = new List<CardSource>();
- #endregion
- #region 一番上以外のカード
- public List<CardSource> DigivolutionCards => cardSources.Filter(cardSource => cardSource != TopCard);
- #endregion
- #region パーマネントのカードリストにカードを追加
- public void AddCardSource(CardSource cardSource)
- {
- cardSources.Insert(0, cardSource);
- cardSource.SetFace();
- }
- #endregion
- #region 進化元の一番上に置く
- public IEnumerator AddDigivolutionCardsTop(List<CardSource> addedDigivolutionCards, ICardEffect cardEffect)
- {
- List<CardSource> addedCards = new List<CardSource>();
- bool isFromSameDigimon = false;
- bool isFromDigimon = false;
- foreach (CardSource addedDigivolutionCard in addedDigivolutionCards)
- {
- if (cardSources.Contains(addedDigivolutionCard))
- {
- isFromSameDigimon = true;
- }
- if (CardEffectCommons.IsExistOnBattleArea(addedDigivolutionCard))
- {
- if (addedDigivolutionCard.PermanentOfThisCard().DigivolutionCards.Count >= 1)
- {
- isFromDigimon = true;
- }
- }
- yield return ContinuousController.instance.StartCoroutine(CardObjectController.RemoveFromAllArea(addedDigivolutionCard));
- if (!this.IsToken && !addedDigivolutionCard.IsToken)
- {
- this.cardSources.Insert(1, addedDigivolutionCard);
- addedDigivolutionCard.SetFace();
- addedCards.Add(addedDigivolutionCard);
- }
- }
- if (addedCards.Count >= 1)
- {
- if (ShowingPermanentCard != null)
- {
- yield return ContinuousController.instance.StartCoroutine(ShowingPermanentCard.ShowAddDigivolutionCardEffect());
- }
- #region "進化元が増えた時"の効果
- #region Hashtable Setting
- Hashtable hashtable = new Hashtable()
- {
- {"Permanent", this},
- {"CardEffect", cardEffect},
- {"CardSources", addedCards},
- {"isFromSameDigimon", isFromSameDigimon},
- {"isFromDigimon", isFromDigimon},
- };
- #endregion
- yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing.StackSkillInfos(hashtable, EffectTiming.OnAddDigivolutionCards));
- #endregion
- }
- }
- #endregion
- #region 進化元の一番下に置く
- public IEnumerator AddDigivolutionCardsBottom(List<CardSource> addedDigivolutionCards, ICardEffect cardEffect, bool skipEffectAndActivateSkill = false)
- {
- List<CardSource> addedCards = new List<CardSource>();
- bool isFromSameDigimon = false;
- bool isFromDigimon = false;
- foreach (CardSource addedDigivolutionCard in addedDigivolutionCards)
- {
- if (addedDigivolutionCard.PermanentOfThisCard() != null)
- {
- if (addedDigivolutionCard.PermanentOfThisCard() != this)
- {
- if (addedDigivolutionCard.PermanentOfThisCard().TopCard == addedDigivolutionCard)
- {
- IPlacePermanentToDigivolutionCards placePermanent = new IPlacePermanentToDigivolutionCards(new List<Permanent[]>() { new Permanent[] { addedDigivolutionCard.PermanentOfThisCard(), this } }, false, cardEffect, skipEffectAndActivateSkill = true);
- yield return ContinuousController.instance.StartCoroutine(placePermanent.PlacePermanentToDigivolutionCards());
- if (!placePermanent.Placed)
- {
- continue;
- }
- }
- }
- }
- if (CardEffectCommons.IsExistOnBattleArea(addedDigivolutionCard))
- {
- if (addedDigivolutionCard.PermanentOfThisCard().DigivolutionCards.Count >= 1)
- {
- isFromDigimon = true;
- }
- }
- if (cardSources.Contains(addedDigivolutionCard))
- {
- isFromSameDigimon = true;
- if (addedDigivolutionCard == TopCard)
- {
- yield return ContinuousController.instance.StartCoroutine(CardObjectController.RemoveFromAllArea(addedDigivolutionCard));
- ShowingPermanentCard.ShowPermanentData(true);
- yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().RemoveDigivolveRootEffect(
- addedDigivolutionCard,
- this));
- }
- }
- yield return ContinuousController.instance.StartCoroutine(CardObjectController.RemoveFromAllArea(addedDigivolutionCard));
- if (!IsToken && !addedDigivolutionCard.IsToken)
- {
- cardSources.Add(addedDigivolutionCard);
- addedDigivolutionCard.SetFace();
- addedCards.Add(addedDigivolutionCard);
- }
- }
- if (addedCards.Count >= 1 && !skipEffectAndActivateSkill)
- {
- if (ShowingPermanentCard != null)
- {
- yield return ContinuousController.instance.StartCoroutine(ShowingPermanentCard.ShowAddDigivolutionCardEffect());
- }
- #region "進化元が増えた時"の効果
- #region Hashtable Setting
- Hashtable hashtable = new Hashtable()
- {
- {"Permanent", this},
- {"CardEffect", cardEffect},
- {"CardSources", addedCards},
- {"isFromSameDigimon", isFromSameDigimon},
- {"isFromDigimon", isFromDigimon},
- };
- #endregion
- yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing.StackSkillInfos(hashtable, EffectTiming.OnAddDigivolutionCards));
- #endregion
- }
- }
- #endregion
- #region パーマネントのカードリストからカードを除く
- public IEnumerator RemoveCardSource(CardSource cardSource)
- {
- yield return null;
- cardSources.Remove(cardSource);
- }
- #endregion
- #region このパーマネントの一番上のカード
- public CardSource TopCard
- {
- get
- {
- if (cardSources.Count >= 1)
- {
- return cardSources[0];
- }
- return null;
- }
- }
- #endregion
- #region Permanent effect list
- #region このパーマネントの効果リスト
- public List<ICardEffect> EffectList(EffectTiming timing)
- {
- return EffectList_ForCard(timing, TopCard);
- }
- #endregion
- #region このポケモンの追加効果リスト
- public List<ICardEffect> EffectList_Added(EffectTiming timing)
- {
- List<ICardEffect> _EffectList = new List<ICardEffect>();
- if (TopCard != null)
- {
- foreach (Func<EffectTiming, ICardEffect> GetCardEffect in UntilOwnerDrawPhaseEffects)
- {
- ICardEffect cardEffect = GetCardEffect(timing);
- if (cardEffect != null)
- {
- _EffectList.Add(cardEffect);
- }
- }
- foreach (Func<EffectTiming, ICardEffect> GetCardEffect in UntilOwnerTurnEndEffects)
- {
- ICardEffect cardEffect = GetCardEffect(timing);
- if (cardEffect != null)
- {
- _EffectList.Add(cardEffect);
- }
- }
- foreach (Func<EffectTiming, ICardEffect> GetCardEffect in UntilEachTurnEndEffects)
- {
- ICardEffect cardEffect = GetCardEffect(timing);
- if (cardEffect != null)
- {
- _EffectList.Add(cardEffect);
- }
- }
- foreach (Func<EffectTiming, ICardEffect> GetCardEffect in UntilOpponentTurnEndEffects)
- {
- ICardEffect cardEffect = GetCardEffect(timing);
- if (cardEffect != null)
- {
- _EffectList.Add(cardEffect);
- }
- }
- foreach (Func<EffectTiming, ICardEffect> GetCardEffect in UntilEndBattleEffects)
- {
- ICardEffect cardEffect = GetCardEffect(timing);
- if (cardEffect != null)
- {
- _EffectList.Add(cardEffect);
- }
- }
- foreach (Func<EffectTiming, ICardEffect> GetCardEffect in UntilOwnerTurnStartEffects)
- {
- ICardEffect cardEffect = GetCardEffect(timing);
- if (cardEffect != null)
- {
- _EffectList.Add(cardEffect);
- }
- }
- foreach (Func<EffectTiming, ICardEffect> GetCardEffect in UntilNextUntapEffects)
- {
- ICardEffect cardEffect = GetCardEffect(timing);
- if (cardEffect != null)
- {
- _EffectList.Add(cardEffect);
- }
- }
- foreach (Func<EffectTiming, ICardEffect> GetCardEffect in PermanentEffects)
- {
- ICardEffect cardEffect = GetCardEffect(timing);
- if (cardEffect != null)
- {
- _EffectList.Add(cardEffect);
- }
- }
- foreach (Func<EffectTiming, ICardEffect> GetCardEffect in UntilEndAttackEffects)
- {
- ICardEffect cardEffect = GetCardEffect(timing);
- if (cardEffect != null)
- {
- _EffectList.Add(cardEffect);
- }
- }
- _EffectList = _EffectList.Filter(cardEffect => cardEffect != null);
- foreach (ICardEffect cardEffect in _EffectList)
- {
- if (cardEffect != null)
- {
- if (cardEffect.EffectSourceCard == null)
- {
- cardEffect.SetEffectSourceCard(TopCard);
- }
- cardEffect.SetIsInheritedEffect(false);
- }
- }
- }
- return _EffectList;
- }
- #endregion
- #region このパーマネントの効果リスト(引数:CardSource)
- public List<ICardEffect> EffectList_ForCard(EffectTiming timing, CardSource _cardSource)
- {
- List<ICardEffect> _EffectList = new List<ICardEffect>();
- if (TopCard != null && _cardSource != null)
- {
- foreach (CardSource cardSource in cardSources)
- {
- if (cardSource != null)
- {
- if (!cardSource.IsFlipped)
- {
- bool isTopCard = cardSource == TopCard;
- if (!isTopCard)
- {
- if (!IsDigimon)
- {
- continue;
- }
- }
- foreach (ICardEffect cardEffect in cardSource.cEntity_EffectController.GetCardEffects(timing, cardSource))
- {
- if (cardEffect != null)
- {
- if (isTopCard == cardEffect.IsInheritedEffect)
- {
- continue;
- }
- _EffectList.Add(cardEffect);
- }
- }
- }
- }
- }
- foreach (ICardEffect cardEffect in EffectList_Added(timing))
- {
- if (cardEffect != null)
- {
- _EffectList.Add(cardEffect);
- }
- }
- foreach (ICardEffect cardEffect in _EffectList)
- {
- if (cardEffect != null)
- {
- if (cardEffect.EffectSourceCard == null)
- {
- cardEffect.SetEffectSourceCard(_cardSource);
- }
- }
- }
- }
- return _EffectList;
- }
- #endregion
- #region 自分のターン終了時に消える効果
- public List<Func<EffectTiming, ICardEffect>> UntilOwnerTurnEndEffects = new List<Func<EffectTiming, ICardEffect>>();
- #endregion
- #region 自分のドローフェイズ終了時に消える効果
- public List<Func<EffectTiming, ICardEffect>> UntilOwnerDrawPhaseEffects = new List<Func<EffectTiming, ICardEffect>>();
- #endregion
- #region お互いのターン終了時に消える効果
- public List<Func<EffectTiming, ICardEffect>> UntilEachTurnEndEffects = new List<Func<EffectTiming, ICardEffect>>();
- #endregion
- #region 相手のターン終了時に消える効果
- public List<Func<EffectTiming, ICardEffect>> UntilOpponentTurnEndEffects = new List<Func<EffectTiming, ICardEffect>>();
- #endregion
- #region バトル終了時に消える効果
- public List<Func<EffectTiming, ICardEffect>> UntilEndBattleEffects = new List<Func<EffectTiming, ICardEffect>>();
- #endregion
- #region 攻撃終了時に消える効果
- public List<Func<EffectTiming, ICardEffect>> UntilEndAttackEffects = new List<Func<EffectTiming, ICardEffect>>();
- #endregion
- #region 自分のターン開始時に消える効果
- public List<Func<EffectTiming, ICardEffect>> UntilOwnerTurnStartEffects = new List<Func<EffectTiming, ICardEffect>>();
- #endregion
- #region 次にアンタップする時に消える効果
- public List<Func<EffectTiming, ICardEffect>> UntilNextUntapEffects = new List<Func<EffectTiming, ICardEffect>>();
- #endregion
- #region 場を離れるまで残る効果
- public List<Func<EffectTiming, ICardEffect>> PermanentEffects = new List<Func<EffectTiming, ICardEffect>>();
- #endregion
- #endregion
- #region 起動型効果を宣言できるか
- public bool CanDeclareSkill() => CanDeclareSkillList().Count > 0;
- #endregion
- #region 宣言可能な起動型効果リスト
- public List<ICardEffect> CanDeclareSkillList()
- {
- List<ICardEffect> CanDeclareSkillList = new List<ICardEffect>();
- if (TopCard != null)
- {
- foreach (ICardEffect _cardEffect in EffectList(EffectTiming.OnDeclaration))
- {
- if (_cardEffect is ActivateICardEffect)
- {
- if (_cardEffect.CanUse(null))
- {
- CanDeclareSkillList.Add(_cardEffect);
- }
- }
- }
- }
- return CanDeclareSkillList;
- }
- #endregion
- #region このパーマネントが場に出たターン
- public int EnterFieldTurnCount { get; set; } = -1;
- #endregion
- #region このパーマネントを表す場のオブジェクト
- public FieldPermanentCard ShowingPermanentCard { get; set; }
- #endregion
- #region Whether this permanent can be selected by the effect
- public bool CanSelectBySkill(ICardEffect skill)
- {
- foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players)
- {
- #region Effects of field permanents
- foreach (Permanent permanent in player.GetFieldPermanents())
- {
- foreach (ICardEffect cardEffect in permanent.EffectList(EffectTiming.None))
- {
- if (cardEffect is ICanNotSelectBySkillEffect)
- {
- if (cardEffect.CanUse(null))
- {
- if (((ICanNotSelectBySkillEffect)cardEffect).CanNotSelectBySkill(this, skill))
- {
- return false;
- }
- }
- }
- }
- }
- #endregion
- }
- return true;
- }
- #endregion
- #region セキュリティチェックを行う枚数
- public List<int> SecurityAttackChanges
- {
- get
- {
- List<int> SecurityAttackChanges = new List<int>();
- int Strike = 1;
- List<ICardEffect> cardEffects_ChangeDirectStrike = new List<ICardEffect>();
- foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players_ForTurnPlayer)
- {
- foreach (Permanent permanent in player.GetFieldPermanents())
- {
- #region 場のパーマネントの効果
- foreach (ICardEffect cardEffect in permanent.EffectList(EffectTiming.None))
- {
- if (cardEffect is IChangeSAttackEffect)
- {
- if (cardEffect.CanUse(null))
- {
- if (!TopCard.CanNotBeAffected(cardEffect))
- {
- if (((IChangeSAttackEffect)cardEffect).isUpDown() == CalculateOrder.UpDownValue)
- {
- cardEffects_ChangeDirectStrike.Add(cardEffect);
- }
- }
- }
- }
- }
- #endregion
- }
- #region プレイヤーの効果
- foreach (ICardEffect cardEffect in player.EffectList(EffectTiming.None))
- {
- if (cardEffect is IChangeSAttackEffect)
- {
- if (cardEffect.CanUse(null))
- {
- if (!TopCard.CanNotBeAffected(cardEffect))
- {
- if (((IChangeSAttackEffect)cardEffect).isUpDown() == CalculateOrder.UpDownValue)
- {
- cardEffects_ChangeDirectStrike.Add(cardEffect);
- }
- }
- }
- }
- }
- #endregion
- }
- foreach (ICardEffect cardEffect in cardEffects_ChangeDirectStrike)
- {
- if (cardEffect is IChangeSAttackEffect)
- {
- if (cardEffect.CanUse(null))
- {
- int Strike1 = ((IChangeSAttackEffect)cardEffect).GetSAttack(Strike, this);
- if (Strike1 != Strike)
- {
- SecurityAttackChanges.Add(Strike1 - Strike);
- }
- }
- }
- }
- return SecurityAttackChanges;
- }
- }
- public bool HasSecurityAttackChanges
- {
- get
- {
- if (!IsDigimon)
- {
- return false;
- }
- return SecurityAttackChanges.Count >= 1;
- }
- }
- public int Strike_AllowMinus
- {
- get
- {
- int Strike = 1;
- #region セキュリティチェックを行う枚数を変更する効果
- List<ICardEffect> cardEffects_ChangeDirectStrike = new List<ICardEffect>();
- foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players_ForTurnPlayer)
- {
- foreach (Permanent permanent in player.GetFieldPermanents())
- {
- #region 場のパーマネントの効果
- foreach (ICardEffect cardEffect in permanent.EffectList(EffectTiming.None))
- {
- if (cardEffect is IChangeSAttackEffect)
- {
- if (((IChangeSAttackEffect)cardEffect).PermanentCondition(this))
- {
- if (cardEffect.CanUse(null))
- {
- if (!TopCard.CanNotBeAffected(cardEffect))
- {
- cardEffects_ChangeDirectStrike.Add(cardEffect);
- }
- }
- }
- }
- }
- #endregion
- }
- #region プレイヤーの効果
- foreach (ICardEffect cardEffect in player.EffectList(EffectTiming.None))
- {
- if (cardEffect is IChangeSAttackEffect)
- {
- if (((IChangeSAttackEffect)cardEffect).PermanentCondition(this))
- {
- if (cardEffect.CanUse(null))
- {
- if (!TopCard.CanNotBeAffected(cardEffect))
- {
- cardEffects_ChangeDirectStrike.Add(cardEffect);
- }
- }
- }
- }
- }
- #endregion
- }
- List<ICardEffect> cardEffects_ChangeDirectStrike_UpToConstant = new List<ICardEffect>();
- List<ICardEffect> cardEffects_ChangeDirectStrike_UpDownValue = new List<ICardEffect>();
- List<ICardEffect> cardEffects_ChangeDirectStrike_DownToConstant = new List<ICardEffect>();
- foreach (ICardEffect cardEffect in cardEffects_ChangeDirectStrike)
- {
- if (cardEffect is IChangeSAttackEffect)
- {
- if (cardEffect.CanUse(null))
- {
- switch (((IChangeSAttackEffect)cardEffect).isUpDown())
- {
- case CalculateOrder.UpToConstant:
- cardEffects_ChangeDirectStrike_UpToConstant.Add(cardEffect);
- break;
- case CalculateOrder.UpDownValue:
- cardEffects_ChangeDirectStrike_UpDownValue.Add(cardEffect);
- break;
- case CalculateOrder.DownToConstant:
- cardEffects_ChangeDirectStrike_DownToConstant.Add(cardEffect);
- break;
- }
- }
- }
- }
- foreach (ICardEffect cardEffect in cardEffects_ChangeDirectStrike_UpToConstant)
- {
- if (cardEffect is IChangeSAttackEffect)
- {
- if (cardEffect.CanUse(null))
- {
- Strike = ((IChangeSAttackEffect)cardEffect).GetSAttack(Strike, this);
- }
- }
- }
- foreach (ICardEffect cardEffect in cardEffects_ChangeDirectStrike_UpDownValue)
- {
- if (cardEffect is IChangeSAttackEffect)
- {
- if (cardEffect.CanUse(null))
- {
- Strike = ((IChangeSAttackEffect)cardEffect).GetSAttack(Strike, this);
- }
- }
- }
- foreach (ICardEffect cardEffect in cardEffects_ChangeDirectStrike_DownToConstant)
- {
- if (cardEffect is IChangeSAttackEffect)
- {
- if (cardEffect.CanUse(null))
- {
- Strike = ((IChangeSAttackEffect)cardEffect).GetSAttack(Strike, this);
- }
- }
- }
- #endregion
- return Strike;
- }
- }
- public int Strike
- {
- get
- {
- int Strike = Strike_AllowMinus;
- if (Strike < 0)
- {
- Strike = 0;
- }
- return Strike;
- }
- }
- #endregion
- #region このパーマネントがタップされているかどうか
- public bool OldIsSuspended = false;
- public bool IsSuspended = false;
- public int DPWhenSuspended = 114514;
- #endregion
- #region Whether this permanent can unsuspend
- public bool CanUnsuspend
- {
- get
- {
- foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players)
- {
- #region Effects of field permanents
- foreach (Permanent permanent in player.GetFieldPermanents())
- {
- foreach (ICardEffect cardEffect in permanent.EffectList(EffectTiming.None))
- {
- if (cardEffect is ICanNotUnsuspendEffect)
- {
- if (cardEffect.CanUse(null))
- {
- if (((ICanNotUnsuspendEffect)cardEffect).CanNotUnsuspend(this))
- {
- return false;
- }
- }
- }
- }
- }
- #endregion
- #region Effects of players
- foreach (ICardEffect cardEffect in player.EffectList(EffectTiming.None))
- {
- if (cardEffect is ICanNotUnsuspendEffect)
- {
- if (cardEffect.CanUse(null))
- {
- if (((ICanNotUnsuspendEffect)cardEffect).CanNotUnsuspend(this))
- {
- return false;
- }
- }
- }
- }
- #endregion
- }
- return true;
- }
- }
- #endregion
- #region このパーマネントが移動できるかどうか
- public bool CanMove
- {
- get
- {
- if (TopCard != null)
- {
- if (!TopCard.Owner.GetBreedingAreaPermanents().Contains(this))
- {
- return false;
- }
- if (!IsDigimon)
- {
- return false;
- }
- if (DP <= 0)
- {
- return false;
- }
- if (GManager.instance.turnStateMachine.gameContext.TurnPlayer.fieldCardFrames.Count((frame) => frame.IsEmptyFrame() && frame.IsBattleAreaFrame()) == 0)
- {
- return false;
- }
- }
- else
- {
- return false;
- }
- return true;
- }
- }
- #endregion
- #region このパーマネントが攻撃できるかどうか
- public bool CanAttack(ICardEffect cardEffect, bool withoutTap = false)
- {
- // can not attack with empty cards
- if (TopCard == null)
- {
- return false;
- }
- // can not attack during opponent's turn
- if (TopCard.Owner != GManager.instance.turnStateMachine.gameContext.TurnPlayer)
- {
- return false;
- }
- // can not attack to player
- if (!CanAttackTargetDigimon(null, cardEffect, withoutTap))
- {
- // can not attack to opponent's Digimon
- if (TopCard.Owner.Enemy.GetFieldPermanents().Count((permanent) => CanAttackTargetDigimon(permanent, cardEffect, withoutTap)) == 0)
- {
- return false;
- }
- }
- return true;
- }
- #endregion
- #region このパーマネントが対象の攻撃パーマネントをブロックできるかどうか
- public bool CanBlock(Permanent AttackingPermanent)
- {
- if (TopCard == null)
- {
- return false;
- }
- if (!IsDigimon)
- {
- return false;
- }
- if (IsSuspended)
- {
- return false;
- }
- if (!CanSuspend)
- {
- return false;
- }
- if (PermanentFrame != null)
- {
- if (!PermanentFrame.IsBattleAreaFrame())
- {
- return false;
- }
- }
- #region "Unblockable" effect
- #region Effects of permanents in play
- foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players)
- {
- foreach (Permanent permanent in player.GetFieldPermanents())
- {
- foreach (ICardEffect cardEffect in permanent.EffectList(EffectTiming.None))
- {
- if (cardEffect is ICannotBlockEffect)
- {
- if (cardEffect.CanUse(null))
- {
- if (((ICannotBlockEffect)cardEffect).CannotBlock(AttackingPermanent, this))
- {
- return false;
- }
- }
- }
- }
- }
- }
- #endregion
- #region player effect
- foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players)
- {
- foreach (ICardEffect cardEffect in player.EffectList(EffectTiming.None))
- {
- if (cardEffect is ICannotBlockEffect)
- {
- if (cardEffect.CanUse(null))
- {
- if (((ICannotBlockEffect)cardEffect).CannotBlock(AttackingPermanent, this))
- {
- if (!TopCard.CanNotBeAffected(cardEffect))
- {
- return false;
- }
- }
- }
- }
- }
- }
- #endregion
- #endregion
- return true;
- }
- #endregion
- #region 対象のパーマネントを攻撃できるか
- public bool CanAttackTargetDigimon(Permanent Defender, ICardEffect cardEffect, bool withoutTap = false)
- {
- if (TopCard != null)
- {
- if (!IsDigimon)
- {
- return false;
- }
- if (!withoutTap)
- {
- if (IsSuspended)
- {
- return false;
- }
- if (!CanSuspend)
- {
- return false;
- }
- }
- if (PermanentFrame != null)
- {
- if (!PermanentFrame.IsBattleAreaFrame())
- {
- return false;
- }
- }
- if (EnterFieldTurnCount == GManager.instance.turnStateMachine.TurnCount)
- {
- if (!HasRush)
- {
- return false;
- }
- }
- #region 「対象の防御パーマネントを攻撃できない」効果
- #region 場のパーマネントの効果
- foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players)
- {
- foreach (Permanent permanent in player.GetFieldPermanents())
- {
- foreach (ICardEffect cardEffect1 in permanent.EffectList(EffectTiming.None))
- {
- if (cardEffect1 is ICanNotAttackTargetDefendingPermanentEffect)
- {
- if (cardEffect1.CanUse(null))
- {
- if (((ICanNotAttackTargetDefendingPermanentEffect)cardEffect1).CanNotAttackTargetDefendingPermanent(this, Defender))
- {
- if (!TopCard.CanNotBeAffected(cardEffect1))
- {
- return false;
- }
- }
- }
- }
- }
- }
- }
- #endregion
- #region プレイヤーの効果
- foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players)
- {
- foreach (ICardEffect cardEffect1 in player.EffectList(EffectTiming.None))
- {
- if (cardEffect1 is ICanNotAttackTargetDefendingPermanentEffect)
- {
- if (cardEffect1.CanUse(null))
- {
- if (((ICanNotAttackTargetDefendingPermanentEffect)cardEffect1).CanNotAttackTargetDefendingPermanent(this, Defender))
- {
- if (!TopCard.CanNotBeAffected(cardEffect1))
- {
- return false;
- }
- }
- }
- }
- }
- }
- #endregion
- #endregion
- if (Defender != null)
- {
- if (Defender.TopCard != null)
- {
- if (Defender.TopCard.Owner == TopCard.Owner.Enemy)
- {
- if (Defender.IsDigimon && Defender.TopCard.Owner.GetBattleAreaPermanents().Contains(Defender))
- {
- if (Defender.IsSuspended)
- {
- return true;
- }
- #region 「対象の防御パーマネントを攻撃できる」効果
- #region 場のパーマネントの効果
- foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players)
- {
- foreach (Permanent permanent in player.GetFieldPermanents())
- {
- foreach (ICardEffect cardEffect1 in permanent.EffectList(EffectTiming.None))
- {
- if (cardEffect1 is ICanAttackTargetDefendingPermanentEffect)
- {
- if (cardEffect1.CanUse(null))
- {
- if (((ICanAttackTargetDefendingPermanentEffect)cardEffect1).CanAttackTargetDefendingPermanent(this, Defender, cardEffect))
- {
- return true;
- }
- }
- }
- }
- }
- }
- #endregion
- #region プレイヤーの効果
- foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players)
- {
- foreach (ICardEffect cardEffect1 in player.EffectList(EffectTiming.None))
- {
- if (cardEffect1 is ICanAttackTargetDefendingPermanentEffect)
- {
- if (cardEffect1.CanUse(null))
- {
- if (((ICanAttackTargetDefendingPermanentEffect)cardEffect1).CanAttackTargetDefendingPermanent(this, Defender, cardEffect))
- {
- return true;
- }
- }
- }
- }
- }
- #endregion
- #endregion
- }
- }
- }
- }
- else
- {
- return true;
- }
- }
- return false;
- }
- #endregion
- #region Is Unblockable
- public bool IsUnblockable
- {
- get
- {
- foreach (ICardEffect cardEffect in this.EffectList(EffectTiming.None))
- {
- if (cardEffect is CannotBlockClass)
- {
- if (cardEffect.EffectName == "Can't Block")
- {
- return true;
- }
- }
- }
- return false;
- }
- }
- #endregion
- #region Has Blocker
- public bool HasBlocker
- {
- get
- {
- foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players_ForTurnPlayer)
- {
- foreach (Permanent permanent in player.GetFieldPermanents())
- {
- #region 場のパーマネントの効果
- foreach (ICardEffect cardEffect in permanent.EffectList(EffectTiming.None))
- {
- if (cardEffect is IBlockerEffect)
- {
- if (cardEffect.CanTrigger(null))
- {
- if (((IBlockerEffect)cardEffect).IsBlocker(this))
- {
- return true;
- }
- }
- }
- }
- #endregion
- }
- #region プレイヤーの効果
- foreach (ICardEffect cardEffect in player.EffectList(EffectTiming.None))
- {
- if (cardEffect is IBlockerEffect)
- {
- if (cardEffect.CanTrigger(null))
- {
- if (((IBlockerEffect)cardEffect).IsBlocker(this))
- {
- return true;
- }
- }
- }
- }
- #endregion
- }
- return false;
- }
- }
- #endregion
- #region Has Jamming
- public bool HasJamming
- {
- get
- {
- foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players_ForTurnPlayer)
- {
- foreach (Permanent permanent in player.GetFieldPermanents())
- {
- #region 場のパーマネントの効果
- foreach (ICardEffect cardEffect in permanent.EffectList(EffectTiming.None))
- {
- if (cardEffect is ICanNotBeDestroyedByBattleEffect)
- {
- if (cardEffect.CanTrigger(null))
- {
- if (cardEffect.EffectName == "Jamming")
- {
- if (((ICanNotBeDestroyedByBattleEffect)cardEffect).PermanentCondition(this))
- {
- return true;
- }
- }
- }
- }
- }
- #endregion
- }
- #region プレイヤーの効果
- foreach (ICardEffect cardEffect in player.EffectList(EffectTiming.None))
- {
- if (cardEffect is ICanNotBeDestroyedByBattleEffect)
- {
- if (cardEffect.CanTrigger(null))
- {
- if (cardEffect.EffectName == "Jamming")
- {
- if (((ICanNotBeDestroyedByBattleEffect)cardEffect).PermanentCondition(this))
- {
- return true;
- }
- }
- }
- }
- }
- #endregion
- }
- return false;
- }
- }
- #endregion
- #region Whether this permanent has Pierce
- public bool HasPierce
- {
- get
- {
- if (IsDigimon)
- {
- foreach (ICardEffect cardEffect in EffectList(EffectTiming.OnDetermineDoSecurityCheck))
- {
- if (cardEffect is ActivateICardEffect)
- {
- if (cardEffect.CanTrigger(CardEffectCommons.PierceCheckHashtableOfPermanent(this)))
- {
- if (cardEffect.EffectName == "Pierce")
- {
- return true;
- }
- if (cardEffect.EffectName == "Piercing")
- {
- return true;
- }
- }
- }
- }
- }
- return false;
- }
- }
- #endregion
- #region 再起動を持つか
- public bool HasReboot
- {
- get
- {
- foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players_ForTurnPlayer)
- {
- foreach (Permanent permanent in player.GetFieldPermanents())
- {
- #region 場のパーマネントの効果
- foreach (ICardEffect cardEffect in permanent.EffectList(EffectTiming.None))
- {
- if (cardEffect is IRebootEffect)
- {
- if (cardEffect.CanTrigger(null))
- {
- if (((IRebootEffect)cardEffect).HasReboot(this))
- {
- return true;
- }
- }
- }
- }
- #endregion
- }
- #region プレイヤーの効果
- foreach (ICardEffect cardEffect in player.EffectList(EffectTiming.None))
- {
- if (cardEffect is IRebootEffect)
- {
- if (cardEffect.CanTrigger(null))
- {
- if (((IRebootEffect)cardEffect).HasReboot(this))
- {
- return true;
- }
- }
- }
- }
- #endregion
- }
- return false;
- }
- }
- #endregion
- #region 突進を持つか
- public bool HasRaid
- {
- get
- {
- foreach (ICardEffect cardEffect in this.EffectList(EffectTiming.OnAllyAttack))
- {
- if (cardEffect is ActivateICardEffect)
- {
- if (cardEffect.EffectName == "Raid")
- {
- return true;
- }
- }
- }
- return false;
- }
- }
- #endregion
- #region 速攻を持つか
- public bool HasRush
- {
- get
- {
- foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players_ForTurnPlayer)
- {
- foreach (Permanent permanent in player.GetFieldPermanents())
- {
- #region 場のパーマネントの効果
- foreach (ICardEffect cardEffect in permanent.EffectList(EffectTiming.None))
- {
- if (cardEffect is IRushEffect)
- {
- if (cardEffect.CanTrigger(null))
- {
- if (((IRushEffect)cardEffect).HasRush(this))
- {
- return true;
- }
- }
- }
- }
- #endregion
- }
- #region プレイヤーの効果
- foreach (ICardEffect cardEffect in player.EffectList(EffectTiming.None))
- {
- if (cardEffect is IRushEffect)
- {
- if (cardEffect.CanTrigger(null))
- {
- if (((IRushEffect)cardEffect).HasRush(this))
- {
- return true;
- }
- }
- }
- }
- #endregion
- }
- return false;
- }
- }
- #endregion
- #region 道連れを持つか
- public bool HasRetaliation
- {
- get
- {
- if (RetaliationCount >= 1)
- {
- return true;
- }
- return false;
- }
- }
- #endregion
- #region 道連れを持つ個数
- public int RetaliationCount
- {
- get
- {
- int count = 0;
- foreach (ICardEffect cardEffect in EffectList(EffectTiming.OnDestroyedAnyone))
- {
- if (cardEffect is ActivateICardEffect)
- {
- if (cardEffect.EffectName == "Retaliation")
- {
- if (cardEffect.CanTrigger(CardEffectCommons.OnDeletionCheckHashtableOfPermanent(this)))
- {
- count++;
- }
- }
- }
- }
- return count;
- }
- }
- #endregion
- #region 不屈を持つか
- public bool HasFortitude
- {
- get
- {
- foreach (ICardEffect cardEffect in EffectList(EffectTiming.OnDestroyedAnyone))
- {
- if (cardEffect is ActivateICardEffect)
- {
- if (cardEffect.EffectName == "Fortitude")
- {
- if (cardEffect.CanTrigger(CardEffectCommons.OnDeletionCheckHashtableOfPermanent(this)))
- {
- return true;
- }
- }
- }
- }
- return false;
- }
- }
- #endregion
- #region Has Blitz
- public bool HasBlitz
- {
- get
- {
- foreach (ICardEffect cardEffect in EffectList(EffectTiming.OnEnterFieldAnyone))
- {
- if (cardEffect is ActivateICardEffect)
- {
- if (cardEffect.CanTrigger(CardEffectCommons.WhenDigivolutionCheckHashtableOfPermanent(this)) || cardEffect.CanTrigger(CardEffectCommons.OnPlayCheckHashtableOfPermanent(this)))
- {
- if (!string.IsNullOrEmpty(cardEffect.EffectDiscription))
- {
- if (cardEffect.EffectDiscription.Contains("Blitz"))
- {
- return true;
- }
- }
- }
- }
- }
- return false;
- }
- }
- #endregion
- #region 回避を持つか
- public bool HasEvade
- {
- get
- {
- foreach (ICardEffect cardEffect in this.EffectList(EffectTiming.WhenPermanentWouldBeDeleted))
- {
- if (cardEffect is ActivateICardEffect)
- {
- Hashtable hashtable = new Hashtable()
- {
- {"Permanents", new List<Permanent>() { this }}
- };
- if (cardEffect.CanTrigger(hashtable))
- {
- if (cardEffect.EffectName == "Evade")
- {
- return true;
- }
- }
- }
- }
- return false;
- }
- }
- #endregion
- #region マインドリンクを持つか
- public bool HasMindLink
- {
- get
- {
- foreach (ICardEffect cardEffect in EffectList(EffectTiming.OnDeclaration))
- {
- if (cardEffect is ActivateICardEffect)
- {
- if (cardEffect.CanTrigger(null))
- {
- if (!String.IsNullOrEmpty(cardEffect.EffectDiscription))
- {
- if (cardEffect.EffectDiscription.Contains("Mind Link"))
- {
- return true;
- }
- }
- }
- }
- }
- return false;
- }
- }
- #endregion
- #region 防壁を持つか
- public bool HasBarrier
- {
- get
- {
- foreach (ICardEffect cardEffect in this.EffectList(EffectTiming.WhenPermanentWouldBeDeleted))
- {
- if (cardEffect is ActivateICardEffect)
- {
- Hashtable hashtable = new Hashtable();
- hashtable.Add("Permanents", new List<Permanent>() { this });
- hashtable.Add("battle", new IBattle(null, null, null));
- if (cardEffect.CanTrigger(hashtable))
- {
- if (cardEffect.EffectName == "Barrier")
- {
- return true;
- }
- }
- }
- }
- return false;
- }
- }
- #endregion
- #region 連携を持つか
- public bool HasAlliance
- {
- get
- {
- foreach (ICardEffect cardEffect in this.EffectList(EffectTiming.OnAllyAttack))
- {
- if (cardEffect is ActivateICardEffect)
- {
- if (cardEffect.EffectName == "Alliance")
- {
- return true;
- }
- }
- }
- return false;
- }
- }
- #endregion
- #region 消滅時効化を持つか
- public bool HasOnDeletionEffect
- {
- get
- {
- foreach (ICardEffect cardEffect in EffectList(EffectTiming.OnDestroyedAnyone))
- {
- if (cardEffect is ActivateICardEffect)
- {
- if (cardEffect.CanTrigger(CardEffectCommons.OnDeletionCheckHashtableOfPermanent(this)))
- {
- if (!string.IsNullOrEmpty(cardEffect.EffectDiscription))
- {
- if (cardEffect.IsOnDeletion)
- {
- return true;
- }
- }
- }
- }
- }
- return false;
- }
- }
- #endregion
- #region バトルしているか
- public IBattle battle { get; set; } = null;
- #endregion
- #region このデジモンが消滅するか
- public bool CanBeDestroyed()
- {
- #region 消滅しない効果
- foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players_ForTurnPlayer)
- {
- foreach (Permanent permanent in player.GetFieldPermanents())
- {
- #region 場のパーマネントの効果
- foreach (ICardEffect cardEffect in permanent.EffectList(EffectTiming.None))
- {
- if (cardEffect is ICanNotBeDestroyedEffect)
- {
- if (cardEffect.CanUse(null))
- {
- if (((ICanNotBeDestroyedEffect)cardEffect).CanNotBeDestroyed(this))
- {
- return false;
- }
- }
- }
- }
- #endregion
- }
- #region プレイヤーの効果
- foreach (ICardEffect cardEffect in player.EffectList(EffectTiming.None))
- {
- if (cardEffect is ICanNotBeDestroyedEffect)
- {
- if (cardEffect.CanUse(null))
- {
- if (((ICanNotBeDestroyedEffect)cardEffect).CanNotBeDestroyed(this))
- {
- return false;
- }
- }
- }
- }
- #endregion
- }
- #endregion
- return true;
- }
- #endregion
- #region このデジモンが戦闘によって消滅するか
- public bool CanBeDestroyedByBattle(Permanent AttackingPermanent, Permanent DefendingPermanent, CardSource DefendingCard)
- {
- if (!CanBeDestroyed())
- {
- return false;
- }
- #region 戦闘で消滅しない効果
- foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players_ForTurnPlayer)
- {
- foreach (Permanent permanent in player.GetFieldPermanents())
- {
- #region 場のパーマネントの効果
- foreach (ICardEffect cardEffect in permanent.EffectList(EffectTiming.None))
- {
- if (cardEffect is ICanNotBeDestroyedByBattleEffect)
- {
- if (cardEffect.CanUse(null))
- {
- if (((ICanNotBeDestroyedByBattleEffect)cardEffect).CanNotBeDestroyedByBattle(this, AttackingPermanent, DefendingPermanent, DefendingCard))
- {
- return false;
- }
- }
- }
- }
- #endregion
- }
- #region プレイヤーの効果
- foreach (ICardEffect cardEffect in player.EffectList(EffectTiming.None))
- {
- if (cardEffect is ICanNotBeDestroyedByBattleEffect)
- {
- if (cardEffect.CanUse(null))
- {
- if (((ICanNotBeDestroyedByBattleEffect)cardEffect).CanNotBeDestroyedByBattle(this, AttackingPermanent, DefendingPermanent, DefendingCard))
- {
- return false;
- }
- }
- }
- }
- #endregion
- }
- #endregion
- return true;
- }
- #endregion
- #region このパーマネントが効果で消滅するか
- public bool CanBeDestroyedBySkill(ICardEffect cardEffect)
- {
- if (this.TopCard != null)
- {
- if (this.TopCard.CanNotBeAffected(cardEffect))
- {
- return false;
- }
- if (!CanBeDestroyed())
- {
- return false;
- }
- #region 効果で消滅しない効果
- foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players_ForTurnPlayer)
- {
- foreach (Permanent permanent in player.GetFieldPermanents())
- {
- #region 場のパーマネントの効果
- foreach (ICardEffect cardEffect1 in permanent.EffectList(EffectTiming.None))
- {
- if (cardEffect1 is ICanNotBeDestroyedBySkillEffect)
- {
- if (cardEffect1.CanUse(null))
- {
- if (((ICanNotBeDestroyedBySkillEffect)cardEffect1).CanNotBeDestroyedBySkill(this, cardEffect))
- {
- return false;
- }
- }
- }
- }
- #endregion
- }
- #region プレイヤーの効果
- foreach (ICardEffect cardEffect1 in player.EffectList(EffectTiming.None))
- {
- if (cardEffect1 is ICanNotBeDestroyedBySkillEffect)
- {
- if (cardEffect1.CanUse(null))
- {
- if (((ICanNotBeDestroyedBySkillEffect)cardEffect1).CanNotBeDestroyedBySkill(this, cardEffect))
- {
- return false;
- }
- }
- }
- }
- #endregion
- }
- #endregion
- }
- return true;
- }
- #endregion
- #region トークンかどうか
- public bool IsToken
- {
- get
- {
- if (TopCard != null)
- {
- if (TopCard.IsToken)
- {
- return true;
- }
- }
- return false;
- }
- }
- #endregion
- #region そのパーマネントが消滅・バウンス待機状態か
- public bool willBeRemoveField { get; set; } = false;
- #endregion
- #region このパーマネントがデジモンか
- public bool IsDigimon
- {
- get
- {
- if (TopCard != null)
- {
- if (TopCard.IsDigimon || TopCard.IsDigiEgg)
- {
- return true;
- }
- #region Effect of treating it as a Digimon
- foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players_ForTurnPlayer)
- {
- foreach (Permanent permanent in player.GetFieldPermanents())
- {
- #region Effects of permanents in play
- foreach (ICardEffect cardEffect in permanent.EffectList_Added(EffectTiming.None))
- {
- if (cardEffect is ITreatAsDigimonEffect)
- {
- if (cardEffect.CanTrigger(null))
- {
- if (((ITreatAsDigimonEffect)cardEffect).IsDigimon(this))
- {
- return true;
- }
- }
- }
- }
- #endregion
- }
- #region player effect
- foreach (ICardEffect cardEffect in player.EffectList(EffectTiming.None))
- {
- if (cardEffect is ITreatAsDigimonEffect)
- {
- if (cardEffect.CanTrigger(null))
- {
- if (((ITreatAsDigimonEffect)cardEffect).IsDigimon(this))
- {
- return true;
- }
- }
- }
- }
- #endregion
- }
- #endregion
- }
- return false;
- }
- }
- #endregion
- #region このパーマネントがテイマーか
- public bool IsTamer
- {
- get
- {
- if (TopCard != null)
- {
- if (TopCard.IsTamer)
- {
- return true;
- }
- }
- return false;
- }
- }
- #endregion
- #region ジョグレスで扱うレベル
- public List<int> Levels_ForJogress(CardSource cardSource)
- {
- List<int> levels = new List<int>();
- if (cardSource != null)
- {
- if (cardSource.HasLevel)
- {
- levels.Add(this.Level);
- }
- #region "ジョグレス進化で扱うレベルを追加する"効果
- foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players_ForTurnPlayer)
- {
- foreach (Permanent permanent in player.GetFieldPermanents())
- {
- #region 場のパーマネントの効果
- foreach (ICardEffect cardEffect in permanent.EffectList(EffectTiming.None))
- {
- if (cardEffect is IAddJogressLevelsEffect)
- {
- if (cardEffect.CanUse(null))
- {
- foreach (int level in ((IAddJogressLevelsEffect)cardEffect).GetJogressLevels(cardSource, this))
- {
- levels.Add(level);
- }
- }
- }
- }
- #endregion
- }
- #region プレイヤーの効果
- foreach (ICardEffect cardEffect in player.EffectList(EffectTiming.None))
- {
- if (cardEffect is IAddJogressLevelsEffect)
- {
- if (cardEffect.CanUse(null))
- {
- foreach (int level in ((IAddJogressLevelsEffect)cardEffect).GetJogressLevels(cardSource, this))
- {
- levels.Add(level);
- }
- }
- }
- }
- #endregion
- }
- #endregion
- }
- return levels;
- }
- #endregion
- #region バトルで消滅したか
- public bool IsDestroyedByBattle { get; set; } = false;
- #endregion
- #region 消滅に使用された効果
- public ICardEffect DestroyingEffect { get; set; } = null;
- #endregion
- #region 他のパーマネントの下に置くのに使用された効果
- public ICardEffect PlaceOtherPermanentEffect { get; set; } = null;
- #endregion
- #region 手札バウンス に使用された効果
- public ICardEffect HandBounceEffect { get; set; } = null;
- #endregion
- #region 山札バウンス に使用された効果
- public ICardEffect LibraryBounceEffect { get; set; } = null;
- #endregion
- #region 登場に使用された効果
- public ICardEffect PlayingEffect { get; set; } = null;
- #endregion
- #region 進化に使用された効果
- public ICardEffect DigivolvingEffect { get; set; } = null;
- #endregion
- #region Whether this digimon is placed in the trash by not having a DP
- public bool IsPlaceToTrashDueToNotHavingDP { get; set; } = true;
- #endregion
- #region Whether this permanent can suspend
- public bool CanSuspend
- {
- get
- {
- foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players)
- {
- #region Effects of field permanents
- foreach (Permanent permanent in player.GetFieldPermanents())
- {
- foreach (ICardEffect cardEffect in permanent.EffectList(EffectTiming.None))
- {
- if (cardEffect is ICanNotSuspendEffect)
- {
- if (cardEffect.CanUse(null))
- {
- if (((ICanNotSuspendEffect)cardEffect).CanNotSuspend(this))
- {
- return false;
- }
- }
- }
- }
- }
- #endregion
- #region Effects of players
- foreach (ICardEffect cardEffect in player.EffectList(EffectTiming.None))
- {
- if (cardEffect is ICanNotSuspendEffect)
- {
- if (cardEffect.CanUse(null))
- {
- if (((ICanNotSuspendEffect)cardEffect).CanNotSuspend(this))
- {
- return false;
- }
- }
- }
- }
- #endregion
- }
- return true;
- }
- }
- #endregion
- #region このデジモンのアタックの対象が変更できるか
- public bool CanSwitchAttackTarget
- {
- get
- {
- #region アタックの対象が変更できない効果
- foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players_ForTurnPlayer)
- {
- foreach (Permanent permanent in player.GetFieldPermanents())
- {
- #region 場のパーマネントの効果
- foreach (ICardEffect cardEffect in permanent.EffectList(EffectTiming.None))
- {
- if (cardEffect is ICanNotSwitchAttackTargetEffect)
- {
- if (cardEffect.CanUse(null))
- {
- if (((ICanNotSwitchAttackTargetEffect)cardEffect).CanNotBeSwitchAttackTarget(this))
- {
- return false;
- }
- }
- }
- }
- #endregion
- }
- #region プレイヤーの効果
- foreach (ICardEffect cardEffect in player.EffectList(EffectTiming.None))
- {
- if (cardEffect is ICanNotSwitchAttackTargetEffect)
- {
- if (cardEffect.CanUse(null))
- {
- if (((ICanNotSwitchAttackTargetEffect)cardEffect).CanNotBeSwitchAttackTarget(this))
- {
- return false;
- }
- }
- }
- }
- #endregion
- }
- #endregion
- return true;
- }
- }
- #endregion
- #region このデジモンを場からデジクロス条件の代わりにできるか
- public bool CanSubstituteForDigiXrosCondition(CardSource cardSource)
- {
- #region デジクロス条件の代わりにできる効果
- foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players_ForTurnPlayer)
- {
- foreach (Permanent permanent in player.GetFieldPermanents())
- {
- #region 場のパーマネントの効果
- foreach (ICardEffect cardEffect in permanent.EffectList(EffectTiming.None))
- {
- if (cardEffect is ICanSelectDigiXrosEffect)
- {
- if (cardEffect.CanUse(null))
- {
- if (((ICanSelectDigiXrosEffect)cardEffect).CanSelect(cardSource, this))
- {
- return true;
- }
- }
- }
- }
- #endregion
- }
- #region プレイヤーの効果
- foreach (ICardEffect cardEffect in player.EffectList(EffectTiming.None))
- {
- if (cardEffect is ICanSelectDigiXrosEffect)
- {
- if (cardEffect.CanUse(null))
- {
- if (((ICanSelectDigiXrosEffect)cardEffect).CanSelect(cardSource, this))
- {
- return true;
- }
- }
- }
- }
- #endregion
- }
- #endregion
- return false;
- }
- #endregion
- #region 登場した直後のLevel
- public int LevelJustAfterPlayed { get; set; } = -1;
- #endregion
- #region 登場した直後のPlay Cost
- public int PlayCostJustAfterPlayed { get; set; } = -1;
- #endregion
- #region 登場した直後のCardNames
- public List<string> CardNamesJustAfterPlayed { get; set; } = new List<string>();
- #endregion
- #region 進化した直後のCardNames
- public List<string> CardNamesJustAfterDigivolved { get; set; } = new List<string>();
- #endregion
- #region 登場した直後のTraits
- public List<string> TraitsJustAfterPlayed { get; set; } = new List<string>();
- #endregion
- #region 場を離れる直前のDP
- public int DPJustBeforeRemoveField { get; set; } = -1;
- #endregion
- #region 場を離れる直前のLevel
- public int LevelJustBeforeRemoveField { get; set; } = -1;
- #endregion
- #region 場を離れる直前のCost
- public int CostJustBeforeRemoveField { get; set; } = -1;
- #endregion
- #region 場を離れる直前のカード名
- public List<string> CardNamesJustBeforeRemoveField { get; set; } = new List<string>();
- #endregion
- #region バースト進化で手札に戻ったか
- public bool IsReturnedToHandByBurstDigivolution { get; set; } = false;
- #endregion
- #region バースト進化したか
- public bool IsBurstDigivolved { get; set; } = false;
- #endregion
- #region 効果で場に出たオプションか
- public bool IsPlayedOptionPermanent { get; set; } = false;
- #endregion
- #region 進化元を持たないか
- public bool HasNoDigivolutionCards => DigivolutionCards.Count == 0;
- #endregion
- #region Digivolution cards' colors
- public List<CardColor> DigivolutionCardsColors
- {
- get
- {
- List<CardColor> cardColors = new List<CardColor>();
- foreach (CardSource cardSource in DigivolutionCards)
- {
- foreach (CardColor cardColor in cardSource.CardColors)
- {
- if (!cardColors.Contains(cardColor))
- {
- cardColors.Add(cardColor);
- }
- }
- }
- return cardColors.Distinct().ToList();
- }
- }
- #endregion
- #region Show "Unsuspend" effect object
- public void ShowUnsuspendEffect()
- {
- if (TopCard != null)
- {
- if (ShowingPermanentCard != null)
- {
- if (ShowingPermanentCard.WillUntapObject != null)
- {
- ShowingPermanentCard.WillUntapObject.transform.parent.gameObject.SetActive(true);
- ShowingPermanentCard.WillUntapObject.SetActive(true);
- }
- }
- }
- }
- #endregion
- #region Show "Return to deck" effect object
- public void ShowDeckBounceEffect()
- {
- if (TopCard != null)
- {
- if (willBeRemoveField)
- {
- if (ShowingPermanentCard != null)
- {
- if (ShowingPermanentCard.WillBeDeckBounceObject != null)
- {
- ShowingPermanentCard.WillBeDeckBounceObject.transform.parent.gameObject.SetActive(true);
- ShowingPermanentCard.WillBeDeckBounceObject.SetActive(true);
- }
- }
- }
- }
- }
- #endregion
- #region Hide "Return to deck" effect object
- public void HideDeckBounceEffect()
- {
- if (TopCard != null)
- {
- if (ShowingPermanentCard != null)
- {
- if (ShowingPermanentCard.WillBeDeckBounceObject != null)
- {
- ShowingPermanentCard.WillBeDeckBounceObject.SetActive(false);
- }
- }
- }
- }
- #endregion
- #region Show "Return to hand" effect object
- public void ShowHandBounceEffect()
- {
- if (TopCard != null)
- {
- if (willBeRemoveField)
- {
- if (ShowingPermanentCard != null)
- {
- if (ShowingPermanentCard.WillBeHandBounceObject != null)
- {
- ShowingPermanentCard.WillBeHandBounceObject.transform.parent.gameObject.SetActive(true);
- ShowingPermanentCard.WillBeHandBounceObject.SetActive(true);
- }
- }
- }
- }
- }
- #endregion
- #region Hide "Return to hand" effect object
- public void HideHandBounceEffect()
- {
- if (TopCard != null)
- {
- if (ShowingPermanentCard != null)
- {
- if (ShowingPermanentCard.WillBeHandBounceObject != null)
- {
- ShowingPermanentCard.WillBeHandBounceObject.SetActive(false);
- }
- }
- }
- }
- #endregion
- #region Show "Delete" effect object
- public void ShowDeleteEffect()
- {
- if (TopCard != null)
- {
- if (willBeRemoveField)
- {
- if (ShowingPermanentCard != null)
- {
- if (ShowingPermanentCard.WillBeDeletedObject != null)
- {
- ShowingPermanentCard.WillBeDeletedObject.transform.parent.gameObject.SetActive(true);
- ShowingPermanentCard.WillBeDeletedObject.SetActive(true);
- }
- }
- }
- }
- }
- #endregion
- #region Hide "Delete" effect object
- public void HideDeleteEffect()
- {
- if (TopCard != null)
- {
- if (ShowingPermanentCard != null)
- {
- if (ShowingPermanentCard.WillBeDeletedObject != null)
- {
- ShowingPermanentCard.WillBeDeletedObject.SetActive(false);
- }
- }
- }
- }
- #endregion
- #region Show "Remove Field" effect object
- public void ShowWillRemoveFieldEffect()
- {
- if (TopCard != null)
- {
- if (willBeRemoveField)
- {
- if (ShowingPermanentCard != null)
- {
- if (ShowingPermanentCard.WillRemoveFieldObject != null)
- {
- ShowingPermanentCard.WillRemoveFieldObject.transform.parent.gameObject.SetActive(true);
- ShowingPermanentCard.WillRemoveFieldObject.SetActive(true);
- }
- }
- }
- }
- }
- #endregion
- #region Hide "Remove Field" effect object
- public void HideWillRemoveFieldEffect()
- {
- if (TopCard != null)
- {
- if (ShowingPermanentCard != null)
- {
- if (ShowingPermanentCard.WillRemoveFieldObject != null)
- {
- ShowingPermanentCard.WillRemoveFieldObject.SetActive(false);
- }
- }
- }
- }
- #endregion
- #region Show "Digivolution" effect object
- public void ShowWillEvolutionEffect()
- {
- if (TopCard != null)
- {
- if (ShowingPermanentCard != null)
- {
- if (ShowingPermanentCard.WillEvolutionObject != null)
- {
- ShowingPermanentCard.WillEvolutionObject.transform.parent.gameObject.SetActive(true);
- ShowingPermanentCard.WillEvolutionObject.SetActive(true);
- }
- }
- }
- }
- #endregion
- #region Hide "Digivolution" effect object
- public void HideWillEvolutionEffect()
- {
- if (TopCard != null)
- {
- if (ShowingPermanentCard != null)
- {
- if (ShowingPermanentCard.WillEvolutionObject != null)
- {
- ShowingPermanentCard.WillEvolutionObject.SetActive(false);
- }
- }
- }
- }
- #endregion
- }
|