private static IEnumerator<bool> LinearLaserOption(PlayerOption option, OptionInitializationInformation info) { var s = false; var ps = false; var la = false; PlayerLinearLaser ls = null; while (true) { s = option.Parent.IsShottableTiming; if (!ps && s) { la = true; ls = new PlayerLinearLaser(option, LinearLaserMarisaStyle, 8, CommonObjects.ImageLaser8) { Angle = GetAngle(info.Direction) ?? 0, X = option.X, Y = option.Y }; option.ParentManager.Add(ls, (int)GameLayer.PlayerBullet); } if (ps && !s) { la = false; ls.AddSubOperation(LaserThrowAway(ls.Angle, 20)); } if (la) { ls.X = option.X; ls.Y = option.Y; } ps = s; yield return true; } }
private static IEnumerator<bool> LinearLaserMarisaStyle(UserSprite par, PlayerLinearLaser laser) { laser.BrightR = (byte)((long)par.SourceUser.Id & 0xFF); laser.BrightG = (byte)((long)(par.SourceUser.Id >> 8) & 0xFF); laser.BrightB = (byte)((long)(par.SourceUser.Id >> 16) & 0xFF); while (true) { if (laser.Length < 800) laser.Length += 20; yield return true; } }