diff --git a/Config/Config.json b/Config/Config.json index c7eb11d..e0374f1 100644 --- a/Config/Config.json +++ b/Config/Config.json @@ -2,117 +2,272 @@ "PlayerInitMoveSpeed": 5, "PlayerInitThrowDistance": 10, "PlayerInitSightRange": 9, + "ItemMoveSpeed": 10, - "RunnerTalentExtraMoveSpeed": 2, - "StrenthTalentExtraThrowDistance": 5, + "TigerShoeExtraMoveSpeed": 2, + "TechnicianTigerShoeExtraMoveSpeed": 3, + "SpeedBuffExtraMoveSpeed": 5, "SpeedBuffDuration": 20000, - "StrenthBuffExtraThrowDistance": 10, + "TechnicianSpeedBuffDuration": 30000, + + "StrenthBuffExtraThrowDistance": 5, "StrenthBuffDuration": 40000, + "TechnicianStrenthBuffDuration": 60000, + "TeleScopeExtraSightRange": 4, + "TechnicianTeleScopeExtraSightRange": 6, + + "CondimentScoreParameter": 0.3, + "CookCondimentScoreParameter": 0.5, + + "SpaceGateMaxDistance": 10, + "TechnicianSpaceGateMaxDistance": 15, + "WaveGlueExtraMoveSpeed": -3, "WaveGlueDuration": 30000, + "MineScore": -50, + "TechnicianMineScore": -100, + "TrapStunDuration": 5000, + "TechnicianTrapStunDuration": 8000, + "TaskTimeLimit": 60000, "TaskRefreshTime": 8000, + + "ToolRefreshTime": 10000, + "FoodPointInitRefreshTime": 10000, - "Apple": { - "Score": 10, - "TaskTime": 60000 - }, - "Banana": { - "Score": 10, - "TaskTime": 60000 + + "LuckTalentRefreshTime": 30000, + + "RunnerTalentExtraMoveSpeed": 3, + + "StrenthTalentExtraThrowDistance": 5, + + + + "Wheat": { + "Score": 0 }, - "Potato": { - "Score": 10, - "TaskTime": 60000 + + "Rice": { + "Score": 0 }, + "Tomato": { - "Score": 20, - "TaskTime": 60000 + "Score": 0 }, + "Egg": { - "Score": 10, - "TaskTime": 60000 + "Score": 0 }, - "Flour": { - "Score": 10, - "TaskTime": 60000 + + "Milk": { + "Score": 0 }, - "Chicken": { - "Score": 20, - "TaskTime": 50000 + + "Apple": { + "Score": 0 }, - "Pork": { - "Score": 20, - "TackTime": 50000 + + "Banana": { + "Score": 0 + }, + + "DarkPlum": { + "Score": 0 + }, + + "Hawthorn": { + "Score": 0 }, + + "Strawberry": { + "Score": 0 + }, + "Beef": { - "Score": 20, - "TaskTime": 50000 + "Score": 20 }, - "Honey": { - "Score": 20, - "TaskTime": 50000 + + "Pork": { + "Score": 20 + }, + + "ChickenMeat": { + "Score": 20 + }, + + "Potato": { + "Score": 20 + }, + + "Lettuce": { + "Score": 20 + }, + + "Agaric": { + "Score": 20 }, - "Butter": { - "Score": 10, - "TaskTime": 50000 + + "NeedleMushroom": { + "Score": 20 }, - "Romaine": { - "Score": 10, - "TaskTime": 60000 + + "Cabbage": { + "Score": 20 }, + + "Flour": { + "Score": 0, + "CookTime": 10000 + }, + + "Noodle": { + "Score": 0, + "CookTime": 10000 + }, + "Bread": { - "Score": 40, - "TaskTime": 40000, - "CookTime": 5000 + "Score": 0, + "CookTime": 10000 + }, + + "CookedRice": { + "Score": 0, + "CookTime": 10000 + }, + + "Ketchup": { + "Score": 0, + "CookTime": 10000 + }, + + "Cream": { + "Score": 0, + "CookTime": 10000 }, - "BasicHamburger": { + + "TomatoFriedEgg": { "Score": 50, - "TaskTime": 40000, - "CookTime": 5000 + "TaskTime": 60000, + "CookTime": 10000 + }, + + "TomatoFriedEggNoodle": { + "Score": 0, + "TaskTime": 90000, + "CookTime": 15000 }, - "GoodHamburger": { + + "BeefNoodle": { "Score": 80, - "TaskTime": 30000, - "CookTime": 6000 - }, - "BananaPie": { - "Score": 40, - "TaskTime": 40000, - "CookTime": 5000 - }, - "ApplePie": { - "Score": 40, - "TaskTime": 40000, - "CookTime": 5000 - }, - "TomatoEgg": { - "Score": 40, - "TaskTime": 40000, - "CookTime": 5000 - }, - "MashedPotato": { - "Score": 40, - "TaskTime": 40000, - "CookTime": 5000 - }, - "DarkDish": { - "Score": -10, + "TaskTime": 90000, + "CookTime": 20000 + }, + + "OverRice": { + "Score": 90, + "TaskTime": 90000, + "CookTime": 20000 + }, + + "HuangMenJi": { + "Score": 100, + "TaskTime": 90000, + "CookTime": 20000 + }, + + "Barbecue": { + "Score": 55, + "TaskTime": 90000, + "CookTime": 20000 + }, + + "FrenchFries": { + "Score": 60, + "TaskTime": 90000, + "CookTime": 15000 + }, + + "PlumJuice": { + "Score": 50, + "TaskTime": 90000, + "CookTime": 10000 + }, + + "Hamburger": { + "Score": 110, + "TaskTime": 100000, + "CookTime": 20000 + }, + + "StrawberryIcecream": { + "Score": 60, + "TaskTime": 90000, + "CookTime": 10000 + }, + + "PopcornChicken": { + "Score": 60, + "TaskTime": 90000, + "CookTime": 15000 + }, + + "AgaricFriedEgg": { + "Score": 50, + "TaskTime": 90000, + "CookTime": 15000 + }, + + "Cake": { + "Score": 160, + "TaskTime": 120000, + "CookTime": 30000 + }, + + "BingTangHuLu": { + "Score": 20, "TaskTime": 60000, - "CookTime": 5000 + "CookTime": 10000 + }, + + "FruitSalad": { + "Score": 100, + "TaskTime": 120000, + "CookTime": 20000 + }, + + "XiangGuo": { + "Score": 0, + "TaskTime": 300000, + "CookTime": 60000 }, + "CookingTable": { - "Flour": "Bread", - "BeefBread": "BasicHamburger", - "BeefRomaineBread": "GoodHamburger", - "AppleFlour": "ApplePie", - "BananaFlour": "BananaPie", - "TamatoEgg": "TomatoEgg", - "PotatoButter": "MashedPotato" + "Wheat": "Flour", + "Flour": "Noodle", + "EggFlour": "Bread", + "Rice": "CookedRice", + "Tomato": "Ketchup", + "Milk": "Cream", + "TomatoEgg": "TomatoFriedEgg", + "NoodleTomatoFriedEgg": "TomatoFriedEggNoodle", + "BeefNoodle": "BeefNoodle", + "PorkCabbageRice": "OverRice", + "ChickenMeatPotatoRice": "HuangMenJi", + "LettucePork": "Barbecue", + "PotatoKetchup": "FrenchFries", + "DarkPlumHawthorn": "PlumJuice", + "BeefLettuceBread": "Hamburger", + "StrawberryCream": "StrawberryIcecream", + "ChickenMeatKetchup": "PopcornChicken", + "EggAgaric": "AgaricFriedEgg", + "EggStrawberryFlourCream": "Cake", + "Hawthorn": "BingTangHuLu", + "TomatoAppleBananaStrawberry": "FruitSalad" } } \ No newline at end of file diff --git a/communication/Proto/MessageToClient.cs b/communication/Proto/MessageToClient.cs index ca81cab..6af34d4 100644 --- a/communication/Proto/MessageToClient.cs +++ b/communication/Proto/MessageToClient.cs @@ -105,33 +105,57 @@ public enum BlockTypeMessage { public enum DishTypeMessage { [pbr::OriginalName("DishEmpty")] DishEmpty = 0, - [pbr::OriginalName("Apple")] Apple = 1, - [pbr::OriginalName("Banana")] Banana = 2, - [pbr::OriginalName("Potato")] Potato = 3, - [pbr::OriginalName("Tomato")] Tomato = 4, - [pbr::OriginalName("Egg")] Egg = 5, - [pbr::OriginalName("Flour")] Flour = 6, - [pbr::OriginalName("Chicken")] Chicken = 7, - [pbr::OriginalName("Pork")] Pork = 8, - [pbr::OriginalName("Beef")] Beef = 9, - [pbr::OriginalName("Honey")] Honey = 10, - [pbr::OriginalName("Butter")] Butter = 11, - [pbr::OriginalName("Romaine")] Romaine = 12, - /// - ///以下为菜品 - /// - [pbr::OriginalName("DishTypeSize1")] DishTypeSize1 = 13, - [pbr::OriginalName("Bread")] Bread = 14, - [pbr::OriginalName("BasicHamburger")] BasicHamburger = 15, - [pbr::OriginalName("GoodHamburger")] GoodHamburger = 16, - [pbr::OriginalName("ApplePie")] ApplePie = 17, - [pbr::OriginalName("BananaPie")] BananaPie = 18, - [pbr::OriginalName("TomatoEgg")] TomatoEgg = 19, - [pbr::OriginalName("MashedPotato")] MashedPotato = 20, - [pbr::OriginalName("DishTypeSize2")] DishTypeSize2 = 21, - [pbr::OriginalName("OverCookedDish")] OverCookedDish = 22, - [pbr::OriginalName("DarkDish")] DarkDish = 23, - [pbr::OriginalName("DishTypeSize3")] DishTypeSize3 = 24, + [pbr::OriginalName("Wheat")] Wheat = 1, + [pbr::OriginalName("Rice")] Rice = 2, + [pbr::OriginalName("Tomato")] Tomato = 3, + [pbr::OriginalName("Egg")] Egg = 4, + [pbr::OriginalName("Milk")] Milk = 5, + [pbr::OriginalName("Apple")] Apple = 6, + [pbr::OriginalName("Banana")] Banana = 7, + [pbr::OriginalName("DarkPlum")] DarkPlum = 8, + [pbr::OriginalName("Hawthorn")] Hawthorn = 9, + [pbr::OriginalName("Strawberry")] Strawberry = 10, + [pbr::OriginalName("Beef")] Beef = 11, + [pbr::OriginalName("Pork")] Pork = 12, + [pbr::OriginalName("ChickenMeat")] ChickenMeat = 13, + [pbr::OriginalName("Potato")] Potato = 14, + [pbr::OriginalName("Lettuce")] Lettuce = 15, + [pbr::OriginalName("Agaric")] Agaric = 16, + [pbr::OriginalName("NeedleMushroom")] NeedleMushroom = 17, + [pbr::OriginalName("Cabbage")] Cabbage = 18, + [pbr::OriginalName("Size1")] Size1 = 19, + [pbr::OriginalName("Flour")] Flour = 20, + [pbr::OriginalName("Noodle")] Noodle = 21, + [pbr::OriginalName("Bread")] Bread = 22, + [pbr::OriginalName("CookedRice")] CookedRice = 23, + [pbr::OriginalName("Ketchup")] Ketchup = 24, + [pbr::OriginalName("Cream")] Cream = 25, + [pbr::OriginalName("TomatoFriedEgg")] TomatoFriedEgg = 26, + [pbr::OriginalName("TomatoFriedEggNoodle")] TomatoFriedEggNoodle = 27, + [pbr::OriginalName("BeefNoodle")] BeefNoodle = 28, + [pbr::OriginalName("OverRice")] OverRice = 29, + [pbr::OriginalName("HuangMenJi")] HuangMenJi = 30, + [pbr::OriginalName("Barbecue")] Barbecue = 31, + [pbr::OriginalName("FrenchFries")] FrenchFries = 32, + [pbr::OriginalName("PlumJuice")] PlumJuice = 33, + [pbr::OriginalName("Hamburger")] Hamburger = 34, + [pbr::OriginalName("StrawberryIcecream")] StrawberryIcecream = 35, + [pbr::OriginalName("PopcornChicken")] PopcornChicken = 36, + [pbr::OriginalName("AgaricFriedEgg")] AgaricFriedEgg = 37, + [pbr::OriginalName("Cake")] Cake = 38, + [pbr::OriginalName("BingTangHuLu")] BingTangHuLu = 39, + [pbr::OriginalName("FruitSalad")] FruitSalad = 40, + [pbr::OriginalName("XiangGuo")] XiangGuo = 41, + [pbr::OriginalName("XiangGuo_3")] XiangGuo_3 = 42, + [pbr::OriginalName("XiangGuo_4")] XiangGuo_4 = 43, + [pbr::OriginalName("XiangGuo_5")] XiangGuo_5 = 44, + [pbr::OriginalName("XiangGuo_6")] XiangGuo_6 = 45, + [pbr::OriginalName("XiangGuo_7")] XiangGuo_7 = 46, + [pbr::OriginalName("XiangGuo_8")] XiangGuo_8 = 47, + [pbr::OriginalName("Size2")] Size2 = 48, + [pbr::OriginalName("OverCookedDish")] OverCookedDish = 49, + [pbr::OriginalName("DarkDish")] DarkDish = 50, + [pbr::OriginalName("Size3")] Size3 = 51, } public enum ToolTypeMessage { diff --git a/communication/Proto/MessageToServer.cs b/communication/Proto/MessageToServer.cs index b4c2037..bcaf7b7 100644 --- a/communication/Proto/MessageToServer.cs +++ b/communication/Proto/MessageToServer.cs @@ -90,6 +90,7 @@ public MessageToServer(MessageToServer other) : this() { isThrowDish_ = other.isThrowDish_; useType_ = other.useType_; speakText_ = other.speakText_; + parameter_= other.parameter_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } @@ -186,6 +187,19 @@ public string SpeakText { } } + /// Field number for the "SpeakText" field. + public const int ParameterFieldNumber = 9; + private string parameter_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Parameter + { + get { return parameter_; } + set + { + parameter_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as MessageToServer); @@ -207,6 +221,7 @@ public bool Equals(MessageToServer other) { if (IsThrowDish != other.IsThrowDish) return false; if (UseType != other.UseType) return false; if (SpeakText != other.SpeakText) return false; + if (Parameter != other.Parameter) return false; return Equals(_unknownFields, other._unknownFields); } @@ -221,6 +236,7 @@ public override int GetHashCode() { if (IsThrowDish != false) hash ^= IsThrowDish.GetHashCode(); if (UseType != 0) hash ^= UseType.GetHashCode(); if (SpeakText.Length != 0) hash ^= SpeakText.GetHashCode(); + if (Parameter.Length != 0) hash ^= Parameter.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -266,6 +282,10 @@ public void WriteTo(pb::CodedOutputStream output) { output.WriteRawTag(66); output.WriteString(SpeakText); } + if (Parameter.Length != 0){ + output.WriteRawTag(76); + output.WriteString(Parameter); + } if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -298,6 +318,9 @@ public int CalculateSize() { if (SpeakText.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(SpeakText); } + if (Parameter.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Parameter); + } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -333,6 +356,9 @@ public void MergeFrom(MessageToServer other) { if (other.SpeakText.Length != 0) { SpeakText = other.SpeakText; } + if (other.Parameter.Length != 0) { + Parameter = other.Parameter; + } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -376,6 +402,10 @@ public void MergeFrom(pb::CodedInputStream input) { SpeakText = input.ReadString(); break; } + case 76: { + Parameter = input.ReadString(); + break; + } } } } diff --git a/communication/Proto/MessageToServer.proto b/communication/Proto/MessageToServer.proto index 7214fe5..f6147be 100644 --- a/communication/Proto/MessageToServer.proto +++ b/communication/Proto/MessageToServer.proto @@ -21,4 +21,5 @@ message MessageToServer { bool IsThrowDish = 6; int32 UseType = 7; string SpeakText = 8; + string Parameter = 9; } diff --git a/logic/Logic.Client/Client.cs b/logic/Logic.Client/Client.cs index 2454373..4a94ecc 100644 --- a/logic/Logic.Client/Client.cs +++ b/logic/Logic.Client/Client.cs @@ -91,12 +91,14 @@ public void RefreshFormLabelMethod(Int64 id_t, GameObjectMessage gameObjectMessa new System.Drawing.Point( (int)((gameObjectMessage.Position.X - 0.5) * GameForm.Form1.LABEL_WIDTH + Form1.HALF_LABEL_INTERVAL), Convert.ToInt32((WorldMap.Height - gameObjectMessage.Position.Y - 0.5) * GameForm.Form1.LABEL_WIDTH + Form1.HALF_LABEL_INTERVAL)); + Program.form.playerLabels[id_t].Text = gameObjectMessage.DishType.ToString(); break; case ObjTypeMessage.Tool: Program.form.playerLabels[id_t].Location = new System.Drawing.Point( (int)((gameObjectMessage.Position.X - 0.5) * GameForm.Form1.LABEL_WIDTH + Form1.HALF_LABEL_INTERVAL), Convert.ToInt32((WorldMap.Height - gameObjectMessage.Position.Y - 0.5) * GameForm.Form1.LABEL_WIDTH + Form1.HALF_LABEL_INTERVAL)); + Program.form.playerLabels[id_t].Text = gameObjectMessage.ToolType.ToString(); break; case ObjTypeMessage.Trigger: break; @@ -226,9 +228,17 @@ private void Operation() case 'x': Move(Direction.Down); break; case 'c': Move(Direction.RightDown); break; case 'f': Pick(); break; - case 'u': Use(1, 0); break; + case 'u': + { + if (tool == ToolType.SpaceGate) + { + Use(1, Console.ReadLine(), Console.ReadLine()); + } + + } + break; - case 'i': Use(0, 0); break; + case 'i': Use(0, "0"); break; case 'r': char temp = Console.ReadKey().KeyChar; if (temp >= '0' && temp <= '9') @@ -281,10 +291,11 @@ public override void Put(double distance, bool isThrowDish) messageToServer.CommandType = CommandTypeMessage.Put; ClientCommunication.SendMessage(messageToServer); } - public override void Use(int type, int parameter) + public override void Use(int type, string parameter_1 = "",string parameter_2="") { messageToServer.CommandType = CommandTypeMessage.Use; messageToServer.UseType = type; + messageToServer.Parameter = parameter_1 + "," + parameter_2; ClientCommunication.SendMessage(messageToServer); } public override void Pick() @@ -369,7 +380,7 @@ public void ChangeTaskLabel(MessageToClient msg) Program.form.ControlLabels["Task"].Text = "Task : "; foreach (var task in msg.Tasks) { - Program.form.ControlLabels["Task"].Text += "\n" + task; + Program.form.ControlLabels["Task"].Text += "\n" + (DishType)task; } } } diff --git a/logic/Logic.Constant/Character.cs b/logic/Logic.Constant/Character.cs index 43b1daa..8a0433a 100644 --- a/logic/Logic.Constant/Character.cs +++ b/logic/Logic.Constant/Character.cs @@ -13,14 +13,19 @@ public class Character : GameObject public Tuple CommunicationID = new Tuple(0, 0);//第一个数表示Agent,第二个数表示Client public int team = 0; public double GlueExtraMoveSpeed = 0; + public double SpeedBuffExtraMoveSpeed = 0; public double moveSpeed = (double)Configs["PlayerInitMoveSpeed"]; + public double MoveSpeed { get { return moveSpeed + GlueExtraMoveSpeed + SpeedBuffExtraMoveSpeed; } } public Direction facingDirection; + public int StrenthBuffThrowDistance = 0; public int MaxThrowDistance = (int)Configs["PlayerInitThrowDistance"]; public int SightRange = (int)(Configs["PlayerInitSightRange"]); - public TALENT talent; - protected int score = 0; - public DishType dish = DishType.Banana; - public ToolType tool = ToolType.Trap; + protected TALENT _talent = TALENT.None; + + protected int _score = 0; + + public DishType dish = DishType.Hawthorn; + public ToolType tool = ToolType.SpaceGate; public Character(double x, double y) : base(new XYPosition(x, y)) { Layer = (int)MapLayer.PlayerLayer; @@ -32,7 +37,7 @@ public virtual void Put(double distance, bool isThrowDish) { } public virtual void Pick() { } - public virtual void Use(int type, int parameter) + public virtual void Use(int type, string parameter_1,string parameter_2) { } } } diff --git a/logic/Logic.Constant/Constant.cs b/logic/Logic.Constant/Constant.cs index 94027d8..053f4dd 100644 --- a/logic/Logic.Constant/Constant.cs +++ b/logic/Logic.Constant/Constant.cs @@ -48,38 +48,65 @@ public enum BlockType Size } public enum DishType - { + {//不确定英文怎么说的直接用了拼音 Empty = 0,//空 - //以下为食材 - Apple, - Banana, - Potato, - Tomato, - Egg, - Flour, - Chicken, - Pork, - Beef, - Honey, - Butter, - Romaine, + //以下为食材 + Wheat,//麦子 + Rice,//水稻 + Tomato,//番茄 + Egg,//鸡蛋 + Milk,//牛奶 + Apple,//苹果 + Banana,//香蕉 + DarkPlum,//乌梅 + Hawthorn,//山楂 + Strawberry,//草莓 + Beef,//牛肉 + Pork,//猪肉 + ChickenMeat,//鸡肉 + Potato,//土豆 + Lettuce,//生菜 + Agaric,//木耳 + NeedleMushroom,//金针菇 + Cabbage,//包菜 Size1, + //以下为中间产物 + Flour,//面粉 + Noodle,//面条 + Bread,//面包片 + CookedRice,//米饭 + Ketchup,//番茄酱 + Cream,//奶油 //以下为菜品 - - Bread, - BasicHamburger, - GoodHamburger, - ApplePie, - BananaPie, - TomatoEgg, - MashedPotato, + TomatoFriedEgg,//番茄炒蛋 + TomatoFriedEggNoodle,//西红柿鸡蛋面 + BeefNoodle,//清青牛拉 + OverRice,//盖浇饭 + HuangMenJi,//黄焖鸡米饭 + Barbecue,//烤肉 + FrenchFries,//薯条 + PlumJuice,//酸梅汤 + Hamburger,//汉堡 + StrawberryIcecream,//草莓圣代 + PopcornChicken,//鸡米花 + AgaricFriedEgg,//木耳炒蛋 + Cake,//蛋糕 + BingTangHuLu,//冰糖葫芦 + FruitSalad,//水果色拉 + XiangGuo, + XiangGuo_3, + XiangGuo_4, + XiangGuo_5, + XiangGuo_6, + XiangGuo_7, + XiangGuo_8,//香锅 Size2, //以下为垃圾 - OverCookedDish, - DarkDish, + DarkDish,//黑暗料理 Size3 } + public enum ToolType { Empty = 0, @@ -91,15 +118,15 @@ public enum ToolType Fertilizer,//肥料 BreastPlate,//护心镜 SpaceGate,//传送门 - Eye,//眼 + //Eye,//眼 WaveGlue,//胶水 LandMine,//地雷 Trap,//陷阱 - FlashBomb,//闪光弹 - Hammer,//锤子 - Brick,//砖头 - Stealer,//分数偷取 + //FlashBomb,//闪光弹 + //Hammer,//锤子 + //Brick,//砖头 + //Stealer,//分数偷取 Size } @@ -124,12 +151,11 @@ public enum CommandType public enum TALENT { None, - Run, - Strenth, + Runner, + StrongMan, Cook, - Technology, - Luck, - Bag, - Drunk + Technician, + LuckyBoy, + //DrunkMan } } diff --git a/logic/Logic.Constant/MapInfo.cs b/logic/Logic.Constant/MapInfo.cs index cfbc7e8..865ee71 100644 --- a/logic/Logic.Constant/MapInfo.cs +++ b/logic/Logic.Constant/MapInfo.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.Text; -using Logic.Constant; +using THUnity2D; namespace Logic.Constant { diff --git a/logic/Logic.Server/Block.cs b/logic/Logic.Server/Block.cs index d4195af..b03771d 100644 --- a/logic/Logic.Server/Block.cs +++ b/logic/Logic.Server/Block.cs @@ -14,7 +14,7 @@ public class Block : Obj public Block(double x_t, double y_t, BlockType type_t) : base(x_t, y_t, ObjType.Block) { - if (type_t == BlockType.Wall) + if (type_t == BlockType.Wall || type_t == BlockType.FoodPoint || type_t == BlockType.TaskPoint) Layer = (int)MapLayer.WallLayer; else Layer = (int)MapLayer.BlockLayer; @@ -52,6 +52,7 @@ public override DishType GetDish(DishType t) case BlockType.Cooker: cookingResult = "Empty"; Cooking = false; + ProtectTimer.Change(0, 0); break; } return temp; @@ -89,32 +90,78 @@ protected void Cook(object o) Dish = (DishType)Enum.Parse(typeof(DishType), cookingResult); if (Dish > DishType.Empty && Dish < DishType.Size2 && Dish != DishType.Size1) { + if(Dish { ProtectedTeam = -1; }); + return _protectTimer; + } + } + + public override void UseCooker(int TeamNumber,TALENT t) { string Material = ""; SortedSet dishTypeSet = new SortedSet(); + bool XiangGuo = false; + if(WorldMap.Grid[(int)Position.x, (int)Position.y].ContainsType(typeof(Tool))) + { + foreach (Tool GameObject in WorldMap.Grid[(int)Position.x, (int)Position.y].GetType(typeof(Tool))) + { + if (GameObject.Tool == ToolType.Condiment) + { + GameObject.Parent = null; + XiangGuo = true; + break; + } + } + } foreach (Dish GameObject in WorldMap.Grid[(int)Position.x, (int)Position.y].GetType(typeof(Dish))) { dishTypeSet.Add(GameObject.Dish); GameObject.Parent = null; } if (dishTypeSet.Count == 0) return; - Cooking = true; - Dish = DishType.DarkDish;//未煮熟之前都是黑暗料理 - foreach (var dishType in dishTypeSet) + if (!XiangGuo) + { + Cooking = true; + ProtectedTeam = TeamNumber; + Dish = DishType.DarkDish;//未煮熟之前都是黑暗料理 + foreach (var dishType in dishTypeSet) + { + Material += dishType.ToString(); + } + cookingResult = (string)Configs["CookingTable"][Material]; + if (cookingResult == null) cookingResult = "DarkDish"; + CookingTimer.Change((int)Configs[cookingResult]["CookTime"], 0); + ProtectTimer.Change((int)(1.25 * (double)Configs[cookingResult]["CookTime"]), 0); + } + else { - Material += dishType.ToString(); + int score = 0; + foreach (var dishType in dishTypeSet) + { + score += (int)Configs[dishType.ToString()]["Score"]; + } + if (score < 60) return; + Cooking = true; + ProtectedTeam = TeamNumber; + Dish = DishType.DarkDish; + cookingResult = "XiangGuo_" + (score / 20).ToString(); + CookingTimer.Change((int)Configs["XiangGuo"]["CookTime"], 0); + ProtectTimer.Change((int)(1.25 * (double)Configs["XiangGuo"]["CookTime"]), 0); } - cookingResult = (string)Configs["CookingTable"][Material]; - if (cookingResult == null) cookingResult = "DarkDish"; - CookingTimer.Change((int)Configs[cookingResult]["CookTime"], 0); } //Cook End @@ -168,10 +215,11 @@ public static System.Threading.Timer RefreshTimer } public static void TaskProduce(object i) { - DishType temp; + DishType temp=DishType.Empty; for (; ; ) { - temp = (DishType)Program.Random.Next(1, (int)DishType.Size2); + if(Timer.Time.GameTime() 0) { - StunTimer.Change((int)Configs["TrapStunDuration"], 0); + StunTimer.Change(value, 0); } } } @@ -53,15 +54,33 @@ protected ToolType Tool Program.MessageToClient.GameObjectMessageList[this.ID].ToolType = (ToolTypeMessage)tool; } } - + public TALENT Talent + { + get { return _talent; } + set + { + _talent = value; + if (_talent == TALENT.Runner) moveSpeed += (double)(Configs["RunnerTalentExtraMoveSpeed"]); + else if (_talent == TALENT.StrongMan) MaxThrowDistance += (int)(Configs["StrenthTalentExtraMoveSpeed"]); + else if (_talent == TALENT.LuckyBoy) + { + LuckTalentTimer = new System.Threading.Timer(Item, null, 30000, (int)Configs["LuckTalentRefreshTime"]); + void Item(object i) + { + if (Tool == ToolType.Empty) Tool = (ToolType)Program.Random.Next(0, (int)ToolType.Size - 1); + else new Tool(Position.x, Position.y, (ToolType)Program.Random.Next(0, (int)ToolType.Size - 1)).Parent = WorldMap; + } + } + } + } protected int Score { - get { return score; } + get { return base._score; } set { - score = value; + base._score = value; lock (Program.MessageToClientLock) - Program.MessageToClient.GameObjectMessageList[this.ID].Score = score; + Program.MessageToClient.GameObjectMessageList[this.ID].Score = base._score; } } @@ -70,9 +89,18 @@ public Player(double x, double y) : { Parent = WorldMap; MoveStopTimer = new System.Threading.Timer((i) => { Velocity = new Vector(Velocity.angle, 0); status = CommandType.Stop; Program.MessageToClient.GameObjectMessageList[this.ID].IsMoving = false; }); - StunTimer = new System.Threading.Timer((i) => { _isStun = false; }); - SpeedBuffTimer = new System.Threading.Timer((i) => { moveSpeed -= (double)Configs["SpeedBuffExtraMoveSpeed"]; }); - StrengthBuffTimer = new System.Threading.Timer((i) => { MaxThrowDistance -= (int)Configs["StrenthBuffExtraThrowDistance"]; }); + StunTimer = new System.Threading.Timer((i) => { _isStun = 0; }); + SpeedBuffTimer = new System.Threading.Timer((i) => { SpeedBuffExtraMoveSpeed = 0; }); + StrengthBuffTimer = new System.Threading.Timer((i) => { StrenthBuffThrowDistance = 0; }); + PositionChangeComplete += new PositionChangeCompleteHandler(ChangePositionInMessage); + void ChangePositionInMessage(GameObject thisGameObject) + { + lock (Program.MessageToClientLock) + { + Program.MessageToClient.GameObjectMessageList[thisGameObject.ID].Position.X = thisGameObject.Position.x; + Program.MessageToClient.GameObjectMessageList[thisGameObject.ID].Position.Y = thisGameObject.Position.y; + } + } lock (Program.MessageToClientLock) { @@ -93,13 +121,13 @@ public Player(double x, double y) : { GlueExtraMoveSpeed = (int)Configs["WaveGlueExtraMoveSpeed"]; if (Velocity.length > 3) - this.Velocity = new Vector(Velocity.angle, moveSpeed + GlueExtraMoveSpeed); + this.Velocity = new Vector(Velocity.angle, MoveSpeed); } else { GlueExtraMoveSpeed = 0; if (Velocity.length > 0 && Velocity.length < 4) - this.Velocity = new Vector(Velocity.angle, moveSpeed); + this.Velocity = new Vector(Velocity.angle, MoveSpeed); } isStepOnGlue = false; @@ -123,7 +151,7 @@ public Player(double x, double y) : } public void ExecuteMessage(CommunicationImpl communication, MessageToServer msg) { - if (IsStun) return; + if (IsStun > 0) return; if (msg.CommandType < 0 || msg.CommandType >= CommandTypeMessage.CommandTypeSize) return; switch (msg.CommandType) @@ -138,7 +166,7 @@ public void ExecuteMessage(CommunicationImpl communication, MessageToServer msg) Put(msg.ThrowDistance, msg.IsThrowDish); break; case CommandTypeMessage.Use: - Use(msg.UseType, 0); + Use(msg.UseType, msg.Parameter); break; case CommandTypeMessage.Speak: SpeakToFriend(msg.SpeakText); @@ -151,13 +179,13 @@ public void ExecuteMessage(CommunicationImpl communication, MessageToServer msg) public void Move(Direction direction) { this.facingDirection = direction; - Move(new MoveEventArgs((int)direction * Math.PI / 4, (moveSpeed + GlueExtraMoveSpeed) / Constant.Constant.FrameRate)); + Move(new MoveEventArgs((int)direction * Math.PI / 4, MoveSpeed / Constant.Constant.FrameRate)); } public override void Move(Direction direction, int durationMilliseconds) { this.facingDirection = direction; - this.Velocity = new Vector(((double)(int)direction) * Math.PI / 4, moveSpeed + GlueExtraMoveSpeed); + this.Velocity = new Vector(((double)(int)direction) * Math.PI / 4, MoveSpeed); this.status = CommandType.Move; lock (Program.MessageToClientLock) Program.MessageToClient.GameObjectMessageList[this.ID].IsMoving = true; @@ -172,10 +200,12 @@ public override void Pick() { foreach (Block block in WorldMap.Grid[(int)xypos.x, (int)xypos.y].GetType(typeof(Block))) { - if ((block.blockType == BlockType.FoodPoint || block.blockType == BlockType.Cooker) + if ((block.blockType == BlockType.FoodPoint || (block.blockType == BlockType.Cooker && (block.ProtectedTeam == team || block.ProtectedTeam < 0))) && block.Dish != DishType.Empty) { + DishType temp = Dish; Dish = block.GetDish(Dish); + if (temp != DishType.Empty) { new Dish(Position.x, Position.y, temp).Parent = WorldMap;Console.WriteLine(111); } Server.ServerDebug("Player : " + ID + " Get Dish " + Dish.ToString()); return; } @@ -232,7 +262,7 @@ public override void Put(double distance, bool isThrowDish) status = CommandType.Stop; Velocity = new Vector(0, 0); } - public override void Use(int type, int parameter) + public override void Use(int type, string parameter_1, string parameter_2 = null) { if (type == 0)//type为0表示使用厨具做菜和提交菜品 { @@ -243,12 +273,13 @@ public override void Use(int type, int parameter) { if (block.blockType == BlockType.Cooker) { - if (block.Cooking == false) block.UseCooker(); + if (block.Cooking == false) block.UseCooker(team, Talent); } else if (block.blockType == BlockType.TaskPoint) { int temp = block.HandIn(Dish); - { Score += temp; Dish = DishType.Empty; } + if(temp>0){ Score += temp; Dish = DishType.Empty; } + else Console.WriteLine("提交任务失败!"); } break; } @@ -256,7 +287,7 @@ public override void Use(int type, int parameter) } else//否则为使用手中道具 { - UseTool(0); + UseTool(parameter_1); } status = CommandType.Stop; Velocity = new Vector(0, 0); @@ -275,33 +306,55 @@ public void DeFunction(ToolType type)//在丢弃装备时生效 public void GetTalent(TALENT t) { - talent = t; - if (talent == TALENT.Run) moveSpeed += (double)(Configs["RunnerTalentExtraMoveSpeed"]); - else if (talent == TALENT.Strenth) MaxThrowDistance += (int)(Configs["StrenthTalentExtraMoveSpeed"]); + Talent = t; } - public void UseTool(int parameter) + public void UseTool(string parameter) { switch (tool) { case ToolType.TigerShoes: case ToolType.TeleScope: case ToolType.BreastPlate: - case ToolType.Condiment: case ToolType.Empty: Console.WriteLine("物品使用失败(为空或无需使用)!"); break; + case ToolType.Condiment: + { + XYPosition xyPosition1 = Position + 2 * EightCornerVector[facingDirection]; + if (WorldMap.Grid[(int)xyPosition1.x, (int)xyPosition1.y].ContainsType(typeof(Block))) + { + foreach (Block block in WorldMap.Grid[(int)xyPosition1.x, (int)xyPosition1.y].GetType(typeof(Block))) + { + if (block.blockType == BlockType.TaskPoint) + { + int temp = block.HandIn(Dish); + if (temp > 0) + { + if(Talent==TALENT.Cook) Score += (int)(temp * (1 + (double)(Configs["CookCondimentScoreParameter"]))); + Score += (int)(temp*(1+ (double)(Configs["CondimentScoreParameter"]))); + Dish = DishType.Empty; Tool = ToolType.Empty; + } + else Console.WriteLine("物品使用失败(提交任务失败)!"); + } + break; + } + } + } + break; case ToolType.SpeedBuff: { - moveSpeed += (double)(Configs["SpeedBuffExtraMoveSpeed"]); - SpeedBuffTimer.Change((int)(Configs["SpeedBuffDuration"]), 0); + SpeedBuffExtraMoveSpeed = (double)(Configs["SpeedBuffExtraMoveSpeed"]); + if(Talent!=TALENT.Technician)SpeedBuffTimer.Change((int)(Configs["SpeedBuffDuration"]), 0); + else SpeedBuffTimer.Change((int)(Configs["TechnicianSpeedBuffDuration"]), 0); if (Velocity.length > 0) - Velocity = new Vector(Velocity.angle, moveSpeed + GlueExtraMoveSpeed); + Velocity = new Vector(Velocity.angle, MoveSpeed); tool = ToolType.Empty; } break; case ToolType.StrenthBuff: { - MaxThrowDistance += (int)(Configs["StrenthBuffExtraThrowDistance"]); - StrengthBuffTimer.Change((int)(Configs["StrenthBuffDuration"]), 0); + StrenthBuffThrowDistance = (int)(Configs["StrenthBuffExtraThrowDistance"]); + if (Talent != TALENT.Technician) SpeedBuffTimer.Change((int)(Configs["StrenthBuffDuration"]), 0); + else SpeedBuffTimer.Change((int)(Configs["TechnicianStrenthBuffDuration"]), 0); tool = ToolType.Empty; } break; @@ -321,16 +374,35 @@ public void UseTool(int parameter) break; case ToolType.WaveGlue: { - XYPosition xyPosition1 = Position.GetMid() + 2 * EightCornerVector[facingDirection]; - if (WorldMap.Grid[(int)xyPosition1.x, (int)xyPosition1.y].ContainsType(typeof(Block))) - { Console.WriteLine("物品使用失败(无效的陷阱放置地点)!"); break; } - new Trigger(xyPosition1.x, xyPosition1.y, TriggerType.WaveGlue, team).Parent = WorldMap; + XYPosition xyPosition1 = Position.GetMid(); + if (this.Talent == TALENT.Technician) + { + for (int i = -2; i <= 2; i++) + { + for (int j = -2; j <= 2; j++) + { + if (!WorldMap.Grid[(int)xyPosition1.x + i, (int)xyPosition1.y + j].ContainsType(typeof(Block))) + new Trigger(xyPosition1.x + i, xyPosition1.y + j, TriggerType.WaveGlue, team).Parent = WorldMap; + } + } + } + else + { + for (int i = -1; i <= 1; i++) + { + for (int j = -1; j <= 1; j++) + { + if (!WorldMap.Grid[(int)xyPosition1.x + i, (int)xyPosition1.y + j].ContainsType(typeof(Block))) + new Trigger(xyPosition1.x + i, xyPosition1.y + j, TriggerType.WaveGlue, team).Parent = WorldMap; + } + } + } tool = ToolType.Empty; } break; case ToolType.LandMine: { - XYPosition xyPosition1 = Position.GetMid() + 2 * EightCornerVector[facingDirection]; + XYPosition xyPosition1 = Position.GetMid(); if (WorldMap.Grid[(int)xyPosition1.x, (int)xyPosition1.y].ContainsType(typeof(Block))) { Console.WriteLine("物品使用失败(无效的陷阱放置地点)!"); break; } new Trigger(xyPosition1.x, xyPosition1.y, TriggerType.Mine, team).Parent = WorldMap; @@ -339,14 +411,40 @@ public void UseTool(int parameter) break; case ToolType.Trap: { - XYPosition xyPosition1 = Position.GetMid() + 2 * EightCornerVector[facingDirection]; + XYPosition xyPosition1 = Position.GetMid(); if (WorldMap.Grid[(int)xyPosition1.x, (int)xyPosition1.y].ContainsType(typeof(Block))) { Console.WriteLine("物品使用失败(无效的陷阱放置地点)!"); break; } new Trigger(xyPosition1.x, xyPosition1.y, TriggerType.Trap, -1).Parent = WorldMap; tool = ToolType.Empty; } break; + case ToolType.SpaceGate: + { + + string[] i = parameter.Split(','); + Console.WriteLine(i[0] + " " + i[1]); + int dx = int.Parse(i[0]), dy = int.Parse(i[1]); + if(Talent==TALENT.Technician) + { + if (Math.Abs(dx) > (int)Configs["TechnicianSpaceGateMaxDistance"]) dx = (int)Configs["TechnicianSpaceGateMaxDistance"] * (dx / Math.Abs(dx)); + if (Math.Abs(dy) > (int)Configs["TechnicianSpaceGateMaxDistance"]) dy = (int)Configs["TechnicianSpaceGateMaxDistance"] * (dy / Math.Abs(dy)); + } + else + { + if (Math.Abs(dx) > (int)Configs["SpaceGateMaxDistance"]) dx = (int)Configs["SpaceGateMaxDistance"] * (dx / Math.Abs(dx)); + if (Math.Abs(dy) > (int)Configs["SpaceGateMaxDistance"]) dy = (int)Configs["SpaceGateMaxDistance"] * (dy / Math.Abs(dy)); + } + XYPosition previous = Position.GetMid(); + XYPosition aim = Position + new XYPosition(dx, dy); + Position = aim; + if (Math.Abs(Position.x - aim.x) > 0.001 || Math.Abs(Position.y - aim.y) > 0.001) + {Position = previous;} + tool = ToolType.Empty; + } + break; } + lock (Program.MessageToClientLock) + Program.MessageToClient.GameObjectMessageList[this.ID].ToolType = (ToolTypeMessage)tool; } public bool TouchTrigger(Trigger trigger) { @@ -361,12 +459,12 @@ public bool TouchTrigger(Trigger trigger) break; case TriggerType.Mine: { - Score += (int)(Configs["MineScore"]); + Score += trigger.parameter; } break; case TriggerType.Trap: { - IsStun = true; + IsStun = trigger.parameter; Velocity = new Vector(Velocity.angle, 0); } break; diff --git a/logic/Logic.Server/Server.cs b/logic/Logic.Server/Server.cs index 23911a2..4726234 100644 --- a/logic/Logic.Server/Server.cs +++ b/logic/Logic.Server/Server.cs @@ -1,10 +1,12 @@ -using Communication.Proto; +using Communication.Proto; using Communication.Server; using Logic.Constant; using System; using System.Threading; using Timer; +using THUnity2D; using static Logic.Constant.Constant; +using static Logic.Constant.MapInfo; namespace Logic.Server { class Server @@ -62,6 +64,17 @@ public void Run() Time.InitializeTime(); Console.WriteLine("Server begin to run"); TaskSystem.RefreshTimer.Change(1000, (int)(Configs["TaskRefreshTime"])); + void ToolRefresh(object i) + { + XYPosition tempPosition = new XYPosition(Program.Random.Next(0, map.GetLength(0)), Program.Random.Next(0, map.GetLength(1))); + while (WorldMap.Grid[(int)tempPosition.x, (int)tempPosition.y].ContainsType(typeof(Block))) + { + tempPosition = new XYPosition(Program.Random.Next(0, map.GetLength(0)), Program.Random.Next(0, map.GetLength(1))); + } + new Tool(tempPosition.x + 0.5, tempPosition.y + 0.5, (ToolType)Program.Random.Next(0, (int)ToolType.Size - 1)).Parent = WorldMap; + } + System.Threading.Timer ToolRefreshTimer = new System.Threading.Timer(ToolRefresh, null, + 0, (int)Configs["ToolRefreshTime"]); System.Threading.Timer timer = new System.Threading.Timer( (o) => diff --git a/logic/Logic.Server/Timer.cs b/logic/Logic.Server/Timer.cs index f3f6ce2..19048c9 100644 --- a/logic/Logic.Server/Timer.cs +++ b/logic/Logic.Server/Timer.cs @@ -6,7 +6,7 @@ namespace Timer { public static class Time { - private static DateTime initTime = new DateTime(); + public static DateTime initTime = new DateTime(); public static bool run = true; public static void InitializeTime() { diff --git a/logic/Logic.Server/Trigger.cs b/logic/Logic.Server/Trigger.cs index 9b51b4a..2ae92ce 100644 --- a/logic/Logic.Server/Trigger.cs +++ b/logic/Logic.Server/Trigger.cs @@ -9,13 +9,30 @@ public class Trigger : Obj { public TriggerType triggerType; public int OwnerTeam; + public int parameter = 0; public System.Threading.Timer DurationTimer; - public Trigger(double x_t, double y_t, TriggerType type_t, int owner_t) : base(x_t, y_t, ObjType.Trigger) + public Trigger(double x_t, double y_t, TriggerType type_t, int owner_t, bool tech = false) : base(x_t, y_t, ObjType.Trigger) { Layer = (int)MapLayer.TriggerLayer; Movable = false; triggerType = type_t; OwnerTeam = owner_t; + if (tech && triggerType==TriggerType.Mine) + { + parameter = (int)(Configs["TechnicianMineScore"]); + } + else if (tech && triggerType == TriggerType.Trap) + { + parameter = (int)(Configs["TechnicianTrapStunDuration"]); + } + if (!tech && triggerType == TriggerType.Mine) + { + parameter = (int)(Configs["MineScore"]); + } + else if (!tech && triggerType == TriggerType.Trap) + { + parameter = (int)(Configs["TrapStunDuration"]); + } if (triggerType == TriggerType.WaveGlue) DurationTimer = new System.Threading.Timer( (i) => { Parent = null; }, null, (int)(Configs["WaveGlueDuration"]), 0); this.OnTrigger += new TriggerHandler( diff --git a/logic/THUnity2D/GameObject.cs b/logic/THUnity2D/GameObject.cs index bf4c198..83459a7 100644 --- a/logic/THUnity2D/GameObject.cs +++ b/logic/THUnity2D/GameObject.cs @@ -128,13 +128,9 @@ protected virtual void PositionChanged(PositionChangedEventArgs e) lock (privateLock) { _position = e.position; - if (OnPositionChanged != null) - { - OnPositionChanged(this, e); - } + OnPositionChanged?.Invoke(this, e); } - if (PositionChangeComplete != null) - PositionChangeComplete(this); + PositionChangeComplete?.Invoke(this); } //Position end diff --git "a/logic/\350\217\234\350\260\261.md" "b/logic/\350\217\234\350\260\261.md" new file mode 100644 index 0000000..a47d40b --- /dev/null +++ "b/logic/\350\217\234\350\260\261.md" @@ -0,0 +1,46 @@ +# 菜谱 + +- Wheat,//麦子 + Rice,//水稻 + Tomato,//番茄 + Egg,//鸡蛋 + Milk,//牛奶 + Apple,//苹果 + Banana,//香蕉 + DarkPlum,//乌梅 + Hawthorn,//山楂 + Strawberry,//草莓 + Beef,//牛肉 + Pork,//猪肉 + ChickenMeat,//鸡肉 + Potato,//土豆 + Lettuce,//生菜 + Agaric,//木耳 + NeedleMushroom,//金针菇 + Cabbage,//包菜 + Size1, + Flour,//面粉=麦子 + Noodle,//面条=面粉 + Bread,//面包片=面粉+鸡蛋 + CookedRice,//米饭=水稻 + Ketchup,//番茄酱=番茄 + Cream,//奶油=牛奶 + TomatoFriedEgg,//番茄炒蛋=番茄+蛋 + TomatoFriedEggNoodle,//西红柿鸡蛋面=番茄炒蛋+面条 + BeefNoodle,//清青牛拉=牛肉+面条 + OverRice,//盖浇饭=米饭+猪肉+包菜 + HuangMenJi,//黄焖鸡米饭=米饭+鸡肉+土豆 + Barbecue,//烤肉=猪肉+生菜 + FrenchFries,//薯条=土豆+番茄酱 + PlumJuice,//酸梅汤=乌梅+山楂 + Hamburger,//汉堡=面包片+牛肉+生菜 + StrawberryIcecream,//草莓圣代=草莓+奶油 + PopcornChicken,//鸡米花=鸡肉+番茄酱 + AgaricFriedEgg,//木耳炒蛋=木耳+蛋 + Cake,//蛋糕=鸡蛋+面粉+奶油+草莓 + BingTangHuLu,//冰糖葫芦=山楂 + FruitSalad,//水果色拉=苹果+香蕉+番茄+草莓 + XiangGuo,//香锅 +- 香锅设想为特殊菜品,如果在做菜时发现原料中有Tool里面的Condiment则表示制作香锅。 +- 香锅的原料可以是猪肉、牛肉、鸡肉、土豆、生菜、包菜、木耳、金针菇中的若干种,至少三种,一般人至多5种,厨师天赋可以八种。种类越多分数越高。 +- 在游戏进行一段时间之后才会出现香锅任务。 \ No newline at end of file diff --git "a/logic/\351\205\215\347\275\256\346\226\207\344\273\266\350\257\264\346\230\216.md" "b/logic/\351\205\215\347\275\256\346\226\207\344\273\266\350\257\264\346\230\216.md" deleted file mode 100644 index 7f2b91b..0000000 --- "a/logic/\351\205\215\347\275\256\346\226\207\344\273\266\350\257\264\346\230\216.md" +++ /dev/null @@ -1,27 +0,0 @@ -# Logic.Server文件夹中的App.config使用说明 - -- 可以通过修改该配置文件中的数值来直接修改游戏数值 -- key值表示该参量的含义,后面的value表示它的值 -- 较为关键的是菜谱是通过配置文件进行编辑的,方法可参照配置文件中的示例 -- 每一样菜品需要三条信息:原料,菜品名和价格,也就需要三组对应的key和value -- 比如 - - - - 即为,可以用Apple和Potato为原料在灶台处烧出Banana,用时2s,Banana的分数为20 -- 需要注意的是,每样食材仅能出现一次,且食材的排列需要按照下面的DishType按从小到大的顺序排,如果自己加入了新的食材或菜品等,记得加到Logic.Constant文件夹中Constant.cs中的DishType中(在40行左右的位置) -- 原则上其实食材和菜品没有区别,毕竟都是DishType中的成员,因此自然地可以支持多步合成 -- public enum DishType - { - Empty = 0,//空 - //以下为食材 - Apple, - Banana, - Potato, - Tomato, - Size1, - //以下为菜品 - - DarkDish, - Size2 - } \ No newline at end of file