1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//! The points of the survivors per altar mod (`survivors-per-altar`).
/// How many copies of a survivor its altars hold,
/// `survivors-per-altar:copy-limit`: the answer is the most entities of the
/// survivor, its original included, before a copy staff is refused.
///
/// The mod answers with the number of altars. Each altar still holds one
/// entity at most, so a higher answer adds one at most: a copy at every
/// altar while the original stands outside them. Asked on the server's
/// game thread when a staff would place a new copy: a copy staff, or the
/// survivor's own with `vanilla_staff_places_copies`.
///
/// # Examples
///
/// ```
/// use enshwick::points::survivors_per_altar::CopyLimit;
/// use enshwick::points::{Order, Verdict};
///
/// fn init(load: &mut enshwick::Load<'_>) -> Result<(), enshwick::Off> {
/// // At most three of each survivor, however many altars.
/// load.extend_point(&Order::new(), |_: &CopyLimit, limit: &u32| Verdict::Set((*limit).min(3)))
/// }
/// ```
/// How many charges placing a copy spends, `survivors-per-altar:charge-cost`:
/// the answer is the charges; a refusal refuses the staff's use, with
/// nothing spent.
///
/// The mod answers 1. A cost of 0 places the copy free; a cost at or above
/// the charges left takes the staff. Moving a copy is always free. Asked
/// on the server's game thread when a copy staff would place a new copy.
///
/// # Examples
///
/// ```
/// use enshwick::points::survivors_per_altar::ChargeCost;
/// use enshwick::points::{Order, Verdict};
///
/// fn init(load: &mut enshwick::Load<'_>) -> Result<(), enshwick::Off> {
/// // Every second copy of a survivor costs two charges.
/// load.extend_point(&Order::new(), |cost: &ChargeCost, spent: &u16| {
/// if cost.copies % 2 == 1 { Verdict::Set(spent.saturating_mul(2)) } else { Verdict::Pass }
/// })
/// }
/// ```