merged syncpoint_gettext1_11 from trunk

This commit is contained in:
Yann Dirson 2004-08-13 20:00:37 +00:00
parent 25b14502da
commit 7bbf92221c
44 changed files with 191 additions and 150 deletions

View file

@ -20,7 +20,13 @@ CVS HEAD:
* Dark Adept: increased ranged damage, reduced cost
* Drake Slave: increased melee damage
* Drake Worker: increased melee damage
* Noble Commander: increased hitpoints
* Noble Fighter: increased hitpoints and melee damage
* Noble Lord: reduced hitpoints, reduced melee and ranged damage
* Noble Youth: increased hitpoints, increased movement, increased melee damage
* Outlaw: reduced hitpoints, reduced number of melee attacks, increased ranged damage
* Outlaw Princess: reduced hitpoints, reduced experience required to level, reduced number of melee attacks, increased ranged damage, replaced 'ambush' with 'skirmisher'
* Outlaw Queen: increased hitpoints, replaced 'ambush' with 'skirmisher', reduced number of melee attacks, increased ranged damage and number of ranged attacks
* Soulless: increased melee damage
* Thug: increased melee damage and reduced number of attacks
* Walking Corpse: increased melee damage
@ -29,10 +35,13 @@ CVS HEAD:
* Drake Warmage
* Skeletal Dragon
* Troll Hero
* Orcish Leader
* Orcish Sovereign
* multiplayer improvements:
* 'Great War' era
* limit to username lenght
* banning for multiplayer server games
* Scenario balancing for most of 'Son of the Black Eye' scenarios
* language fixes and polishing (english)
* support for multi-animation attacks
* support for per-scenario configurable village flags, sample black-eyed banner for Son of the Black Eye campaign
@ -57,6 +66,8 @@ CVS HEAD:
* fixed holy water in 'Heir to the Throne: Valley of Death' scenario (#9930)
* fixed a bug where a unit moving with [move_unit_fake] segfaulted the game
* fixed problems with cache invalidation
* fixed file descriptor leak
* fixed 'gender' not working with move_unit_fake
* terrains tiles are now cut according to the hexagonal shape, to avoid some graphical glitches
* workaround a SDL_TTF bug that makes it crash when presented an invalid UTF-8 string
* limited length of schema items in compressed WML to make a DoS attack harder to perform

View file

@ -27,7 +27,7 @@ Defeat:
#Turns run out"
[side]
type=Orcish Ruler
type=Orcish Leader
description=Kapou'e
side=1
canrecruit=1
@ -52,8 +52,8 @@ Defeat:
village_value=10.0
leader_value=50.0
[/ai]
{GOLD 100 160 200}
{INCOME 10 16 20}
{GOLD 100 120 180}
{INCOME 5 10 15}
[/side]
[side]
@ -95,7 +95,7 @@ Defeat:
[/recall]
[teleport]
[filter]
type=Orcish Ruler
description=Kapou'e
[/filter]
x=25
y=1

View file

@ -29,7 +29,7 @@ Defeat:
#Death of Inarix"
[side]
type=Orcish Ruler
type=Orcish Leader
description=Kapou'e
side=1
canrecruit=1

View file

@ -28,7 +28,7 @@ Defeat:
#Death of a Shaman"
[side]
type=Orcish Ruler
type=Orcish Leader
description=Kapou'e
side=1
canrecruit=1

View file

@ -38,7 +38,7 @@ Defeat:
[/item]
[side]
type=Orcish Ruler
type=Orcish Leader
description=Kapou'e
side=1
canrecruit=1

View file

@ -95,7 +95,7 @@ Defeat:
#Death of more than 5 saurians"
[side]
type=Orcish Ruler
type=Orcish Leader
description=Kapou'e
side=1
canrecruit=1

View file

@ -28,7 +28,7 @@ Defeat:
#Death of a shaman"
[side]
type=Orcish Ruler
type=Orcish Leader
description=Kapou'e
side=1
canrecruit=1

View file

@ -28,7 +28,7 @@ Defeat:
#Death of a Shaman"
[side]
type=Orcish Ruler
type=Orcish Leader
description=Kapou'e
side=1
canrecruit=1
@ -50,8 +50,8 @@ Defeat:
aggression=-1.0
[/ai]
recruit=Elvish Fighter, Elvish Captain, Elvish Scout, Elvish Shaman, Elvish Archer
{GOLD 120, 180, 220}
{INCOME 0, 6, 12}
{GOLD 80, 100, 120}
{INCOME 0, 4, 8}
[/side]
[side]

View file

@ -28,7 +28,7 @@ Defeat:
#Turns run out"
[side]
type=Orcish Ruler
type=Orcish Leader
description=Kapou'e
side=1
canrecruit=1
@ -100,10 +100,10 @@ Defeat:
[/recall]
{ELVISH_FIGHTER 22 12}
{ELVISH_FIGHTER 21 13}
{ELVISH_FIGHTER 20 15}
{ELVISH_FIGHTER 19 16}
{ELVISH_ARCHER 25 14}
{ELVISH_ARCHER 24 13}
{ELVISH_ARCHER 23 17}
{ELVISH_ARCHER 24 17}
{ORCISH_ARCHER_G 21 14}
{ORCISH_ARCHER_G 22 13}
{ORCISH_ARCHER_G 23 16}
@ -368,7 +368,7 @@ Defeat:
first_time_only=no
name=moveto
[filter]
type=Orcish Ruler
description=Kapou'e
x=1
y=13-14
[/filter]

View file

@ -42,7 +42,7 @@ Defeat:
#Death of a Shaman"
[side]
type=Orcish Ruler
type=Orcish Leader
description=Kapou'e
side=1
canrecruit=1

View file

@ -48,7 +48,7 @@ Defeat:
[/item]
[side]
type=Orcish Ruler
type=Orcish Leader
description=Kapou'e
side=1
canrecruit=1
@ -134,7 +134,7 @@ Defeat:
[/unit]
[unit]
description=Grüü
type=Troll
type=Troll Hero
side=3
x=27
y=13
@ -328,11 +328,17 @@ Defeat:
[kill]
description=Blemaker
[/kill]
[unit]
side=1
description=Grüü
type=Troll
[/unit]
[store_unit]
[filter]
description=Grüü
[/filter]
variable=gruu_store
[/store_unit]
{VARIABLE gruu_store.side 1}
[unstore_unit]
variable=gruu_store
[/unstore_unit]
{CLEAR_VARIABLE gruu_store}
[/event]
[/scenario]

View file

@ -26,7 +26,7 @@
[part]
id=orc_intro_5
story= _ "By nightfall his troops reached a mountainous territory, under the authority of orcish ruler Kapou'e, the son of the Black Eye."
story= _ "By nightfall his troops reached a mountainous territory, under the authority of orcish leader Kapou'e, the son of the Black Eye."
background=maps/sotbe.png
[/part]

View file

@ -55,7 +55,8 @@ Defeat:
[/side]
[side]
type=Female Outlaw
type=Outlaw
gender=female
description=Wesfolk Leader
side=2
canrecruit=1

View file

@ -135,12 +135,14 @@
message= _ "We can't all stay here for the winter or we'll all starve, or freeze. Your hospitality has barely been enough as it is. Wait a second, I see somebody!"
[/message]
[move_unit_fake]
type=Female Outlaw
type=Outlaw
gender=female
x=8,8,8,8,8,7,7,6,6
y=30,29,28,27,26,26,25,24,23,22
[/move_unit_fake]
[unit]
type=Female Outlaw
type=Outlaw
gender=female
description=Lady Outlaw
side=1
x=6

View file

@ -46,7 +46,8 @@ Defeat:
[/side]
[side]
type=Female Outlaw
type=Outlaw
gender=female
description=Wesfolk Leader
side=2
canrecruit=1
@ -54,7 +55,7 @@ Defeat:
[ai]
recruitment_pattern=fighter,fighter,archer,scout
{NO_SCOUTS}
aggression=-0.25
aggression=-0.35
passive_leader=yes
grouping=defensive
[/ai]
@ -310,7 +311,8 @@ Defeat:
[/message]
[unit]
description=Lady Outlaw
type=Female Outlaw
type=Outlaw
gender=female
side=1
[/unit]
[set_variable]

View file

@ -141,9 +141,5 @@
speaker=Prince Haldric
message= _ "I kind of had plans for him."
[/message]
[endlevel]
result=defeat
bonus=no
[/endlevel]
[/event]

View file

@ -5,9 +5,9 @@ name= _ "Fireball"
image=projectiles/fireball.png
image_defensive=projectiles/fireball.png
hitpoints=1
movement_type=none
movement=1
experience=1
movement_type=fly
movement=5
experience=500
level=0
alignment=neutral
advanceto=null

View file

@ -1,5 +1,6 @@
[unit]
name=Great Troll
id=Great Troll
name= _ "Great Troll"
race=troll
image=great-troll.png
#image_defensive=great-troll-defend.png
@ -12,7 +13,7 @@ level=3
alignment=chaotic
advanceto=null
cost=38
unit_description="Great Trolls are strong and brutal humanoid monsters with the amazing ability to regenerate themselves, so that they recover from wounds on their own, even during battle."
unit_description= _ "Great Trolls are strong and brutal humanoid monsters with the amazing ability to regenerate themselves, so that they recover from wounds on their own, even during battle."
get_hit_sound=ugg.wav
usage=fighter
[attack]

View file

@ -6,7 +6,7 @@ gender=male
image=noble-commander.png
image_defensive=noble-commander-defend.png
image_leading=noble-commander-leading.png
hitpoints=45
hitpoints=48
ability=leadership
movement_type=smallfoot
movement=6

View file

@ -5,7 +5,7 @@ race=human
gender=male
image=noble-fighter.png
image_defensive=noble-fighter-defend.png
hitpoints=32
hitpoints=36
movement_type=smallfoot
movement=6
experience=28
@ -14,13 +14,13 @@ alignment=lawful
advanceto=Noble Commander
cost=35
usage=mixed fighter
unit_description= _ "Young and brash, Fighters fight with a sword, and are vulnerable to attack from enemies. However they have the potential to become great warriors one day."
unit_description= _ "Young and brash, Fighters fight with a sword, and are vulnerable to ranged attacks from enemies. However they have the potential to become great Commanders one day."
get_hit_sound=groan.wav
[attack]
name=sword
type=blade
range=short
damage=6
damage=7
number=3
icon=attacks/sword.png
[frame]

View file

@ -6,7 +6,7 @@ gender=male
image=noble-lord.png
image_defensive=noble-lord-defend.png
image_leading=noble-lord-leading.png
hitpoints=68
hitpoints=64
ability=leadership
movement_type=smallfoot
movement=6
@ -22,7 +22,7 @@ get_hit_sound=groan.wav
name=sword
type=blade
range=short
damage=12
damage=11
number=4
icon=attacks/sword.png
[frame]
@ -40,7 +40,7 @@ get_hit_sound=groan.wav
name=bow
type=pierce
range=long
damage=9
damage=8
number=3
icon=attacks/bow.png
[frame]

View file

@ -5,9 +5,9 @@ race=human
gender=male
image=noble-youth.png
image_defensive=noble-youth-defend.png
hitpoints=20
hitpoints=24
movement_type=smallfoot
movement=4
movement=5
experience=8
level=0
alignment=neutral
@ -21,7 +21,7 @@ get_hit_sound=groan.wav
icon=attacks/woodensword.png
type=impact
range=short
damage=3
damage=4
number=2
[frame]
begin=-100

View file

@ -1,5 +1,6 @@
[unit]
name=Orcish Leader
id=Orcish Leader
name= _ "Orcish Leader"
race=orc
image=orcish-leader.png
image_defensive=orcish-leader-defend.png
@ -14,7 +15,7 @@ alignment=chaotic
advanceto=Orcish Ruler
cost=120
usage=mixed fighter
unit_description="Orcish Rulers are the chiefs of their tribe. They make the important decisions and lead their people into battle. They carry a bow out of necessity, but are much more skilled with the sword; all in all, they are powerful fighters. Their natural leadership skills make them very precious in the battle: if the Ruler is lost, so is the battle."
unit_description= _ "Orcish Rulers are the chiefs of their tribe. They make the important decisions and lead their people into battle. They carry a bow out of necessity, but are much more skilled with the sword; all in all, they are powerful fighters. Their natural leadership skills make them very precious in the battle: if the Ruler is lost, so is the battle."
get_hit_sound=orc-hit.wav
[attack]
name=sword

View file

@ -3,15 +3,16 @@ id=Orcish Ruler
name= _ "Orcish Ruler"
race=orc
image=orcish-ruler.png
image_defensive=orcish-ruler-defend.png
#profile=misc/kapoue.png
hitpoints=45
hitpoints=60
ability=leadership
movement_type=orcishfoot
movement=6
experience=60
experience=120
level=2
alignment=chaotic
advanceto=null
advanceto=Orcish Sovereign
cost=120
usage=mixed fighter
unit_description= _ "Orcish Rulers are the chiefs of their tribe. They make the important decisions and lead their people into battle. They carry a bow out of necessity, but are much more skilled with the sword; all in all, they are powerful fighters. Their natural leadership skills make them very precious in the battle: if the Ruler is lost, so is the battle."
@ -25,6 +26,7 @@ get_hit_sound=orc-hit.wav
[sound]
time=-250
sound=sword-swish.wav
image=orcish-ruler-attack.png
[/sound]
[/attack]
[attack]

View file

@ -1,5 +1,6 @@
[unit]
name=Orcish Sovereign
id=Orcish Sovereign
name= _ "Orcish Sovereign"
race=orc
image=orcish-ruler.png
#profile=misc/kapoue.png
@ -13,7 +14,7 @@ alignment=chaotic
advanceto=null
cost=120
usage=mixed fighter
unit_description="Orcish Sovereign are the chiefs of their tribe. They make the important decisions and lead their people into battle. They carry a bow out of necessity, but are much more skilled with the sword; all in all, they are powerful fighters. Their natural leadership skills make them very precious in the battle: if the Ruler is lost, so is the battle."
unit_description= _ "Orcish Sovereign are the chiefs of their tribe. They make the important decisions and lead their people into battle. They carry a bow out of necessity, but are much more skilled with the sword; all in all, they are powerful fighters. Their natural leadership skills make them very precious in the battle: if the Ruler is lost, so is the battle."
get_hit_sound=orc-hit.wav
[attack]
name=sword

View file

@ -2,6 +2,7 @@
id=Outlaw
name= _ "Outlaw"
race=human
gender=male,female
image=neutral-outlaw.png
image_defensive=neutral-outlaw-defend.png
hitpoints=40
@ -68,4 +69,72 @@ get_hit_sound=groan.wav
image_diagonal=projectiles/stone.png
[/missile_frame]
[/attack]
[female]
name=Outlaw
race=human
gender=female
image=neutral-outlaw+female.png
image_defensive=neutral-outlaw+female-defend.png
hitpoints=40
movement_type=elusivefoot
movement=7
experience=500
level=2
alignment=chaotic
advanceto=null
cost=40
usage=mixed fighter
unit_description="Outlaws fight better at night. Female Outlaws look good while doing it."
get_hit_sound=female-hit.wav
[attack]
name=mace
type=impact
range=short
damage=7
number=2
icon=attacks/mace.png
[frame]
begin=-100
end=100
image=neutral-outlaw+female-attack.png
[/frame]
[sound]
time=-100
sound=mace.wav
[/sound]
[/attack]
[attack]
name=sling
type=impact
range=long
damage=6
number=3
icon=attacks/sling.png
[sound]
time=-100
sound=firearrow.wav
[/sound]
[frame]
begin=-250
end=-50
image=neutral-outlaw+female-attack1.png
[/frame]
[frame]
begin=-50
end=50
image=neutral-outlaw+female-attack2.png
[/frame]
[missile_frame]
begin=-100
end=0
image=projectiles/stone.png
image_diagonal=projectiles/stone.png
[/missile_frame]
[/attack]
[/female]
[/unit]

View file

@ -1,69 +0,0 @@
[unit]
#All credit for the images goes to Sangel
#In a sane world she'd level to the Outlaw Princess, who is level 2
id=Female Outlaw
name= _ "Female Outlaw"
race=human
gender=female
image=neutral-outlaw-female.png
image_defensive=neutral-outlaw-female-defend.png
hitpoints=48
movement_type=elusivefoot
movement=7
experience=500
level=2
alignment=chaotic
advanceto=null
cost=40
usage=mixed fighter
unit_description= _ "Outlaws fight better at night. Female Outlaws look good while doing it (fighting at night)."
get_hit_sound=groan.wav
[attack]
name=mace
type=impact
range=short
damage=7
number=4
icon=attacks/mace.png
[frame]
begin=-100
end=100
image=neutral-outlaw-female-attack-mace.png
[/frame]
[sound]
time=-100
sound=mace.wav
[/sound]
[/attack]
[attack]
name=sling
type=impact
range=long
damage=5
number=3
icon=attacks/sling.png
[sound]
time=-100
sound=firearrow.wav
[/sound]
[frame]
begin=-250
end=-50
image=neutral-outlaw-female-attack1.png
[/frame]
[frame]
begin=-50
end=50
image=neutral-outlaw-female-attack2.png
[/frame]
[missile_frame]
begin=-100
end=0
image=projectiles/stone.png
image_diagonal=projectiles/stone.png
[/missile_frame]
[/attack]
[/unit]

View file

@ -6,16 +6,15 @@ race=human
gender=female
image=neutral-outlaw-princess.png
image_defensive=neutral-outlaw-princess-defend.png
hitpoints=48
hitpoints=46
movement_type=elusivefoot
movement=7
experience=70
experience=60
level=2
alignment=chaotic
advanceto=Outlaw Queen
cost=50
ability=ambush
ability=skirmisher
usage=mixed fighter
unit_description= _ "A noble by birth, the Outlaw Princess has learnt swordplay with the greatest generals, but she is the product of a failed aristocracy who has opted for the life of an Outlaw. She dreams of founding her own Queendom with the plunder she finds on the road."
@ -25,7 +24,7 @@ get_hit_sound=groan.wav
type=impact
range=short
damage=7
number=4
number=2
icon=attacks/mace.png
[frame]
begin=-100
@ -42,7 +41,7 @@ get_hit_sound=groan.wav
name=sling
type=impact
range=long
damage=5
damage=6
number=3
icon=attacks/sling.png
[frame]

View file

@ -6,7 +6,7 @@ gender=female
image=neutral-outlaw-queen.png
image_defensive=neutral-outlaw-queen-defend.png
image_leading=neutral-outlaw-queen-leading.png
hitpoints=56
hitpoints=62
movement_type=elusivefoot
movement=7
experience=500
@ -14,7 +14,7 @@ level=3
alignment=chaotic
advanceto=null
cost=150
ability=ambush,leadership
ability=skirmisher,leadership
usage=mixed fighter
unit_description= _ "A noble by birth, the Outlaw Queen has learnt swordplay with the greatest generals and battle tactics with the greatest sages, making her both a great combatant and leader. However, she is the product of a failed aristocracy who has opted for the life of an Outlaw. She dreams of founding her own Queendom with the plunder she finds on the road, and she is ever so close to that goal."
@ -25,7 +25,7 @@ get_hit_sound=groan.wav
type=impact
range=short
damage=9
number=4
number=3
icon=attacks/mace.png
[frame]
begin=-100
@ -42,8 +42,8 @@ get_hit_sound=groan.wav
name=sling
type=impact
range=long
damage=7
number=3
damage=8
number=4
icon=attacks/sling.png
[frame]
begin=-250

View file

@ -1,5 +1,6 @@
[unit]
name=Troll Hero
id=Troll Hero
name= _ "Troll Hero"
race=troll
image=troll-hero.png
#image_defensive=troll-hero-defend.png
@ -12,7 +13,7 @@ level=2
alignment=chaotic
advanceto=Great Troll
cost=30
unit_description="Trolls hero are strong and brutal humanoid monsters with the amazing ability to regenerate themselves, so that they recover from wounds on their own, even during battle."
unit_description= _ "Trolls hero are strong and brutal humanoid monsters with the amazing ability to regenerate themselves, so that they recover from wounds on their own, even during battle."
get_hit_sound=ugg.wav
usage=fighter
[attack]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 957 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View file

@ -186,6 +186,8 @@ std::string get_dir(const std::string& dir_path)
if(dir == NULL)
return "";
closedir(dir);
#endif
return dir_path;

View file

@ -433,9 +433,10 @@ bool event_handler::handle_event_command(const queued_event& event_info, const s
//the visual effect
else if(cmd == "move_unit_fake") {
const std::string& type = cfg["type"];
const unit_race::GENDER gender = cfg["gender"] == "female" ? unit_race::FEMALE : unit_race::MALE;
const game_data::unit_type_map::const_iterator itor = game_data_ptr->unit_types.find(type);
if(itor != game_data_ptr->unit_types.end()) {
unit dummy_unit(&itor->second,0,false,true);
unit dummy_unit(&itor->second,0,false,true,gender);
const std::vector<std::string> xvals = config::split(cfg["x"]);
const std::vector<std::string> yvals = config::split(cfg["y"]);
std::vector<gamemap::location> path;

View file

@ -381,6 +381,7 @@ void load_game(const game_data& data, const std::string& name, game_state& state
void save_game(const game_state& state)
{
log_scope("save_game");
std::string name = state.label;
std::replace(name.begin(),name.end(),' ','_');
@ -389,17 +390,20 @@ void save_game(const game_state& state)
write_game(state,cfg);
const std::string fname = get_saves_dir() + "/" + name;
/*
write_file(fname,cfg.write());
config& summary = save_summary(state.label);
extract_summary_data_from_save(state,summary);
const int mod_time = static_cast<int>(file_create_time(fname));
summary["mod_time"] = str_cast(mod_time);
write_save_index();
*/
} catch(io_exception& e) {
throw gamestatus::save_game_failed(e.what());
};
}
}
namespace {
@ -450,6 +454,7 @@ void delete_save_summary(const std::string& save)
void write_save_index()
{
log_scope("write_save_index()");
try {
write_file(get_save_index_file(),save_index().write());
} catch(io_exception& e) {

View file

@ -13,4 +13,8 @@
#include "log.hpp"
#include <unistd.h>
#include <sstream>
int scope_logger::indent = 0;

View file

@ -25,18 +25,24 @@
struct scope_logger
{
scope_logger(const std::string& str) : ticks_(SDL_GetTicks()), str_(str) {
for(int i = 0; i != indent; ++i)
std::cerr << " ";
++indent;
do_indent();
std::cerr << "BEGIN: " << str_ << "\n";
do_indent();
++indent;
}
~scope_logger() {
const int ticks = SDL_GetTicks() - ticks_;
--indent;
do_indent();
do_indent();
std::cerr << "END: " << str_ << " (took " << ticks << "ms)\n";
}
void do_indent()
{
for(int i = 0; i != indent; ++i)
std::cerr << " ";
std::cerr << "END: " << str_ << " (took " << ticks << "ms)\n";
}
private:

View file

@ -162,7 +162,7 @@ void turn_info::turn_slice()
tooltips::process(mousex,mousey,mouse_flags & SDL_BUTTON_LMASK);
const int scroll_threshold = preferences::fullscreen() ? 5 : 0;
const int scroll_threshold = 5;
if(key_[SDLK_UP] || mousey < scroll_threshold)
gui_.scroll(0,-preferences::scroll_speed());

View file

@ -67,8 +67,8 @@ unit_race::GENDER unit::generate_gender(const unit_type& type, bool gen)
}
//constructor for creating a new unit
unit::unit(const unit_type* t, int side, bool use_traits, bool dummy_unit) :
gender_(generate_gender(*t,use_traits)),
unit::unit(const unit_type* t, int side, bool use_traits, bool dummy_unit, unit_race::GENDER gender) :
gender_(dummy_unit ? gender : generate_gender(*t,use_traits)),
type_(t->get_gender_unit_type(gender_)), state_(STATE_NORMAL),
hitpoints_(type_->hitpoints()),
maxHitpoints_(type_->hitpoints()),

View file

@ -32,7 +32,7 @@ public:
friend struct unit_movement_resetter;
unit(const game_data& data, const config& cfg);
unit(const unit_type* t, int side, bool use_traits=false, bool dummy_unit=false);
unit(const unit_type* t, int side, bool use_traits=false, bool dummy_unit=false, unit_race::GENDER gender=unit_race::MALE);
//a constructor used when advancing a unit
unit(const unit_type* t, const unit& u);