From 667e5eb5100a5fbbba8123dc197cbcc71f04cf7e Mon Sep 17 00:00:00 2001 From: Avi Weinstock Date: Wed, 9 Jun 2021 01:14:20 -0400 Subject: [PATCH 1/6] Mining skill tree. --- CHANGELOG.md | 1 + .../common/skill_trees/skill_max_levels.ron | 3 + .../skills_skill-groups_manifest.ron | 5 ++ .../resource_experience_manifest.ron | 19 +++++ .../element/skills/pickaxe_gemgain.png | Bin 0 -> 1780 bytes .../element/skills/pickaxe_oregain.png | Bin 0 -> 1790 bytes .../voxygen/element/skills/pickaxe_speed.png | Bin 0 -> 1734 bytes assets/voxygen/element/weapons/pickaxe.png | Bin 0 -> 1720 bytes assets/voxygen/i18n/en/skills.ron | 9 ++ assets/voxygen/item_image_manifest.ron | 4 + common/src/cmd.rs | 2 +- common/src/comp/ability.rs | 17 ++++ common/src/comp/inventory/item/tool.rs | 15 ++++ common/src/comp/skills.rs | 29 +++++-- common/src/event.rs | 1 + common/systems/src/melee.rs | 1 + server/src/cmd.rs | 1 + server/src/events/entity_manipulation.rs | 13 ++- server/src/events/interaction.rs | 78 +++++++++++++++++- server/src/events/mod.rs | 4 +- server/src/migrations/V41__mining_tree.sql | 7 ++ server/src/persistence/json_models.rs | 17 ++-- voxygen/src/hud/diary.rs | 73 +++++++++++++++- voxygen/src/hud/img_ids.rs | 5 ++ voxygen/src/hud/mod.rs | 1 + 25 files changed, 278 insertions(+), 27 deletions(-) create mode 100644 assets/server/manifests/resource_experience_manifest.ron create mode 100644 assets/voxygen/element/skills/pickaxe_gemgain.png create mode 100644 assets/voxygen/element/skills/pickaxe_oregain.png create mode 100644 assets/voxygen/element/skills/pickaxe_speed.png create mode 100644 assets/voxygen/element/weapons/pickaxe.png create mode 100644 server/src/migrations/V41__mining_tree.sql diff --git a/CHANGELOG.md b/CHANGELOG.md index 4466ae1851..99fa93a4cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -85,6 +85,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Meat drops from animals - New ores, plants and hides to be looted from the world and processed into craft ingredients - Added more crafting stations, loom, spinning wheel, tanning rack, forge +- Added a skill tree for mining, which gains xp from mining ores and gems. ### Changed diff --git a/assets/common/skill_trees/skill_max_levels.ron b/assets/common/skill_trees/skill_max_levels.ron index 275c23b15b..a319299903 100644 --- a/assets/common/skill_trees/skill_max_levels.ron +++ b/assets/common/skill_trees/skill_max_levels.ron @@ -76,4 +76,7 @@ Climb(Cost): Some(2), Climb(Speed): Some(2), Swim(Speed): Some(2), + Pick(Speed): Some(3), + Pick(OreGain): Some(3), + Pick(GemGain): Some(3), }) diff --git a/assets/common/skill_trees/skills_skill-groups_manifest.ron b/assets/common/skill_trees/skills_skill-groups_manifest.ron index 220f2b1e97..641ba74520 100644 --- a/assets/common/skill_trees/skills_skill-groups_manifest.ron +++ b/assets/common/skill_trees/skills_skill-groups_manifest.ron @@ -109,4 +109,9 @@ Sceptre(ARange), Sceptre(ACost), ], + Weapon(Pick): [ + Pick(Speed), + Pick(OreGain), + Pick(GemGain), + ], }) diff --git a/assets/server/manifests/resource_experience_manifest.ron b/assets/server/manifests/resource_experience_manifest.ron new file mode 100644 index 0000000000..6345e0d392 --- /dev/null +++ b/assets/server/manifests/resource_experience_manifest.ron @@ -0,0 +1,19 @@ +ResourceExperienceManifest({ + "common.items.mineral.gem.amethyst": 20, + "common.items.mineral.gem.sapphire": 50, + "common.items.mineral.gem.topaz": 20, + "common.items.mineral.gem.diamond": 100, + "common.items.mineral.gem.emerald": 50, + "common.items.mineral.gem.ruby": 75, + + "common.items.mineral.ore.coal": 25, + "common.items.mineral.ore.gold": 100, + "common.items.mineral.ore.iron": 20, + "common.items.mineral.ore.silver": 75, + "common.items.mineral.ore.velorite": 30, + "common.items.mineral.ore.veloritefrag": 20, + "common.items.mineral.ore.bloodstone": 100, + "common.items.mineral.ore.cobalt": 75, + "common.items.mineral.ore.copper": 10, + "common.items.mineral.ore.tin": 10, +}) diff --git a/assets/voxygen/element/skills/pickaxe_gemgain.png b/assets/voxygen/element/skills/pickaxe_gemgain.png new file mode 100644 index 0000000000000000000000000000000000000000..4b3bdf6d048e39cef4516879eab38cba6fd577ee GIT binary patch literal 1780 zcmcIlUx?g998Rwu*ln*b`e5x#Ob@NpY$n<4ZW0=gyWP`UY_7+3WzSOOW;3(9aW|Qm zml{PCBe{N1pK+X6=39y^1+J z{{X}EershXf(c`rW)eFJ5y|6d&2}l8VYUv`TxgbYz~*t$a&+$c$x|F_A)U*`4Pdw_ zT(U-HJ-lOfG;7Y5O%-tikF#5A8YQrC0NI*daeS?&a}8dN&ckJaV;hj5taF2*L3Y9z zV^hS#Y&@FaO;MKEq#6|yK$YajSP6(p0VD-6#sg6U2`#3wt&5}9JXFxe(@(T)(Knqd z1%ayxLbY0rR%21(6$MdMRRKtXB=Ho%`!h}eYrNxcYBQvid93cERHIfzvKM?+DqGdK+ctaB2OL>?q~pk@KkKwOK<#6OpWm0 ztTpy->q~7oZFb?b(`D&Pr%z*tQhT%u58ditrXBojCOw!{mX{8l?>ht5?fdlUhrinF zu0Izq{`t!}`Pk|G4~_M|ldq%7TMK(@A0Az-|5iNt{DoWYu9x21zDNA>=PUIOn9E0^ z*N&_rU+2ELaix6e##0+sUwZYkwY&ZI%g5h-xBtQ$2QQC`x#JfPy}r2d;O^_MeDcV; zAB!idtC{D(v6tUGyLdo3ZAUiNe?SY7$;0I>&%U^{e5R7A>F9f5xc9`>-pTV5>iVCq z&j0$?Yjfj~qxg^cQ|O*;Uj3sUVF}Ka_T2m~H!!#GdGhAp7k?ireX%e6FJ*>D(;p8_ G?)?Y;Z%@tu literal 0 HcmV?d00001 diff --git a/assets/voxygen/element/skills/pickaxe_oregain.png b/assets/voxygen/element/skills/pickaxe_oregain.png new file mode 100644 index 0000000000000000000000000000000000000000..be9dfa330d1bdad7ecc91d9bdf696fcba2981e17 GIT binary patch literal 1790 zcmcIlTWB0r7~TfFBpNBSp|MChPDNVU*}3lQ&UB|C?xx)pHx1i0-Gn@N=A5&;V|M0D zXC~Rpi=?QvQUt4li1^luNGoV9LZcS62sTo*PXSSU@TCpjO0kNFXZB{1Hsr;H**P=w zo$vqt|NG~kW0Mp62M4weL?V&FY$lzj=gr}9Zy){dyY}J?J@vbpX+ILVZ&P?|h`jOU za3pfq*H)nz6mw7Lkl0axh>4?h+okA8Bsp4l0i44DW8$*q80^pIKV=yU8SJ50PRO|_ zT(L4u4YKR@(%OvYMC9rV-n7Unce7$b4Enc0j!`nQ|v>?Hp!H$IinPP5| zNf8e-v8c*HQIVLq78O-Nla$?zB#3cdi1VV%38F5jx~wssA4{WosHEr9`#Q1cmBChm zz}0!aR;xv8a+G*wUeq*=7bISiIEvu>h7*7~=lI*Z3~B5`&vFBcI84Y0OfnxBELGZ0 z!FGGJj^8O0Ef`-1E-yxfFr_Xqms=ZZ+dZ@&j4#kA9lf_D_6rRc^Lgx(c@N_81?&Xd zyTK6b?RDq9YAaI&d0fRdh51yN*bC)WNI?7wxkDbk$GvP^J>_8#5U)T;wQJO5mxW2C zLSquljzgA%NX_3Fit6maX%Jw8l>|xT1eFsK1xeOpiXIbpg$@dBXpXi50s&Ybm>{dv zSPwLp)3c5r00-i1+F+@usAVA?0;t4GVuF)JMde~K#pHlY+d%^HL`;JMLZ;Z#Mfax( zoDVA)?r(Q4B9L8psixrpp1FfDYMMKYEq<1 zyc|Ka=5pB3l$~agv3%-Yqw|U!#D_bps>QVWP6se-cY}qY&ls_t+tzKWw?3V1+FAuu z(lyL)!+cT-YQV!|Wm@U=^cR08{XSS&TmAaH|9{nYiVG{iDPuZ8c{a?44`)r=8veho zwVvHFm%4B|?80Sl%F>J8oW>5N_UIIzo&8m%6Z}dxJyu9u`sx*9pikVm@AtdSoyC=z zmBt2t(Ku#j9$Y$lx_1A~m+#porZ0|v4u;?V;JP%LJ$32Ex#HUg7V}?T{^7SB@aEa? zx#ivY=C^0yajiU^oLO4zH>y+L_(ST6r|rLo9(s4<;OfV}90ymQ4T5Wjw-~FBzBBds z**)bgL(=o-_da*>)!F38$|tMml1EQWE$zAdWV8NO`Kq$Ky!c0OWaNQ|6R*|b3x5@V z9KJB}dPe?fdTO{IeX;-KwgGeL^o{-xuQdM@J}RS4?_I2Ycm0_Qwa*-9>mx5|#qbN2 N9iK>_dF-hp{{SxxNU;C_ literal 0 HcmV?d00001 diff --git a/assets/voxygen/element/skills/pickaxe_speed.png b/assets/voxygen/element/skills/pickaxe_speed.png new file mode 100644 index 0000000000000000000000000000000000000000..0e181d113753c04aebcd2a6d34877a3990123b04 GIT binary patch literal 1734 zcmcIlO>Epm6gHJ2+C~A1R$R;cRoG3Ng*uJWg{C=B#-7<-D{GHq zJK5bFpel+)5U8huAaLjfCpgF<`YryLM)puHBsfl8>Nq6aD=MMyB-A5)<=+6yb$ z9^2o1?|biie!Dz5ad2qsLt8nH8!C+#r`UCSa%|qj&YOOFb%tHG1mnjdjvL&T9QSZ< zzq6C$1}?kh>3G^YWIEK#AWUtNX?g)ebKJ=OW`LYo67x2xx_(}`dGT|BcX3`gnzeux z6iCe-Uku5S#fh@BIO`Z#*#9Iy(li-?M`FY`y}BQn&Aia&HQ73OED3xY63^y^(Ig;0 zZB6n88WKL6(L@KTGM_UtPy>dn?&D~VO4^LVMsuhWLabgF>3iSYKnfeyT?!@krTQ>>{6dk7?Dlq zc2e+yl-7^BWnu-BnkbN91|%u@fa*(!eAOIsL_~4HF}pk(${G=fmsL%ifLG;wB9pnvd6*~ z3W+f~zxSx?W7>!wOGI_|kRpmnUXXzdMWBg5FUyLl%BBLJNE`$msKr_VqZsuErr52t z`hi-OS@NS8`3@-+^8yoZH7pXI! zR501!>0C@5#*r4uR8?IAL?&Xz$m*hPt3?@+z|barSPHNr?Y zFuwzfXeDl-kc?JYrTghG>2CTXw6L-I{=ENx)pv{Q)R12#Y=TNcl8=%XG@Jn{-YSpHYWw3WuxvF0l!|QYwy?_1E9M0`EHkHV^#p)1@!hE?)TT z`n6pnr~U-~@E3z?t>OFmE$^K+cogx%IcnHg4e>G z_dYly{2>pnpS}6<)3?^YKlkuApPuFa2B$xH>DI188)0D<0 LiXT1o!pVOCqO39P literal 0 HcmV?d00001 diff --git a/assets/voxygen/element/weapons/pickaxe.png b/assets/voxygen/element/weapons/pickaxe.png new file mode 100644 index 0000000000000000000000000000000000000000..25ea9168a0115dd3ac063534e4e00428edb52b63 GIT binary patch literal 1720 zcmcIlU1%It6rL6YO^hH4iuiDuB-Gm6o!_0E8M1BTZZs=SjOj{KOToMM-rXItGj}pG z$?gWE#fLyj`ydN_koqK|58{gtiYXQq3q=rro)i(KMcOE}FZD@^_wJuX+K?9)X6Me# zcfa$U^PM@fxiJ6S*vJzjk|d3l=8B8_{HQqY-^>5^{(kxuetIC9JC;b&=p*9TBfWY4 zaY?%GTfe-NE_pAwm<1U`ScPUyZ5FXQ!P>=60TK``BNIYB^E1X@8OOx#vp?(({PEp96^=t9!vygVZUf+cSO z6j)3_He*4onL5Zh8O>51-JAlts^t_lr)UOLHCMGMj6eKYOlhG=(K4z?X#n)RouNT6L?`L&8jsS~dspJ5+>WTSNE5aiV>-J=!*qNQ zjNswkXf;d7R+Jkz$6$nbv?!b)r)%I?n zp68arBt;>nrD9&@qB6cuT&I$y$j%aoZOegG!&G6#avbOw#6ekGwX|HdtBdb1GQ27( zDE9X{moUsZhDCBUgV-jvbI@{#4)v<(KwHZph|H{IYqmo)#~84^82kL?L5(|Eg(|`s zO^h`|t!U7yWKD=Fro~m^D&&oC*;SfV^&FM~!ETks0phLV2dGAsD6GlgUo{2RV6n#t zuel)_nzQpP=KO@a*Y3X}N9am_)$l>L?_7jMyXR#re5OS1-}diPz1`{T(KhRplkQ-C z50mWAMa-I>HOhZo>pr_< zE)C#(*oozE%JPfhoTeeCj`(v|Ezio7C zH>ZF8;^VfY{PJaE@%zKa>!1C-d2?i9 = vec!["general", "sword", "axe", "hammer", "bow", "staff", "sceptre"] + static ref SKILL_TREES: Vec = vec!["general", "sword", "axe", "hammer", "bow", "staff", "sceptre", "pick"] .iter() .map(|s| s.to_string()) .collect(); diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs index 8ab75b8928..bab3f56117 100644 --- a/common/src/comp/ability.rs +++ b/common/src/comp/ability.rs @@ -1174,6 +1174,23 @@ impl CharacterAbility { _ => {}, } }, + Some(ToolKind::Pick) => { + use skills::PickSkill::*; + if let BasicMelee { + ref mut buildup_duration, + ref mut swing_duration, + ref mut recover_duration, + .. + } = self + { + if let Ok(Some(level)) = skillset.skill_level(Pick(Speed)) { + let speed = 1.1_f32.powi(level.into()); + *buildup_duration /= speed; + *swing_duration /= speed; + *recover_duration /= speed; + } + } + }, None => { if let CharacterAbility::Roll { ref mut energy_cost, diff --git a/common/src/comp/inventory/item/tool.rs b/common/src/comp/inventory/item/tool.rs index e91b52c0de..c0f3ee2d03 100644 --- a/common/src/comp/inventory/item/tool.rs +++ b/common/src/comp/inventory/item/tool.rs @@ -50,6 +50,21 @@ impl ToolKind { ToolKind::Empty => "empty", } } + + pub fn gains_combat_xp(&self) -> bool { + matches!( + self, + ToolKind::Sword + | ToolKind::Axe + | ToolKind::Hammer + | ToolKind::Bow + | ToolKind::Dagger + | ToolKind::Staff + | ToolKind::Spear + | ToolKind::Sceptre + | ToolKind::Shield + ) + } } #[derive(Clone, Copy, Debug, Serialize, Deserialize)] diff --git a/common/src/comp/skills.rs b/common/src/comp/skills.rs index e1c113d8f2..c130b067c9 100644 --- a/common/src/comp/skills.rs +++ b/common/src/comp/skills.rs @@ -107,6 +107,7 @@ pub enum Skill { Roll(RollSkill), Climb(ClimbSkill), Swim(SwimSkill), + Pick(PickSkill), } pub enum SkillError { @@ -263,6 +264,13 @@ pub enum SwimSkill { Speed, } +#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, Serialize, Deserialize)] +pub enum PickSkill { + Speed, + OreGain, + GemGain, +} + #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, Serialize, Deserialize)] pub enum SkillGroupKind { General, @@ -344,7 +352,10 @@ impl Default for SkillSet { /// player fn default() -> Self { Self { - skill_groups: vec![SkillGroup::new(SkillGroupKind::General)], + skill_groups: vec![ + SkillGroup::new(SkillGroupKind::General), + SkillGroup::new(SkillGroupKind::Weapon(ToolKind::Pick)), + ], skills: HashMap::new(), modify_health: false, modify_energy: false, @@ -365,7 +376,7 @@ impl SkillSet { /// let mut skillset = SkillSet::default(); /// skillset.unlock_skill_group(SkillGroupKind::Weapon(ToolKind::Sword)); /// - /// assert_eq!(skillset.skill_groups.len(), 2); + /// assert_eq!(skillset.skill_groups.len(), 3); /// ``` pub fn unlock_skill_group(&mut self, skill_group_kind: SkillGroupKind) { if !self.contains_skill_group(skill_group_kind) { @@ -668,13 +679,13 @@ mod tests { skillset.add_skill_points(SkillGroupKind::Weapon(ToolKind::Axe), 1); skillset.unlock_skill(Skill::Axe(AxeSkill::UnlockLeap)); - assert_eq!(skillset.skill_groups[1].available_sp, 0); + assert_eq!(skillset.skill_groups[2].available_sp, 0); assert_eq!(skillset.skills.len(), 1); assert!(skillset.has_skill(Skill::Axe(AxeSkill::UnlockLeap))); skillset.refund_skill(Skill::Axe(AxeSkill::UnlockLeap)); - assert_eq!(skillset.skill_groups[1].available_sp, 1); + assert_eq!(skillset.skill_groups[2].available_sp, 1); assert_eq!(skillset.skills.get(&Skill::Axe(AxeSkill::UnlockLeap)), None); } @@ -683,9 +694,9 @@ mod tests { let mut skillset = SkillSet::default(); skillset.unlock_skill_group(SkillGroupKind::Weapon(ToolKind::Axe)); - assert_eq!(skillset.skill_groups.len(), 2); + assert_eq!(skillset.skill_groups.len(), 3); assert_eq!( - skillset.skill_groups[1], + skillset.skill_groups[2], SkillGroup::new(SkillGroupKind::Weapon(ToolKind::Axe)) ); } @@ -697,13 +708,13 @@ mod tests { skillset.unlock_skill_group(SkillGroupKind::Weapon(ToolKind::Axe)); skillset.add_skill_points(SkillGroupKind::Weapon(ToolKind::Axe), 1); - assert_eq!(skillset.skill_groups[1].available_sp, 1); + assert_eq!(skillset.skill_groups[2].available_sp, 1); assert_eq!(skillset.skills.len(), 0); // Try unlocking a skill with enough skill points skillset.unlock_skill(Skill::Axe(AxeSkill::UnlockLeap)); - assert_eq!(skillset.skill_groups[1].available_sp, 0); + assert_eq!(skillset.skill_groups[2].available_sp, 0); assert_eq!(skillset.skills.len(), 1); assert!(skillset.has_skill(Skill::Axe(AxeSkill::UnlockLeap))); @@ -720,6 +731,6 @@ mod tests { skillset.unlock_skill_group(SkillGroupKind::Weapon(ToolKind::Axe)); skillset.add_skill_points(SkillGroupKind::Weapon(ToolKind::Axe), 1); - assert_eq!(skillset.skill_groups[1].available_sp, 1); + assert_eq!(skillset.skill_groups[2].available_sp, 1); } } diff --git a/common/src/event.rs b/common/src/event.rs index 1c507d0876..d21eee05c5 100644 --- a/common/src/event.rs +++ b/common/src/event.rs @@ -164,6 +164,7 @@ pub enum ServerEvent { }, // Attempt to mine a block, turning it into an item MineBlock { + entity: EcsEntity, pos: Vec3, tool: Option, }, diff --git a/common/systems/src/melee.rs b/common/systems/src/melee.rs index 561b9a4b5b..46a3b004fd 100644 --- a/common/systems/src/melee.rs +++ b/common/systems/src/melee.rs @@ -86,6 +86,7 @@ impl<'a> System<'a> for Sys { < (rad + scale * melee_attack.range).powi(2) { server_emitter.emit(ServerEvent::MineBlock { + entity: attacker, pos: block_pos, tool, }); diff --git a/server/src/cmd.rs b/server/src/cmd.rs index 926b439588..eb6af36349 100644 --- a/server/src/cmd.rs +++ b/server/src/cmd.rs @@ -2610,6 +2610,7 @@ fn parse_skill_tree(skill_tree: &str) -> CmdResult "bow" => Ok(SkillGroupKind::Weapon(ToolKind::Bow)), "staff" => Ok(SkillGroupKind::Weapon(ToolKind::Staff)), "sceptre" => Ok(SkillGroupKind::Weapon(ToolKind::Sceptre)), + "pick" => Ok(SkillGroupKind::Weapon(ToolKind::Pick)), _ => Err(format!("{} is not a skill group!", skill_tree)), } } diff --git a/server/src/events/entity_manipulation.rs b/server/src/events/entity_manipulation.rs index 78b14d3517..c559ba19b6 100644 --- a/server/src/events/entity_manipulation.rs +++ b/server/src/events/entity_manipulation.rs @@ -992,13 +992,12 @@ fn handle_exp_gain( // Closure to add xp pool corresponding to weapon type equipped in a particular // EquipSlot let mut add_tool_from_slot = |equip_slot| { - let tool_kind = inventory.equipped(equip_slot).and_then(|i| { - if let ItemKind::Tool(tool) = &i.kind() { - Some(tool.kind) - } else { - None - } - }); + let tool_kind = inventory + .equipped(equip_slot) + .and_then(|i| match &i.kind() { + ItemKind::Tool(tool) if tool.kind.gains_combat_xp() => Some(tool.kind), + _ => None, + }); if let Some(weapon) = tool_kind { // Only adds to xp pools if entity has that skill group available if skill_set.contains_skill_group(SkillGroupKind::Weapon(weapon)) { diff --git a/server/src/events/interaction.rs b/server/src/events/interaction.rs index e8c4a5e0e9..3220a8a25b 100644 --- a/server/src/events/interaction.rs +++ b/server/src/events/interaction.rs @@ -3,6 +3,7 @@ use tracing::error; use vek::*; use common::{ + assets, comp::{ self, agent::{AgentEvent, Sound, MAX_LISTEN_DIST}, @@ -11,7 +12,7 @@ use common::{ item, slot::Slot, tool::ToolKind, - Inventory, Pos, + Inventory, Pos, SkillGroupKind, }, consts::{MAX_MOUNT_RANGE, SOUND_TRAVEL_DIST_PER_VOLUME}, outcome::Outcome, @@ -27,6 +28,10 @@ use crate::{ Server, }; +use hashbrown::HashMap; +use lazy_static::lazy_static; +use serde::Deserialize; + pub fn handle_lantern(server: &mut Server, entity: EcsEntity, enable: bool) { let ecs = server.state_mut().ecs(); @@ -281,13 +286,80 @@ fn within_mounting_range(player_position: Option<&Pos>, mount_position: Option<& } } -pub fn handle_mine_block(server: &mut Server, pos: Vec3, tool: Option) { +#[derive(Deserialize)] +struct ResourceExperienceManifest(HashMap); + +impl assets::Asset for ResourceExperienceManifest { + type Loader = assets::RonLoader; + + const EXTENSION: &'static str = "ron"; +} + +lazy_static! { + static ref RESOURCE_EXPERIENCE_MANIFEST: assets::AssetHandle = + assets::AssetExt::load_expect("server.manifests.resource_experience_manifest"); +} + +pub fn handle_mine_block( + server: &mut Server, + entity: EcsEntity, + pos: Vec3, + tool: Option, +) { let state = server.state_mut(); if state.can_set_block(pos) { let block = state.terrain().get(pos).ok().copied(); if let Some(block) = block.filter(|b| b.mine_tool().map_or(false, |t| Some(t) == tool)) { // Drop item if one is recoverable from the block - if let Some(item) = comp::Item::try_reclaim_from_block(block) { + if let Some(mut item) = comp::Item::try_reclaim_from_block(block) { + if let Some(mut skillset) = state + .ecs() + .write_storage::() + .get_mut(entity) + { + if let (Some(tool), Some(uid), Some(exp_reward)) = ( + tool, + state.ecs().uid_from_entity(entity), + RESOURCE_EXPERIENCE_MANIFEST + .read() + .0 + .get(item.item_definition_id()), + ) { + skillset.change_experience(SkillGroupKind::Weapon(tool), *exp_reward); + state + .ecs() + .write_resource::>() + .push(Outcome::ExpChange { + uid, + exp: *exp_reward, + }); + } + use common::comp::skills::{PickSkill, Skill}; + use rand::Rng; + let mut rng = rand::thread_rng(); + if item.item_definition_id().contains("mineral.ore.") + && rng.gen_bool( + 0.05 * skillset + .skill_level(Skill::Pick(PickSkill::OreGain)) + .ok() + .flatten() + .unwrap_or(0) as f64, + ) + { + let _ = item.increase_amount(1); + } + if item.item_definition_id().contains("mineral.gem.") + && rng.gen_bool( + 0.05 * skillset + .skill_level(Skill::Pick(PickSkill::GemGain)) + .ok() + .flatten() + .unwrap_or(0) as f64, + ) + { + let _ = item.increase_amount(1); + } + } state .create_object(Default::default(), comp::object::Body::Pouch) .with(comp::Pos(pos.map(|e| e as f32) + Vec3::new(0.5, 0.5, 0.0))) diff --git a/server/src/events/mod.rs b/server/src/events/mod.rs index c808e8f28a..7079b3bda3 100644 --- a/server/src/events/mod.rs +++ b/server/src/events/mod.rs @@ -207,7 +207,9 @@ impl Server { handle_combo_change(&self, entity, change) }, ServerEvent::RequestSiteInfo { entity, id } => handle_site_info(&self, entity, id), - ServerEvent::MineBlock { pos, tool } => handle_mine_block(self, pos, tool), + ServerEvent::MineBlock { entity, pos, tool } => { + handle_mine_block(self, entity, pos, tool) + }, ServerEvent::TeleportTo { entity, target, diff --git a/server/src/migrations/V41__mining_tree.sql b/server/src/migrations/V41__mining_tree.sql new file mode 100644 index 0000000000..e4cd339df7 --- /dev/null +++ b/server/src/migrations/V41__mining_tree.sql @@ -0,0 +1,7 @@ +-- Every character should have the pick skilltree unlocked by default. +-- This is handled by `SkillSet::default()` for new characters (and their skill +-- sets serialize properly during character creation), but since the database +-- deserialization builds the SkillSet fields from empty Vecs/HashMaps, the skill +-- tree needs to manually be added to each character. +INSERT INTO skill_group (entity_id, skill_group_kind, exp, available_sp, earned_sp) + SELECT character_id, 'Weapon Pick', 0, 0, 0 FROM character; diff --git a/server/src/persistence/json_models.rs b/server/src/persistence/json_models.rs index 81d9531022..b74955ae46 100644 --- a/server/src/persistence/json_models.rs +++ b/server/src/persistence/json_models.rs @@ -40,8 +40,8 @@ pub fn skill_to_db_string(skill: comp::skills::Skill) -> String { use comp::{ item::tool::ToolKind, skills::{ - AxeSkill, BowSkill, ClimbSkill, GeneralSkill, HammerSkill, RollSkill, SceptreSkill, - Skill::*, SkillGroupKind, StaffSkill, SwimSkill, SwordSkill, + AxeSkill, BowSkill, ClimbSkill, GeneralSkill, HammerSkill, PickSkill, RollSkill, + SceptreSkill, Skill::*, SkillGroupKind, StaffSkill, SwimSkill, SwordSkill, }, }; let skill_string = match skill { @@ -135,6 +135,9 @@ pub fn skill_to_db_string(skill: comp::skills::Skill) -> String { Climb(ClimbSkill::Cost) => "Climb Cost", Climb(ClimbSkill::Speed) => "Climb Speed", Swim(SwimSkill::Speed) => "Swim Speed", + Pick(PickSkill::Speed) => "Pick Speed", + Pick(PickSkill::OreGain) => "Pick OreGain", + Pick(PickSkill::GemGain) => "Pick GemGain", UnlockGroup(SkillGroupKind::Weapon(ToolKind::Sword)) => "Unlock Weapon Sword", UnlockGroup(SkillGroupKind::Weapon(ToolKind::Axe)) => "Unlock Weapon Axe", UnlockGroup(SkillGroupKind::Weapon(ToolKind::Hammer)) => "Unlock Weapon Hammer", @@ -160,8 +163,8 @@ pub fn db_string_to_skill(skill_string: &str) -> comp::skills::Skill { use comp::{ item::tool::ToolKind, skills::{ - AxeSkill, BowSkill, ClimbSkill, GeneralSkill, HammerSkill, RollSkill, SceptreSkill, - Skill::*, SkillGroupKind, StaffSkill, SwimSkill, SwordSkill, + AxeSkill, BowSkill, ClimbSkill, GeneralSkill, HammerSkill, PickSkill, RollSkill, + SceptreSkill, Skill::*, SkillGroupKind, StaffSkill, SwimSkill, SwordSkill, }, }; match skill_string { @@ -255,6 +258,9 @@ pub fn db_string_to_skill(skill_string: &str) -> comp::skills::Skill { "Climb Cost" => Climb(ClimbSkill::Cost), "Climb Speed" => Climb(ClimbSkill::Speed), "Swim Speed" => Swim(SwimSkill::Speed), + "Pick Speed" => Pick(PickSkill::Speed), + "Pick GemGain" => Pick(PickSkill::GemGain), + "Pick OreGain" => Pick(PickSkill::OreGain), "Unlock Weapon Sword" => UnlockGroup(SkillGroupKind::Weapon(ToolKind::Sword)), "Unlock Weapon Axe" => UnlockGroup(SkillGroupKind::Weapon(ToolKind::Axe)), "Unlock Weapon Hammer" => UnlockGroup(SkillGroupKind::Weapon(ToolKind::Hammer)), @@ -280,12 +286,12 @@ pub fn skill_group_to_db_string(skill_group: comp::skills::SkillGroupKind) -> St Weapon(ToolKind::Bow) => "Weapon Bow", Weapon(ToolKind::Staff) => "Weapon Staff", Weapon(ToolKind::Sceptre) => "Weapon Sceptre", + Weapon(ToolKind::Pick) => "Weapon Pick", Weapon(ToolKind::Dagger) | Weapon(ToolKind::Shield) | Weapon(ToolKind::Spear) | Weapon(ToolKind::Debug) | Weapon(ToolKind::Farming) - | Weapon(ToolKind::Pick) | Weapon(ToolKind::Empty) | Weapon(ToolKind::Natural) => panic!( "Tried to add unsupported skill group to database: {:?}", @@ -305,6 +311,7 @@ pub fn db_string_to_skill_group(skill_group_string: &str) -> comp::skills::Skill "Weapon Bow" => Weapon(ToolKind::Bow), "Weapon Staff" => Weapon(ToolKind::Staff), "Weapon Sceptre" => Weapon(ToolKind::Sceptre), + "Weapon Pick" => Weapon(ToolKind::Pick), _ => panic!( "Tried to convert an unsupported string from the database: {}", skill_group_string diff --git a/voxygen/src/hud/diary.rs b/voxygen/src/hud/diary.rs index 2e679c6362..48182bda38 100644 --- a/voxygen/src/hud/diary.rs +++ b/voxygen/src/hud/diary.rs @@ -149,6 +149,11 @@ widget_ids! { skill_sceptre_aura_2, skill_sceptre_aura_3, skill_sceptre_aura_4, + pick_render, + skill_pick_m1, + skill_pick_m1_0, + skill_pick_m1_1, + skill_pick_m1_2, general_combat_render_0, general_combat_render_1, skill_general_stat_0, @@ -227,7 +232,7 @@ impl<'a> Diary<'a> { pub type SelectedSkillTree = skills::SkillGroupKind; -const TREES: [&str; 7] = [ +const TREES: [&str; 8] = [ "General Combat", "Sword", "Hammer", @@ -235,6 +240,7 @@ const TREES: [&str; 7] = [ "Sceptre", "Bow", "Fire Staff", + "Pickaxe", ]; pub enum Event { @@ -353,6 +359,7 @@ impl<'a> Widget for Diary<'a> { "Sceptre" => self.imgs.sceptre, "Bow" => self.imgs.bow, "Fire Staff" => self.imgs.staff, + "Pickaxe" => self.imgs.pickaxe, _ => self.imgs.nothing, }); @@ -500,6 +507,9 @@ impl<'a> Widget for Diary<'a> { SelectedSkillTree::Weapon(ToolKind::Staff) => { self.localized_strings.get("common.weapons.staff") }, + SelectedSkillTree::Weapon(ToolKind::Pick) => { + self.localized_strings.get("common.tool.pick") + }, _ => "Unknown", }; self.create_new_text(&tree_title, state.content_align, 2.0, 34, TEXT_COLOR) @@ -531,6 +541,7 @@ impl<'a> Widget for Diary<'a> { SelectedSkillTree::Weapon(ToolKind::Bow) => 6, SelectedSkillTree::Weapon(ToolKind::Staff) => 4, SelectedSkillTree::Weapon(ToolKind::Sceptre) => 5, + SelectedSkillTree::Weapon(ToolKind::Pick) => 4, _ => 0, }; let skills_top_r = match sel_tab { @@ -1976,6 +1987,65 @@ impl<'a> Widget for Diary<'a> { &diary_tooltip, ); }, + SelectedSkillTree::Weapon(ToolKind::Pick) => { + use skills::PickSkill::*; + // Pick + Image::new(animate_by_pulse( + &self + .item_imgs + .img_ids_or_not_found_img(Tool("example_pick".to_string())), + self.pulse, + )) + .wh(art_size) + .middle_of(state.content_align) + .color(Some(Color::Rgba(1.0, 1.0, 1.0, 1.0))) + .set(state.pick_render, ui); + // Top Left skills + // 5 1 6 + // 3 0 4 + // 8 2 7 + Button::image(self.imgs.pickaxe) + .w_h(74.0, 74.0) + .mid_top_with_margin_on(state.skills_top_l[0], 3.0) + .with_tooltip( + self.tooltip_manager, + &self.localized_strings.get("hud.skill.pick_strike_title"), + &self.localized_strings.get("hud.skill.pick_strike"), + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_pick_m1, ui); + self.create_unlock_skill_button( + Skill::Pick(Speed), + self.imgs.pickaxe_speed_skill, + state.skills_top_l[1], + "pick_strike_speed", + state.skill_pick_m1_0, + ui, + &mut events, + &diary_tooltip, + ); + self.create_unlock_skill_button( + Skill::Pick(OreGain), + self.imgs.pickaxe_oregain_skill, + state.skills_top_l[2], + "pick_strike_oregain", + state.skill_pick_m1_1, + ui, + &mut events, + &diary_tooltip, + ); + self.create_unlock_skill_button( + Skill::Pick(GemGain), + self.imgs.pickaxe_gemgain_skill, + state.skills_top_l[3], + "pick_strike_gemgain", + state.skill_pick_m1_2, + ui, + &mut events, + &diary_tooltip, + ); + }, _ => {}, } @@ -2034,6 +2104,7 @@ fn skill_tree_from_str(string: &str) -> Option { "Sceptre" => Some(SelectedSkillTree::Weapon(ToolKind::Sceptre)), "Bow" => Some(SelectedSkillTree::Weapon(ToolKind::Bow)), "Fire Staff" => Some(SelectedSkillTree::Weapon(ToolKind::Staff)), + "Pickaxe" => Some(SelectedSkillTree::Weapon(ToolKind::Pick)), _ => None, } } diff --git a/voxygen/src/hud/img_ids.rs b/voxygen/src/hud/img_ids.rs index f96bd8b610..e451dd3409 100644 --- a/voxygen/src/hud/img_ids.rs +++ b/voxygen/src/hud/img_ids.rs @@ -78,6 +78,7 @@ image_ids! { hammer: "voxygen.element.weapons.hammer", bow: "voxygen.element.weapons.bow", staff: "voxygen.element.weapons.staff", + pickaxe: "voxygen.element.weapons.pickaxe", lock: "voxygen.element.ui.diary.buttons.lock", wpn_icon_border_skills: "voxygen.element.ui.diary.buttons.border_skills", wpn_icon_border: "voxygen.element.ui.generic.buttons.border", @@ -303,6 +304,10 @@ image_ids! { utility_speed_skill: "voxygen.element.skills.skilltree.utility_speed", utility_duration_skill: "voxygen.element.skills.skilltree.utility_duration", + pickaxe_speed_skill: "voxygen.element.skills.pickaxe_speed", + pickaxe_oregain_skill: "voxygen.element.skills.pickaxe_oregain", + pickaxe_gemgain_skill: "voxygen.element.skills.pickaxe_gemgain", + // Skillbar level_up: "voxygen.element.ui.skillbar.level_up", bar_content: "voxygen.element.ui.skillbar.bar_content", diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 585361849d..90aef9563f 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -1353,6 +1353,7 @@ impl Hud { Weapon(ToolKind::Sceptre) => &i18n.get("common.weapons.sceptre"), Weapon(ToolKind::Bow) => &i18n.get("common.weapons.bow"), Weapon(ToolKind::Staff) => &i18n.get("common.weapons.staff"), + Weapon(ToolKind::Pick) => &i18n.get("common.tool.pick"), _ => "Unknown", }; Text::new(skill) From ef3d5f36d5f5b57b6e1e6816bae4d5ee44b0cf89 Mon Sep 17 00:00:00 2001 From: Avi Weinstock Date: Wed, 9 Jun 2021 01:35:30 -0400 Subject: [PATCH 2/6] Address MR 2406 comments. - Tweak ore xp values per Slipped's advice. --- assets/server/manifests/resource_experience_manifest.ron | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/server/manifests/resource_experience_manifest.ron b/assets/server/manifests/resource_experience_manifest.ron index 6345e0d392..c597adef8f 100644 --- a/assets/server/manifests/resource_experience_manifest.ron +++ b/assets/server/manifests/resource_experience_manifest.ron @@ -9,11 +9,11 @@ ResourceExperienceManifest({ "common.items.mineral.ore.coal": 25, "common.items.mineral.ore.gold": 100, "common.items.mineral.ore.iron": 20, - "common.items.mineral.ore.silver": 75, + "common.items.mineral.ore.silver": 90, "common.items.mineral.ore.velorite": 30, "common.items.mineral.ore.veloritefrag": 20, - "common.items.mineral.ore.bloodstone": 100, - "common.items.mineral.ore.cobalt": 75, + "common.items.mineral.ore.bloodstone": 80, + "common.items.mineral.ore.cobalt": 60, "common.items.mineral.ore.copper": 10, "common.items.mineral.ore.tin": 10, }) From c34fa59a08fe80ca11c0a6d5fc7adb4fe8f0f433 Mon Sep 17 00:00:00 2001 From: Monty Marz Date: Wed, 9 Jun 2021 21:07:34 +0200 Subject: [PATCH 3/6] icons and naming --- .../element/{weapons => skills}/pickaxe.png | Bin assets/voxygen/element/weapons/axe.png | Bin 168 -> 285 bytes assets/voxygen/element/weapons/bow.png | Bin 169 -> 294 bytes assets/voxygen/element/weapons/daggers.png | Bin 183 -> 319 bytes assets/voxygen/element/weapons/hammer.png | Bin 157 -> 276 bytes assets/voxygen/element/weapons/mining.png | Bin 0 -> 435 bytes assets/voxygen/element/weapons/staff.png | Bin 149 -> 279 bytes assets/voxygen/element/weapons/sword.png | Bin 158 -> 288 bytes assets/voxygen/i18n/en/common.ron | 1 + assets/voxygen/i18n/en/skills.ron | 3 ++- common/src/comp/ability.rs | 2 +- common/src/comp/skills.rs | 4 ++-- server/src/events/interaction.rs | 6 +++--- server/src/persistence/json_models.rs | 16 ++++++++-------- voxygen/src/hud/diary.rs | 12 ++++++------ voxygen/src/hud/img_ids.rs | 3 ++- voxygen/src/hud/mod.rs | 3 ++- 17 files changed, 27 insertions(+), 23 deletions(-) rename assets/voxygen/element/{weapons => skills}/pickaxe.png (100%) create mode 100644 assets/voxygen/element/weapons/mining.png diff --git a/assets/voxygen/element/weapons/pickaxe.png b/assets/voxygen/element/skills/pickaxe.png similarity index 100% rename from assets/voxygen/element/weapons/pickaxe.png rename to assets/voxygen/element/skills/pickaxe.png diff --git a/assets/voxygen/element/weapons/axe.png b/assets/voxygen/element/weapons/axe.png index bb626251839e504cfa94c4ade6f7246efad17101..2c1ec4eb42aec6607c3a3fb6426872f3fe577521 100644 GIT binary patch delta 269 zcmV+o0rLK+0i6Pn8Gi-<0043g-;@9V010qNS#tmY3ljhU3ljkVnw%H_001CkNK#Dz z0D2_=0Dyx40Qvs_0D$QL0Cg|`0P0`>06Lfe02gnPU&TfM005&&L_t(|+U(Xn3cw%? z1z_*c+0%H7?4H9*W$p<&d7*R)Xn#|h*P%E(h#-6#R16`6<$vQ0(3V=OXrQ1X%q+|- z@Ex`o9Nc0${sh#Th=howo#P5>-C|nnLflX383qC89J@B&VDG>=M=5ENlBTY;in)SE znDO%aV6dm{CH4$-!0ezCW&<6ud(auX1_9VP2*Qp*Ahrj=*d7F9_V+k#bT#5gy6>_+b+_;r{tBbZ z7gZ*eYfKa7e|LYKeeH$u+06Lfe02gnPU&TfM0068>L_t(|+U(Xn4uBvG z2GHKY*_DxzgxQ3ZQ+N(9#q0^V6HX)q`890^b?AiQrSe$;0Dthz^@DE&&wUNGLIvZd z$F@`p0WL2%=Wd%K!S%%wn!?uTfF7C}3IN_39h4LSJ*6#FNio~$*n^0jj=zqPP6vWC zcjzrNh6#Pr^wQfwpMAhRlw_9nh6Bm)ZlPp8ga7~l delta 152 zcmZ3+w32axWIZzj1B2^j{bfK(D8MJg6-bx4FobD|ZP~KL-_6oYPwl*-@<*U3V@Z%- z@R>^{VShn7JY5_^DsG)UZOC^(f#I;j+eONi42~uelF{r5}E)i C4?I=? diff --git a/assets/voxygen/element/weapons/daggers.png b/assets/voxygen/element/weapons/daggers.png index f63f8a3345e150d26cfebd1b7a16c96d772bb442..73e476d09bcb461b780fbd7f1dbf9b259093b77f 100644 GIT binary patch delta 303 zcmV+~0nq-p0lxx}8Gi-<0043g-;@9V010qNS#tmY3ljhU3ljkVnw%H_001CkNK#Dz z0D2_=0Dyx40Qvs_0D$QL0Cg|`0P0`>06Lfe02gnPU&TfM006~FL_t(|+U(Y`5rZ%c z1yJwcnrXa+dlt|FUP?6+WGAKicTNIG!ZJmULPx{Dhd>}wN`L8fb3LG5%q+Kn%q*zs zATtXQ364|20n85$VmjDAp8!k;0R&;TTS`Qiu!Hl@L#j3>oB1AOZ)W)6V*fG=blpSxf0`AM|wAf7T40{eqY(PiL53$L;?N?@X0x^c@pC zwk`Vi(}>1xizsQ}e{G9k>>4j^#*!ev z;4_y@!u|p|!JaOTAr-gwPBi2@V8C(2LipeRr+tlHdsjA{H99Adl$|o=%Ugl{Ry+B2 znoH)rOLbEAD-M;s9+viAEp+*=Csr@7cDiMh9F&}WLw^489SIMU!mG9$@#iowys&*- Rmj^VT!PC{xWt~$(69CkuL5~0c diff --git a/assets/voxygen/element/weapons/hammer.png b/assets/voxygen/element/weapons/hammer.png index 04c4b73c27dda0da645317004dbfdec58f0761a2..adeb6ed68f48c728e07bbfa77a55ba47edd7025a 100644 GIT binary patch delta 259 zcmV+e0sQ`*0h9ue8Gi-<0043g-;@9V010qNS#tmY3ljhU3ljkVnw%H_001CkNK#Dz z0D2_=0Dyx40Qvs_0D$QL0Cg|`0P0`>06Lfe02gnPU&TfM005dvL_t(|+U(ZN4Zt7> z22ghJ+-aPp3%Ed+;@k0C*N>gM1$X5s{XGh)5iFkfD^4 z2A#tc=p4owK*uZ0Aq6_#!xq?y>ZWu8)q(eUkP_8lR}6H;AfhG}=9u)nCOxcSHPmEE zB`ilx_OJ&tJ8j083_4(K&ZtF#aWY~%!T3L_w!LeA;yv*zu+^M zOv3&GIX0dyjv*Dd&YoPz*kB;Qa`3MAul16RPyG`nZ9L3+Nl!C9=v<23@zCdA|G(Q* rts6g|{p|wTEsy^k{TZ(_`g8%^e{{R4h=>PzAFaQARU;qF*m;eA5Z<1fd zMgRZ-IY~r8RCwC#)-i4ZK@0`Zy+i7BZs!tCHMshR$T?Edr{Dq+LR=yz$Q2Nx_8~S! z;*oJ?(C)C%gklN=%(K5O*kKrkuREUy_y89KPshX9I*Ws+<6+$Iw$*bbJnsuN{N^+K ze0?6@UY_m)8s@>7XdmX|y$KjGKhwoQkFC}l<@XPbOJuM8dtG4c%s{)?gRz*|U@gYg zdZYg0#lY6gVwVQ`LPSLEbCbY`#j5?~``vbAX7xqnob^Jt(_*xX0H_B6s0T%4I@pTQ z1I+vf08k(i(YRPu@Y2j;m&~jpq9XEBz;CA!1E2u3*H4Mdb1^h- zrjOTB=msNNB6V>BIGeMGC=uyZ{}x1~DJ2C^w$^X26~oLmtpAxNrBr5=Qc@x+AQ82& dfAG}yJpgu$u$K(jgI)jt002ovPDHLkV1m*%xy%3n literal 0 HcmV?d00001 diff --git a/assets/voxygen/element/weapons/staff.png b/assets/voxygen/element/weapons/staff.png index 60a3e593ecde75cd8a6fbaf2c414f1e336dc7c56..abd21760c6385c2bdfd15f4c2a3f3acdc54120db 100644 GIT binary patch delta 264 zcmbQrIGt&NL_G%^0|P@5@BJx2inG8YvY3H^TNs2H8D`Cq017H3dj$D1FjT2BFf=qX zF#P-vq+c>Hlo~KFyh>nTu$sZZAf7)d{-_&J?Oab6$B>F!Z?0K$H5dr6T-e(@mGSr9 z_6pAG^$XK4n$>zmOTRY>YkFXQGS6Y-j9-QZN9zRy&vt%p)@RT))-j&cFirBZLqTcZ zHHj5X$-xJV4qvtW)pe;McIHCUXFQXc!*hCHWo(=A%gc77g#iOMJM%^Z1E$aH%7*p< z4Ap#GiRT?0-^hs^Tj$97MkeG?pQCFIzgF^bUeS&Jx7ISmurbIn?{vOix-bstQU*^~ LKbLh*35-nuZ$Dg; delta 132 zcmbQvG?j6JL@f(50|P^Y@}cEGN+Q4~#1%-d*3dYS zJ3u+ck|4j}GnY)l{sKALo-U3d6^zLX_!2}M9&*i8_#Dw19I!)`@5G%CMIxRC{ECqV gC90A)R*LLkU^3t~508701k}dh>FVdQ&MBb@0Ex9G{r~^~ diff --git a/assets/voxygen/element/weapons/sword.png b/assets/voxygen/element/weapons/sword.png index d986a7cb56826f6211dd7995fcc7aa37740f7937..5a15e2b54f1f33aba3b6e72a9cba3d5672ac491f 100644 GIT binary patch delta 272 zcmbQoxPWPbWIY=L149w-{V70-v%n*=n1O*?7=#%aX3dcR3MwRf1o<*BRH-sBG&D0X z{QM83UotS18Za=tN?>5Hn!&&zo1@czNCWgo>} zZ9Wixz>tDWIZzj1B2^j{bfK(D8MJg6-aN{vZbh~C@Lx{&Vr%Lh2iOyIUPVz#*!ev z;4_y@!u|p|R-P`7Ar-f-URce@puod?@z0I=R35XdU)~hA=PR*K7MEskzQMa;o@lA5 q%c?S=)zS&&+NV { - use skills::PickSkill::*; + use skills::MiningSkill::*; if let BasicMelee { ref mut buildup_duration, ref mut swing_duration, diff --git a/common/src/comp/skills.rs b/common/src/comp/skills.rs index c130b067c9..bd7e999f04 100644 --- a/common/src/comp/skills.rs +++ b/common/src/comp/skills.rs @@ -107,7 +107,7 @@ pub enum Skill { Roll(RollSkill), Climb(ClimbSkill), Swim(SwimSkill), - Pick(PickSkill), + Pick(MiningSkill), } pub enum SkillError { @@ -265,7 +265,7 @@ pub enum SwimSkill { } #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, Serialize, Deserialize)] -pub enum PickSkill { +pub enum MiningSkill { Speed, OreGain, GemGain, diff --git a/server/src/events/interaction.rs b/server/src/events/interaction.rs index 3220a8a25b..9653ef4fc1 100644 --- a/server/src/events/interaction.rs +++ b/server/src/events/interaction.rs @@ -334,13 +334,13 @@ pub fn handle_mine_block( exp: *exp_reward, }); } - use common::comp::skills::{PickSkill, Skill}; + use common::comp::skills::{MiningSkill, Skill}; use rand::Rng; let mut rng = rand::thread_rng(); if item.item_definition_id().contains("mineral.ore.") && rng.gen_bool( 0.05 * skillset - .skill_level(Skill::Pick(PickSkill::OreGain)) + .skill_level(Skill::Pick(MiningSkill::OreGain)) .ok() .flatten() .unwrap_or(0) as f64, @@ -351,7 +351,7 @@ pub fn handle_mine_block( if item.item_definition_id().contains("mineral.gem.") && rng.gen_bool( 0.05 * skillset - .skill_level(Skill::Pick(PickSkill::GemGain)) + .skill_level(Skill::Pick(MiningSkill::GemGain)) .ok() .flatten() .unwrap_or(0) as f64, diff --git a/server/src/persistence/json_models.rs b/server/src/persistence/json_models.rs index b74955ae46..d359cc4672 100644 --- a/server/src/persistence/json_models.rs +++ b/server/src/persistence/json_models.rs @@ -40,7 +40,7 @@ pub fn skill_to_db_string(skill: comp::skills::Skill) -> String { use comp::{ item::tool::ToolKind, skills::{ - AxeSkill, BowSkill, ClimbSkill, GeneralSkill, HammerSkill, PickSkill, RollSkill, + AxeSkill, BowSkill, ClimbSkill, GeneralSkill, HammerSkill, MiningSkill, RollSkill, SceptreSkill, Skill::*, SkillGroupKind, StaffSkill, SwimSkill, SwordSkill, }, }; @@ -135,9 +135,9 @@ pub fn skill_to_db_string(skill: comp::skills::Skill) -> String { Climb(ClimbSkill::Cost) => "Climb Cost", Climb(ClimbSkill::Speed) => "Climb Speed", Swim(SwimSkill::Speed) => "Swim Speed", - Pick(PickSkill::Speed) => "Pick Speed", - Pick(PickSkill::OreGain) => "Pick OreGain", - Pick(PickSkill::GemGain) => "Pick GemGain", + Pick(MiningSkill::Speed) => "Pick Speed", + Pick(MiningSkill::OreGain) => "Pick OreGain", + Pick(MiningSkill::GemGain) => "Pick GemGain", UnlockGroup(SkillGroupKind::Weapon(ToolKind::Sword)) => "Unlock Weapon Sword", UnlockGroup(SkillGroupKind::Weapon(ToolKind::Axe)) => "Unlock Weapon Axe", UnlockGroup(SkillGroupKind::Weapon(ToolKind::Hammer)) => "Unlock Weapon Hammer", @@ -163,7 +163,7 @@ pub fn db_string_to_skill(skill_string: &str) -> comp::skills::Skill { use comp::{ item::tool::ToolKind, skills::{ - AxeSkill, BowSkill, ClimbSkill, GeneralSkill, HammerSkill, PickSkill, RollSkill, + AxeSkill, BowSkill, ClimbSkill, GeneralSkill, HammerSkill, MiningSkill, RollSkill, SceptreSkill, Skill::*, SkillGroupKind, StaffSkill, SwimSkill, SwordSkill, }, }; @@ -258,9 +258,9 @@ pub fn db_string_to_skill(skill_string: &str) -> comp::skills::Skill { "Climb Cost" => Climb(ClimbSkill::Cost), "Climb Speed" => Climb(ClimbSkill::Speed), "Swim Speed" => Swim(SwimSkill::Speed), - "Pick Speed" => Pick(PickSkill::Speed), - "Pick GemGain" => Pick(PickSkill::GemGain), - "Pick OreGain" => Pick(PickSkill::OreGain), + "Pick Speed" => Pick(MiningSkill::Speed), + "Pick GemGain" => Pick(MiningSkill::GemGain), + "Pick OreGain" => Pick(MiningSkill::OreGain), "Unlock Weapon Sword" => UnlockGroup(SkillGroupKind::Weapon(ToolKind::Sword)), "Unlock Weapon Axe" => UnlockGroup(SkillGroupKind::Weapon(ToolKind::Axe)), "Unlock Weapon Hammer" => UnlockGroup(SkillGroupKind::Weapon(ToolKind::Hammer)), diff --git a/voxygen/src/hud/diary.rs b/voxygen/src/hud/diary.rs index 48182bda38..96a0cb6fc7 100644 --- a/voxygen/src/hud/diary.rs +++ b/voxygen/src/hud/diary.rs @@ -240,7 +240,7 @@ const TREES: [&str; 8] = [ "Sceptre", "Bow", "Fire Staff", - "Pickaxe", + "Mining", ]; pub enum Event { @@ -359,7 +359,7 @@ impl<'a> Widget for Diary<'a> { "Sceptre" => self.imgs.sceptre, "Bow" => self.imgs.bow, "Fire Staff" => self.imgs.staff, - "Pickaxe" => self.imgs.pickaxe, + "Mining" => self.imgs.mining, _ => self.imgs.nothing, }); @@ -508,7 +508,7 @@ impl<'a> Widget for Diary<'a> { self.localized_strings.get("common.weapons.staff") }, SelectedSkillTree::Weapon(ToolKind::Pick) => { - self.localized_strings.get("common.tool.pick") + self.localized_strings.get("common.tool.mining") }, _ => "Unknown", }; @@ -1988,8 +1988,8 @@ impl<'a> Widget for Diary<'a> { ); }, SelectedSkillTree::Weapon(ToolKind::Pick) => { - use skills::PickSkill::*; - // Pick + use skills::MiningSkill::*; + // Mining Image::new(animate_by_pulse( &self .item_imgs @@ -2104,7 +2104,7 @@ fn skill_tree_from_str(string: &str) -> Option { "Sceptre" => Some(SelectedSkillTree::Weapon(ToolKind::Sceptre)), "Bow" => Some(SelectedSkillTree::Weapon(ToolKind::Bow)), "Fire Staff" => Some(SelectedSkillTree::Weapon(ToolKind::Staff)), - "Pickaxe" => Some(SelectedSkillTree::Weapon(ToolKind::Pick)), + "Mining" => Some(SelectedSkillTree::Weapon(ToolKind::Pick)), _ => None, } } diff --git a/voxygen/src/hud/img_ids.rs b/voxygen/src/hud/img_ids.rs index e451dd3409..2a48f5e028 100644 --- a/voxygen/src/hud/img_ids.rs +++ b/voxygen/src/hud/img_ids.rs @@ -78,7 +78,8 @@ image_ids! { hammer: "voxygen.element.weapons.hammer", bow: "voxygen.element.weapons.bow", staff: "voxygen.element.weapons.staff", - pickaxe: "voxygen.element.weapons.pickaxe", + mining: "voxygen.element.weapons.mining", + pickaxe: "voxygen.element.skills.pickaxe", lock: "voxygen.element.ui.diary.buttons.lock", wpn_icon_border_skills: "voxygen.element.ui.diary.buttons.border_skills", wpn_icon_border: "voxygen.element.ui.generic.buttons.border", diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 90aef9563f..605833dd5f 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -1353,7 +1353,7 @@ impl Hud { Weapon(ToolKind::Sceptre) => &i18n.get("common.weapons.sceptre"), Weapon(ToolKind::Bow) => &i18n.get("common.weapons.bow"), Weapon(ToolKind::Staff) => &i18n.get("common.weapons.staff"), - Weapon(ToolKind::Pick) => &i18n.get("common.tool.pick"), + Weapon(ToolKind::Pick) => &i18n.get("common.tool.mining"), _ => "Unknown", }; Text::new(skill) @@ -1378,6 +1378,7 @@ impl Hud { Weapon(ToolKind::Sceptre) => self.imgs.sceptre, Weapon(ToolKind::Bow) => self.imgs.bow, Weapon(ToolKind::Staff) => self.imgs.staff, + Weapon(ToolKind::Pick) => self.imgs.mining, _ => self.imgs.swords_crossed, }) .w_h(20.0, 20.0) From 4bd989e2a598c54d5cc58c6350af8b0329c0757a Mon Sep 17 00:00:00 2001 From: Avi Weinstock Date: Wed, 9 Jun 2021 16:03:25 -0400 Subject: [PATCH 4/6] Adjust mining xp numbers and add SkillGroupKind information to Outcome::ExpChange. --- .../resource_experience_manifest.ron | 32 +++++++++---------- common/src/outcome.rs | 4 ++- server/src/events/entity_manipulation.rs | 5 +-- server/src/events/interaction.rs | 4 ++- voxygen/src/hud/mod.rs | 9 ++++-- 5 files changed, 31 insertions(+), 23 deletions(-) diff --git a/assets/server/manifests/resource_experience_manifest.ron b/assets/server/manifests/resource_experience_manifest.ron index c597adef8f..829cea21c8 100644 --- a/assets/server/manifests/resource_experience_manifest.ron +++ b/assets/server/manifests/resource_experience_manifest.ron @@ -1,19 +1,19 @@ ResourceExperienceManifest({ - "common.items.mineral.gem.amethyst": 20, - "common.items.mineral.gem.sapphire": 50, - "common.items.mineral.gem.topaz": 20, - "common.items.mineral.gem.diamond": 100, - "common.items.mineral.gem.emerald": 50, - "common.items.mineral.gem.ruby": 75, + "common.items.mineral.gem.amethyst": 4, + "common.items.mineral.gem.sapphire": 8, + "common.items.mineral.gem.topaz": 4, + "common.items.mineral.gem.diamond": 25, + "common.items.mineral.gem.emerald": 10, + "common.items.mineral.gem.ruby": 12, - "common.items.mineral.ore.coal": 25, - "common.items.mineral.ore.gold": 100, - "common.items.mineral.ore.iron": 20, - "common.items.mineral.ore.silver": 90, - "common.items.mineral.ore.velorite": 30, - "common.items.mineral.ore.veloritefrag": 20, - "common.items.mineral.ore.bloodstone": 80, - "common.items.mineral.ore.cobalt": 60, - "common.items.mineral.ore.copper": 10, - "common.items.mineral.ore.tin": 10, + "common.items.mineral.ore.coal": 6, + "common.items.mineral.ore.gold": 25, + "common.items.mineral.ore.iron": 4, + "common.items.mineral.ore.silver": 22, + "common.items.mineral.ore.velorite": 8, + "common.items.mineral.ore.veloritefrag": 4, + "common.items.mineral.ore.bloodstone": 20, + "common.items.mineral.ore.cobalt": 15, + "common.items.mineral.ore.copper": 3, + "common.items.mineral.ore.tin": 3, }) diff --git a/common/src/outcome.rs b/common/src/outcome.rs index 559139d23a..d1ec35e15c 100644 --- a/common/src/outcome.rs +++ b/common/src/outcome.rs @@ -1,5 +1,6 @@ use crate::{comp, uid::Uid}; -use comp::{beam, item::Reagent, poise::PoiseState}; +use comp::{beam, item::Reagent, poise::PoiseState, skills::SkillGroupKind}; +use hashbrown::HashSet; use serde::{Deserialize, Serialize}; use vek::*; @@ -36,6 +37,7 @@ pub enum Outcome { ExpChange { uid: Uid, exp: i32, + xp_pools: HashSet, }, SkillPointGain { uid: Uid, diff --git a/server/src/events/entity_manipulation.rs b/server/src/events/entity_manipulation.rs index c559ba19b6..15dd48bae3 100644 --- a/server/src/events/entity_manipulation.rs +++ b/server/src/events/entity_manipulation.rs @@ -1011,12 +1011,13 @@ fn handle_exp_gain( add_tool_from_slot(EquipSlot::InactiveMainhand); add_tool_from_slot(EquipSlot::InactiveOffhand); let num_pools = xp_pools.len() as f32; - for pool in xp_pools { - skill_set.change_experience(pool, (exp_reward / num_pools).ceil() as i32); + for pool in xp_pools.iter() { + skill_set.change_experience(*pool, (exp_reward / num_pools).ceil() as i32); } outcomes.push(Outcome::ExpChange { uid: *uid, exp: exp_reward as i32, + xp_pools, }); } diff --git a/server/src/events/interaction.rs b/server/src/events/interaction.rs index 9653ef4fc1..03b5fe992a 100644 --- a/server/src/events/interaction.rs +++ b/server/src/events/interaction.rs @@ -28,9 +28,10 @@ use crate::{ Server, }; -use hashbrown::HashMap; +use hashbrown::{HashMap, HashSet}; use lazy_static::lazy_static; use serde::Deserialize; +use std::iter::FromIterator; pub fn handle_lantern(server: &mut Server, entity: EcsEntity, enable: bool) { let ecs = server.state_mut().ecs(); @@ -332,6 +333,7 @@ pub fn handle_mine_block( .push(Outcome::ExpChange { uid, exp: *exp_reward, + xp_pools: HashSet::from_iter(vec![SkillGroupKind::Weapon(tool)]), }); } use common::comp::skills::{MiningSkill, Skill}; diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 605833dd5f..b2944c0f39 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -1353,7 +1353,7 @@ impl Hud { Weapon(ToolKind::Sceptre) => &i18n.get("common.weapons.sceptre"), Weapon(ToolKind::Bow) => &i18n.get("common.weapons.bow"), Weapon(ToolKind::Staff) => &i18n.get("common.weapons.staff"), - Weapon(ToolKind::Pick) => &i18n.get("common.tool.mining"), + Weapon(ToolKind::Pick) => &i18n.get("common.tool.pick"), _ => "Unknown", }; Text::new(skill) @@ -1378,7 +1378,6 @@ impl Hud { Weapon(ToolKind::Sceptre) => self.imgs.sceptre, Weapon(ToolKind::Bow) => self.imgs.bow, Weapon(ToolKind::Staff) => self.imgs.staff, - Weapon(ToolKind::Pick) => self.imgs.mining, _ => self.imgs.swords_crossed, }) .w_h(20.0, 20.0) @@ -3659,7 +3658,11 @@ impl Hud { pub fn handle_outcome(&mut self, outcome: &Outcome) { match outcome { - Outcome::ExpChange { uid, exp } => self.floaters.exp_floaters.push(ExpFloater { + Outcome::ExpChange { + uid, + exp, + xp_pools: _, + } => self.floaters.exp_floaters.push(ExpFloater { owner: *uid, exp_change: *exp, timer: 4.0, From 8466df5078abf068074e43c3e5d10f43849401cf Mon Sep 17 00:00:00 2001 From: Monty Marz Date: Thu, 10 Jun 2021 02:23:27 +0200 Subject: [PATCH 5/6] mining exp sct color and icon; add mining to skill_preset --- assets/server/manifests/presets.ron | 4 ++ assets/voxygen/element/weapons/pickaxe.png | Bin 0 -> 466 bytes server/src/cmd.rs | 2 +- voxygen/src/hud/img_ids.rs | 1 + voxygen/src/hud/mod.rs | 48 +++++++++++++++------ 5 files changed, 40 insertions(+), 15 deletions(-) create mode 100644 assets/voxygen/element/weapons/pickaxe.png diff --git a/assets/server/manifests/presets.ron b/assets/server/manifests/presets.ron index 615af7a8da..136ef46054 100644 --- a/assets/server/manifests/presets.ron +++ b/assets/server/manifests/presets.ron @@ -127,6 +127,10 @@ (Sceptre(ADuration), 2), (Sceptre(ARange), 2), (Sceptre(ACost), 2), + // Mining + (Pick(Speed), 3), + (Pick(OreGain), 3), + (Pick(GemGain), 3), ], // Just copypasta from max with random reductions "middle": [ diff --git a/assets/voxygen/element/weapons/pickaxe.png b/assets/voxygen/element/weapons/pickaxe.png new file mode 100644 index 0000000000000000000000000000000000000000..ca6df22d7b1aa41b97ad270c5b5a89a63c6b1dd8 GIT binary patch literal 466 zcmV;@0WJQCP)(_`g8%^e{{R4h=>PzAFaQARU;qF*m;eA5Z<1fd zMgRZ-SV=@dRCwC#);n$jK@0#;-ywB6w{r=n8eI7hIY&zR6kH%eh)d)q2vPeGP7%B^ zW+quSyQE1k7tv>T$zJ@aRhTRH-oJ< zuGSlk7taQ^FrQnj(!rPrGpi>s3d~r}I$pltZHgFg3LS~ z?6olhM05p+$N(|3=EZ7)JuJ_y)~ZCL%&g4(oxr)$jERVfh&Dk0Xkxu8b2YiOwbmiJ zE$v}u25~Nq=FN=l^)CDf{`QrK=+M&8P7%47Gczk9>f|4905C+oGb*JhA`T!THnF@kw>~x^;Jg_B_pj}108%RxdyWoMwEzGB07*qo IM6N<$f=~#$z5oCK literal 0 HcmV?d00001 diff --git a/server/src/cmd.rs b/server/src/cmd.rs index eb6af36349..e2499761af 100644 --- a/server/src/cmd.rs +++ b/server/src/cmd.rs @@ -2610,7 +2610,7 @@ fn parse_skill_tree(skill_tree: &str) -> CmdResult "bow" => Ok(SkillGroupKind::Weapon(ToolKind::Bow)), "staff" => Ok(SkillGroupKind::Weapon(ToolKind::Staff)), "sceptre" => Ok(SkillGroupKind::Weapon(ToolKind::Sceptre)), - "pick" => Ok(SkillGroupKind::Weapon(ToolKind::Pick)), + "mining" => Ok(SkillGroupKind::Weapon(ToolKind::Pick)), _ => Err(format!("{} is not a skill group!", skill_tree)), } } diff --git a/voxygen/src/hud/img_ids.rs b/voxygen/src/hud/img_ids.rs index 2a48f5e028..6b5b5cfec0 100644 --- a/voxygen/src/hud/img_ids.rs +++ b/voxygen/src/hud/img_ids.rs @@ -80,6 +80,7 @@ image_ids! { staff: "voxygen.element.weapons.staff", mining: "voxygen.element.weapons.mining", pickaxe: "voxygen.element.skills.pickaxe", + pickaxe_ico: "voxygen.element.weapons.pickaxe", lock: "voxygen.element.ui.diary.buttons.lock", wpn_icon_border_skills: "voxygen.element.ui.diary.buttons.border_skills", wpn_icon_border: "voxygen.element.ui.generic.buttons.border", diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index b2944c0f39..a1501f6a2c 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -98,7 +98,7 @@ use conrod_core::{ widget::{self, Button, Image, Text}, widget_ids, Color, Colorable, Labelable, Positionable, Sizeable, Widget, }; -use hashbrown::HashMap; +use hashbrown::{HashMap, HashSet}; use rand::Rng; use specs::{Entity as EcsEntity, Join, WorldExt}; use std::{ @@ -211,6 +211,7 @@ widget_ids! { player_rank_up_icon, sct_exp_bgs[], sct_exps[], + sct_exp_icons[], sct_lvl_bg, sct_lvl, hurt_bg, @@ -324,6 +325,7 @@ pub struct ExpFloater { pub exp_change: i32, pub timer: f32, pub rand_offset: (f32, f32), + pub xp_pools: HashSet, } pub struct SkillPointGain { @@ -1252,7 +1254,11 @@ impl Hud { &mut self.ids.player_scts, &mut ui_widgets.widget_id_generator(), ); - // Increase font size based on fraction of maximum health + let player_sct_icon_id = player_sct_id_walker.next( + &mut self.ids.player_scts, + &mut ui_widgets.widget_id_generator(), + ); + // Increase font size based on fraction of maximum Experience // "flashes" by having a larger size in the first 100ms let font_size_xp = 30 + ((floater.exp_change as f32 / 300.0).min(1.0) * 50.0) as u32; @@ -1266,6 +1272,7 @@ impl Hud { }; if floater.exp_change > 0 { + let xp_pool = &floater.xp_pools; // Don't show 0 Exp Text::new(&format!("{} Exp", floater.exp_change.max(1))) .font_size(font_size_xp) @@ -1280,12 +1287,25 @@ impl Hud { Text::new(&format!("{} Exp", floater.exp_change.max(1))) .font_size(font_size_xp) .font_id(self.fonts.cyri.conrod_id) - .color(Color::Rgba(0.59, 0.41, 0.67, fade)) + .color( + if xp_pool.contains(&SkillGroupKind::Weapon(ToolKind::Pick)) { + Color::Rgba(0.18, 0.32, 0.9, fade) + } else { + Color::Rgba(0.59, 0.41, 0.67, fade) + }, + ) .x_y( ui_widgets.win_w * (0.5 * floater.rand_offset.0 as f64 - 0.25), ui_widgets.win_h * (0.15 * floater.rand_offset.1 as f64) + y, ) .set(player_sct_id, ui_widgets); + // Exp Source Image + if xp_pool.contains(&SkillGroupKind::Weapon(ToolKind::Pick)) { + Image::new(self.imgs.pickaxe_ico) + .w_h(font_size_xp as f64, font_size_xp as f64) + .left_from(player_sct_id, 5.0) + .set(player_sct_icon_id, ui_widgets); + } } } } @@ -1353,7 +1373,7 @@ impl Hud { Weapon(ToolKind::Sceptre) => &i18n.get("common.weapons.sceptre"), Weapon(ToolKind::Bow) => &i18n.get("common.weapons.bow"), Weapon(ToolKind::Staff) => &i18n.get("common.weapons.staff"), - Weapon(ToolKind::Pick) => &i18n.get("common.tool.pick"), + Weapon(ToolKind::Pick) => &i18n.get("common.tool.mining"), _ => "Unknown", }; Text::new(skill) @@ -1378,6 +1398,7 @@ impl Hud { Weapon(ToolKind::Sceptre) => self.imgs.sceptre, Weapon(ToolKind::Bow) => self.imgs.bow, Weapon(ToolKind::Staff) => self.imgs.staff, + Weapon(ToolKind::Pick) => self.imgs.mining, _ => self.imgs.swords_crossed, }) .w_h(20.0, 20.0) @@ -3658,16 +3679,15 @@ impl Hud { pub fn handle_outcome(&mut self, outcome: &Outcome) { match outcome { - Outcome::ExpChange { - uid, - exp, - xp_pools: _, - } => self.floaters.exp_floaters.push(ExpFloater { - owner: *uid, - exp_change: *exp, - timer: 4.0, - rand_offset: rand::thread_rng().gen::<(f32, f32)>(), - }), + Outcome::ExpChange { uid, exp, xp_pools } => { + self.floaters.exp_floaters.push(ExpFloater { + owner: *uid, + exp_change: *exp, + timer: 4.0, + rand_offset: rand::thread_rng().gen::<(f32, f32)>(), + xp_pools: xp_pools.clone(), + }) + }, Outcome::SkillPointGain { uid, skill_tree, From 4f8fa1fb6d2897ea51a1cef2177b0c08c9b35112 Mon Sep 17 00:00:00 2001 From: Avi Weinstock Date: Sun, 13 Jun 2021 14:35:44 -0400 Subject: [PATCH 6/6] Move changelog entry for mining to 0.10 section. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99fa93a4cc..d42eaa89b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added +- Added a skill tree for mining, which gains xp from mining ores and gems. ### Changed @@ -85,7 +86,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Meat drops from animals - New ores, plants and hides to be looted from the world and processed into craft ingredients - Added more crafting stations, loom, spinning wheel, tanning rack, forge -- Added a skill tree for mining, which gains xp from mining ores and gems. ### Changed