System: "Adventure Skeletons!"
- Player: Mac
- Ancestry: Goblin
- Favorite Bone: Humerus
fn main() { | |
println!("Hello, world!"); | |
} | |
// Functions that you wish to access from Javascript | |
// must be marked as no_mangle | |
#[no_mangle] | |
pub fn add(a: i32, b: i32) -> i32 { | |
return a + b | |
} |
-- screenshake | |
shake = 0 | |
if shake>0 then | |
shake-=1 | |
camera() | |
if shake>0 then | |
camera(-2+rnd(5),-2+rnd(5)) | |
end | |
end |
const wasm = require('./main.rs') | |
wasm.initialize({noExitRuntime: true}).then(module => { | |
// Create a Javascript wrapper around our Rust function | |
const add = module.cwrap('add', 'number', ['number', 'number']) | |
console.log('Calling rust functions from javascript!') | |
console.log(add(1, 2)) | |
}) |
module.exports = { | |
entry: './src/index.js', | |
output: { | |
filename: 'bundle.js', | |
path: __dirname + '/build', | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.rs$/, |
[ | |
"Alabama", | |
"Alaska", | |
"American Samoa", | |
"Arizona", | |
"Arkansas", | |
"California", | |
"Colorado", | |
"Connecticut", | |
"Delaware", |
typedef B MapWithIndexCallback<B, A>(A a, int index); | |
Iterable<B> mapWithIndex<B, A>(List<A> l, MapWithIndexCallback<B, A> cb) { | |
Map<int, A> map = l.asMap(); | |
return map.keys.map((key) { | |
return cb(map[key], key); | |
}); | |
} | |
// Example usage |
{ | |
"ImprovedInitiative.Creatures.mqhpvhf8": "{\"Id\":\"mqhpvhf8\",\"Name\":\"Night Axe Bonebinder\",\"Path\":\"HSI\",\"Source\":\"\",\"Type\":\"Large giant\",\"HP\":{\"Value\":78,\"Notes\":\"(12d10+12)\"},\"AC\":{\"Value\":14,\"Notes\":\"(natural armor)\"},\"InitiativeModifier\":2,\"InitiativeAdvantage\":false,\"Speed\":[\"30 ft.\"],\"Abilities\":{\"Str\":13,\"Dex\":15,\"Con\":12,\"Int\":13,\"Wis\":17,\"Cha\":14},\"DamageVulnerabilities\":[],\"DamageResistances\":[\"acid\",\"cold\",\"fire\",\"bludgeoning, piercing, and slashing from nonmagical weapons\"],\"DamageImmunities\":[],\"ConditionImmunities\":[\"exhaustion\",\"frightened\"],\"Saves\":[],\"Skills\":[],\"Senses\":[\"darkvision 60 ft.\",\"passive Perception 13\"],\"Languages\":[\"Giant\"],\"Challenge\":\"5\",\"Traits\":[{\"Name\":\"Adaptable\",\"Content\":\"Night Axe Ogres are immune to the effects of extreme heat and cold.\",\"Usage\":\"\"},{\"Name\":\"Strategist\",\"Content\":\"Using its water gourd, the bonebinder can unleash animated ropes of water |
/** | |
Copyright 2019 Ian J Sikes | |
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 |
{ | |
"v": "5.1.16", | |
"fr": 29.9700012207031, | |
"ip": 0, | |
"op": 60.0000024438501, | |
"w": 342, | |
"h": 400, | |
"nm": "loadingModule", | |
"ddd": 0, | |
"assets": [ |