From 4ab4abaa89c82f535de44d5676febad20e17d042 Mon Sep 17 00:00:00 2001 From: Joel Date: Thu, 7 May 2020 14:51:52 +0200 Subject: [PATCH] Last Images and at last fixed the Production System --- Game1/Content/BarleyIcon.png | Bin 0 -> 2177 bytes Game1/Content/Content.mgcb | 36 ++++++++++++++++++++++++++ Game1/Content/CottonIcon.png | Bin 0 -> 3613 bytes Game1/Content/GroundNutsIcon.png | Bin 0 -> 1612 bytes Game1/Game1.cs | 8 +++--- Game1/Sources/Crops/Crops.cs | 26 +++++++++---------- Game1/Sources/Crops/SoilProperties.cs | 6 ++--- 7 files changed, 56 insertions(+), 20 deletions(-) create mode 100644 Game1/Content/BarleyIcon.png create mode 100644 Game1/Content/CottonIcon.png create mode 100644 Game1/Content/GroundNutsIcon.png diff --git a/Game1/Content/BarleyIcon.png b/Game1/Content/BarleyIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..1c7b5af7595e73cf45d51abb5cc46ee8eabb726f GIT binary patch literal 2177 zcmV-{2!8j8P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGmbN~PnbOGLGA9w%&2o_01K~#8N?VQbv z97Pz$Yj!^NBiY>;*MN#BiU$=vcrXarORg&DL60Jc2MKr(h1~S!e~^IWpn?}YiTV#D zdoV%{#y~*uB50z-B%96d%ZH+t6p|oxFiwC6v@7s8fvE3u5S%2}xT#nIUD^O8U zN)g0H2+;*Ae}BluAoBEhu?$?l^T2zo+5d<2mS5w?MBp&hIo)v^aq;x~Uit zLJmoLOQ+-1n7yS_acT_43p6;k&i1AFXp(;W={PmM9t|tHNJKsdA>caQHB@K0-YQ&- znS~vaRSA;^L8C9-`JAy~kL@qK%yy2y8=qlp_2wDY7;N#h&OJx&oMY{spS1U)-alxa zm~sJyK$ChBS+22liZh3}5CcGr#^4@njP_WkdoeybX3%;fPAS|I_wGUKvG|A@>isGg zKpYz}Kvw=DPRZ?%w4161XI+d2t2f@C%$mTc8I?U6veDdvc934&{5mT07dAJzIcXr> zJ<{$?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8fpOy#Sz)QD7@&|Kz=bG; ztvJABog%*-NLxS1n2rr5Vt|MBBTnVR)**fgl75&O2rfv1Nc9N{EsjZLna8~8HEI~4RL{NfuU*2wUz54)Kg2h(r}H6Vq@eNC;bQ2o7;bQFj2Rf&`Zo zCpg42oC`9`E-5mgy9iexIK%<2!~mrT62_AJ1cwyFr8_`rg3Ovr@{Av@#Q>!`V> zGQ@6%lglK*O>N=K+b7mY;XUDb=N z+wJoDRK@x8=au!SY6HT)@?fpo*|TSPeafb8A!q}_zVe_~n@fRw5kcI5u&+Gm{bnMP z>N+1cv97hxvI5DruYHykND>6`j39_-1VKC_2;vz*5YGsLct#M!GlC$V5d`s!Ac$uK zK|CV};u%2@&j^BeM&f%&pg!n($V8BUAB2$Q6^#7{ybyG4WYXGn00000NkvXXu0mjf D+t3C$ literal 0 HcmV?d00001 diff --git a/Game1/Content/Content.mgcb b/Game1/Content/Content.mgcb index c286d3c..2a9708d 100644 --- a/Game1/Content/Content.mgcb +++ b/Game1/Content/Content.mgcb @@ -13,6 +13,18 @@ #---------------------------------- Content ---------------------------------# +#begin BarleyIcon.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:BarleyIcon.png + #begin BerriesIcon.png /importer:TextureImporter /processor:TextureProcessor @@ -37,6 +49,18 @@ /processorParam:TextureFormat=Color /build:CarronIcon.png;CarrotIcon.png +#begin CottonIcon.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:CottonIcon.png + #begin Crop.png /importer:TextureImporter /processor:TextureProcessor @@ -56,6 +80,18 @@ /processorParam:TextureFormat=Compressed /build:Font.spritefont +#begin GroundNutsIcon.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:GroundNutsIcon.png + #begin house.png /importer:TextureImporter /processor:TextureProcessor diff --git a/Game1/Content/CottonIcon.png b/Game1/Content/CottonIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..eab2fb3aa0764629ee95811a551e89abf86f85a9 GIT binary patch literal 3613 zcmV+&4&w2NP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGmbN~PnbOGLGA9w%&4YEl@K~#8N?VM|@ z6;~C<_ocJ~O)IoeNv%9=CB#%}s$WQxN~pEaRE5y0_`yJI3}{mQVDJ)SfSBe&G=ZuS z5@RlsSV*uzT2nB6BvcbVXv%Gkxqy#@it?&}g#c-2kMp0i*I}J?_IqZ|IhT8X$X z%@>|9VM2b+iWMvJeG{^fX8i1-wigez1cyV;w`uqFUz`%gsYlRBs*B5@TZu`pIJTK%WIYlg%z;k?S+jrF)_x;!DF2SWg zo>Jo`j8_+4IUdw(mSqn?vb-!;Z>OfrI`ZEMrBN^5x4>qHwUEB8CZD<(Rzeo~9s3 zJ}Uui-Vr%UW$95T9-AC>w|-XI=3B&#_w-SAr@B#@_9n7 z1h9Q$W>Vr{zo@UKT4$@($PbMrv6cbLj&*JFd8C!_=iv#kePd=);*=RU4;?zB_u4@r zn4U$ZPFab3o}LjTq;{b;ZQi_D@7cjix(d|vET+^cQTRQ%AhtNduc>UtFr;UU;gcgr zj^w>~7Z_>*zVm!++_+J1bq+q7kaZySmYuFn;i8~33sHv;AJ#c`)~#C?bY2;(T)9%M zUAtEA7318lqk2oJzMH~|yUlD;la1lwVZCL>6>#}6+j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><&}ZFuPc=yiVK%j zm_#(4KjH-m3G6&oA&M;65G%KdH{t~e3G6b#r3^a$YfzQATpCiWAjyM^SxwekZZK34 zvM_+aFhndE&vGq(s|viE@B6|O+Eg+nNl1$ZW(;$W9d0q*KQ>iiH8!`z6Q&dHe0qNK zAI-#CNT1$7u5)U#aZMbH7cb67g<}UIZO?(>dMri@{r9WgfTp1_u!uEUnF#tw137&Q zc-faWV`ws4%$1b23It4h>f>s{y|+g#JaYkov2HiyyN^(48aig$mQ$J_zR998DEhJz z`nH2U$ms=269kh*A*(Ss2#TqgYIJOk=W`PfxhyLwLa-pdmISqqVp<$n85jef@G;fs z*cy+82)^I!G{J(%nK{z}Gc<)`X7CX3WAH7lNvZJ{U;DS-3cChYSmYZ*AHjmie*lAd zXDLe7EX?!Ky228FAF%;n)@Zc2I4L!L;=HMPtHIQ7%+p(D%5GRlqGAYlM<{%V#Pi^` zFyAg$qU_(lUoBm_G)N?0TzUJq*Q`K(pAMuINzo*7j=OJspR@MUqKuH=PO+jWLAX0Y z;rI9V2f3)MbC@sf_pMTK{m&`l?2ci*)hHARtmJ<$TwC}C(Odq^1*Kc@)(!Zsipod?l;1p`skyR74zS&8i$Ss|owsY^(S z=qph8nDuw8@Sc3D9#ZULeNL7_?4 z1yO3XTE1orRz%{21b2wxb5jymfe@wu?-Hf0ATxupU6X1BA#1YYZ7M@96a$D45C-Ei zlw8Y9Ap}H=6$6A8h&<0G9>E2~!ZzDAQaqpa5g`i!lLP?}C3d)*{z#l_S5VrT>3L;28g}4fq5)_W`3)5LxSegcPjFN^l=)*@Xu6Q7K3) zAq8u*667PGhknpHY6ani7eYwEaw|z)$T#Ymy#zIXQR8Dj$1WRQ_M=viUcxHK7~P{y jkTH6Lu~t@3q168Y(pYSWZ7ca&00000NkvXXu0mjfkkz;@ literal 0 HcmV?d00001 diff --git a/Game1/Content/GroundNutsIcon.png b/Game1/Content/GroundNutsIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..de2cf45481d4a35df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8=z`NmwFo=rRj+?`55c5AJZvraw9U3X_lZQMUlD_Rm~FnuUm_?5{|0-G7oQIx2Gbs!^85$fA353 z0E~>3oF2byX!Nq`iwqqJ-&+v`)@+bxv?CD2H|qimY*&Wa{jR}$i9s!JpyV9FvXT_A zjS+Cr;gWh_bImG2nU@P_tsk?=73zchc$jc!$fY_K7Q(4pSrA*HvUiWmC}y0)kkA^p zyY#LH5u3!%;CeeV_3mkXLtAZh%{YWL4_msEGW*=T|5(V5Zg%&NagFS2`2xGkgXxxZu1ucNnTn(HH7_?9Wec0tm{5k SQPNi)0Pyt=APAxGtbYMe|JmaJ literal 0 HcmV?d00001 diff --git a/Game1/Game1.cs b/Game1/Game1.cs index a1372d0..0fb937c 100644 --- a/Game1/Game1.cs +++ b/Game1/Game1.cs @@ -97,12 +97,14 @@ namespace Game1 tile[2] = Content.Load("Plantable"); tile[3] = Content.Load("Crop"); - Crops[0] = Content.Load("CarrotIcon"); - Crops[1] = Content.Load("WheatIcon"); - Crops[2] = Content.Load("BerriesIcon"); + + + Crops[0] = Content.Load("BarleyIcon"); + Crops[1] = Content.Load("CottonIcon"); + Crops[2] = Content.Load("GroundNutsIcon"); Crops[3] = Content.Load("MaizeIcon"); Crops[4] = Content.Load("MilletsIcon"); Crops[5] = Content.Load("SeedOilIcon"); diff --git a/Game1/Sources/Crops/Crops.cs b/Game1/Sources/Crops/Crops.cs index 357864c..9e060c1 100644 --- a/Game1/Sources/Crops/Crops.cs +++ b/Game1/Sources/Crops/Crops.cs @@ -28,7 +28,7 @@ class Crops getProductionRate(); if (Status == 3 && Timer != 1) { - Timer = Timer - 1 * ProductionRate; + Timer = Timer - 1f * ProductionRate; } Size = newSize; UpdateCrop++; @@ -198,33 +198,31 @@ class Crops ProductionRate = 1; if (DataSet != null) { - ProductionRate = (ProductionRate * compareToDatset(soilProperties.Temperature, DataSet.Temparature)); - ProductionRate = (ProductionRate * compareToDatset(soilProperties.Moisture, DataSet.Moisture)); - ProductionRate = (ProductionRate * compareToDatset(soilProperties.Humidity, DataSet.Humidity)); - ProductionRate = (ProductionRate * compareToDatset(soilProperties.Phosphorous, DataSet.Phosphorous)); - ProductionRate = (ProductionRate * compareToDatset(soilProperties.Potassium, DataSet.Potassium)); - ProductionRate = (ProductionRate * compareToDatset(soilProperties.Nitrogen, DataSet.Nitrogen)); + ProductionRate = ProductionRate + (ProductionRate * compareToDatset(soilProperties.Temperature, DataSet.Temparature)); + ProductionRate = ProductionRate + (ProductionRate * compareToDatset(soilProperties.Moisture, DataSet.Moisture)); + ProductionRate = ProductionRate + (ProductionRate * compareToDatset(soilProperties.Humidity, DataSet.Humidity)); + ProductionRate = ProductionRate + (ProductionRate * compareToDatset(soilProperties.Phosphorous, DataSet.Phosphorous)); + ProductionRate = ProductionRate + (ProductionRate * compareToDatset(soilProperties.Potassium, DataSet.Potassium)); + ProductionRate = ProductionRate + (ProductionRate * compareToDatset(soilProperties.Nitrogen, DataSet.Nitrogen)); if (ProductionRate < 0) { ProductionRate = 0; } + ProductionRate = ProductionRate / 20; } } public float compareToDatset(float i, float j) { - if (i > j) + if (i < j) { - return (i / j) * 0.15f; - } - else if (i < j / 2) - { - return (i / j) * 2f; + return (i / j); } else { - return i / j; + return (j / i); } + } diff --git a/Game1/Sources/Crops/SoilProperties.cs b/Game1/Sources/Crops/SoilProperties.cs index bf3e3b7..c8dcffe 100644 --- a/Game1/Sources/Crops/SoilProperties.cs +++ b/Game1/Sources/Crops/SoilProperties.cs @@ -17,9 +17,9 @@ class SoilProperties public float Nitrogen; public float Potassium; public float Phosphorous; - public float NitrogenDegradeRate = 0.001f; - public float PotassiumDegradeRate = 0.001f; - public float PhosphorousDegradeRate = 0.001f; + public float NitrogenDegradeRate = 0.01f; + public float PotassiumDegradeRate = 0.01f; + public float PhosphorousDegradeRate = 0.01f; public void setSoilProperties() {