feat(fifa17): apply the rare all-six training card
Passes a null attribute slot for the rare card -- Core reads absence as "every slot", so sending 0 would silently train pace alone -- and declares the per-family ceiling rather than a single constant. Tests pin the null-slot serialisation, both ceilings, and that all 36 single-attribute plus all 6 rare cards resolve.
This commit is contained in:
@@ -91,7 +91,7 @@ use openfut_adapter_fifa17::fut::store_session::{
|
||||
validate_capability, SessionStore, StoreMode, SENTINEL_PACK_ID,
|
||||
};
|
||||
use openfut_adapter_fifa17::fut::training_cards::{
|
||||
class_accepts_position, training_effect, TRAINING_MAX_AMOUNT,
|
||||
ceiling_for, class_accepts_position, training_effect,
|
||||
};
|
||||
use openfut_identity::ExternalIdentityStore;
|
||||
use rand::{Rng, SeedableRng};
|
||||
@@ -1316,7 +1316,8 @@ pub enum ApplyEffect {
|
||||
/// out of `cardsubtypeid` by the adapter — Core is never told a FIFA
|
||||
/// attribute name.
|
||||
ApplyTraining {
|
||||
attribute_index: i64,
|
||||
/// `None` = the rare card that boosts all six attributes.
|
||||
attribute_index: Option<i64>,
|
||||
amount: i64,
|
||||
max_amount: i64,
|
||||
},
|
||||
@@ -1344,6 +1345,9 @@ impl ApplyEffect {
|
||||
amount,
|
||||
max_amount,
|
||||
} => json!({
|
||||
// `attribute_index` is deliberately null for the rare all-six
|
||||
// card: Core reads absence as "every slot", so omitting the key
|
||||
// or sending 0 would silently train pace only.
|
||||
"kind": "apply_training",
|
||||
"attribute_index": attribute_index,
|
||||
"amount": amount,
|
||||
@@ -5087,10 +5091,14 @@ impl Server {
|
||||
);
|
||||
return error_response(409, "training_target_class_mismatch");
|
||||
}
|
||||
// The ceiling is per-family: 15 for a single attribute, 10 for the
|
||||
// rare all-six card. Sending the single-attribute ceiling for an
|
||||
// all-six card would let Core accept a +15 all-six boost that EA
|
||||
// never authored.
|
||||
let effect = ApplyEffect::ApplyTraining {
|
||||
attribute_index: t.attribute_index,
|
||||
amount: t.amount,
|
||||
max_amount: TRAINING_MAX_AMOUNT,
|
||||
max_amount: ceiling_for(&t),
|
||||
};
|
||||
return self.finish_consumable_apply(
|
||||
econ,
|
||||
|
||||
Reference in New Issue
Block a user