Exemple #1
0
        private ChipEntry ChipEntryFromChipBase(ChipBase chipBase, int id)
        {
            var chipDisplayId = (chipBase is DammyChip) ? id.ToString() : chipBase.libraryDisplayId ?? chipBase.number.ToString();
            var chipIsSeen    = !(chipBase is DammyChip) && this.savedata.datelist[id - 1];

            return(new ChipEntry {
                IsSeen = chipIsSeen, Chip = chipBase, DisplayId = chipDisplayId
            });
        }
Exemple #2
0
        public override void Updata()
        {
            if (!this.parent.blackOut)
            {
                base.Updata();

                if (this.controller == this)
                {
                    this.infoPanel.ForcedShowState = null;
                    this.blackoutAdaptChip         = null;

                    foreach (var b in this.controlledBarriers)
                    {
                        b.blackOutObject             = false;
                        b.blackoutBuildupInterrupted = false;
                        b.blackoutWaittime           = 0;
                    }
                }
            }
            else
            {
                // redundant check since only flagged objs run during blackout
                // harmless, but explicitly should only run if it's the "main" one
                if (this.blackOutObject)
                {
                    this.controller.infoPanel.ForcedShowState = false;

                    if (this.controller.preAdaptWaitTime != null && parent.blackOutChips[0] != this.controller.blackoutAdaptChip)
                    {
                        foreach (CharacterBase characterBase in parent.AllChara())
                        {
                            if (characterBase.number == parent.blackOutChips[0].userNum)
                            {
                                characterBase.waittime = this.controller.preAdaptWaitTime.Value;
                            }
                        }
                        this.controller.preAdaptWaitTime = null;
                    }

                    foreach (var b in this.controller.controlledBarriers)
                    {
                        if (b.blackoutSimulhitPossible)
                        {
                            b.blackoutSimulhitPossible = false;
                        }
                    }
                }

                this.blackoutWaittime++;
            }
        }
Exemple #3
0
        public override void Dameged(AttackBase attack)
        {
            if (attack is Dummy)
            {
                return;
            }

            if (this.state == MOTION.Absorbing)
            {
                if (this.parent.blackOut && this.controller.blackoutAdaptChip == null && this.controller.preAdaptWaitTime == null)
                {
                    foreach (CharacterBase characterBase in this.parent.AllChara())
                    {
                        if (characterBase.number == parent.blackOutChips[0].userNum)
                        {
                            this.controller.preAdaptWaitTime = characterBase.waittime;
                        }
                    }

                    this.controller.blackoutAdaptChip = new DammyChip(this.sound);
                    var adaptText = ShanghaiEXE.Translate("Enemy.HeavenBarrierSpecial");
                    this.controller.blackoutAdaptChip.BlackOut(this, this.parent, adaptText, "");
                }

                if (this.parent.blackOut)
                {
                    if (!this.controller.controlledBarriers.Any(b => b.blackOutObject))
                    {
                        this.blackOutObject = true;

                        foreach (var b in this.controller.controlledBarriers)
                        {
                            if (b == this)
                            {
                                continue;
                            }

                            b.blackoutSimulhitPossible = true;
                        }
                    }
                }

                if (!this.parent.blackOut || this.blackOutObject || this.blackoutSimulhitPossible)
                {
                    var attackDamage = this.lastDamage;
                    if (attackDamage == -1)
                    {
                        attackDamage = attack.DamageMath(this);
                    }

                    var remainingDamage = this.controller.totalHp - this.controller.rawDamageTaken;
                    var cappedDamage    = Math.Min(attackDamage, remainingDamage);
                    this.controller.rawDamageTakenSinceLastUpdate += cappedDamage;

                    this.controller.unprocessedAttacks.Add(Tuple.Create(this, attack.Element, cappedDamage));
                }
                else if (this.parent.blackOut && !this.blackoutBuildupInterrupted)
                {
                    this.sound.PlaySE(SoundEffect.bound);

                    var effectiveEffect = new Elementhit(this.sound, this.parent, this.positionDirect, 1, this.position, ChipBase.ELEMENT.eleki);
                    effectiveEffect.blackOutObject = true;
                    this.parent.effects.Add(effectiveEffect);

                    this.invincibility     = true;
                    this.invincibilitytime = 1;
                    // alpha increases by 15 per tick, if not exact then overflows and wraps around
                    this.alfha = byte.MaxValue - (15 * 8);

                    // TODO: Effects
                    this.blackoutBuildupInterrupted = true;
                }

                this.lastDamage = -1;
            }
        }