I guess so. The idea is that the JS/JSON is in regular communication with the core Java game server, so data is exchanged back & forth throughout the game
@nhgrif More or less. That, and also, that a different fork can make their own cards, effects, etc. using a default code base
(we would eventually include forks into the main game, so the user can choose as they started the client, which mod they would like to play; but that's somewhat out of scope to what I'm asking about)
JSON (/ˈdʒeɪsən/ JAY-sən), or JavaScript Object Notation, is an open standard format that uses human-readable text to transmit data objects consisting of attribute–value pairs. It is used primarily to transmit data between a server and web application, as an alternative to XML.
Although originally derived from the JavaScript scripting language, JSON is a language-independent data format. Code for parsing and generating JSON data is readily available in many programming languages.
The JSON format was originally specified by Douglas Crockford. It is currently described by two competing standards...
I don't think this would do well on Code Review, likely get closed as stub code, unless more context is provided, e.g., the rest of the module/function. — Phrancis22 secs ago
Also, our JSON is different somewhat, because it's native JS (notice the lack of quotes around identifier), so the data really and truly is, just Plain Old JavaScript Object
So if in three years, you finally do have to make a schema change to add some new thing, you can without instantly invalidating three years worth of card set.
The old card sets simply won't have the new property you added.
Or won't be organized in the same manner.
But forks of the game potentially won't support the new card set schema until they've updated to handle it.
But that's how mods for any game work.
But as for the specific structure... I can buy the triggers each having their own value... but the value for each trigger should probably be an array rather than a dictionary?
But... explain how actions:, targets: and other: are used?
Also, be sure when you code the application that it's okay if a trigger isn't present. The JSON object should only contain a trigger if it actually does something on that trigger.
The naming doesn't match, but in short, this says... card "Some Card" has 1 health, 1 attack; and on end of turn, has a chance (with 0.5 probability) to perform the action "draw" [a card] into the player (self) hand
I would like to optimize the second line in my for loop(var phase). I believe moving parts of it outside of the loop would optimize performance. What can I move outside the for loop to improve performance?
for (var i = 0; i < items.length; i++) {
var phase = Math.sin((document.body.scrollTop / 1...
I'm fairly certain some of those triggers are already implemented in Java and just need to be referenced to; but other things, specifically "actions" and "targets", will modify the Java ECS data map directly during the game
A place where this is confusing, for example... in MTG... if you have more than 7 cards in your hand at the end of your turn, you must discard down to 7.
The card's mechanic should specify if it's beforeSelfDamage: or afterSelfDamage:
If the effect is beforeSelfDamage:, I win. I have killed my opponent before he killed me.
If it is afterSelfDamage:, I lose.
If we only have an onSelfDamage: event, we both think we've won and we argue endlessly about how the game should work. And no matter how the game resolves it, 50% of all people will file a bug report.
I adapted most of the suggestions from answers for my previous question Printing all the permutations of a string in alphabetical order to rewrote my solution again. Please let me know any more changes required or any more suggestions.
#include <iostream>
#include<fstream>
#include<algorithm>
#i...
I'm new to writing bash scripts and I was wondering if I could get someone's advice on a part of the script I'm working on.
Intended purpose of code
Check if a font is installed by using fc-list and grep, if the particular font is not installed, offer to install it for the user. This snippet is...
chance: function (probability) {
var roll = Math.random();
if ((typeof probability) !== "number" && isNaN(probability)) {
return NaN;
}
return roll <= probability;
}
I must admit most prepackaged sounds on keyboards sound quite "canned". I prefer to just capture the MIDI data into the computer, then assign high-quality samplers to play the notes
Some OEMs are definitely better at either acoustic or electronic instruments. Roland makes fantastic electronic instruments, but only "OK" acoustic ones. Kawai may be the other way around.
I needed a method to get the median of 3 values, I thought it a good opportunity to write a generic method since I don't really have that practiced. I wrote this and it seems pretty straight-forward, though I get a warning, but it seems to work fine, according to my tests.
I'm aware I could use ...
This is my basic C# calculator; I'm sure there is much that can be improved. This design is based on Bjarne Stroustrup's C++ calculator, a purposely be-bugged version of which can be found at his website.
enum Operators
{
Addition, Subtraction, Multiplication, Division, Modulo
}
static cla...
This makes me wonder if people feel that their answer wouldn't meet a certain standard? I personally can relate to such. Sometimes, I worry that whatever I can answer is obvious/won't be helpful to the asker, or deals with too few points. An answerer's task definitely requires more work and the very notion that one could go through someone else's code and have whatever their contribution be considered unhelpful is dissuading. I can come nowhere near some of the fantastic answers I've received here, and it's not something that I take lightly. — Legato2 days ago
I don't experiment much with different beers. I'm a simple person: if I like something then I'll only rarely try alternatives since in my mind there's basically nothing to gain
@JeroenVannevel Americans have to live with the unfortunate constraint that reasonable alcohol consumption is viewed as bad as excessive alcohol consumption. It's pretty stupid, really; IMO.
I mostly meant if it's being checked on a weekly basis. I'm sure it makes sense to say "Seems like it's been a while, let's have a new one" but I was just wondering if there's an actual system in place for seeing how many you have over a period of time.
it started with @rolfl bitching about a pretty bad implementation of rock-paper-scissors in Python IIRC.. so he suggested we all implement our own over a weekend.. ah, got the meta post:
Those of you that weren't following what's going on in the chat room might have been taken by surprise by a recent avalanche of Rock Paper Scissors Lizard Spock posts.
This is how it started:
OK, weekend challenge.... we all solve the Rock Paper Scissors Lizzard Spock problem with our 'favou...