Compare commits
2 Commits
bd5fff40b5
...
long
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
194e394b49 | ||
|
|
a1f5d5f917 |
21
LICENSE
Executable file
21
LICENSE
Executable file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2024 iceyrazor
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
22
src/main.rs
22
src/main.rs
@@ -1,9 +1,6 @@
|
||||
#![allow(unused)]
|
||||
use toml::{value::Array, Table};
|
||||
//#![allow(unused)]
|
||||
//use std::io;
|
||||
use std::fs;
|
||||
use std::option;
|
||||
use std::any::{Any, TypeId};
|
||||
use serde::Deserialize;
|
||||
use struct_iterable::Iterable;
|
||||
|
||||
@@ -111,18 +108,18 @@ fn main() {
|
||||
}
|
||||
}
|
||||
let mut i=0;
|
||||
for (name) in &toml_data.prof_throws {
|
||||
for name in &toml_data.prof_throws {
|
||||
dnd_data.prof_throws[i]=name.to_string();
|
||||
i=i+1;
|
||||
}
|
||||
i=0;
|
||||
for (name) in &toml_data.skill_prof_bonuses{
|
||||
for name in &toml_data.skill_prof_bonuses{
|
||||
dnd_data.skill_prof_bonuses[i][0]=name[0].to_string();
|
||||
dnd_data.skill_prof_bonuses[i][1]=name[1].to_string();
|
||||
i=i+1;
|
||||
}
|
||||
i=0;
|
||||
for (name) in &toml_data.prof_throws {
|
||||
for name in &toml_data.prof_throws {
|
||||
match name.as_str(){
|
||||
"str" => dnd_data.prof_throws_vec[0]=dnd_data.profiency as i64,
|
||||
"dex" => dnd_data.prof_throws_vec[1]=dnd_data.profiency as i64,
|
||||
@@ -135,12 +132,12 @@ fn main() {
|
||||
i=i+1;
|
||||
}
|
||||
i=0;
|
||||
for (name) in &toml_data.prof_skills {
|
||||
for name in &toml_data.prof_skills {
|
||||
dnd_data.prof_skills[i]=name.to_string();
|
||||
i=i+1;
|
||||
}
|
||||
i=0;
|
||||
for (name) in &toml_data.list.skills {
|
||||
for name in &toml_data.list.skills {
|
||||
dnd_data.skills_names[i][0]=name[0].to_string();
|
||||
dnd_data.skills_names[i][1]=name[1].to_string();
|
||||
i=i+1;
|
||||
@@ -199,7 +196,6 @@ fn main() {
|
||||
dnd_data.throws[i]=dnd_data.prof_throws_vec[i] + val;
|
||||
i=i+1
|
||||
}
|
||||
i=0;
|
||||
fn base_to_num(str: String) -> usize{
|
||||
match str.as_str(){
|
||||
"str" => return 0,
|
||||
@@ -210,7 +206,8 @@ fn main() {
|
||||
"charis" => return 5,
|
||||
_ => return 0,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
i=0;
|
||||
for name in &dnd_data.skills_names{
|
||||
let mut modi=0;
|
||||
@@ -229,7 +226,6 @@ fn main() {
|
||||
dnd_data.skills[i].modi=modi as i64;
|
||||
|
||||
i=i+1;
|
||||
modi=0;
|
||||
}
|
||||
|
||||
println!("profiency: {}",dnd_data.profiency);
|
||||
@@ -263,13 +259,11 @@ fn main() {
|
||||
i=i+1
|
||||
}
|
||||
println!("---------");
|
||||
i=0;
|
||||
for val in &dnd_data.skills{
|
||||
if val.name!=""{
|
||||
println!("{} : {}",val.name,val.modi);
|
||||
}
|
||||
}
|
||||
i=0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user