-
-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
763 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
src/Snap.Hutao/Snap.Hutao/Model/Binding/Cultivation/CultivateItemHelper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// Copyright (c) DGP Studio. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
namespace Snap.Hutao.Model.Binding.Cultivation; | ||
|
||
/// <summary> | ||
/// 养成物品帮助类 | ||
/// </summary> | ||
public static class CultivateItemHelper | ||
{ | ||
/// <summary> | ||
/// 判断是否为当日物品 | ||
/// </summary> | ||
/// <param name="itemId">材料Id</param> | ||
/// <param name="now">时间</param> | ||
/// <returns>是否为当日物品</returns> | ||
public static bool IsTodaysMaterial(int itemId, DateTimeOffset now) | ||
{ | ||
DateTimeOffset utcNow = now.ToUniversalTime(); | ||
utcNow = utcNow.AddHours(4); | ||
DayOfWeek dayOfWeek = utcNow.DayOfWeek; | ||
|
||
return dayOfWeek switch | ||
{ | ||
DayOfWeek.Monday or DayOfWeek.Thursday => itemId switch | ||
{ | ||
104301 or 104302 or 104303 => true, // 「自由」 | ||
104310 or 104311 or 104312 => true, // 「繁荣」 | ||
104320 or 104321 or 104322 => true, // 「浮世」 | ||
104329 or 104330 or 104331 => true, // 「诤言」 | ||
114001 or 114002 or 114003 or 114004 => true, // 高塔孤王 | ||
114013 or 114014 or 114015 or 114016 => true, // 孤云寒林 | ||
114025 or 114026 or 114027 or 114028 => true, // 远海夷地 | ||
114037 or 114038 or 114039 or 114040 => true, // 谧林涓露 | ||
_ => false, | ||
}, | ||
DayOfWeek.Tuesday or DayOfWeek.Friday => itemId switch | ||
{ | ||
104304 or 104305 or 104306 => true, // 「抗争」 | ||
104313 or 104314 or 104315 => true, // 「勤劳」 | ||
104323 or 104324 or 104325 => true, // 「风雅」 | ||
104332 or 104333 or 104334 => true, // 「巧思」 | ||
114005 or 114006 or 114007 or 114008 => true, // 凛风奔狼 | ||
114017 or 114018 or 114019 or 114020 => true, // 雾海云间 | ||
114029 or 114030 or 114031 or 114032 => true, // 鸣神御灵 | ||
114041 or 114042 or 114043 or 114044 => true, // 绿洲花园 | ||
_ => false, | ||
}, | ||
DayOfWeek.Wednesday or DayOfWeek.Saturday => itemId switch | ||
{ | ||
104307 or 104308 or 104309 => true, // 「诗文」 | ||
104316 or 104317 or 104318 => true, // 「黄金」 | ||
104326 or 104327 or 104328 => true, // 「天光」 | ||
104335 or 104336 or 104337 => true, // 「笃行」 | ||
114009 or 114010 or 114011 or 114012 => true, // 狮牙斗士 | ||
114021 or 114022 or 114023 or 114024 => true, // 漆黑陨铁 | ||
114033 or 114034 or 114035 or 114036 => true, // 今昔剧画 | ||
114045 or 114046 or 114047 or 114048 => true, // 谧林涓露 | ||
_ => false, | ||
}, | ||
_ => false, | ||
}; | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
src/Snap.Hutao/Snap.Hutao/Model/Binding/Hutao/CookBonusView.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright (c) DGP Studio. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
using Snap.Hutao.Model.Metadata; | ||
using Snap.Hutao.Model.Metadata.Avatar; | ||
using Snap.Hutao.Model.Primitive; | ||
|
||
namespace Snap.Hutao.Model.Binding.Hutao; | ||
|
||
/// <summary> | ||
/// 料理奖励视图 | ||
/// </summary> | ||
public class CookBonusView | ||
{ | ||
/// <summary> | ||
/// 原型 | ||
/// </summary> | ||
public Material OriginItem { get; set; } = default!; | ||
|
||
/// <summary> | ||
/// 名称 | ||
/// </summary> | ||
public Material Item { get; set; } = default!; | ||
|
||
/// <summary> | ||
/// 创建一个新的料理奖励视图 | ||
/// </summary> | ||
/// <param name="cookBonus">料理奖励</param> | ||
/// <param name="idMaterialMap">材料映射</param> | ||
/// <returns>新的料理奖励视图</returns> | ||
public static CookBonusView? Create(CookBonus? cookBonus, Dictionary<MaterialId, Material> idMaterialMap) | ||
{ | ||
if (cookBonus == null) | ||
{ | ||
return null; | ||
} | ||
|
||
CookBonusView view = new() | ||
{ | ||
OriginItem = idMaterialMap[cookBonus.OriginItemId], | ||
Item = idMaterialMap[cookBonus.ItemId], | ||
}; | ||
|
||
return view; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/Snap.Hutao/Snap.Hutao/Model/InterChange/Inventory/UIIFItem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright (c) DGP Studio. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
using System.Collections.Immutable; | ||
|
||
namespace Snap.Hutao.Model.InterChange.Inventory; | ||
|
||
/// <summary> | ||
/// UIIF物品 | ||
/// </summary> | ||
internal class UIIFItem | ||
{ | ||
/// <summary> | ||
/// 物品Id | ||
/// </summary> | ||
[JsonPropertyName("itemId")] | ||
public int ItemId { get; set; } | ||
|
||
/// <summary> | ||
/// 物品Id | ||
/// </summary> | ||
[JsonPropertyName("count")] | ||
public int Count { get; set; } | ||
|
||
/// <summary> | ||
/// 等级 | ||
/// Reliquary/Weapon | ||
/// </summary> | ||
[JsonPropertyName("level")] | ||
public int? Level { get; set; } | ||
|
||
/// <summary> | ||
/// 副属性列表 | ||
/// Reliquary | ||
/// </summary> | ||
[JsonPropertyName("appendPropIdList")] | ||
public List<int>? AppendPropIdList { get; set; } = default!; | ||
|
||
/// <summary> | ||
/// 精炼等级 0-4 | ||
/// Weapon | ||
/// </summary> | ||
[JsonPropertyName("promoteLevel")] | ||
public int? PromoteLevel { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// Copyright (c) DGP Studio. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
namespace Snap.Hutao.Model.Intrinsic; | ||
|
||
/// <summary> | ||
/// 材料类型 | ||
/// </summary> | ||
[SuppressMessage("", "SA1602")] | ||
public enum MaterialType | ||
{ | ||
MATERIAL_NONE = 0, | ||
MATERIAL_FOOD = 1, | ||
MATERIAL_QUEST = 2, | ||
MATERIAL_EXCHANGE = 4, | ||
MATERIAL_CONSUME, | ||
MATERIAL_EXP_FRUIT, | ||
MATERIAL_AVATAR, | ||
MATERIAL_ADSORBATE, | ||
MATERIAL_CRICKET, | ||
MATERIAL_ELEM_CRYSTAL, | ||
MATERIAL_WEAPON_EXP_STONE, | ||
MATERIAL_CHEST, | ||
MATERIAL_RELIQUARY_MATERIAL, | ||
MATERIAL_AVATAR_MATERIAL, | ||
MATERIAL_NOTICE_ADD_HP, | ||
MATERIAL_SEA_LAMP, | ||
MATERIAL_SELECTABLE_CHEST, | ||
MATERIAL_FLYCLOAK, | ||
MATERIAL_NAMECARD, | ||
MATERIAL_TALENT, | ||
MATERIAL_WIDGET, | ||
MATERIAL_CHEST_BATCH_USE, | ||
MATERIAL_FAKE_ABSORBATE, | ||
MATERIAL_CONSUME_BATCH_USE, | ||
MATERIAL_WOOD, | ||
MATERIAL_FURNITURE_FORMULA = 27, | ||
MATERIAL_CHANNELLER_SLAB_BUFF, | ||
MATERIAL_FURNITURE_SUITE_FORMULA, | ||
MATERIAL_COSTUME, | ||
MATERIAL_HOME_SEED, | ||
MATERIAL_FISH_BAIT, | ||
MATERIAL_FISH_ROD, | ||
MATERIAL_SUMO_BUFF, // never appear | ||
MATERIAL_FIREWORKS, | ||
MATERIAL_BGM, | ||
MATERIAL_SPICE_FOOD, | ||
MATERIAL_ACTIVITY_ROBOT, | ||
MATERIAL_ACTIVITY_GEAR, | ||
MATERIAL_ACTIVITY_JIGSAW, | ||
MATERIAL_ARANARA, | ||
MATERIAL_GCG_CARD, | ||
MATERIAL_GCG_CARD_FACE, // 影幻卡面 | ||
MATERIAL_GCG_CARD_BACK, | ||
MATERIAL_GCG_FIELD, | ||
MATERIAL_DESHRET_MANUAL, | ||
MATERIAL_RENAME_ITEM, | ||
MATERIAL_GCG_EXCHANGE_ITEM, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.