Skip to content

Commit da951e3

Browse files
authored
clean: remove text changelogs (#22)
1 parent 84e2a3e commit da951e3

38 files changed

Lines changed: 604 additions & 900 deletions

mudlib/cmds/arch/.ChangeLog

Lines changed: 0 additions & 5 deletions
This file was deleted.

mudlib/cmds/std/.ChangeLog

Lines changed: 0 additions & 11 deletions
This file was deleted.

mudlib/cmds/usr/.ChangeLog

Lines changed: 0 additions & 13 deletions
This file was deleted.

mudlib/cmds/wiz/.ChangeLog

Lines changed: 0 additions & 24 deletions
This file was deleted.

mudlib/feature/.ChangeLog

Lines changed: 0 additions & 31 deletions
This file was deleted.

mudlib/feature/attribute.c

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1-
1+
/*
2+
* Package: Attributes
3+
* Summary: An entity's attributes, such as strength, intelligence, etc.
4+
*
5+
* If the entity is a character (living object), then the attributes will be used to
6+
* calculate the character's abilities, such as attack, defense, magic power, etc.
7+
* Character's attributes can be modified by various means, such as conditions, equipments,
8+
* magical effects, etc.
9+
*
10+
* If the entity is not a character, the attributes will be used for calculation when
11+
* a character interacts with it.
12+
*/
213

314
#include <dbase.h>
415
#include <attribute.h>
@@ -7,56 +18,47 @@ mapping attribute = ([]);
718

819
mapping query_attribute() { return attribute; }
920

10-
// query_attr()
11-
//
12-
// returns the value of a character's attribute.
13-
14-
varargs int
15-
query_attr(string what, int raw)
16-
{
21+
varargs int query_attr (string what, int raw) {
1722
int a;
23+
if (!mapp(attribute) || undefinedp(a = attribute[what]))
24+
return 0;
1825

19-
if( !mapp(attribute) || undefinedp(a=attribute[what]) ) return 0;
20-
21-
if( raw ) return a;
26+
if (raw)
27+
return a;
2228

23-
return a + (int)query_temp("apply/" + what);
29+
return a + (int)query_temp ("apply/" + what);
2430
}
2531

26-
int
27-
set_attr(string what, int value)
28-
{
29-
if( !mapp(attribute) ) return 0;
32+
int set_attr (string what, int value) {
33+
if (!mapp(attribute))
34+
attribute = ([]);
3035

31-
if( userp(this_object())
32-
&&( undefinedp(attribute[what])
33-
|| value < ATTRVAL_MIN
34-
|| value > ATTRVAL_MAX ) )
35-
return 0;
36+
// For user characters, the attribute must be initialized in init_attribute() and
37+
// the value must be between ATTRVAL_MIN and ATTRVAL_MAX.
38+
if (userp(this_object())
39+
&& (undefinedp(attribute[what]) || value < ATTRVAL_MIN || value > ATTRVAL_MAX))
40+
return 0;
3641

3742
return (attribute[what] = value);
3843
}
3944

40-
varargs void
41-
init_attribute(mapping base)
42-
{
45+
varargs void init_attribute (mapping base) {
4346
mapping attr;
4447
string name;
4548
int value;
4649

47-
48-
if( mapp(attr=query("attribute")) ) {
49-
attribute = attr;
50-
delete("attribute");
50+
if (mapp (attr = query("attribute"))) {
51+
attribute = attr;
52+
delete("attribute");
5153
}
5254

53-
if( !mapp(attribute) ) attribute = allocate_mapping(NUM_ATTRIBUTES);
54-
55-
if( !mapp(base) || !sizeof(base) ) return;
55+
if (!mapp(attribute))
56+
attribute = allocate_mapping (NUM_ATTRIBUTES);
5657

58+
if (!mapp(base) || !sizeof(base))
59+
return;
5760

58-
foreach(name, value in base)
59-
if( undefinedp(attribute[name]) )
61+
foreach (name, value in base)
62+
if (undefinedp(attribute[name]))
6063
attribute[name] = value;
6164
}
62-

mudlib/feature/char/.ChangeLog

Lines changed: 0 additions & 17 deletions
This file was deleted.

mudlib/feature/char/attack.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88

99
#define MAX_OPPONENT 4
1010

11-
private object charge_target = 0;
12-
private object guarding = 0, *guarded = ({});
13-
private object *enemy = ({});
14-
private mapping killer = ([]);
15-
private int attack_patience;
11+
static object charge_target = 0;
12+
static object guarding = 0, *guarded = ({});
13+
static object *enemy = ({});
14+
static mapping killer = ([]);
15+
static int attack_patience;
1616

17-
private object current_target;
17+
static object current_target;
1818

1919
void fight_ob(object ob);
2020
void kill_ob(object ob);

mudlib/feature/char/combat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include <statistic.h>
99
#include <combat.h>
1010

11-
private string combat_message = "";
11+
static string combat_message = "";
1212

1313
void set_combat_message(string s) { combat_message = s; }
1414
void add_combat_message(string s) { combat_message += s; }

mudlib/feature/char/command.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <login.h>
77

88
/* 指令搜尋路徑。 */
9-
private string *path = ({});
9+
static string *path = ({});
1010

1111
string
1212
find_command(string verb)

0 commit comments

Comments
 (0)