crates for shops and stats
This commit is contained in:
		
							parent
							
								
									04e9aa91d8
								
							
						
					
					
						commit
						7020f38863
					
				| @ -9,6 +9,8 @@ members = [ | ||||
|     "entity", | ||||
|     "maps", | ||||
|     "networking", | ||||
|     "shops", | ||||
|     "stats", | ||||
| ] | ||||
| 
 | ||||
| [workspace.dependencies] | ||||
| @ -16,6 +18,8 @@ libpso = { git = "http://git.sharnoth.com/jake/libpso" } | ||||
| entity = { path = "./entity" } | ||||
| maps = { path = "./maps" } | ||||
| networking = { path = "./networking" } | ||||
| shops = { path = "./shops" } | ||||
| stats = { path = "./stats" } | ||||
| async-std = { version = "1.9.0", features = ["unstable", "attributes"] } | ||||
| futures = "0.3.5" | ||||
| rand = "0.7.3" | ||||
| @ -49,6 +53,8 @@ libpso = { git = "http://git.sharnoth.com/jake/libpso" } | ||||
| entity = { path = "./entity" } | ||||
| maps = { path = "./maps" } | ||||
| networking = { path = "./networking" } | ||||
| shops = { path = "./shops" } | ||||
| stats = { path = "./stats" } | ||||
| async-std = { version = "1.9.0", features = ["unstable", "attributes"] } | ||||
| futures = "0.3.5" | ||||
| rand = "0.7.3" | ||||
|  | ||||
							
								
								
									
										13
									
								
								shops/Cargo.toml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								shops/Cargo.toml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,13 @@ | ||||
| [package] | ||||
| name = "shops" | ||||
| version = "0.1.0" | ||||
| edition = "2021" | ||||
| 
 | ||||
| [dependencies] | ||||
| maps = { workspace = true } | ||||
| stats = { workspace = true } | ||||
| entity = { workspace = true } | ||||
| 
 | ||||
| rand = { workspace = true } | ||||
| toml = { workspace = true } | ||||
| serde = { workspace = true } | ||||
| @ -9,8 +9,8 @@ use entity::item::ItemDetail; | ||||
| use entity::item::armor::{Armor, ArmorType}; | ||||
| use entity::item::shield::{Shield, ShieldType}; | ||||
| use entity::item::unit::{Unit, UnitType}; | ||||
| use crate::ship::shops::ShopItem; | ||||
| use crate::ship::item_stats::{ARMOR_STATS, SHIELD_STATS, UNIT_STATS}; | ||||
| use crate::ShopItem; | ||||
| use stats::items::{ARMOR_STATS, SHIELD_STATS, UNIT_STATS}; | ||||
| 
 | ||||
| // #[derive(Debug)]
 | ||||
| // pub enum ArmorShopItem {
 | ||||
| @ -9,8 +9,8 @@ use rand::distributions::{WeightedIndex, Distribution}; | ||||
| use entity::item::ItemDetail; | ||||
| use entity::item::tool::{Tool, ToolType}; | ||||
| use entity::item::tech::{Technique, TechniqueDisk}; | ||||
| use crate::ship::shops::ShopItem; | ||||
| use crate::ship::item_stats::{TOOL_STATS, TECH_STATS}; | ||||
| use crate::ShopItem; | ||||
| use stats::items::{TOOL_STATS, TECH_STATS}; | ||||
| 
 | ||||
| 
 | ||||
| #[derive(Debug, PartialEq, Eq)] | ||||
| @ -12,8 +12,8 @@ use entity::character::SectionID; | ||||
| use maps::room::Difficulty; | ||||
| use entity::item::ItemDetail; | ||||
| use entity::item::weapon::{Weapon, WeaponType, WeaponSpecial, Attribute, WeaponAttribute}; | ||||
| use crate::ship::shops::ShopItem; | ||||
| use crate::ship::item_stats::WEAPON_STATS; | ||||
| use crate::ShopItem; | ||||
| use stats::items::WEAPON_STATS; | ||||
| 
 | ||||
| 
 | ||||
| const TIER1_SPECIAL: [WeaponSpecial; 8] = [WeaponSpecial::Draw, WeaponSpecial::Heart, WeaponSpecial::Ice, WeaponSpecial::Bind, | ||||
| @ -14,7 +14,7 @@ use entity::item; | ||||
| use crate::ship::ship::ShipError; | ||||
| use crate::ship::items; | ||||
| use maps::area::MapArea; | ||||
| use crate::ship::shops::{WeaponShopItem, ToolShopItem, ArmorShopItem}; | ||||
| use shops::{WeaponShopItem, ToolShopItem, ArmorShopItem}; | ||||
| 
 | ||||
| 
 | ||||
| #[derive(Clone, Default)] | ||||
|  | ||||
| @ -8,7 +8,7 @@ use entity::item::armor::{ArmorType, Armor}; | ||||
| use maps::room::{Difficulty, Episode}; | ||||
| use maps::area::MapArea; | ||||
| use crate::ship::drops::{ItemDropType, load_data_file}; | ||||
| use crate::ship::item_stats::{armor_stats, ArmorStats}; | ||||
| use stats::items::{armor_stats, ArmorStats}; | ||||
| 
 | ||||
| 
 | ||||
| #[derive(Debug, Serialize, Deserialize)] | ||||
|  | ||||
| @ -8,7 +8,7 @@ use entity::character::SectionID; | ||||
| use maps::room::{Difficulty, Episode}; | ||||
| use maps::area::MapArea; | ||||
| use crate::ship::drops::{ItemDropType, load_data_file}; | ||||
| use crate::ship::item_stats::{shield_stats, ShieldStats}; | ||||
| use stats::items::{shield_stats, ShieldStats}; | ||||
| 
 | ||||
| 
 | ||||
| #[derive(Debug, Serialize, Deserialize)] | ||||
|  | ||||
| @ -8,7 +8,7 @@ use entity::item::unit::{UnitType, Unit, UnitModifier}; | ||||
| use maps::room::{Difficulty, Episode}; | ||||
| use maps::area::MapArea; | ||||
| use crate::ship::drops::{ItemDropType, load_data_file}; | ||||
| use crate::ship::item_stats::{unit_stats, UnitStats}; | ||||
| use stats::items::{unit_stats, UnitStats}; | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|  | ||||
| @ -21,7 +21,7 @@ use crate::ship::items::bank::{BankItem, BankItemDetail}; | ||||
| use crate::ship::items::inventory::{InventoryItem, InventoryItemDetail}; | ||||
| use crate::ship::items::floor::{FloorItem, FloorItemDetail}; | ||||
| use crate::ship::items::apply_item::{apply_item, ApplyItemAction}; | ||||
| use crate::ship::shops::ShopItem; | ||||
| use shops::ShopItem; | ||||
| use crate::ship::drops::{ItemDrop, ItemDropType}; | ||||
| use crate::ship::packet::builder; | ||||
| use crate::ship::location::AreaClient; | ||||
|  | ||||
| @ -9,7 +9,7 @@ use entity::character::CharacterEntityId; | ||||
| use entity::item::tool::ToolType; | ||||
| use entity::item::mag::Mag; | ||||
| use entity::item::weapon::Weapon; | ||||
| use crate::ship::shops::{ShopItem, ArmorShopItem, ToolShopItem, WeaponShopItem}; | ||||
| use shops::{ShopItem, ArmorShopItem, ToolShopItem, WeaponShopItem}; | ||||
| use crate::ship::items::state::ItemStateError; | ||||
| use crate::ship::items::state::{IndividualItemDetail, StackedItemDetail, AddItemResult}; | ||||
| use crate::ship::items::floor::{FloorItem, FloorItemDetail}; | ||||
|  | ||||
| @ -12,7 +12,7 @@ use crate::ship::items::state::{ItemState, ItemStateProxy, IndividualItemDetail} | ||||
| use crate::ship::items::itemstateaction::{ItemStateAction, ItemAction}; | ||||
| use crate::ship::items::inventory::InventoryItem; | ||||
| use crate::ship::items::floor::FloorItem; | ||||
| use crate::ship::shops::ShopItem; | ||||
| use shops::ShopItem; | ||||
| use crate::ship::trade::TradeItem; | ||||
| use crate::ship::location::AreaClient; | ||||
| use crate::ship::drops::ItemDrop; | ||||
|  | ||||
| @ -5,12 +5,12 @@ pub mod character; | ||||
| pub mod client; | ||||
| pub mod room; | ||||
| pub mod items; | ||||
| pub mod item_stats; | ||||
| //pub mod item_stats;
 | ||||
| //pub mod map;
 | ||||
| //pub mod monster;
 | ||||
| pub mod drops; | ||||
| pub mod packet; | ||||
| pub mod quests; | ||||
| pub mod shops; | ||||
| //pub mod shops;
 | ||||
| pub mod trade; | ||||
| pub mod chatcommand; | ||||
|  | ||||
| @ -10,7 +10,7 @@ use crate::ship::items::bank::BankState; | ||||
| use crate::ship::items::floor::FloorItem; | ||||
| use crate::ship::location::AreaClient; | ||||
| use std::convert::TryInto; | ||||
| use crate::ship::shops::ShopItem; | ||||
| use shops::ShopItem; | ||||
| 
 | ||||
| 
 | ||||
| pub fn item_drop(client: u8, target: u8, item_drop: &FloorItem) -> Result<ItemDrop, ShipError> { | ||||
|  | ||||
| @ -14,7 +14,7 @@ use entity::gateway::EntityGateway; | ||||
| use entity::item; | ||||
| use libpso::utf8_to_utf16_array; | ||||
| use crate::ship::packet::builder; | ||||
| use crate::ship::shops::{ShopItem, ToolShopItem, ArmorShopItem}; | ||||
| use shops::{ShopItem, ToolShopItem, ArmorShopItem}; | ||||
| use crate::ship::items::state::{ItemState, ItemStateError}; | ||||
| use crate::ship::items::floor::{FloorType, FloorItemDetail}; | ||||
| use crate::ship::items::actions::TriggerCreateItem; | ||||
|  | ||||
| @ -29,7 +29,7 @@ use maps::area::MapAreaError; | ||||
| use maps::maps::{Maps, MapsError, generate_free_roam_maps}; | ||||
| use maps::enemy::RareEnemyEvent; | ||||
| use crate::ship::packet::handler; | ||||
| use crate::ship::shops::{WeaponShop, ToolShop, ArmorShop}; | ||||
| use shops::{WeaponShop, ToolShop, ArmorShop}; | ||||
| use crate::ship::trade::TradeState; | ||||
| use crate::ship::chatcommand; | ||||
| 
 | ||||
|  | ||||
							
								
								
									
										10
									
								
								stats/Cargo.toml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								stats/Cargo.toml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,10 @@ | ||||
| [package] | ||||
| name = "stats" | ||||
| version = "0.1.0" | ||||
| edition = "2021" | ||||
| 
 | ||||
| [dependencies] | ||||
| entity = { workspace = true } | ||||
| toml = { workspace = true } | ||||
| serde  = { workspace = true } | ||||
| lazy_static = { workspace = true } | ||||
							
								
								
									
										1
									
								
								stats/src/lib.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								stats/src/lib.rs
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1 @@ | ||||
| pub mod items; | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user