| Crates.io | steelkilt |
| lib.rs | steelkilt |
| version | 0.1.0 |
| created_at | 2025-11-02 14:55:36.473797+00 |
| updated_at | 2025-11-02 14:55:36.473797+00 |
| description | A Rust implementation of the Draft 0.4 RPG rule set |
| homepage | |
| repository | https://github.com/tonybierman/steelkilt |
| max_upload_size | |
| id | 1913201 |
| size | 136,235 |
A Rust implementation of the Draft 0.4 RPG rule set.
Based on the "Draft 0.4 RPG Rule Set" by Pitt Murmann (1993-1998), this library provides a reusable combat system for tabletop role-playing games.
The combat system follows the Draft RPG rules:
Wound Levels (based on damage vs Constitution):
Wound Stacking:
Add steelkilt to your Cargo.toml:
[dependencies]
steelkilt = "0.1.0"
# With serde support for JSON serialization
steelkilt = { version = "0.1.0", features = ["serde"] }
Or build from source:
cargo build --release
use steelkilt::*;
// Create attributes (STR, DEX, CON, REA, INT, WIL, CHA, PER, EMP)
let attrs = Attributes::new(8, 6, 7, 5, 6, 5, 5, 7, 4);
// Create a character
let mut fighter = Character::new(
"Aldric",
attrs,
7, // weapon skill
5, // dodge skill
Weapon::long_sword(),
Armor::chain_mail(),
);
// Create an opponent
let mut opponent = Character::new(
"Grimwald",
Attributes::new(9, 5, 8, 4, 5, 6, 4, 6, 3),
6, // weapon skill
4, // dodge skill
Weapon::two_handed_sword(),
Armor::leather(),
);
// Execute combat round
let result = combat_round(&mut fighter, &mut opponent, DefenseAction::Parry);
if result.hit {
println!("{} hit {} for {} damage!", result.attacker, result.defender, result.damage);
}
Run the interactive combat simulator:
cargo run --bin combat-sim
The simulation features:
steelkilt/
├── src/
│ ├── lib.rs # Core library implementation
│ ├── modules/ # Advanced feature modules
│ │ ├── mod.rs # Module exports
│ │ ├── skills.rs # Skill development system
│ │ ├── exhaustion.rs # Exhaustion tracking
│ │ ├── maneuvers.rs # Combat maneuvers
│ │ ├── hit_location.rs # Hit location tracking
│ │ ├── ranged_combat.rs # Ranged combat mechanics
│ │ └── magic.rs # Magic system
│ └── bin/
│ └── combat_sim.rs # Interactive combat simulation
├── examples/
│ ├── quick_combat.rs # Basic combat example
│ ├── advanced_features.rs # Showcase of all advanced features
│ └── magic_combat.rs # Wizard duel simulation
├── Cargo.toml
└── README.md
AttributesContains all 9 character attributes (range 1-10)
CharacterRepresents a combatant with attributes, skills, equipment, and wounds
WeaponWeapon definitions with impact levels (Small=1, Medium=2, Large=3, Huge=4)
ArmorArmor types with protection values and movement penalties
WoundsTracks Light, Severe, and Critical wounds with automatic stacking
CombatResultContains the outcome of a combat round
Run the test suite:
cargo test
The project includes 39 comprehensive tests covering:
Core Combat System:
Advanced Features:
All tests validate proper implementation of Draft 0.4 RPG rules.
This implementation is based on specific rules from Draft 0.4:
Core Systems:
Advanced Features:
This implementation is released under the MIT license. The original Draft 0.4 RPG Rule Set was released under the OpenContent License (OPL) Version 1.0.
=== DRAFT RPG COMBAT SIMULATOR ===
╔═══════════════════════════════════════╗
║ Aldric the Bold ║
╠═══════════════════════════════════════╣
║ PHYSICAL ATTRIBUTES: ║
║ STR: 8 DEX: 6 CON: 7 ║
║ Weapon: Long Sword ║
║ Damage: 5 ║
║ Armor: Chain Mail ║
║ Protection: 3 ║
╚═══════════════════════════════════════╝
--- ROUND 1 ---
Aldric the Bold's turn to attack!
How does Grimwald Ironfist defend? [P]arry or [D]odge? p
>>> Attack: Aldric the Bold rolls 14 vs Grimwald Ironfist's defense 11
>>> HIT! 6 damage dealt
>>> Severe wound inflicted!
The library now includes comprehensive implementations of advanced Draft RPG mechanics:
Complete skill learning and advancement system with:
use steelkilt::modules::*;
let mut skill_set = SkillSet::new(30); // 30 skill points
// Add skills with different difficulties
let sword = Skill::new("Longsword", 7, SkillDifficulty::Normal);
skill_set.add_skill(sword);
// Raise skill level
skill_set.raise_skill("Longsword").unwrap();
Cost Mechanics:
Track physical and magical exhaustion:
let mut exhaustion = Exhaustion::new(stamina);
exhaustion.add_points(1); // Each combat round
let penalty = exhaustion.penalty(); // -1 to -4
exhaustion.rest(10); // Recover from rest
Tactical combat options:
use steelkilt::modules::*;
let mut stance = CombatStance::new();
stance.set_maneuver(CombatManeuver::Charge).unwrap();
// Apply modifiers
let attack_bonus = stance.total_attack_modifier(); // +1
let defense_penalty = stance.total_defense_modifier(); // -2
let damage_bonus = stance.total_damage_modifier(); // +1
Detailed wound tracking by body part:
use steelkilt::modules::*;
let location = HitLocation::determine(AttackDirection::Front);
let multiplier = location.damage_multiplier();
let mut arm = LocationalDamage::new(HitLocation::RightArm);
arm.add_wound(WoundSeverity::Severe);
if !arm.is_functional() {
println!("Arm disabled!");
}
Complete ranged weapon system:
use steelkilt::modules::*;
let bow = RangedWeapon::long_bow();
let mut state = RangedAttackState::new();
state.prepare_weapon(&bow);
state.start_aiming();
state.continue_aiming(); // Aim for a round
let modifier = calculate_ranged_modifiers(
50, // distance in meters
TargetSize::Medium,
Cover::Partial,
&bow,
&state,
);
state.fire().unwrap(); // Shoot!
Weapon Examples:
Full implementation of Draft RPG magic:
use steelkilt::modules::*;
let mut mage = MagicUser::new(7); // Empathy 7
// Learn a branch of magic
mage.add_lore(MagicBranch::Divination, 5);
// Create and learn a spell
let spell = Spell {
name: "Detect Magic".to_string(),
branch: MagicBranch::Divination,
difficulty: SpellDifficulty::Easy,
preparation_time: 5,
casting_time: 1,
range: SpellRange::Short(20),
duration: SpellDuration::Minutes(10),
};
mage.learn_spell(spell, 4).unwrap(); // Level 4 skill
// Cast spell: skill + empathy + roll
let result = mage.cast_spell("Detect Magic", d10()).unwrap();
if result.success {
println!("Quality: {}", result.quality);
}
// Magical exhaustion penalties apply
let penalty = mage.exhaustion_penalty();
Branches of Magic:
The project includes comprehensive examples:
cargo run --example quick_combat
Basic melee combat demonstration showing the core combat system in action.
cargo run --example advanced_features
Comprehensive showcase of all advanced features:
cargo run --example magic_combat
Simulated duel between two magic users demonstrating: