コード例 #1
0
        void RunDialog(MissionDialog dlg)
        {
            var netdlg = new NetDlgLine[dlg.Lines.Count];

            for (int i = 0; i < dlg.Lines.Count; i++)
            {
                var d    = dlg.Lines[i];
                var src  = msn.Ships.First((x) => x.Nickname.Equals(d.Source, StringComparison.OrdinalIgnoreCase));
                var npc  = msn.NPCs.First((x) => x.Nickname.Equals(src.NPC, StringComparison.OrdinalIgnoreCase));
                var hash = FLHash.CreateID(d.Line);
                lock (waitingLines)
                {
                    waitingLines.Add(new PendingLine()
                    {
                        Hash = hash, Line = d.Line
                    });
                }
                netdlg[i] = new NetDlgLine()
                {
                    Voice = npc.Voice,
                    Hash  = hash
                };
            }
            player.PlayDialog(netdlg);
        }
コード例 #2
0
        void RunDialog(MissionDialog dlg, int index = 0)
        {
            if (index >= dlg.Lines.Count)
            {
                return;
            }
            var d    = dlg.Lines[index];
            var src  = msn.Ships.First((x) => x.Nickname.Equals(d.Source, StringComparison.OrdinalIgnoreCase));
            var npc  = msn.NPCs.First((x) => x.Nickname.Equals(src.NPC, StringComparison.OrdinalIgnoreCase));
            var hash = FLHash.CreateID(d.Line);

            session.Game.Sound.PlayVoiceLine(npc.Voice, hash, () =>
            {
                finishedLines.Add(d.Line);
                RunDialog(dlg, index + 1);
            });
        }
コード例 #3
0
        IEnumerable <NetSoldShip> GetSoldShips()
        {
            var b = Game.GameData.GetBase(Base);

            foreach (var s in b.SoldShips)
            {
                ulong goodsPrice = 0;
                foreach (var eq in s.Package.Addons)
                {
                    goodsPrice += (ulong)((long)GetUnitPrice(eq.Equipment) * eq.Amount);
                }
                yield return(new NetSoldShip()
                {
                    ShipCRC = (int)FLHash.CreateID(s.Package.Ship),
                    PackageCRC = (int)FLHash.CreateID(s.Package.Nickname),
                    HullPrice = (ulong)s.Package.BasePrice,
                    PackagePrice = (ulong)s.Package.BasePrice + goodsPrice
                });
            }
        }