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; } }