dsaster-svnlog Mailing List for DSAster
Status: Pre-Alpha
Brought to you by:
j6cubic
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(7) |
Nov
|
Dec
(14) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <j6...@us...> - 2008-08-14 00:03:54
|
Revision: 24 http://dsaster.svn.sourceforge.net/dsaster/?rev=24&view=rev Author: j6cubic Date: 2008-08-14 00:03:51 +0000 (Thu, 14 Aug 2008) Log Message: ----------- Fixed GE/FF swap during h42 read Modified Paths: -------------- h422/trunk/opt/makesxw.php h422/trunk/src/io_h42.cpp Modified: h422/trunk/opt/makesxw.php =================================================================== --- h422/trunk/opt/makesxw.php 2007-04-20 17:05:18 UTC (rev 23) +++ h422/trunk/opt/makesxw.php 2008-08-14 00:03:51 UTC (rev 24) @@ -67,7 +67,7 @@ if ($filename === false) { - if (is_dir($argv[2])) + if ($argc > 2 && is_dir($argv[2])) $filename = $argv[2].'/'.$held['name'].'.sxw'; else $filename = $held['name'].'.sxw'; @@ -571,9 +571,9 @@ function e() { global $retval, $zip; - - if ($retval == 0) { - die("Fehler: ".$zip->errorInfo(true)); + + if ($retval == 0) { + die("Fehler: ".$zip->errorInfo(true)); } } Modified: h422/trunk/src/io_h42.cpp =================================================================== --- h422/trunk/src/io_h42.cpp 2007-04-20 17:05:18 UTC (rev 23) +++ h422/trunk/src/io_h42.cpp 2008-08-14 00:03:51 UTC (rev 24) @@ -1,161 +1,165 @@ -/******************************************************************************* -* h422 - converts DSAv3 hero data between various formats * -* Copyright (C) 2006 Tim "Jesus_666" Okrongli * -* * -* This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU General Public License as published by the Free * -* Software Foundation; either version 2 of the License, or (at your option) * -* any later version. * -* * -* This program is distributed in the hope that it will be useful, but WITHOUT * -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -* more details. * -* * -* You should have received a copy of the GNU General Public License along with * -* this program; if not, write to the Free Software Foundation, Inc., 51 * -* Franklin St, Fifth Floor, Boston, MA 02110, USA * -*******************************************************************************/ - -#include "modules.h" -#include "iostream" -// These two are used as an el-cheapo tokenizer -#include <sstream> -#include <vector> - +/******************************************************************************* +* h422 - converts DSAv3 hero data between various formats * +* Copyright (C) 2006 Tim "Jesus_666" Okrongli * +* * +* This program is free software; you can redistribute it and/or modify it * +* under the terms of the GNU General Public License as published by the Free * +* Software Foundation; either version 2 of the License, or (at your option) * +* any later version. * +* * +* This program is distributed in the hope that it will be useful, but WITHOUT * +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * +* more details. * +* * +* You should have received a copy of the GNU General Public License along with * +* this program; if not, write to the Free Software Foundation, Inc., 51 * +* Franklin St, Fifth Floor, Boston, MA 02110, USA * +*******************************************************************************/ + +/* Changes: + * 2008-08-14 Swapped GE and FF in input -- Jeez + */ + +#include "modules.h" +#include "iostream" +// These two are used as an el-cheapo tokenizer +#include <sstream> +#include <vector> + // Counts read lines, used for error messages. Also ensures proper treatment of -// the line endings, which are Windows-style +// the line endings, which are Windows-style #define getline(x, y); { lineno++; getline(x, y, '\r'); \ - if ('\n' == x.peek()) x.ignore(1); } - -// Some conversion functions we need -inline int strtoi(string str) { return atoi(str.c_str()); } -inline string itostr(int i) -{ - stringstream ss; - ss << i; - return ss.str(); -} -inline bool strtobool(string str) -{ - return ("TRUE" == str) ? true : false; -} - -// Shorthand for adding talents to a talent group -void addTalent(talentgruppe* &tg, string name, Grundwert gw0, Grundwert gw1, - Grundwert gw2, int taw, int stps, int stpsue, int fvue) -{ + if ('\n' == x.peek()) x.ignore(1); } + +// Some conversion functions we need +inline int strtoi(string str) { return atoi(str.c_str()); } +inline string itostr(int i) +{ + stringstream ss; + ss << i; + return ss.str(); +} +inline bool strtobool(string str) +{ + return ("TRUE" == str) ? true : false; +} + +// Shorthand for adding talents to a talent group +void addTalent(talentgruppe* &tg, string name, Grundwert gw0, Grundwert gw1, + Grundwert gw2, int taw, int stps, int stpsue, int fvue) +{ s_talent* talent = new s_talent; - talent->gw[0] = gw0; - talent->gw[1] = gw1; - talent->gw[2] = gw2; - talent->taw = taw; - talent->stps = stps; - talent->stpsue = stpsue; - talent->fvue = fvue; - (*tg)[name] = talent; -} - -// registers the plugin with the main program -s_plugdata* registerPlugin() -{ - s_plugdata* pd = new s_plugdata; - pd->name = "h42"; - pd->capabilities = CAN_READ; - pd->version = 1; - pd->description = "Liest h42-Heldendokumente"; - pd->extensions.push_back("h42"); - // Just leave these two lines be. The main program relies on them. - pd->read = &readHero; - pd->write = &writeHero; - - return pd; -} - -// Reads a h42 file into an s_hero struct -s_held* readHero(char* filename) -{ - ifstream source (filename); - if (!source.is_open()) - { - cout << "Fehler beim Öffnen von " << filename << endl; - exit(101); - } - - // No need to initialize these before we have opened the file - int lineno = 0; - string tempstring, buffer; - stringstream ss(stringstream::in | stringstream::out); - vector<string> tokens; - int i = 0; + talent->gw[0] = gw0; + talent->gw[1] = gw1; + talent->gw[2] = gw2; + talent->taw = taw; + talent->stps = stps; + talent->stpsue = stpsue; + talent->fvue = fvue; + (*tg)[name] = talent; +} + +// registers the plugin with the main program +s_plugdata* registerPlugin() +{ + s_plugdata* pd = new s_plugdata; + pd->name = "h42"; + pd->capabilities = CAN_READ; + pd->version = 1; + pd->description = "Liest h42-Heldendokumente"; + pd->extensions.push_back("h42"); + // Just leave these two lines be. The main program relies on them. + pd->read = &readHero; + pd->write = &writeHero; + + return pd; +} + +// Reads a h42 file into an s_hero struct +s_held* readHero(char* filename) +{ + ifstream source (filename); + if (!source.is_open()) + { + cout << "Fehler beim Öffnen von " << filename << endl; + exit(101); + } + + // No need to initialize these before we have opened the file + int lineno = 0; + string tempstring, buffer; + stringstream ss(stringstream::in | stringstream::out); + vector<string> tokens; + int i = 0; s_held* held = new s_held; - - // Okay, the file is open and everything's set up. First we read the hero's - // class and the attributes - - // I love reading in string values - getline(source, held->klasse); - - // My love for multiple values in one line is somewhat lesser, though an - // std::stringstream makes for a decent tokenizer, as it treats whitespace as - // separators - getline(source, tempstring); - ss << tempstring; - ss >> buffer; held->mu = held->mu_gw = strtoi(buffer); - ss >> buffer; held->kl = held->kl_gw = strtoi(buffer); - ss >> buffer; held->in = held->in_gw = strtoi(buffer); - ss >> buffer; held->ch = held->ch_gw = strtoi(buffer); - ss >> buffer; held->ge = held->ge_gw = strtoi(buffer); - ss >> buffer; held->ff = held->ff_gw = strtoi(buffer); - ss >> buffer; held->kk = held->kk_gw = strtoi(buffer); - getline(source, tempstring); - - // We should reset stringstreams before reusing them, just in case there's - // still junk left from the last line - ss.str(""); ss.clear(); - ss << tempstring; - ss >> buffer; held->ag = held->ag_gw = strtoi(buffer); - ss >> buffer; held->ha = held->ha_gw = strtoi(buffer); - ss >> buffer; held->ra = held->ra_gw = strtoi(buffer); - ss >> buffer; held->ta = held->ta_gw = strtoi(buffer); - ss >> buffer; held->ng = held->ng_gw = strtoi(buffer); - ss >> buffer; held->gg = held->gg_gw = strtoi(buffer); - ss >> buffer; held->jz = held->jz_gw = strtoi(buffer); - - // Next comes the talent handling. Since combat talents are special and come - // first we do some custom stuff with them - - // The group name of the combat talents. We throw this away as it doesn't - // conform to what most people expect to see on their character sheet. - // Besides, only regular talents are stored in name:group format - getline(source, tempstring); - // Unknown Value 1. We also throw this away since it seems to be pointless - // anyway - getline(source, tempstring); - getline(source, tempstring); // Number of combat talents - held->kampftalente.reserve(strtoi(tempstring)); - - for (int talentsToGo = strtoi(tempstring); talentsToGo > 0; talentsToGo--) - { - string talentName = ""; - int beMod = 0; - int taw, stps, stpsue, fvue; - bool bFirstPart = true; - - getline(source, tempstring); + + // Okay, the file is open and everything's set up. First we read the hero's + // class and the attributes + + // I love reading in string values + getline(source, held->klasse); + + // My love for multiple values in one line is somewhat lesser, though an + // std::stringstream makes for a decent tokenizer, as it treats whitespace as + // separators + getline(source, tempstring); + ss << tempstring; + ss >> buffer; held->mu = held->mu_gw = strtoi(buffer); + ss >> buffer; held->kl = held->kl_gw = strtoi(buffer); + ss >> buffer; held->in = held->in_gw = strtoi(buffer); + ss >> buffer; held->ch = held->ch_gw = strtoi(buffer); + ss >> buffer; held->ff = held->ff_gw = strtoi(buffer); + ss >> buffer; held->ge = held->ge_gw = strtoi(buffer); + ss >> buffer; held->kk = held->kk_gw = strtoi(buffer); + getline(source, tempstring); + + // We should reset stringstreams before reusing them, just in case there's + // still junk left from the last line + ss.str(""); ss.clear(); + ss << tempstring; + ss >> buffer; held->ag = held->ag_gw = strtoi(buffer); + ss >> buffer; held->ha = held->ha_gw = strtoi(buffer); + ss >> buffer; held->ra = held->ra_gw = strtoi(buffer); + ss >> buffer; held->ta = held->ta_gw = strtoi(buffer); + ss >> buffer; held->ng = held->ng_gw = strtoi(buffer); + ss >> buffer; held->gg = held->gg_gw = strtoi(buffer); + ss >> buffer; held->jz = held->jz_gw = strtoi(buffer); + + // Next comes the talent handling. Since combat talents are special and come + // first we do some custom stuff with them + + // The group name of the combat talents. We throw this away as it doesn't + // conform to what most people expect to see on their character sheet. + // Besides, only regular talents are stored in name:group format + getline(source, tempstring); + // Unknown Value 1. We also throw this away since it seems to be pointless + // anyway + getline(source, tempstring); + getline(source, tempstring); // Number of combat talents + held->kampftalente.reserve(strtoi(tempstring)); + + for (int talentsToGo = strtoi(tempstring); talentsToGo > 0; talentsToGo--) + { + string talentName = ""; + int beMod = 0; + int taw, stps, stpsue, fvue; + bool bFirstPart = true; + + getline(source, tempstring); /* - ss.str(""); ss.clear(); // reset stringstream - ss << tempstring; - ss >> buffer; + ss.str(""); ss.clear(); // reset stringstream + ss << tempstring; + ss >> buffer; // TODO: Make this loop better <- rfind(); index=tempstr.rfind("(",string::npos); - //tempstr.substr(0,index) und der andere tempstr.substr(index) - while (buffer.substr(0, 1) != "(") - { - talentName += ((bFirstPart) ? "" : " ") + buffer; - bFirstPart = false; - string lastVal = buffer; - ss >> buffer; - if (buffer == lastVal) break; + //tempstr.substr(0,index) und der andere tempstr.substr(index) + while (buffer.substr(0, 1) != "(") + { + talentName += ((bFirstPart) ? "" : " ") + buffer; + bFirstPart = false; + string lastVal = buffer; + ss >> buffer; + if (buffer == lastVal) break; } */ int index = tempstring.rfind("(", string::npos); @@ -166,106 +170,106 @@ talentName = tempstring.substr(0, index - 1); } else - talentName = tempstring; - - // Not all combat talents have a modifier - if (rside.size() > 0) - beMod = strtoi(rside.substr(3, rside.size() - 4)); - - getline(source, tempstring); - ss.str(""); ss.clear(); // reset stringstream - ss << tempstring; - ss >> buffer; taw = strtoi(buffer); - ss >> buffer; stps = strtoi(buffer); - ss >> buffer; stpsue = strtoi(buffer); - ss >> buffer; fvue = strtoi(buffer); - - s_kampftalent* ktal = new s_kampftalent; - ktal->beMod = beMod; - ktal->taw = taw; - ktal->stps = stps; - ktal->stpsue = stpsue; - ktal->fvue = fvue; - // The following values can only be determined later and are thus filled - // with dummy values - ktal->at = 0; + talentName = tempstring; + + // Not all combat talents have a modifier + if (rside.size() > 0) + beMod = strtoi(rside.substr(3, rside.size() - 4)); + + getline(source, tempstring); + ss.str(""); ss.clear(); // reset stringstream + ss << tempstring; + ss >> buffer; taw = strtoi(buffer); + ss >> buffer; stps = strtoi(buffer); + ss >> buffer; stpsue = strtoi(buffer); + ss >> buffer; fvue = strtoi(buffer); + + s_kampftalent* ktal = new s_kampftalent; + ktal->beMod = beMod; + ktal->taw = taw; + ktal->stps = stps; + ktal->stpsue = stpsue; + ktal->fvue = fvue; + // The following values can only be determined later and are thus filled + // with dummy values + ktal->at = 0; ktal->pa = 0; - held->kampftalente[talentName] = ktal; - } - - // The number of talent groups we still have to parse - int talentGroupsToGo = 8; // No combat talents - for (; talentGroupsToGo > 0; talentGroupsToGo--) - { - // Uh-oh, trouble. I just realized that we need wstrings everywhere, - // due to the fact that we have to deal with umlauts etc. - // I think we'll just have to replace all instances of "string" with - // "wstring" and "stringstream" with "wstringstream". Still, I can't be - // arsed to do it right now. - // The strtoi function, however, could present a problem, depending on - // how easy it is to cast const wchar_t* to const char*. - - // Eh, whatever. For the time being we just assume that the file is in - // latin-1 and the output plugin expects latin-1 data. - - string currentGroup; - //int unknownValue1; // unused until we know what it's good for - int talentsToGo; - - - getline(source, currentGroup); - // The following line was deprecated in favor of [] = new - //held->talente.insert(make_pair(currentGroup, new talentgruppe)); - held->talente[currentGroup] = new talentgruppe; - talentgruppe* tgroup = held->talente[currentGroup]; - - // see definition of unknownValue1 - getline(source, tempstring); // we skip the unknown value - //unknownValue1 = strtoi(tempstring); - getline(source, tempstring); - talentsToGo = strtoi(tempstring); - - for (; talentsToGo > 0; talentsToGo--) - { - string talentName = ""; - Grundwert gw0, gw1, gw2; - int taw, stps, stpsue, fvue; - bool bFirstPart = true; - - getline(source, tempstring); + held->kampftalente[talentName] = ktal; + } + + // The number of talent groups we still have to parse + int talentGroupsToGo = 8; // No combat talents + for (; talentGroupsToGo > 0; talentGroupsToGo--) + { + // Uh-oh, trouble. I just realized that we need wstrings everywhere, + // due to the fact that we have to deal with umlauts etc. + // I think we'll just have to replace all instances of "string" with + // "wstring" and "stringstream" with "wstringstream". Still, I can't be + // arsed to do it right now. + // The strtoi function, however, could present a problem, depending on + // how easy it is to cast const wchar_t* to const char*. + + // Eh, whatever. For the time being we just assume that the file is in + // latin-1 and the output plugin expects latin-1 data. + + string currentGroup; + //int unknownValue1; // unused until we know what it's good for + int talentsToGo; + + + getline(source, currentGroup); + // The following line was deprecated in favor of [] = new + //held->talente.insert(make_pair(currentGroup, new talentgruppe)); + held->talente[currentGroup] = new talentgruppe; + talentgruppe* tgroup = held->talente[currentGroup]; + + // see definition of unknownValue1 + getline(source, tempstring); // we skip the unknown value + //unknownValue1 = strtoi(tempstring); + getline(source, tempstring); + talentsToGo = strtoi(tempstring); + + for (; talentsToGo > 0; talentsToGo--) + { + string talentName = ""; + Grundwert gw0, gw1, gw2; + int taw, stps, stpsue, fvue; + bool bFirstPart = true; + + getline(source, tempstring); /* - ss.str(""); ss.clear(); // reset stringstream - ss << tempstring; - ss >> buffer; - // TODO: Make this loop better - while (buffer.substr(0, 1) != "(") - { - talentName += ((bFirstPart) ? "" : " ") + buffer; - bFirstPart = false; - string lastVal = buffer; - ss >> buffer; - if (buffer == lastVal) break; + ss.str(""); ss.clear(); // reset stringstream + ss << tempstring; + ss >> buffer; + // TODO: Make this loop better + while (buffer.substr(0, 1) != "(") + { + talentName += ((bFirstPart) ? "" : " ") + buffer; + bFirstPart = false; + string lastVal = buffer; + ss >> buffer; + if (buffer == lastVal) break; } - - if (buffer.substr(0, 1) == "(") - { - gw0 = strtogw(buffer.substr(1, 2)); - gw1 = strtogw(buffer.substr(4, 2)); - gw2 = strtogw(buffer.substr(7, 2)); - - if ((ATTR_INVALID == gw0 || ATTR_INVALID == gw1 || ATTR_INVALID == gw2) &&) - { - cout << "Datei kann nicht gelesen werden: Ungültiger Talentname " << - "in Zeile " << lineno << endl; - exit(102); - } - } - else - { - cout << "Datei kann nicht gelesen werden: Ungültiger Talentname in " << + + if (buffer.substr(0, 1) == "(") + { + gw0 = strtogw(buffer.substr(1, 2)); + gw1 = strtogw(buffer.substr(4, 2)); + gw2 = strtogw(buffer.substr(7, 2)); + + if ((ATTR_INVALID == gw0 || ATTR_INVALID == gw1 || ATTR_INVALID == gw2) &&) + { + cout << "Datei kann nicht gelesen werden: Ungültiger Talentname " << + "in Zeile " << lineno << endl; + exit(102); + } + } + else + { + cout << "Datei kann nicht gelesen werden: Ungültiger Talentname in " << "Zeile " << lineno << endl; - cout << talentName << " - " << talentsToGo << endl; - exit(102); + cout << talentName << " - " << talentsToGo << endl; + exit(102); } */ @@ -275,95 +279,95 @@ rside = tempstring.substr(index); if (rside.size() == 10 && rside.substr(3, 1) == "/" && rside.substr(6, 1) == "/") - { - gw0 = strtogw(rside.substr(1, 2)); - gw1 = strtogw(rside.substr(4, 2)); + { + gw0 = strtogw(rside.substr(1, 2)); + gw1 = strtogw(rside.substr(4, 2)); gw2 = strtogw(rside.substr(7, 2)); talentName = tempstring.substr(0, index - 1); } else - { + { gw0 = gw1 = gw2 = ATTR_INVALID; talentName = tempstring; - } - - getline(source, tempstring); - ss.str(""); ss.clear(); - ss << tempstring; - ss >> buffer; taw = strtoi(buffer); - ss >> buffer; stps = strtoi(buffer); - ss >> buffer; stpsue = strtoi(buffer); - ss >> buffer; fvue = strtoi(buffer); - - addTalent(tgroup, talentName, gw0, gw1, gw2, taw, stps, stpsue, fvue); - } - } - - // Whew. Time to relax with some simple one-value lines - - // h42 doesn't distinguish between current and map HP/MP/KP - getline(source, tempstring); held->le = held->le_gw = strtoi(tempstring); - getline(source, tempstring); held->ae = held->ae_gw = strtoi(tempstring); - getline(source, tempstring); held->ke = held->ke_gw = strtoi(tempstring); - getline(source, tempstring); held->zf_stps = strtoi(tempstring); - getline(source, tempstring); held->talent_stps = strtoi(tempstring); - getline(source, tempstring); held->taw_zf_vs = strtoi(tempstring); - getline(source, tempstring); held->be_minus = strtoi(tempstring); - getline(source, tempstring); held->gs = strtoi(tempstring); - getline(source, tempstring); held->mr_bonus = strtoi(tempstring); - getline(source, held->le_plus_ps); - getline(source, held->ae_plus_ps); - getline(source, tempstring); held->le_ae_separat = strtobool(tempstring); + } + + getline(source, tempstring); + ss.str(""); ss.clear(); + ss << tempstring; + ss >> buffer; taw = strtoi(buffer); + ss >> buffer; stps = strtoi(buffer); + ss >> buffer; stpsue = strtoi(buffer); + ss >> buffer; fvue = strtoi(buffer); + + addTalent(tgroup, talentName, gw0, gw1, gw2, taw, stps, stpsue, fvue); + } + } + + // Whew. Time to relax with some simple one-value lines + + // h42 doesn't distinguish between current and map HP/MP/KP + getline(source, tempstring); held->le = held->le_gw = strtoi(tempstring); + getline(source, tempstring); held->ae = held->ae_gw = strtoi(tempstring); + getline(source, tempstring); held->ke = held->ke_gw = strtoi(tempstring); + getline(source, tempstring); held->zf_stps = strtoi(tempstring); + getline(source, tempstring); held->talent_stps = strtoi(tempstring); + getline(source, tempstring); held->taw_zf_vs = strtoi(tempstring); + getline(source, tempstring); held->be_minus = strtoi(tempstring); + getline(source, tempstring); held->gs = strtoi(tempstring); + getline(source, tempstring); held->mr_bonus = strtoi(tempstring); + getline(source, held->le_plus_ps); + getline(source, held->ae_plus_ps); + getline(source, tempstring); held->le_ae_separat = strtobool(tempstring); getline(source, tempstring); held->magiertyp = strtobool(tempstring); held->au = held->le + held->kk; - held->au_gw = held->le_gw + held->kk_gw; - - // Okay, funtime's over, here comes another one of those pesky arrays - - // Time for the spells - getline(source, tempstring); - for (int spellsToGo = strtoi(tempstring); spellsToGo > 0; spellsToGo--) - { - string zauberName = "", gebiet, herkunft; - Grundwert gw0, gw1, gw2; - int taw, stps, stpsue, fvue; - bool bFirstPart = true; - + held->au_gw = held->le_gw + held->kk_gw; + + // Okay, funtime's over, here comes another one of those pesky arrays + + // Time for the spells + getline(source, tempstring); + for (int spellsToGo = strtoi(tempstring); spellsToGo > 0; spellsToGo--) + { + string zauberName = "", gebiet, herkunft; + Grundwert gw0, gw1, gw2; + int taw, stps, stpsue, fvue; + bool bFirstPart = true; + getline(source, tempstring); - /* - ss.str(""); ss.clear(); // reset stringstream - ss << tempstring; - ss >> buffer; - // TODO: Make this loop better - while (buffer.substr(0, 1) != "(") - { - zauberName += ((bFirstPart) ? "" : " ") + buffer; - bFirstPart = false; - string lastVal = buffer; - ss >> buffer; - if (buffer == lastVal) break; - } + /* + ss.str(""); ss.clear(); // reset stringstream + ss << tempstring; + ss >> buffer; + // TODO: Make this loop better + while (buffer.substr(0, 1) != "(") + { + zauberName += ((bFirstPart) ? "" : " ") + buffer; + bFirstPart = false; + string lastVal = buffer; + ss >> buffer; + if (buffer == lastVal) break; + } - if (buffer.substr(0, 1) == "(") - { - gw0 = strtogw(buffer.substr(1, 2)); - gw1 = strtogw(buffer.substr(4, 2)); - gw2 = strtogw(buffer.substr(7, 2)); - - if (ATTR_INVALID == gw0 || ATTR_INVALID == gw1 || ATTR_INVALID == gw2) - { - cout << "Datei kann nicht gelesen werden: Ungültiger Zaubername " << - "in Zeile " << lineno << endl; - exit(103); - } - } - else - { - cout << "Datei kann nicht gelesen werden: Ungültiger Zaubername in " << - "Zeile " << lineno << endl; - exit(103); + if (buffer.substr(0, 1) == "(") + { + gw0 = strtogw(buffer.substr(1, 2)); + gw1 = strtogw(buffer.substr(4, 2)); + gw2 = strtogw(buffer.substr(7, 2)); + + if (ATTR_INVALID == gw0 || ATTR_INVALID == gw1 || ATTR_INVALID == gw2) + { + cout << "Datei kann nicht gelesen werden: Ungültiger Zaubername " << + "in Zeile " << lineno << endl; + exit(103); + } } + else + { + cout << "Datei kann nicht gelesen werden: Ungültiger Zaubername in " << + "Zeile " << lineno << endl; + exit(103); + } */ int index = tempstring.rfind("(", string::npos); @@ -372,127 +376,127 @@ rside = tempstring.substr(index); if (rside.size() == 10 && rside.substr(3, 1) == "/" && rside.substr(6, 1) == "/") - { - gw0 = strtogw(rside.substr(1, 2)); - gw1 = strtogw(rside.substr(4, 2)); + { + gw0 = strtogw(rside.substr(1, 2)); + gw1 = strtogw(rside.substr(4, 2)); gw2 = strtogw(rside.substr(7, 2)); zauberName = tempstring.substr(0, index - 1); } else - { + { gw0 = gw1 = gw2 = ATTR_INVALID; zauberName = tempstring; - } - - getline(source, herkunft); - getline(source, gebiet); - - getline(source, tempstring); - ss.str(""); ss.clear(); - ss << tempstring; - ss >> buffer; taw = strtoi(buffer); - ss >> buffer; stps = strtoi(buffer); - ss >> buffer; stpsue = strtoi(buffer); - ss >> buffer; fvue = strtoi(buffer); - + } + + getline(source, herkunft); + getline(source, gebiet); + + getline(source, tempstring); + ss.str(""); ss.clear(); + ss << tempstring; + ss >> buffer; taw = strtoi(buffer); + ss >> buffer; stps = strtoi(buffer); + ss >> buffer; stpsue = strtoi(buffer); + ss >> buffer; fvue = strtoi(buffer); + s_zauber* zbr = new s_zauber; - zbr->gw[0] = gw0; - zbr->gw[1] = gw1; - zbr->gw[2] = gw2; - zbr->gebiet = gebiet; - zbr->herkunft = herkunft; - zbr->taw = taw; - zbr->stps = stps; - zbr->stpsue = stpsue; - zbr->fvue = fvue; + zbr->gw[0] = gw0; + zbr->gw[1] = gw1; + zbr->gw[2] = gw2; + zbr->gebiet = gebiet; + zbr->herkunft = herkunft; + zbr->taw = taw; + zbr->stps = stps; + zbr->stpsue = stpsue; + zbr->fvue = fvue; held->zauber[zauberName] = zbr; - } - + } + // And another one, this time quite trivial: The list of yet-to-be-learned - // special abilities - getline(source, tempstring); - for (int abilitesToGo = strtoi(tempstring); abilitesToGo > 0; abilitesToGo--) - { - // We learn which ones actually have been learned later - getline(source, tempstring); - held->sonderfertigkeiten[tempstring] = false; - } - - // Whee, another field of POD entries! - getline(source, tempstring); held->hat_rituale = strtobool(tempstring); - getline(source, tempstring); held->ritual_stps = strtoi(tempstring); - getline(source, held->name); - getline(source, held->geburtsort); - getline(source, held->haarfarbe); - getline(source, held->stand); - getline(source, tempstring); held->groesse = strtoi(tempstring); + // special abilities + getline(source, tempstring); + for (int abilitesToGo = strtoi(tempstring); abilitesToGo > 0; abilitesToGo--) + { + // We learn which ones actually have been learned later + getline(source, tempstring); + held->sonderfertigkeiten[tempstring] = false; + } + + // Whee, another field of POD entries! + getline(source, tempstring); held->hat_rituale = strtobool(tempstring); + getline(source, tempstring); held->ritual_stps = strtoi(tempstring); + getline(source, held->name); + getline(source, held->geburtsort); + getline(source, held->haarfarbe); + getline(source, held->stand); + getline(source, tempstring); held->groesse = strtoi(tempstring); getline(source, tempstring); held->gewicht = strtoi(tempstring); - getline(source, tempstring); - ss.str(""); ss.clear(); // reset stringstream - ss << tempstring; - ss >> buffer; held->geburtstag = strtoi(buffer); - ss >> buffer; held->geburtsmonat = itomon[strtoi(buffer)]; + getline(source, tempstring); + ss.str(""); ss.clear(); // reset stringstream + ss << tempstring; + ss >> buffer; held->geburtstag = strtoi(buffer); + ss >> buffer; held->geburtsmonat = itomon[strtoi(buffer)]; ss >> buffer; held->geburtsjahr = strtoi(buffer); - + getline(source, tempstring); held->alter = strtoi(tempstring); - // Now we fill in which special abilities have been learned - getline(source, tempstring); - for (int abilitesToGo = strtoi(tempstring); abilitesToGo > 0; abilitesToGo--) - { - getline(source, tempstring); - held->sonderfertigkeiten[tempstring] = true; + // Now we fill in which special abilities have been learned + getline(source, tempstring); + for (int abilitesToGo = strtoi(tempstring); abilitesToGo > 0; abilitesToGo--) + { + getline(source, tempstring); + held->sonderfertigkeiten[tempstring] = true; } - + getline(source, tempstring); held->ist_mann = strtobool(tempstring); - getline(source, tempstring); - ss.str(""); ss.clear(); // reset stringstream - ss << tempstring; - ss >> buffer; held->ritual_stue = strtoi(buffer); - ss >> buffer; held->talent_stue = strtoi(buffer); + getline(source, tempstring); + ss.str(""); ss.clear(); // reset stringstream + ss << tempstring; + ss >> buffer; held->ritual_stue = strtoi(buffer); + ss >> buffer; held->talent_stue = strtoi(buffer); ss >> buffer; held->zf_stue = strtoi(buffer); - - getline(source, held->gottheit); - getline(source, held->augenfarbe); - getline(source, held->titel); - getline(source, held->geburtsort); - getline(source, tempstring); held->ap = strtoi(tempstring); + + getline(source, held->gottheit); + getline(source, held->augenfarbe); + getline(source, held->titel); + getline(source, held->geburtsort); + getline(source, tempstring); held->ap = strtoi(tempstring); getline(source, tempstring); held->stufe = strtoi(tempstring); - getline(source, tempstring); - ss.str(""); ss.clear(); // reset stringstream - ss << tempstring; - ss >> buffer; held->gw_stue = strtoi(buffer); - ss >> buffer; held->ngw_stue = strtoi(buffer); - ss >> buffer; held->le_ae_stue = strtoi(buffer); + getline(source, tempstring); + ss.str(""); ss.clear(); // reset stringstream + ss << tempstring; + ss >> buffer; held->gw_stue = strtoi(buffer); + ss >> buffer; held->ngw_stue = strtoi(buffer); + ss >> buffer; held->le_ae_stue = strtoi(buffer); ss >> buffer; held->zf2ae_ue = strtoi(buffer); // This relies on the combat talent map preserving order - getline(source, tempstring); - ss.str(""); ss.clear(); // reset stringstream + getline(source, tempstring); + ss.str(""); ss.clear(); // reset stringstream ss << tempstring; for (kampftalentgruppe::iterator ktit = held->kampftalente.begin(); ktit != held->kampftalente.end(); ktit++) - { + { ss >> buffer; (*ktit).second->at = strtoi(buffer); } - getline(source, tempstring); - ss.str(""); ss.clear(); // reset stringstream + getline(source, tempstring); + ss.str(""); ss.clear(); // reset stringstream ss << tempstring; for (kampftalentgruppe::iterator ktit = held->kampftalente.begin(); ktit != held->kampftalente.end(); ktit++) - { + { ss >> buffer; (*ktit).second->pa = strtoi(buffer); - } + } - getline(source, tempstring); - ss.str(""); ss.clear(); // reset stringstream - ss << tempstring; - ss >> buffer; - for (int weaponsToGo = strtoi(buffer); weaponsToGo > 0; weaponsToGo--) + getline(source, tempstring); + ss.str(""); ss.clear(); // reset stringstream + ss << tempstring; + ss >> buffer; + for (int weaponsToGo = strtoi(buffer); weaponsToGo > 0; weaponsToGo--) { int type; @@ -569,9 +573,9 @@ held->fk_waffen.push_back(wfe); end_of_fkw_loop:; } - } - ss >> buffer; - for (int armorsToGo = strtoi(buffer); armorsToGo > 0; armorsToGo--) + } + ss >> buffer; + for (int armorsToGo = strtoi(buffer); armorsToGo > 0; armorsToGo--) { s_ruestung* rstg = new s_ruestung; @@ -618,9 +622,9 @@ // Now we read in the comments. This would be trivial, but we store some // additional data in there, which we need to strip and process getline(source, tempstring); - int commentLinesToGo; + int commentLinesToGo; for (commentLinesToGo = strtoi(tempstring); commentLinesToGo > 0; - commentLinesToGo--) + commentLinesToGo--) { getline(source, tempstring); // After this line only wrapped data follows @@ -628,14 +632,14 @@ held->kommentare.push_back(tempstring); } // break causes the last commentLinesToGo-- to not be performed, so we have to - // decrement the variable before looping over it + // decrement the variable before looping over it for (commentLinesToGo--; commentLinesToGo > 0; - commentLinesToGo--) + commentLinesToGo--) { getline(source, tempstring); - - ss.str(""); ss.clear(); // reset stringstream - ss << tempstring; + + ss.str(""); ss.clear(); // reset stringstream + ss << tempstring; ss >> buffer; if (buffer == "abenteuer" && tempstring.size() > 9) @@ -672,8 +676,8 @@ */ // Languages - getline(source, tempstring); - for (int languagesToGo = strtoi(tempstring); languagesToGo > 0; languagesToGo--) + getline(source, tempstring); + for (int languagesToGo = strtoi(tempstring); languagesToGo > 0; languagesToGo--) { bool bOld = false; string name; @@ -691,8 +695,8 @@ } // Inventory - getline(source, tempstring); - for (int itemsToGo = strtoi(tempstring); itemsToGo > 0; itemsToGo--) + getline(source, tempstring); + for (int itemsToGo = strtoi(tempstring); itemsToGo > 0; itemsToGo--) { s_item* item = new s_item; @@ -726,13 +730,13 @@ if (held->vt_nt_punkte == 0) held->vt_nt_punkte = 20; - - source.close(); - return held; -} - -void writeHero(s_held* held, char* filename) + + source.close(); + return held; +} + +void writeHero(s_held* held, char* filename) { // In case we ever use this function: - // - Remember to enforce Windows-style line terminators! -} + // - Remember to enforce Windows-style line terminators! +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <df...@us...> - 2007-04-20 17:05:23
|
Revision: 23 http://svn.sourceforge.net/dsaster/?rev=23&view=rev Author: dfyx Date: 2007-04-20 10:05:18 -0700 (Fri, 20 Apr 2007) Log Message: ----------- Thoughts about support for scripting languages (In German) Added Paths: ----------- h422/trunk/notes/sprachsupport_dfyx.txt Added: h422/trunk/notes/sprachsupport_dfyx.txt =================================================================== --- h422/trunk/notes/sprachsupport_dfyx.txt (rev 0) +++ h422/trunk/notes/sprachsupport_dfyx.txt 2007-04-20 17:05:18 UTC (rev 23) @@ -0,0 +1,50 @@ +Sprachsupport f\xFCr h422 Ansatz b) - Ein Aufsatz von DFYX +======================================================= + +1) In C/C++ geschriebene Wrapperplugins werden geladen + Diese Plugins hinterlegen in einer Liste die unterst\xFCtzte Dateiendung und + einen oder mehrere Funktionspointer auf Wrapperfunktionen. + + Variante A: + Getrennte Pointer f\xFCr jede Funktion, die im Plugin ansprechbar sein muss: + s_plugdata* (*fp_registerPlugin)(char* plugin); + s_held* (*fp_readHero)(char* plugin, char* filename); + + Variante B: + Pointer auf eine Wrapperfunktion, der zus\xE4tzlich die gew\xFCnschte Aktion + \xFCbergeben wird. + void* (*fp_pluginExecute)(char* plugin, char* action, ...); + +2) In fetchPluginList wird die Dateiendung \xFCberpr\xFCft. F\xFCr .so/.dll oder was + auch immer die entsprechende Plattform f\xFCr dynamisch gelinkte Bibliotheken + verwendet, wird vorgegangen wie bisher. + + F\xFCr alle anderen Typen wird entsprechend der Endung eine der hinterlegten + Funktionen aufgerufen. + + Variante A: + // registerPlugin wird aus der entsprechenden Liste gelesen + registerPlugin(fullname); + + Variante B: + // pluginExecute wird aus der entsprechenden Liste gelesen + pluginExecute(fullname, "registerPlugin"); + +3) In translate wird f\xFCr C/C++-Plugins auch wie bisher verfahren: + oPlug->write(iPlug->read(inputFile), (char*)outputFile.c_str()); + + F\xFCr Plugins in anderen Sprachen s\xE4he das etwa folgenderma\xDFen aus: + + Variante A: + // read und write werden aus den entsprechenden Listen gelesen + write(outputPlugin, read(inputPlugin, inputFile), + (char*)outputFile.c_str()); + + Variante B: + // pluginExecuteIn und pluginExecuteOut werden aus den entsprechenden + // Listen gelesen + s_held* held = (s_held*) pluginExecuteIn(inputPlugin, "read", inputFile); + pluginExecuteOut(outputPlugin, "write", held, (char*)outputFile.c_str()); + +An den bestehenden Plugins m\xFCsste man daf\xFCr nichts \xE4ndern. Allerdings w\xE4re es +unter Umst\xE4nden n\xFCtzlich, die Dateiendung in s_plugdata zu hinterlegen. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <j6...@us...> - 2006-12-25 00:36:35
|
Revision: 22 http://svn.sourceforge.net/dsaster/?rev=22&view=rev Author: j6cubic Date: 2006-12-24 16:36:33 -0800 (Sun, 24 Dec 2006) Log Message: ----------- Now, that wasn't too hard. opt/makesxw.php - Removed some debug code that shouldn't have been in the last revision anyway test.h42 - Added a data comment for testing purposes io_h42.cpp - Changed the talent/etc. name detection code again to cut a trailing space that tended to be generated - Added data comment handling. We can not store the current adventure, the (dis)advantage points and (dis)advantages in the h422 file. The format is as follows: ::::h422:::: - marks the start of the data part. Everything from here does not appear in held->kommentare <name> <parameters> - the basic format of the data These values are currently supported: abenteuer <list of strings> -> denotes the current adventure. Everything between the <name> and the end of the line is copied into the hero's abenteuer field vt_nt_punkte <integer> -> denotes the hero's (dis)advantage starting score. The first space-separated token after the <name> is converted to int and stored in held->vt_nt_punkte. If it's not an int it's stored as 0 vt_nt <list of strings> <int> -> denotes a (dis)advantage. Everything after the last " " is cut off, converted to int and used as the (dis)advantage's point delta. Everything between the first " " and that is used as the (dis)advantage's name Modified Paths: -------------- h422/trunk/notes/test.h42 h422/trunk/opt/makesxw.php h422/trunk/src/io_h42.cpp Modified: h422/trunk/notes/test.h42 =================================================================== --- h422/trunk/notes/test.h42 2006-12-24 23:11:52 UTC (rev 21) +++ h422/trunk/notes/test.h42 2006-12-25 00:36:33 UTC (rev 22) @@ -411,10 +411,17 @@ 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 Standard.rtf 5 5 -3 +10 Aberglauben: rote Haare, Fl\xF6he, magische Zahlen Besuchte Magierakademie: Kampfseminar Andergast Spezialgebiet: Kampf +::::h422:::: +vt_nt_punkte 15 +vt_nt Adelige Abstammung -7 +vt_nt Linksh\xE4nder -5 +vt_nt Astrale Regeneration -10 +vt_nt Krankheitsanf\xE4llig 7 +abenteuer Mein lieber Herr Gesangsverein! 6 Garethi 0 Modified: h422/trunk/opt/makesxw.php =================================================================== --- h422/trunk/opt/makesxw.php 2006-12-24 23:11:52 UTC (rev 21) +++ h422/trunk/opt/makesxw.php 2006-12-25 00:36:33 UTC (rev 22) @@ -543,8 +543,8 @@ $i = 1; $vt_nt_punkte = $held['vt_nt_punkte']; - $held['vt_nt'][] = array('name' => 'Coolheit', 'wert' => -12); - $held['vt_nt'][] = array('name' => 'Käsefüße', 'wert' => 3); + //$held['vt_nt'][] = array('name' => 'Coolheit', 'wert' => -12); + //$held['vt_nt'][] = array('name' => 'Käsefüße', 'wert' => 3); foreach($held['vt_nt'] as $vtnt) { $vt_nt_punkte += $vtnt['wert']; Modified: h422/trunk/src/io_h42.cpp =================================================================== --- h422/trunk/src/io_h42.cpp 2006-12-24 23:11:52 UTC (rev 21) +++ h422/trunk/src/io_h42.cpp 2006-12-25 00:36:33 UTC (rev 22) @@ -163,7 +163,7 @@ if (index != string::npos) { rside = tempstring.substr(index); - talentName = tempstring.substr(0, index); + talentName = tempstring.substr(0, index - 1); } else talentName = tempstring; @@ -279,7 +279,7 @@ gw0 = strtogw(rside.substr(1, 2)); gw1 = strtogw(rside.substr(4, 2)); gw2 = strtogw(rside.substr(7, 2)); - talentName = tempstring.substr(0, index); + talentName = tempstring.substr(0, index - 1); } else { @@ -376,7 +376,7 @@ gw0 = strtogw(rside.substr(1, 2)); gw1 = strtogw(rside.substr(4, 2)); gw2 = strtogw(rside.substr(7, 2)); - zauberName = tempstring.substr(0, index); + zauberName = tempstring.substr(0, index - 1); } else { @@ -615,14 +615,51 @@ // Unknown Values 2 and 3. TODO: We really should find out what these do getline(source, tempstring); - // Now we read in the comments. Easy enough - getline(source, tempstring); - for (int commentLinesToGo = strtoi(tempstring); commentLinesToGo > 0; + // Now we read in the comments. This would be trivial, but we store some + // additional data in there, which we need to strip and process + getline(source, tempstring); + int commentLinesToGo; + for (commentLinesToGo = strtoi(tempstring); commentLinesToGo > 0; commentLinesToGo--) { getline(source, tempstring); + // After this line only wrapped data follows + if (tempstring == "::::h422::::") break; held->kommentare.push_back(tempstring); } + // break causes the last commentLinesToGo-- to not be performed, so we have to + // decrement the variable before looping over it + for (commentLinesToGo--; commentLinesToGo > 0; + commentLinesToGo--) + { + getline(source, tempstring); + + ss.str(""); ss.clear(); // reset stringstream + ss << tempstring; + ss >> buffer; + + if (buffer == "abenteuer" && tempstring.size() > 9) + { + /*string abenteuer = ""; + while (ss >> buffer && buffer != "") + { + abenteuer += ((abenteuer.size() != 0) ? " " : "") + buffer; + }*/ + held->abenteuer = tempstring.substr(10); + } + else if (buffer == "vt_nt_punkte" && tempstring.size() > 12) + { + ss >> buffer; + held->vt_nt_punkte = strtoi(buffer); + } + else if (buffer == "vt_nt" && tempstring.size() > 5) + { + int index = tempstring.rfind(" ", string::npos); + if (index == string::npos) continue; + int wert = strtoi(tempstring.substr(index)); + held->vt_nt[tempstring.substr(6, index - 6)] = wert; + } + } /* TBD // Zing! BONUS! We also check if a file with the hero's background is present // and import that as well @@ -687,7 +724,8 @@ end_of_item_loop:; } - held->vt_nt_punkte = 20; + if (held->vt_nt_punkte == 0) + held->vt_nt_punkte = 20; source.close(); return held; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <j6...@us...> - 2006-12-24 23:11:54
|
Revision: 21 http://svn.sourceforge.net/dsaster/?rev=21&view=rev Author: j6cubic Date: 2006-12-24 15:11:52 -0800 (Sun, 24 Dec 2006) Log Message: ----------- Me and my big mouth. Hopefully now we can process ALL h42 files DSAW can write. io_h42.cpp - Redid the skill/spell name determination to be more robust - Disabled all checks for illegal skill/spell names - DSAW allows (and uses) names that bend the rules (like "Hartes schmelze (cs) (MU/KL/KK)") and it's really better to just ignore illegal values and pass them on opt/makesxw.php - Added a half-assed batch processing mode - Minor prettification of output Removed opt/test.sxw from revision management; it didn't belong there anyway Maybe I'll put out another revision before the NATO; that one will allow us to put data h422 doesn't manage (like DSA3.5-specific data) into the hero comment field and strip them out when readingg the file. Modified Paths: -------------- h422/trunk/opt/makesxw.php h422/trunk/src/io_h42.cpp Removed Paths: ------------- h422/trunk/opt/test.sxw Modified: h422/trunk/opt/makesxw.php =================================================================== --- h422/trunk/opt/makesxw.php 2006-12-24 16:55:34 UTC (rev 20) +++ h422/trunk/opt/makesxw.php 2006-12-24 23:11:52 UTC (rev 21) @@ -5,14 +5,37 @@ $lastLineLength = 0; if ($argc < 2) usage(); + if ('--batch' == $argv[1]) + { + // Okay, this is some extremely cheap batch processing, but it works, right? + $thiscommand = array_shift($argv); + array_shift($argv); + $end = ''; + if ($argv[count($argv) - 1] == "digital") + { + $end = array_pop($argv); + } + $targetdir = array_pop($argv); + echo 'Verarbeite '.count($argv)." Helden...\n"; + foreach($argv as $arg) + { + if (!is_file($arg) || !is_readable($arg)) + { + echo "$arg ist keine Datei oder nicht lesbar.\n"; + continue; + } + passthru("$thiscommand '$arg' $targetdir $end"); + } + exit(0); + } if (!is_file($argv[1])) usage(); - if ($argc < 3 || $argv[2] == '') + if ($argc < 3 || $argv[2] == '' || is_dir($argv[2])) $filename = false; // Filename will be autogenerated later else $filename = $argv[2]; - if ($argc > 3 && $argv[3] == "digital") + if ($argc > 3 && $argv[$argc - 1] == "digital") $papermode = false; else $papermode = true; @@ -22,12 +45,11 @@ status('Hole Heldendaten'); - $befehl = '../bin/h422 '.$argv[1].' php'; + $befehl = '../bin/h422 "'.$argv[1].'" php'; $rohheld = `$befehl`; $held = @unserialize($rohheld); - array_walk_recursive($held, 'unicodize'); if (isset($php_errormsg)) { @@ -36,6 +58,7 @@ $temp = explode(' ', $temp); $offset = $temp[0]; die("\nFehler beim Deserialisieren der Heldendaten bei Offset $offset.\n"); } + array_walk_recursive($held, 'unicodize'); $template = file_get_contents('res/sxw/content.xml.template'); if (false === $template) @@ -43,7 +66,12 @@ replace_values($template, $held); if ($filename === false) - $filename = $held['name'].'.sxw'; + { + if (is_dir($argv[2])) + $filename = $argv[2].'/'.$held['name'].'.sxw'; + else + $filename = $held['name'].'.sxw'; + } status('Schreibe Heldenbrief'); // The temporary file must have 'content.xml' as its basename @@ -399,7 +427,7 @@ { $i++; $ii = (($i < 10) ? '0' : '').$i; - $t_num = $wfe['anzahl']; + $t_num = $item['anzahl']; $string = str_replace('!it'.$ii, $item['name'], $string); $string = str_replace('!ia'.$ii, $t_num, $string); $string = str_replace('!id'.$ii, n(floor($item['wert'] / 1000)), $string); @@ -513,19 +541,19 @@ } $string = str_replace('!bem', $temp_string, $string); - $i = 0; + $i = 1; $vt_nt_punkte = $held['vt_nt_punkte']; - //$held['vt_nt'][] = array('name' => 'Coolheit', 'wert' => -12); - //$held['vt_nt'][] = array('name' => 'Käsefüße', 'wert' => 3); + $held['vt_nt'][] = array('name' => 'Coolheit', 'wert' => -12); + $held['vt_nt'][] = array('name' => 'Käsefüße', 'wert' => 3); foreach($held['vt_nt'] as $vtnt) { - $i++; - $vt_nt_punkte += $vtnt['wert']; $string = str_replace('!vk'.$i, $vtnt['wert'], $string); - $string = str_replace('!.'.$i, '>', $string); + $string = str_replace('!.'.$i, chr(226).chr(134).chr(146), $string); $string = str_replace('!vw'.$i, $vt_nt_punkte, $string); $string = str_replace('!vn'.$i, $vtnt['name'], $string); + + $i++; } for (; $i < 8; $i++) { @@ -565,8 +593,11 @@ { global $argv; $name = basename($argv[0]); - die("Usage: $name <Name der Quelldatei> <Name der Zieldatei>\n". - " $name <Name der Quelldatei>\n"); + echo '['.implode(' ', $argv)."]\n"; + die("Usage: $name <Name der Quelldatei> <Name der Zieldatei> [digital]\n". + " $name <Name der Quelldatei> ['' digital]\n". + " $name --batch <Quelldatei> [<Quelldatei> ...] ". + "<Zielverzeichnis> [digital]\n"); } /* Deleted: h422/trunk/opt/test.sxw =================================================================== (Binary files differ) Modified: h422/trunk/src/io_h42.cpp =================================================================== --- h422/trunk/src/io_h42.cpp 2006-12-24 16:55:34 UTC (rev 20) +++ h422/trunk/src/io_h42.cpp 2006-12-24 23:11:52 UTC (rev 21) @@ -143,23 +143,34 @@ bool bFirstPart = true; getline(source, tempstring); + /* ss.str(""); ss.clear(); // reset stringstream ss << tempstring; ss >> buffer; // TODO: Make this loop better <- rfind(); index=tempstr.rfind("(",string::npos); //tempstr.substr(0,index) und der andere tempstr.substr(index) - while (buffer.substr(0, 1) != "("/* && !(ss.eol())*/) + while (buffer.substr(0, 1) != "(") { talentName += ((bFirstPart) ? "" : " ") + buffer; bFirstPart = false; string lastVal = buffer; ss >> buffer; if (buffer == lastVal) break; - } + } + */ + int index = tempstring.rfind("(", string::npos); + string rside = ""; + if (index != string::npos) + { + rside = tempstring.substr(index); + talentName = tempstring.substr(0, index); + } + else + talentName = tempstring; // Not all combat talents have a modifier - if (buffer.substr(0, 1) == "(") - beMod = strtoi(buffer.substr(3, buffer.size() - 4)); + if (rside.size() > 0) + beMod = strtoi(rside.substr(3, rside.size() - 4)); getline(source, tempstring); ss.str(""); ss.clear(); // reset stringstream @@ -222,25 +233,27 @@ bool bFirstPart = true; getline(source, tempstring); + /* ss.str(""); ss.clear(); // reset stringstream ss << tempstring; ss >> buffer; // TODO: Make this loop better - while (buffer.substr(0, 1) != "("/* && !(ss.eol())*/) + while (buffer.substr(0, 1) != "(") { talentName += ((bFirstPart) ? "" : " ") + buffer; bFirstPart = false; string lastVal = buffer; ss >> buffer; if (buffer == lastVal) break; - } + } + if (buffer.substr(0, 1) == "(") { gw0 = strtogw(buffer.substr(1, 2)); gw1 = strtogw(buffer.substr(4, 2)); gw2 = strtogw(buffer.substr(7, 2)); - if (ATTR_INVALID == gw0 || ATTR_INVALID == gw1 || ATTR_INVALID == gw2) + if ((ATTR_INVALID == gw0 || ATTR_INVALID == gw1 || ATTR_INVALID == gw2) &&) { cout << "Datei kann nicht gelesen werden: Ungültiger Talentname " << "in Zeile " << lineno << endl; @@ -253,6 +266,25 @@ "Zeile " << lineno << endl; cout << talentName << " - " << talentsToGo << endl; exit(102); + } + */ + + int index = tempstring.rfind("(", string::npos); + string rside = ""; + if (index != string::npos) + rside = tempstring.substr(index); + if (rside.size() == 10 && rside.substr(3, 1) == "/" && + rside.substr(6, 1) == "/") + { + gw0 = strtogw(rside.substr(1, 2)); + gw1 = strtogw(rside.substr(4, 2)); + gw2 = strtogw(rside.substr(7, 2)); + talentName = tempstring.substr(0, index); + } + else + { + gw0 = gw1 = gw2 = ATTR_INVALID; + talentName = tempstring; } getline(source, tempstring); @@ -298,12 +330,13 @@ int taw, stps, stpsue, fvue; bool bFirstPart = true; - getline(source, tempstring); + getline(source, tempstring); + /* ss.str(""); ss.clear(); // reset stringstream ss << tempstring; ss >> buffer; // TODO: Make this loop better - while (buffer.substr(0, 1) != "("/* && !(ss.eol())*/) + while (buffer.substr(0, 1) != "(") { zauberName += ((bFirstPart) ? "" : " ") + buffer; bFirstPart = false; @@ -311,7 +344,7 @@ ss >> buffer; if (buffer == lastVal) break; } - + if (buffer.substr(0, 1) == "(") { gw0 = strtogw(buffer.substr(1, 2)); @@ -330,6 +363,25 @@ cout << "Datei kann nicht gelesen werden: Ungültiger Zaubername in " << "Zeile " << lineno << endl; exit(103); + } + */ + + int index = tempstring.rfind("(", string::npos); + string rside = ""; + if (index != string::npos) + rside = tempstring.substr(index); + if (rside.size() == 10 && rside.substr(3, 1) == "/" && + rside.substr(6, 1) == "/") + { + gw0 = strtogw(rside.substr(1, 2)); + gw1 = strtogw(rside.substr(4, 2)); + gw2 = strtogw(rside.substr(7, 2)); + zauberName = tempstring.substr(0, index); + } + else + { + gw0 = gw1 = gw2 = ATTR_INVALID; + zauberName = tempstring; } getline(source, herkunft); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <j6...@us...> - 2006-12-24 16:55:36
|
Revision: 20 http://svn.sourceforge.net/dsaster/?rev=20&view=rev Author: j6cubic Date: 2006-12-24 08:55:34 -0800 (Sun, 24 Dec 2006) Log Message: ----------- <play "fanfare.wav"> commondefs.cpp - Added a money value to s_held io_h42.cpp - Spell base attributes weren't saved. Fixed. - The plugin now sets the hero's advantage/disadvantage points to 20 io_php.cpp - Workaround for the bogus item prices generated by io_h42 - Improved the handling of empty talent groups - Added export of advantage/handicap list and points opt/makesxw.php - Implemented the rest of the replacements TODO - Oh hell, why am I even explaining the changes made to that file? *** We can now generate hero documents from h42 files *** Modified Paths: -------------- h422/trunk/TODO h422/trunk/opt/makesxw.php h422/trunk/opt/res/sxw/content.xml.template h422/trunk/opt/res/sxw/template.sxw h422/trunk/opt/test.sxw h422/trunk/src/commondefs.h h422/trunk/src/io_h42.cpp h422/trunk/src/io_php.cpp Modified: h422/trunk/TODO =================================================================== --- h422/trunk/TODO 2006-12-24 12:21:35 UTC (rev 19) +++ h422/trunk/TODO 2006-12-24 16:55:34 UTC (rev 20) @@ -1,8 +1,7 @@ Neccessary for preliminary NATO release DONE - read h42 files as far as they're understood and store them in memory - - add a plugin for output into a common format such as PDF or SXW/ODT - - stopgap measure: Generic text-replacement output with LaTeX template + DONE - add a plugin for output into a common format such as PDF or SXW/ODT Necessary for full release @@ -15,7 +14,9 @@ - better plugin handling, ability to pass options to plugins - optparse? + - add an SXW/ODT output plugin that doesn't rely on a PHP script + Really ought to be done - Internal documentation, especially interface definitions - Investigate whether Doxygen makes sense Modified: h422/trunk/opt/makesxw.php =================================================================== --- h422/trunk/opt/makesxw.php 2006-12-24 12:21:35 UTC (rev 19) +++ h422/trunk/opt/makesxw.php 2006-12-24 16:55:34 UTC (rev 20) @@ -225,23 +225,23 @@ $string = str_replace('!ke', $held['ke'], $string); } - status('Ersetze: Waffen, Rüstungen und Inventar'); + status('Ersetze: Waffen und Rüstungen'); $i = 0; $be -= $held['be_minus']; foreach($held['ruestungen'] as $rstg) { $i++; - $temp_num = ($rstg['anzahl'] > 1) ? + $t_num = ($rstg['anzahl'] > 1) ? ' <text:span text:style-name="T4">x'.$rstg['anzahl']. '</text:span>' : ''; - $string = str_replace('!rn'.$i, $rstg['name'].$temp_num, $string); - $temp_rs = $rstg['rs'] * $rstg['anzahl']; - $temp_be = $rstg['be'] * $rstg['anzahl']; - $string = str_replace('!rs'.$i, $temp_rs, $string); - $string = str_replace('!rb'.$i, $temp_be, $string); - $rs += $temp_rs; - $be += $temp_be; + $string = str_replace('!rn'.$i, $rstg['name'].$t_num, $string); + $t_rs = $rstg['rs'] * $rstg['anzahl']; + $t_be = $rstg['be'] * $rstg['anzahl']; + $string = str_replace('!rs'.$i, $t_rs, $string); + $string = str_replace('!rb'.$i, $t_be, $string); + $rs += $t_rs; + $be += $t_be; $last += $rstg['gewicht']; } for (; $i < 5; $i++) @@ -257,18 +257,18 @@ foreach($held['nahkampfwaffen'] as $wfe) { $i++; - $temp_num = ($wfe['anzahl'] > 1) ? + $t_num = ($wfe['anzahl'] > 1) ? ' <text:span text:style-name="T4">x'.$wfe['anzahl']. '</text:span>' : ''; - $string = str_replace('!wn'.$i, $wfe['name'].$temp_num, $string); + $string = str_replace('!wn'.$i, $wfe['name'].$t_num, $string); $string = str_replace('!wk'.$i, $wfe['kk_bonus'], $string); $string = str_replace('!wv'.$i, $wfe['w_v'], $string); - $temp_at = $held['kampftalente'][$wfe['talent']]['at']; - $temp_pa = $held['kampftalente'][$wfe['talent']]['pa']; - $string = str_replace('!w1'.$i, $temp_at, $string); - $string = str_replace('!w2'.$i, $temp_pa, $string); - $string = str_replace('!w3'.$i, $temp_at - ceil($be/2), $string); - $string = str_replace('!w4'.$i, $temp_at - floor($be/2), $string); + $t_at = $held['kampftalente'][$wfe['talent']]['at']; + $t_pa = $held['kampftalente'][$wfe['talent']]['pa']; + $string = str_replace('!w1'.$i, $t_at, $string); + $string = str_replace('!w2'.$i, $t_pa, $string); + $string = str_replace('!w3'.$i, $t_at - ceil($be/2), $string); + $string = str_replace('!w4'.$i, $t_at - floor($be/2), $string); $string = str_replace('!wtp'.$i, $wfe['tp'], $string); $string = str_replace('!wb'.$i, $wfe['bf'], $string); $last += $wfe['gewicht']; @@ -290,10 +290,10 @@ foreach($held['fernkampfwaffen'] as $wfe) { $i++; - $temp_num = ($wfe['anzahl'] > 1) ? + $t_num = ($wfe['anzahl'] > 1) ? ' <text:span text:style-name="T4">x'.$wfe['anzahl']. '</text:span>' : ''; - $string = str_replace('!fn'.$i, $wfe['name'].$temp_num, $string); + $string = str_replace('!fn'.$i, $wfe['name'].$t_num, $string); $string = str_replace('!ft'.$i, $wfe['tp'], $string); $string = str_replace('!fr'.$i, $wfe['rw'], $string); $string = str_replace('!fm'.$i, $wfe['entf_mod'], $string); @@ -339,6 +339,202 @@ $string = str_replace('!a2'.$ii, '', $string); $string = str_replace('!p2'.$ii, '', $string); } + + status('Ersetze: Talente'); + + $highestTalent = array(20, 12, 10, 9, 14, 18, 5, 14); + + for ($i = 0; $i < count($held['kampftalente']); $i++) + { + $string = str_replace('!1'.base_convert($i + 10, 10, 36), + $held['kampftalente'][$i]['taw'], $string); + } + for ($i = 0; $i < 7; $i++) + { + $j = 0; + for (; $j < count($held['talente'][$i]['werte']); $j++) + { + $string = str_replace('!'.($i + 2).base_convert($j + 10, 10, 36), + $held['talente'][$i]['werte'][$j]['taw'], + $string); + } + for (; $j < $highestTalent[$i + 1]; $j++) + { + $string = str_replace('!'.($i + 2).base_convert($j + 10, 10, 36), '', + $string); + } + } + + $i = 0; + for (; $i < count($held['talente'][6]['werte']); $i++) + { + $string = str_replace('!b'.base_convert($i + 10, 10, 36).'n', + $held['talente'][6]['werte'][$i]['name'], $string); + $string = str_replace('!b'.base_convert($i + 10, 10, 36).'1', + $gw[$held['talente'][6]['werte'][$i]['gw'][0]], + $string); + $string = str_replace('!b'.base_convert($i + 10, 10, 36).'2', + $gw[$held['talente'][6]['werte'][$i]['gw'][1]], + $string); + $string = str_replace('!b'.base_convert($i + 10, 10, 36).'3', + $gw[$held['talente'][6]['werte'][$i]['gw'][2]], + $string); + } + for (; $i < $highestTalent[7]; $i++) + { + $string = str_replace('!b'.base_convert($i + 10, 10, 36).'n', '', + $string); + $string = str_replace('!b'.base_convert($i + 10, 10, 36).'1', '', + $string); + $string = str_replace('!b'.base_convert($i + 10, 10, 36).'2', '', + $string); + $string = str_replace('!b'.base_convert($i + 10, 10, 36).'3', '', + $string); + } + + status('Ersetze: Inventar'); + + $i = 0; + foreach($held['inventar'] as $item) + { + $i++; + $ii = (($i < 10) ? '0' : '').$i; + $t_num = $wfe['anzahl']; + $string = str_replace('!it'.$ii, $item['name'], $string); + $string = str_replace('!ia'.$ii, $t_num, $string); + $string = str_replace('!id'.$ii, n(floor($item['wert'] / 1000)), $string); + $string = str_replace('!is'.$ii, + n(floor($item['wert'] % 1000 / 100)), $string); + $string = str_replace('!ih'.$ii, n($item['wert'] % 100 / 10), $string); + $string = str_replace('!iD'.$ii, n(floor($item['wert'] * $t_num / 1000)), + $string); + $string = str_replace('!iS'.$ii, + n(floor($item['wert'] * $t_num % 1000 / 100)), + $string); + $string = str_replace('!iH'.$ii, n($item['wert'] * $t_num % 100 / 10), + $string); + $last += $item['gewicht']; + } + for (; $i < 57; $i++) + { + $ii = (($i < 10) ? '0' : '').$i; + $string = str_replace('!it'.$ii, '', $string); + $string = str_replace('!ia'.$ii, '', $string); + $string = str_replace('!id'.$ii, '', $string); + $string = str_replace('!is'.$ii, '', $string); + $string = str_replace('!ih'.$ii, '', $string); + $string = str_replace('!iD'.$ii, '', $string); + $string = str_replace('!iS'.$ii, '', $string); + $string = str_replace('!iH'.$ii, '', $string); + } + if ($papermode) + { + $string = str_replace('!g_d', '', $string); + $string = str_replace('!g_s', '', $string); + $string = str_replace('!g_h', '', $string); + } + else + { + $string = str_replace('!g_d', n(floor($held['geld'] / 1000)), $string); + $string = str_replace('!g_s', + n(floor($held['geld'] % 1000 / 100)), $string); + $string = str_replace('!g_h', n($held['geld'] % 100 / 10), $string); + } + + status('Ersetze: Zauberliste'); + + $i = 0; + foreach($held['zauber'] as $zbr) + { + $i++; + $ii = (($i < 10) ? '0' : '').$i; + // TODO: Fix this when the template has been improved + $string = str_replace('!zn'.$ii, + $zbr['name'].' ('. + $gw[$zbr['gw'][0]].'/'. + $gw[$zbr['gw'][1]].'/'. + $gw[$zbr['gw'][2]].')', $string); + $string = str_replace('!zg'.$ii, $zbr['gebiet'], $string); + $string = str_replace('!zu'.$ii, $zbr['herkunft'], $string); + $string = str_replace('!zw'.$ii, $zbr['taw'], $string); + } + for (; $i < 59; $i++) + { + $ii = (($i < 10) ? '0' : '').$i; + $string = str_replace('!zn'.$ii, '', $string); + $string = str_replace('!zg'.$ii, '', $string); + $string = str_replace('!zu'.$ii, '', $string); + $string = str_replace('!zw'.$ii, '', $string); + } + + status('Ersetze: Sonstiges'); + + $i = 0; + foreach($held['talente'][7]['werte'] as $rtl) + { + $i++; + // TODO: Fix this when the template has been improved + $string = str_replace('!r'.$i.'_n', + $rtl['name'].' ('. + $gw[$rtl['gw'][0]].'/'. + $gw[$rtl['gw'][1]].'/'. + $gw[$rtl['gw'][2]].')', $string); + $string = str_replace('!r'.$i.'_w', $rtl['taw'], $string); + } + for (; $i < 15; $i++) + { + $string = str_replace('!r'.$i.'_n', '', $string); + $string = str_replace('!r'.$i.'_w', '', $string); + } + + $br = '</text:p><text:p text:style-name="P35">'; + + $temp_string = ''; + foreach($held['sonderfertigkeiten'] as $sf) + { + if ($sf['gelernt']) $temp_string .= $sf['name'].$br; + } + $string = str_replace('!son', $temp_string, $string); + + $string = str_replace('!gs', $held['gs'], $string); + + $temp_string = ''; + foreach($held['kommentare'] as $k) + { + $temp_string .= $k.$br; + } + if (0 != count($held['jugend'])) + { + $temp_string .= $br.$br.'Jugend:'.$br; + foreach($held['jugend'] as $j) + { + $temp_string .= $j.$br; + } + } + $string = str_replace('!bem', $temp_string, $string); + + $i = 0; + $vt_nt_punkte = $held['vt_nt_punkte']; + //$held['vt_nt'][] = array('name' => 'Coolheit', 'wert' => -12); + //$held['vt_nt'][] = array('name' => 'Käsefüße', 'wert' => 3); + foreach($held['vt_nt'] as $vtnt) + { + $i++; + + $vt_nt_punkte += $vtnt['wert']; + $string = str_replace('!vk'.$i, $vtnt['wert'], $string); + $string = str_replace('!.'.$i, '>', $string); + $string = str_replace('!vw'.$i, $vt_nt_punkte, $string); + $string = str_replace('!vn'.$i, $vtnt['name'], $string); + } + for (; $i < 8; $i++) + { + $string = str_replace('!vk'.$i, '', $string); + $string = str_replace('!.'.$i, '', $string); + $string = str_replace('!vw'.$i, '', $string); + $string = str_replace('!vn'.$i, '', $string); + } + $string = str_replace('!vw0', $held['vt_nt_punkte'], $string); } /** @@ -354,6 +550,15 @@ } /** + * Just another little shorthand + */ + function n($val) + { + if (0 == $val) return ''; + return $val; + } + + /** * Print usage information and terminate */ function usage() Modified: h422/trunk/opt/res/sxw/content.xml.template =================================================================== --- h422/trunk/opt/res/sxw/content.xml.template 2006-12-24 12:21:35 UTC (rev 19) +++ h422/trunk/opt/res/sxw/content.xml.template 2006-12-24 16:55:34 UTC (rev 20) @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?> @@ Diff output truncated at 100000 characters. @@ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <j6...@us...> - 2006-12-24 12:21:38
|
Revision: 19 http://svn.sourceforge.net/dsaster/?rev=19&view=rev Author: j6cubic Date: 2006-12-24 04:21:35 -0800 (Sun, 24 Dec 2006) Log Message: ----------- Okay, this is a big one. commondefs.cpp - Added some values that were missing from s_held as well as additional DSA3.5- and DSAW-specific data fields main.cpp - Minor cleanup io_php.cpp - Some additional exported values, mostly stuff that is calculated - All instances where thing names were stored in the array index have been changed so that the name now is part of the thing. This is due to the fact that it's damn difficult to dynamically rename array indices without changing their order - and the names have to be converted from latin-1 to UTF-8 by the SXW writer. Actually, this might be the first hint of a reorganization of the main data structures later io_h42.cpp - The plugin now populates the fields for current and normal stamina TODO - Added another entry test.h42 - Minor changes to test further stuff h42.format-r2 - Found a conflict we ought to resolve sometime later opt/makesxw.php - Changed the file handling to make better use of PclZip's capabilities (see below) - Added a function that converts all strings into unicode before they're written to the .sxw file, as OOo expects unicode - Added further replacements opt/res/ - Rework of the directory structure - we don't need to have the whole .sxw tree in a directory, as PclZip can clone and manipulate zipfiles in memory. Yes, this makes the version tree for the moved files rather ugly, but it's cleaner now - Added further replacements opt/res/sxw/content.xml.template (formerly opt/res/sxw.content.template) - Reworked the file to prepare it for processing by our script. This still isn't the final version, but for now it'll have to do. The missing stuff (prettification of the spell list) would require editing of the table and that's a real hassle with the OOo 2 Aqua Beta, which is all I currently have to edit the file Modified Paths: -------------- h422/trunk/TODO h422/trunk/notes/h42.format-r2 h422/trunk/notes/test.h42 h422/trunk/opt/makesxw.php h422/trunk/opt/test.sxw h422/trunk/src/commondefs.h h422/trunk/src/io_h42.cpp h422/trunk/src/io_php.cpp Added Paths: ----------- h422/trunk/opt/res/sxw/ h422/trunk/opt/res/sxw/content.xml.template h422/trunk/opt/res/sxw/template.sxw Removed Paths: ------------- h422/trunk/opt/res/sxw.content.template h422/trunk/opt/res/sxw.template/ Modified: h422/trunk/TODO =================================================================== --- h422/trunk/TODO 2006-12-23 05:11:07 UTC (rev 18) +++ h422/trunk/TODO 2006-12-24 12:21:35 UTC (rev 19) @@ -16,6 +16,11 @@ - optparse? +Really ought to be done + - Internal documentation, especially interface definitions + - Investigate whether Doxygen makes sense + + Nice to have - output that works on all platforms, not the hodgepodge of UTF-8 and latin-1 we have now Modified: h422/trunk/notes/h42.format-r2 =================================================================== --- h422/trunk/notes/h42.format-r2 2006-12-23 05:11:07 UTC (rev 18) +++ h422/trunk/notes/h42.format-r2 2006-12-24 12:21:35 UTC (rev 19) @@ -33,7 +33,7 @@ Bool: Hat Rituale Ritualsteigerungen/Stufe Heldenname -Geburtsort +Geburtsort ::: KONFLIKT MIT ZEILE 51 ::: Haarfarbe Stand Größe @@ -48,7 +48,7 @@ Gottheit Augenfarbe Titel -Geburtsort +Geburtsort ::: KONFLIKT MIT ZEILE 36 ::: Abenteuerpunkte Stufe Grundwertsteigerungen_übrig Negativ-GW-Sterigerungen_übrig LE/AE-Steigerungen_übrig ZF->AE_übrig Modified: h422/trunk/notes/test.h42 =================================================================== --- h422/trunk/notes/test.h42 2006-12-23 05:11:07 UTC (rev 18) +++ h422/trunk/notes/test.h42 2006-12-24 12:21:35 UTC (rev 19) @@ -200,7 +200,9 @@ -4 1 0 0 Sondertalente/Berufe 0 -0 +1 +H\xE4keln (IN/FF/FF) +0 3 0 0 Schamanenrituale 2 0 @@ -360,10 +362,10 @@ 2. Kugelzauber TRUE 0 0 -10 - +Theia dunkelbraun - - +Prinz von Arkadien +Arkadien 2100 7 0 0 0 2 @@ -406,7 +408,7 @@ 0 1 80 -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 Standard.rtf 5 5 3 Modified: h422/trunk/opt/makesxw.php =================================================================== --- h422/trunk/opt/makesxw.php 2006-12-23 05:11:07 UTC (rev 18) +++ h422/trunk/opt/makesxw.php 2006-12-24 12:21:35 UTC (rev 19) @@ -2,67 +2,399 @@ <?php ini_set('track_errors', 1); require_once('pclzip.lib.php'); + $lastLineLength = 0; if ($argc < 2) usage(); if (!is_file($argv[1])) usage(); - if ($argc < 3) - $filename = substr($argv[1], 0, -1).'.sxw'; + if ($argc < 3 || $argv[2] == '') + $filename = false; // Filename will be autogenerated later else $filename = $argv[2]; + + if ($argc > 3 && $argv[3] == "digital") + $papermode = false; + else + $papermode = true; + // Paper mode means that some values (usually current values) are not written, + // enabling the user to write down his own stuff in that field. Since that's + // not sensible when the user works digitally it can be disabled upon request + status('Hole Heldendaten'); + $befehl = '../bin/h422 '.$argv[1].' php'; $rohheld = `$befehl`; $held = @unserialize($rohheld); + array_walk_recursive($held, 'unicodize'); if (isset($php_errormsg)) { $temp = substr($php_errormsg, strpos($php_errormsg, "at offset") + 10); $temp = explode(' ', $temp); $offset = $temp[0]; - die("Fehler beim Deserialisieren der Heldendaten bei Offset $offset.\n"); + die("\nFehler beim Deserialisieren der Heldendaten bei Offset $offset.\n"); } - $template = file_get_contents('res/sxw.content.template'); + $template = file_get_contents('res/sxw/content.xml.template'); + if (false === $template) + die("\nFehler beim Öffnen der Templatedatei.\n"); replace_values($template, $held); + + if ($filename === false) + $filename = $held['name'].'.sxw'; - $handle = fopen ('res/sxw.template/content.xml', 'w'); + status('Schreibe Heldenbrief'); + // The temporary file must have 'content.xml' as its basename + $handle = fopen ('content.xml', 'w'); fwrite ($handle, $template); fclose ($handle); - //die(strlen($template)."\n"); - if('/' != $filename[0]) $filename = getcwd().'/'.$filename; if (file_exists($filename)) unlink($filename); - /* $tempfile = tempnam('.', 'TEMP_'); - shell_exec("cd res/sxw.template/ && zip -r ../../${tempfile} * && cd ../.."); - rename($tempfile.'.zip', $filename); - unlink($tempfile); */ + $zip = new PclZip($filename); + $retval = $zip->duplicate('res/sxw/template.sxw'); e(); + $retval = $zip->delete(PCLZIP_OPT_BY_NAME, 'content.xml'); e(); + $retval = $zip->add('content.xml'); e(); - $zip = new PclZip($filename); - chdir('res/sxw.template/'); - $retval = $zip->create(glob('*')); - - if ($retval == 0) { - die("Error : ".$zip->errorInfo(true)); - } + status("Fertig mit ${held['name']}"); + echo "\n"; + // No need to keep temporary files around + unlink('content.xml'); + //////////////////////////////////////////////////////////////////////////// + /** + * Replace everything. This function is just there to make the code above more + * legible + */ function replace_values(&$string, $held) { + global $papermode; + + status('Ersetze: Grunddaten'); + + $gw = array("??", "MU", "KL", "IN", "CH", "GE", "FF", "KK"); + $monate = array("??", "Praios", "Rondra", "Efferd", "Travia", "Boron", + "Hesinde", "Firun", "Tsa", "Phex", "Peraine", "Ingerimm", + "Rahja", "Namenloser"); + + $last = 0; + $rs = 0; + $be = 0; + $string = str_replace('!name', $held['name'], $string); + $string = str_replace('!typ', $held['klasse'], $string); + $string = str_replace('!ruf', $held['ruf'], $string); + $string = str_replace('!sex', ($held['ist_mann'] ? 'männlich' : 'weiblich'), + $string); + $string = str_replace('!alt', $held['alter'], $string); + $string = str_replace('!geb', $held['geburtstag'].'. '. + $monate[$held['geburtsmonat']].' '. + abs($held['geburtsjahr']).' '. + (($held['geburtsjahr'] < 0) ? 'v' : 'n').'. Hal', + $string); + $string = str_replace('!ort', $held['geburtsort'], $string); + $string = str_replace('!gro', $held['groesse'], $string); + $string = str_replace('!gew', $held['gewicht'], $string); + $string = str_replace('!haar', $held['haarfarbe'], $string); + $string = str_replace('!augen', $held['augenfarbe'], $string); + $string = str_replace('!stand', $held['stand'], $string); + $string = str_replace('!gott', $held['gottheit'], $string); + $string = str_replace('!titel', $held['titel'], $string); + $string = str_replace('!abenteuer', $held['abenteuer'], $string); + + $string = str_replace('!mug', $held['mu_gw'], $string); + $string = str_replace('!klg', $held['kl_gw'], $string); + $string = str_replace('!ing', $held['in_gw'], $string); + $string = str_replace('!chg', $held['ch_gw'], $string); + $string = str_replace('!geg', $held['ge_gw'], $string); + $string = str_replace('!ffg', $held['ff_gw'], $string); + $string = str_replace('!kkg', $held['kk_gw'], $string); + $string = str_replace('!agg', $held['ag_gw'], $string); + $string = str_replace('!hag', $held['ha_gw'], $string); + $string = str_replace('!rag', $held['ra_gw'], $string); + $string = str_replace('!tag', $held['ta_gw'], $string); + $string = str_replace('!ngg', $held['ng_gw'], $string); + $string = str_replace('!ggg', $held['gg_gw'], $string); + $string = str_replace('!jzg', $held['jz_gw'], $string); + + $string = str_replace('!leg', $held['le_gw'], $string); + $string = str_replace('!aug', $held['au_gw'], $string); + $string = str_replace('!aeg', $held['ae_gw'], $string); + $string = str_replace('!keg', $held['ke_gw'], $string); + + $string = str_replace('!mb', $held['mr_bonus'], $string); + $string = str_replace('!mr', $held['mr'], $string); + $string = str_replace('!ap', $held['ap'], $string); + $string = str_replace('!nst', $held['nextLevel'], $string); + $string = str_replace('!stufe', $held['stufe'], $string); + + $string = str_replace('!atb', $held['atb'], $string); + $string = str_replace('!pab', $held['pab'], $string); + $string = str_replace('!auw', $held['auw'], $string); + $string = str_replace('!fkb', $held['fkb'], $string); + + $string = str_replace('!be_min', $held['be_minus'], $string); + + $i = 0; + foreach($held['sprachen'] as $sprache) + { + $i++; + + $string = str_replace('!sp'.$i.'_n', $sprache['name'], $string); + if ($sprache['alt']) + { + $temp = '<text:span text:style-name="T0">*</text:span> '. + $sprache['wert'].' *'; + $string = str_replace('!sp'.$i.'_w', $temp, $string); + } + else + $string = str_replace('!sp'.$i.'_w', $sprache['wert'], $string); + } + for (; $i < 11; $i++) + { + $string = str_replace('!sp'.$i.'_n', '', $string); + $string = str_replace('!sp'.$i.'_w', '', $string); + } + + if ($papermode) + { + $string = str_replace('!mu.', $held['mu_gw'], $string); + $string = str_replace('!kl.', $held['kl_gw'], $string); + $string = str_replace('!in.', $held['in_gw'], $string); + $string = str_replace('!ch.', $held['ch_gw'], $string); + $string = str_replace('!ge.', $held['ge_gw'], $string); + $string = str_replace('!ff.', $held['ff_gw'], $string); + $string = str_replace('!kk.', $held['kk_gw'], $string); + + $string = str_replace('!mu', '', $string); + $string = str_replace('!kl', '', $string); + $string = str_replace('!in', '', $string); + $string = str_replace('!ch', '', $string); + $string = str_replace('!ge', '', $string); + $string = str_replace('!ff', '', $string); + $string = str_replace('!kk', '', $string); + $string = str_replace('!ag', '', $string); + $string = str_replace('!ha', '', $string); + $string = str_replace('!ra', '', $string); + $string = str_replace('!ta', '', $string); + $string = str_replace('!ng', '', $string); + $string = str_replace('!gg', '', $string); + $string = str_replace('!jz', '', $string); + + $string = str_replace('!le', '', $string); + $string = str_replace('!au', '', $string); + $string = str_replace('!ae', '', $string); + $string = str_replace('!ke', '', $string); + } + else + { + $string = str_replace('!mu.', $held['mu'], $string); + $string = str_replace('!kl.', $held['kl'], $string); + $string = str_replace('!in.', $held['in'], $string); + $string = str_replace('!ch.', $held['ch'], $string); + $string = str_replace('!ge.', $held['ge'], $string); + $string = str_replace('!ff.', $held['ff'], $string); + $string = str_replace('!kk.', $held['kk'], $string); + + $string = str_replace('!mu', $held['mu'], $string); + $string = str_replace('!kl', $held['kl'], $string); + $string = str_replace('!in', $held['in'], $string); + $string = str_replace('!ch', $held['ch'], $string); + $string = str_replace('!ge', $held['ge'], $string); + $string = str_replace('!ff', $held['ff'], $string); + $string = str_replace('!kk', $held['kk'], $string); + $string = str_replace('!ag', $held['ag'], $string); + $string = str_replace('!ha', $held['ha'], $string); + $string = str_replace('!ra', $held['ra'], $string); + $string = str_replace('!ta', $held['ta'], $string); + $string = str_replace('!ng', $held['ng'], $string); + $string = str_replace('!gg', $held['gg'], $string); + $string = str_replace('!jz', $held['jz'], $string); + + $string = str_replace('!le', $held['le'], $string); + $string = str_replace('!au', $held['au'], $string); + $string = str_replace('!ae', $held['ae'], $string); + $string = str_replace('!ke', $held['ke'], $string); + } + + status('Ersetze: Waffen, Rüstungen und Inventar'); + + $i = 0; + $be -= $held['be_minus']; + foreach($held['ruestungen'] as $rstg) + { + $i++; + $temp_num = ($rstg['anzahl'] > 1) ? + ' <text:span text:style-name="T4">x'.$rstg['anzahl']. + '</text:span>' : ''; + $string = str_replace('!rn'.$i, $rstg['name'].$temp_num, $string); + $temp_rs = $rstg['rs'] * $rstg['anzahl']; + $temp_be = $rstg['be'] * $rstg['anzahl']; + $string = str_replace('!rs'.$i, $temp_rs, $string); + $string = str_replace('!rb'.$i, $temp_be, $string); + $rs += $temp_rs; + $be += $temp_be; + $last += $rstg['gewicht']; + } + for (; $i < 5; $i++) + { + $string = str_replace('!rn'.$i, '', $string); + $string = str_replace('!rs'.$i, '', $string); + $string = str_replace('!rb'.$i, '', $string); + } + $string = str_replace('!rsu', $rs, $string); + $string = str_replace('!bsu', $be, $string); + + $i = 0; + foreach($held['nahkampfwaffen'] as $wfe) + { + $i++; + $temp_num = ($wfe['anzahl'] > 1) ? + ' <text:span text:style-name="T4">x'.$wfe['anzahl']. + '</text:span>' : ''; + $string = str_replace('!wn'.$i, $wfe['name'].$temp_num, $string); + $string = str_replace('!wk'.$i, $wfe['kk_bonus'], $string); + $string = str_replace('!wv'.$i, $wfe['w_v'], $string); + $temp_at = $held['kampftalente'][$wfe['talent']]['at']; + $temp_pa = $held['kampftalente'][$wfe['talent']]['pa']; + $string = str_replace('!w1'.$i, $temp_at, $string); + $string = str_replace('!w2'.$i, $temp_pa, $string); + $string = str_replace('!w3'.$i, $temp_at - ceil($be/2), $string); + $string = str_replace('!w4'.$i, $temp_at - floor($be/2), $string); + $string = str_replace('!wtp'.$i, $wfe['tp'], $string); + $string = str_replace('!wb'.$i, $wfe['bf'], $string); + $last += $wfe['gewicht']; + } + for (; $i < 6; $i++) + { + $string = str_replace('!wn'.$i, '', $string); + $string = str_replace('!wk'.$i, '', $string); + $string = str_replace('!wv'.$i, '', $string); + $string = str_replace('!w1'.$i, '', $string); + $string = str_replace('!w2'.$i, '', $string); + $string = str_replace('!w3'.$i, '', $string); + $string = str_replace('!w4'.$i, '', $string); + $string = str_replace('!wtp'.$i, '', $string); + $string = str_replace('!wb'.$i, '', $string); + } + + $i = 0; + foreach($held['fernkampfwaffen'] as $wfe) + { + $i++; + $temp_num = ($wfe['anzahl'] > 1) ? + ' <text:span text:style-name="T4">x'.$wfe['anzahl']. + '</text:span>' : ''; + $string = str_replace('!fn'.$i, $wfe['name'].$temp_num, $string); + $string = str_replace('!ft'.$i, $wfe['tp'], $string); + $string = str_replace('!fr'.$i, $wfe['rw'], $string); + $string = str_replace('!fm'.$i, $wfe['entf_mod'], $string); + $last += $wfe['gewicht']; + } + for (; $i < 3; $i++) + { + $string = str_replace('!fn'.$i, '', $string); + $string = str_replace('!ft'.$i, '', $string); + $string = str_replace('!fr'.$i, '', $string); + $string = str_replace('!fm'.$i, '', $string); + } + + $kt_drucken = explode(' ', $held['welche_kt_drucken']); + $i = 0; $j = 0; + foreach($kt_drucken as $wert) + { + if ('1' == $wert) + { + $i++; + $ii = (($i < 10) ? '0' : '').$i; + $string = str_replace('!kampf'.$ii, $held['kampftalente'][$j]['name'], + $string); + $string = str_replace('!a1'.$ii, $held['kampftalente'][$j]['at'], + $string); + $string = str_replace('!p1'.$ii, $held['kampftalente'][$j]['pa'], + $string); + $string = str_replace('!a2'.$ii, + $held['kampftalente'][$j]['at'] - ceil($be/2), + $string); + $string = str_replace('!p2'.$ii, + $held['kampftalente'][$j]['pa'] - floor($be/2), + $string); + } + $j++; + } + for (; $i < 11; $i++) + { + $ii = (($i < 10) ? '0' : '').$i; + $string = str_replace('!kampf'.$ii, '', $string); + $string = str_replace('!a1'.$ii, '', $string); + $string = str_replace('!p1'.$ii, '', $string); + $string = str_replace('!a2'.$ii, '', $string); + $string = str_replace('!p2'.$ii, '', $string); + } } + /** + * Just a little shorthand + */ + function e() + { + global $retval, $zip; + + if ($retval == 0) { + die("Fehler: ".$zip->errorInfo(true)); + } + } + + /** + * Print usage information and terminate + */ function usage() { - die('Usage: '.$argv[0].' <Name der Quelldatei> <Name der Zieldatei>\n'. - ' '.$argv[0].' <Name der Quelldatei>\n'); + global $argv; + $name = basename($argv[0]); + die("Usage: $name <Name der Quelldatei> <Name der Zieldatei>\n". + " $name <Name der Quelldatei>\n"); } + + /* + * Convert the latin-1ish output from the file into the UTF-8 OOo expects + */ + function unicodize(&$value, $key, $userdata = '') + { + if (!is_string($value)) return; + + $value = mb_convert_encoding($value, 'UTF-8'); + } + + /** + * Print a fancy status message + */ + function status($string) + { + // I'm pretty sure that moving back to the beginning of the line doesn't + // work like below under Windows, so we'll just use linebreaks there + if (substr(PHP_OS, 0, 3) == "WIN") + { + echo $string."\n"; + return; + } + + global $lastLineLength; + $thisLineLength = strlen($string); + + echo chr(13).$string; + for ($i = $thisLineLength; $i <= $lastLineLength; $i++) + { + echo ' '; + } + $lastLineLength = $thisLineLength; + } ?> \ No newline at end of file Added: h422/trunk/opt/res/sxw/content.xml.template =================================================================== --- h422/trunk/opt/res/sxw/content.xml.template (rev 0) +++ h422/trunk/opt/res/sxw/content.xml.template 2006-12-24 12:21:35 UTC (rev 19) @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> @@ Diff output truncated at 100000 characters. @@ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <j6...@us...> - 2006-12-23 05:11:10
|
Revision: 18 http://svn.sourceforge.net/dsaster/?rev=18&view=rev Author: j6cubic Date: 2006-12-22 21:11:07 -0800 (Fri, 22 Dec 2006) Log Message: ----------- io_php.cpp - Now actually added the PHP output plugin to the repository. ^^' opt/ - Added the opt directory, which contains stuff that isn't technically part of h422 but is used with it. Currently it contains a PHP script that runs h422 and generates an OpenOffice document Added Paths: ----------- h422/trunk/opt/ h422/trunk/opt/makesxw.php h422/trunk/opt/pclzip.lib.php h422/trunk/opt/res/ h422/trunk/opt/res/sxw.content.template h422/trunk/opt/res/sxw.template/ h422/trunk/opt/res/sxw.template/Configurations2/ h422/trunk/opt/res/sxw.template/Configurations2/accelerator/ h422/trunk/opt/res/sxw.template/Configurations2/accelerator/current.xml h422/trunk/opt/res/sxw.template/Configurations2/floater/ h422/trunk/opt/res/sxw.template/Configurations2/images/ h422/trunk/opt/res/sxw.template/Configurations2/images/Bitmaps/ h422/trunk/opt/res/sxw.template/Configurations2/menubar/ h422/trunk/opt/res/sxw.template/Configurations2/popupmenu/ h422/trunk/opt/res/sxw.template/Configurations2/progressbar/ h422/trunk/opt/res/sxw.template/Configurations2/statusbar/ h422/trunk/opt/res/sxw.template/Configurations2/toolbar/ h422/trunk/opt/res/sxw.template/META-INF/ h422/trunk/opt/res/sxw.template/META-INF/manifest.xml h422/trunk/opt/res/sxw.template/content.xml h422/trunk/opt/res/sxw.template/layout-cache h422/trunk/opt/res/sxw.template/meta.xml h422/trunk/opt/res/sxw.template/mimetype h422/trunk/opt/res/sxw.template/settings.xml h422/trunk/opt/res/sxw.template/styles.xml h422/trunk/opt/test.sxw h422/trunk/src/io_php.cpp Added: h422/trunk/opt/makesxw.php =================================================================== --- h422/trunk/opt/makesxw.php (rev 0) +++ h422/trunk/opt/makesxw.php 2006-12-23 05:11:07 UTC (rev 18) @@ -0,0 +1,68 @@ +#!/usr/bin/php -Cq +<?php + ini_set('track_errors', 1); + require_once('pclzip.lib.php'); + + if ($argc < 2) usage(); + + if (!is_file($argv[1])) usage(); + if ($argc < 3) + $filename = substr($argv[1], 0, -1).'.sxw'; + else + $filename = $argv[2]; + + $befehl = '../bin/h422 '.$argv[1].' php'; + + $rohheld = `$befehl`; + + $held = @unserialize($rohheld); + + if (isset($php_errormsg)) + { + $temp = substr($php_errormsg, + strpos($php_errormsg, "at offset") + 10); + $temp = explode(' ', $temp); $offset = $temp[0]; + die("Fehler beim Deserialisieren der Heldendaten bei Offset $offset.\n"); + } + + $template = file_get_contents('res/sxw.content.template'); + replace_values($template, $held); + + $handle = fopen ('res/sxw.template/content.xml', 'w'); + fwrite ($handle, $template); + fclose ($handle); + + //die(strlen($template)."\n"); + + if('/' != $filename[0]) + $filename = getcwd().'/'.$filename; + + if (file_exists($filename)) + unlink($filename); + + /* $tempfile = tempnam('.', 'TEMP_'); + shell_exec("cd res/sxw.template/ && zip -r ../../${tempfile} * && cd ../.."); + rename($tempfile.'.zip', $filename); + unlink($tempfile); */ + + $zip = new PclZip($filename); + chdir('res/sxw.template/'); + $retval = $zip->create(glob('*')); + + if ($retval == 0) { + die("Error : ".$zip->errorInfo(true)); + } + + //////////////////////////////////////////////////////////////////////////// + + function replace_values(&$string, $held) + { + $string = str_replace('!name', $held['name'], $string); + } + + function usage() + { + die('Usage: '.$argv[0].' <Name der Quelldatei> <Name der Zieldatei>\n'. + ' '.$argv[0].' <Name der Quelldatei>\n'); + } +?> \ No newline at end of file Property changes on: h422/trunk/opt/makesxw.php ___________________________________________________________________ Name: svn:executable + * Added: h422/trunk/opt/pclzip.lib.php =================================================================== --- h422/trunk/opt/pclzip.lib.php (rev 0) +++ h422/trunk/opt/pclzip.lib.php 2006-12-23 05:11:07 UTC (rev 18) @@ -0,0 +1,5748 @@ +<?php +// -------------------------------------------------------------------------------- +// PhpConcept Library - Zip Module 2.5 +// -------------------------------------------------------------------------------- +// License GNU/LGPL - Vincent Blavet - March 2006 +// http://www.phpconcept.net +// -------------------------------------------------------------------------------- +// +// Presentation : +// PclZip is a PHP library that manage ZIP archives. +// So far tests show that archives generated by PclZip are readable by +// WinZip application and other tools. +// +// Description : +// See readme.txt and http://www.phpconcept.net +// +// Warning : +// This library and the associated files are non commercial, non professional +// work. +// It should not have unexpected results. However if any damage is caused by +// this software the author can not be responsible. +// The use of this software is at the risk of the user. +// +// -------------------------------------------------------------------------------- +// $Id: pclzip.lib.php,v 1.44 2006/03/08 21:23:59 vblavet Exp $ +// -------------------------------------------------------------------------------- + + // ----- Constants + define( 'PCLZIP_READ_BLOCK_SIZE', 2048 ); + + // ----- File list separator + // In version 1.x of PclZip, the separator for file list is a space + // (which is not a very smart choice, specifically for windows paths !). + // A better separator should be a comma (,). This constant gives you the + // abilty to change that. + // However notice that changing this value, may have impact on existing + // scripts, using space separated filenames. + // Recommanded values for compatibility with older versions : + //define( 'PCLZIP_SEPARATOR', ' ' ); + // Recommanded values for smart separation of filenames. + define( 'PCLZIP_SEPARATOR', ',' ); + + // ----- Error configuration + // 0 : PclZip Class integrated error handling + // 1 : PclError external library error handling. By enabling this + // you must ensure that you have included PclError library. + // [2,...] : reserved for futur use + define( 'PCLZIP_ERROR_EXTERNAL', 0 ); + + // ----- Optional static temporary directory + // By default temporary files are generated in the script current + // path. + // If defined : + // - MUST BE terminated by a '/'. + // - MUST be a valid, already created directory + // Samples : + // define( 'PCLZIP_TEMPORARY_DIR', '/temp/' ); + // define( 'PCLZIP_TEMPORARY_DIR', 'C:/Temp/' ); + define( 'PCLZIP_TEMPORARY_DIR', '' ); + +// -------------------------------------------------------------------------------- +// ***** UNDER THIS LINE NOTHING NEEDS TO BE MODIFIED ***** +// -------------------------------------------------------------------------------- + + // ----- Global variables + $g_pclzip_version = "2.5"; + + // ----- Error codes + // -1 : Unable to open file in binary write mode + // -2 : Unable to open file in binary read mode + // -3 : Invalid parameters + // -4 : File does not exist + // -5 : Filename is too long (max. 255) + // -6 : Not a valid zip file + // -7 : Invalid extracted file size + // -8 : Unable to create directory + // -9 : Invalid archive extension + // -10 : Invalid archive format + // -11 : Unable to delete file (unlink) + // -12 : Unable to rename file (rename) + // -13 : Invalid header checksum + // -14 : Invalid archive size + define( 'PCLZIP_ERR_USER_ABORTED', 2 ); + define( 'PCLZIP_ERR_NO_ERROR', 0 ); + define( 'PCLZIP_ERR_WRITE_OPEN_FAIL', -1 ); + define( 'PCLZIP_ERR_READ_OPEN_FAIL', -2 ); + define( 'PCLZIP_ERR_INVALID_PARAMETER', -3 ); + define( 'PCLZIP_ERR_MISSING_FILE', -4 ); + define( 'PCLZIP_ERR_FILENAME_TOO_LONG', -5 ); + define( 'PCLZIP_ERR_INVALID_ZIP', -6 ); + define( 'PCLZIP_ERR_BAD_EXTRACTED_FILE', -7 ); + define( 'PCLZIP_ERR_DIR_CREATE_FAIL', -8 ); + define( 'PCLZIP_ERR_BAD_EXTENSION', -9 ); + define( 'PCLZIP_ERR_BAD_FORMAT', -10 ); + define( 'PCLZIP_ERR_DELETE_FILE_FAIL', -11 ); + define( 'PCLZIP_ERR_RENAME_FILE_FAIL', -12 ); + define( 'PCLZIP_ERR_BAD_CHECKSUM', -13 ); + define( 'PCLZIP_ERR_INVALID_ARCHIVE_ZIP', -14 ); + define( 'PCLZIP_ERR_MISSING_OPTION_VALUE', -15 ); + define( 'PCLZIP_ERR_INVALID_OPTION_VALUE', -16 ); + define( 'PCLZIP_ERR_ALREADY_A_DIRECTORY', -17 ); + define( 'PCLZIP_ERR_UNSUPPORTED_COMPRESSION', -18 ); + define( 'PCLZIP_ERR_UNSUPPORTED_ENCRYPTION', -19 ); + define( 'PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE', -20 ); + define( 'PCLZIP_ERR_DIRECTORY_RESTRICTION', -21 ); + + // ----- Options values + define( 'PCLZIP_OPT_PATH', 77001 ); + define( 'PCLZIP_OPT_ADD_PATH', 77002 ); + define( 'PCLZIP_OPT_REMOVE_PATH', 77003 ); + define( 'PCLZIP_OPT_REMOVE_ALL_PATH', 77004 ); + define( 'PCLZIP_OPT_SET_CHMOD', 77005 ); + define( 'PCLZIP_OPT_EXTRACT_AS_STRING', 77006 ); + define( 'PCLZIP_OPT_NO_COMPRESSION', 77007 ); + define( 'PCLZIP_OPT_BY_NAME', 77008 ); + define( 'PCLZIP_OPT_BY_INDEX', 77009 ); + define( 'PCLZIP_OPT_BY_EREG', 77010 ); + define( 'PCLZIP_OPT_BY_PREG', 77011 ); + define( 'PCLZIP_OPT_COMMENT', 77012 ); + define( 'PCLZIP_OPT_ADD_COMMENT', 77013 ); + define( 'PCLZIP_OPT_PREPEND_COMMENT', 77014 ); + define( 'PCLZIP_OPT_EXTRACT_IN_OUTPUT', 77015 ); + define( 'PCLZIP_OPT_REPLACE_NEWER', 77016 ); + define( 'PCLZIP_OPT_STOP_ON_ERROR', 77017 ); + // Having big trouble with crypt. Need to multiply 2 long int + // which is not correctly supported by PHP ... + //define( 'PCLZIP_OPT_CRYPT', 77018 ); + define( 'PCLZIP_OPT_EXTRACT_DIR_RESTRICTION', 77019 ); + + // ----- File description attributes + define( 'PCLZIP_ATT_FILE_NAME', 79001 ); + define( 'PCLZIP_ATT_FILE_NEW_SHORT_NAME', 79002 ); + define( 'PCLZIP_ATT_FILE_NEW_FULL_NAME', 79003 ); + + // ----- Call backs values + define( 'PCLZIP_CB_PRE_EXTRACT', 78001 ); + define( 'PCLZIP_CB_POST_EXTRACT', 78002 ); + define( 'PCLZIP_CB_PRE_ADD', 78003 ); + define( 'PCLZIP_CB_POST_ADD', 78004 ); + /* For futur use + define( 'PCLZIP_CB_PRE_LIST', 78005 ); + define( 'PCLZIP_CB_POST_LIST', 78006 ); + define( 'PCLZIP_CB_PRE_DELETE', 78007 ); + define( 'PCLZIP_CB_POST_DELETE', 78008 ); + */ + + // -------------------------------------------------------------------------------- + // Class : PclZip + // Description : + // PclZip is the class that represent a Zip archive. + // The public methods allow the manipulation of the archive. + // Attributes : + // Attributes must not be accessed directly. + // Methods : + // PclZip() : Object creator + // create() : Creates the Zip archive + // listContent() : List the content of the Zip archive + // extract() : Extract the content of the archive + // properties() : List the properties of the archive + // -------------------------------------------------------------------------------- + class PclZip + { + // ----- Filename of the zip file + var $zipname = ''; + + // ----- File descriptor of the zip file + var $zip_fd = 0; + + // ----- Internal error handling + var $error_code = 1; + var $error_string = ''; + + // ----- Current status of the magic_quotes_runtime + // This value store the php configuration for magic_quotes + // The class can then disable the magic_quotes and reset it after + var $magic_quotes_status; + + // -------------------------------------------------------------------------------- + // Function : PclZip() + // Description : + // Creates a PclZip object and set the name of the associated Zip archive + // filename. + // Note that no real action is taken, if the archive does not exist it is not + // created. Use create() for that. + // -------------------------------------------------------------------------------- + function PclZip($p_zipname) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::PclZip', "zipname=$p_zipname"); + + // ----- Tests the zlib + if (!function_exists('gzopen')) + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 1, "zlib extension seems to be missing"); + die('Abort '.basename(__FILE__).' : Missing zlib extensions'); + } + + // ----- Set the attributes + $this->zipname = $p_zipname; + $this->zip_fd = 0; + $this->magic_quotes_status = -1; + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 1); + return; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : + // create($p_filelist, $p_add_dir="", $p_remove_dir="") + // create($p_filelist, $p_option, $p_option_value, ...) + // Description : + // This method supports two different synopsis. The first one is historical. + // This method creates a Zip Archive. The Zip file is created in the + // filesystem. The files and directories indicated in $p_filelist + // are added in the archive. See the parameters description for the + // supported format of $p_filelist. + // When a directory is in the list, the directory and its content is added + // in the archive. + // In this synopsis, the function takes an optional variable list of + // options. See bellow the supported options. + // Parameters : + // $p_filelist : An array containing file or directory names, or + // a string containing one filename or one directory name, or + // a string containing a list of filenames and/or directory + // names separated by spaces. + // $p_add_dir : A path to add before the real path of the archived file, + // in order to have it memorized in the archive. + // $p_remove_dir : A path to remove from the real path of the file to archive, + // in order to have a shorter path memorized in the archive. + // When $p_add_dir and $p_remove_dir are set, $p_remove_dir + // is removed first, before $p_add_dir is added. + // Options : + // PCLZIP_OPT_ADD_PATH : + // PCLZIP_OPT_REMOVE_PATH : + // PCLZIP_OPT_REMOVE_ALL_PATH : + // PCLZIP_OPT_COMMENT : + // PCLZIP_CB_PRE_ADD : + // PCLZIP_CB_POST_ADD : + // Return Values : + // 0 on failure, + // The list of the added files, with a status of the add action. + // (see PclZip::listContent() for list entry format) + // -------------------------------------------------------------------------------- + function create($p_filelist) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::create', "filelist='$p_filelist', ..."); + $v_result=1; + + // ----- Reset the error handler + $this->privErrorReset(); + + // ----- Set default values + $v_options = array(); + $v_options[PCLZIP_OPT_NO_COMPRESSION] = FALSE; + + // ----- Look for variable options arguments + $v_size = func_num_args(); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method"); + + // ----- Look for arguments + if ($v_size > 1) { + // ----- Get the arguments + $v_arg_list = func_get_args(); + + // ----- Remove from the options list the first argument + array_shift($v_arg_list); + $v_size--; + + // ----- Look for first arg + if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Variable list of options detected"); + + // ----- Parse the options + $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, + array (PCLZIP_OPT_REMOVE_PATH => 'optional', + PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', + PCLZIP_OPT_ADD_PATH => 'optional', + PCLZIP_CB_PRE_ADD => 'optional', + PCLZIP_CB_POST_ADD => 'optional', + PCLZIP_OPT_NO_COMPRESSION => 'optional', + PCLZIP_OPT_COMMENT => 'optional' + //, PCLZIP_OPT_CRYPT => 'optional' + )); + if ($v_result != 1) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return 0; + } + } + + // ----- Look for 2 args + // Here we need to support the first historic synopsis of the + // method. + else { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Static synopsis"); + + // ----- Get the first argument + $v_options[PCLZIP_OPT_ADD_PATH] = $v_arg_list[0]; + + // ----- Look for the optional second argument + if ($v_size == 2) { + $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1]; + } + else if ($v_size > 2) { + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, + "Invalid number / type of arguments"); + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return 0; + } + } + } + + // ----- Init + $v_string_list = array(); + $v_att_list = array(); + $v_filedescr_list = array(); + $p_result_list = array(); + + // ----- Look if the $p_filelist is really an array + if (is_array($p_filelist)) { + + // ----- Look if the first element is also an array + // This will mean that this is a file description entry + if (isset($p_filelist[0]) && is_array($p_filelist[0])) { + $v_att_list = $p_filelist; + } + + // ----- The list is a list of string names + else { + $v_string_list = $p_filelist; + } + } + + // ----- Look if the $p_filelist is a string + else if (is_string($p_filelist)) { + // ----- Create a list from the string + $v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist); + } + + // ----- Invalid variable type for $p_filelist + else { + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_filelist"); + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return 0; + } + + // ----- Reformat the string list + if (sizeof($v_string_list) != 0) { + foreach ($v_string_list as $v_string) { + if ($v_string != '') { + $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string; + } + else { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Ignore an empty filename"); + } + } + } + + // ----- For each file in the list check the attributes + $v_supported_attributes + = array ( PCLZIP_ATT_FILE_NAME => 'mandatory' + ,PCLZIP_ATT_FILE_NEW_SHORT_NAME => 'optional' + ,PCLZIP_ATT_FILE_NEW_FULL_NAME => 'optional' + ); + foreach ($v_att_list as $v_entry) { + $v_result = $this->privFileDescrParseAtt($v_entry, + $v_filedescr_list[], + $v_options, + $v_supported_attributes); + if ($v_result != 1) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return 0; + } + } + + // ----- Expand the filelist (expand directories) + $v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options); + if ($v_result != 1) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return 0; + } + + // ----- Call the create fct + $v_result = $this->privCreate($v_filedescr_list, $p_result_list, $v_options); + if ($v_result != 1) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return 0; + } + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_result_list); + return $p_result_list; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : + // add($p_filelist, $p_add_dir="", $p_remove_dir="") + // add($p_filelist, $p_option, $p_option_value, ...) + // Description : + // This method supports two synopsis. The first one is historical. + // This methods add the list of files in an existing archive. + // If a file with the same name already exists, it is added at the end of the + // archive, the first one is still present. + // If the archive does not exist, it is created. + // Parameters : + // $p_filelist : An array containing file or directory names, or + // a string containing one filename or one directory name, or + // a string containing a list of filenames and/or directory + // names separated by spaces. + // $p_add_dir : A path to add before the real path of the archived file, + // in order to have it memorized in the archive. + // $p_remove_dir : A path to remove from the real path of the file to archive, + // in order to have a shorter path memorized in the archive. + // When $p_add_dir and $p_remove_dir are set, $p_remove_dir + // is removed first, before $p_add_dir is added. + // Options : + // PCLZIP_OPT_ADD_PATH : + // PCLZIP_OPT_REMOVE_PATH : + // PCLZIP_OPT_REMOVE_ALL_PATH : + // PCLZIP_OPT_COMMENT : + // PCLZIP_OPT_ADD_COMMENT : + // PCLZIP_OPT_PREPEND_COMMENT : + // PCLZIP_CB_PRE_ADD : + // PCLZIP_CB_POST_ADD : + // Return Values : + // 0 on failure, + // The list of the added files, with a status of the add action. + // (see PclZip::listContent() for list entry format) + // -------------------------------------------------------------------------------- + function add($p_filelist) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::add', "filelist='$p_filelist', ..."); + $v_result=1; + + // ----- Reset the error handler + $this->privErrorReset(); + + // ----- Set default values + $v_options = array(); + $v_options[PCLZIP_OPT_NO_COMPRESSION] = FALSE; + + // ----- Look for variable options arguments + $v_size = func_num_args(); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method"); + + // ----- Look for arguments + if ($v_size > 1) { + // ----- Get the arguments + $v_arg_list = func_get_args(); + + // ----- Remove form the options list the first argument + array_shift($v_arg_list); + $v_size--; + + // ----- Look for first arg + if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Variable list of options detected"); + + // ----- Parse the options + $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, + array (PCLZIP_OPT_REMOVE_PATH => 'optional', + PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', + PCLZIP_OPT_ADD_PATH => 'optional', + PCLZIP_CB_PRE_ADD => 'optional', + PCLZIP_CB_POST_ADD => 'optional', + PCLZIP_OPT_NO_COMPRESSION => 'optional', + PCLZIP_OPT_COMMENT => 'optional', + PCLZIP_OPT_ADD_COMMENT => 'optional', + PCLZIP_OPT_PREPEND_COMMENT => 'optional' + //, PCLZIP_OPT_CRYPT => 'optional' + )); + if ($v_result != 1) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return 0; + } + } + + // ----- Look for 2 args + // Here we need to support the first historic synopsis of the + // method. + else { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Static synopsis"); + + // ----- Get the first argument + $v_options[PCLZIP_OPT_ADD_PATH] = $v_add_path = $v_arg_list[0]; + + // ----- Look for the optional second argument + if ($v_size == 2) { + $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1]; + } + else if ($v_size > 2) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return 0; + } + } + } + + // ----- Init + $v_string_list = array(); + $v_att_list = array(); + $v_filedescr_list = array(); + $p_result_list = array(); + + // ----- Look if the $p_filelist is really an array + if (is_array($p_filelist)) { + + // ----- Look if the first element is also an array + // This will mean that this is a file description entry + if (isset($p_filelist[0]) && is_array($p_filelist[0])) { + $v_att_list = $p_filelist; + } + + // ----- The list is a list of string names + else { + $v_string_list = $p_filelist; + } + } + + // ----- Look if the $p_filelist is a string + else if (is_string($p_filelist)) { + // ----- Create a list from the string + $v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist); + } + + // ----- Invalid variable type for $p_filelist + else { + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type '".gettype($p_filelist)."' for p_filelist"); + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return 0; + } + + // ----- Reformat the string list + if (sizeof($v_string_list) != 0) { + foreach ($v_string_list as $v_string) { + $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string; + } + } + + // ----- For each file in the list check the attributes + $v_supported_attributes + = array ( PCLZIP_ATT_FILE_NAME => 'mandatory' + ,PCLZIP_ATT_FILE_NEW_SHORT_NAME => 'optional' + ,PCLZIP_ATT_FILE_NEW_FULL_NAME => 'optional' + ); + foreach ($v_att_list as $v_entry) { + $v_result = $this->privFileDescrParseAtt($v_entry, + $v_filedescr_list[], + $v_options, + $v_supported_attributes); + if ($v_result != 1) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return 0; + } + } + + // ----- Expand the filelist (expand directories) + $v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options); + if ($v_result != 1) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return 0; + } + + // ----- Call the create fct + $v_result = $this->privAdd($v_filedescr_list, $p_result_list, $v_options); + if ($v_result != 1) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return 0; + } + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_result_list); + return $p_result_list; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : listContent() + // Description : + // This public method, gives the list of the files and directories, with their + // properties. + // The properties of each entries in the list are (used also in other functions) : + // filename : Name of the file. For a create or add action it is the filename + // given by the user. For an extract function it is the filename + // of the extracted file. + // stored_filename : Name of the file / directory stored in the archive. + // size : Size of the stored file. + // compressed_size : Size of the file's data compressed in the archive + // (without the headers overhead) + // mtime : Last known modification date of the file (UNIX timestamp) + // comment : Comment associated with the file + // folder : true | false + // index : index of the file in the archive + // status : status of the action (depending of the action) : + // Values are : + // ok : OK ! + // filtered : the file / dir is not extracted (filtered by user) + // already_a_directory : the file can not be extracted because a + // directory with the same name already exists + // write_protected : the file can not be extracted because a file + // with the same name already exists and is + // write protected + // newer_exist : the file was not extracted because a newer file exists + // path_creation_fail : the file is not extracted because the folder + // does not exists and can not be created + // write_error : the file was not extracted because there was a + // error while writing the file + // read_error : the file was not extracted because there was a error + // while reading the file + // invalid_header : the file was not extracted because of an archive + // format error (bad file header) + // Note that each time a method can continue operating when there + // is an action error on a file, the error is only logged in the file status. + // Return Values : + // 0 on an unrecoverable failure, + // The list of the files in the archive. + // -------------------------------------------------------------------------------- + function listContent() + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::listContent', ""); + $v_result=1; + + // ----- Reset the error handler + $this->privErrorReset(); + + // ----- Check archive + if (!$this->privCheckFormat()) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return(0); + } + + // ----- Call the extracting fct + $p_list = array(); + if (($v_result = $this->privList($p_list)) != 1) + { + unset($p_list); + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo()); + return(0); + } + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_list); + return $p_list; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : + // extract($p_path="./", $p_remove_path="") + // extract([$p_option, $p_option_value, ...]) + // Description : + // This method supports two synopsis. The first one is historical. + // This method extract all the files / directories from the archive to the + // folder indicated in $p_path. + // If you want to ignore the 'root' part of path of the memorized files + // you can indicate this in the optional $p_remove_path parameter. + // By default, if a newer file with the same name already exists, the + // file is not extracted. + // + // If both PCLZIP_OPT_PATH and PCLZIP_OPT_ADD_PATH aoptions + // are used, the path indicated in PCLZIP_OPT_ADD_PATH is append + // at the end of the path value of PCLZIP_OPT_PATH. + // Parameters : + // $p_path : Path where the files and directories are to be extracted + // $p_remove_path : First part ('root' part) of the memorized path + // (if any similar) to remove while extracting. + // Options : + // PCLZIP_OPT_PATH : + // PCLZIP_OPT_ADD_PATH : + // PCLZIP_OPT_REMOVE_PATH : + // PCLZIP_OPT_REMOVE_ALL_PATH : + // PCLZIP_CB_PRE_EXTRACT : + // PCLZIP_CB_POST_EXTRACT : + // Return Values : + // 0 or a negative value on failure, + // The list of the extracted files, with a status of the action. + // (see PclZip::listContent() for list entry format) + // -------------------------------------------------------------------------------- + function extract() + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::extract", ""); + $v_result=1; + + // ----- Reset the error handler + $this->privErrorReset(); + + // ----- Check archive + if (!$this->privCheckFormat()) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return(0); + } + + // ----- Set default values + $v_options = array(); +// $v_path = "./"; + $v_path = ''; + $v_remove_path = ""; + $v_remove_all_path = false; + + // ----- Look for variable options arguments + $v_size = func_num_args(); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method"); + + // ----- Default values for option + $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE; + + // ----- Look for arguments + if ($v_size > 0) { + // ----- Get the arguments + $v_arg_list = func_get_args(); + + // ----- Look for first arg + if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Variable list of options"); + + // ----- Parse the options + $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, + array (PCLZIP_OPT_PATH => 'optional', + PCLZIP_OPT_REMOVE_PATH => 'optional', + PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', + PCLZIP_OPT_ADD_PATH => 'optional', + PCLZIP_CB_PRE_EXTRACT => 'optional', + PCLZIP_CB_POST_EXTRACT => 'optional', + PCLZIP_OPT_SET_CHMOD => 'optional', + PCLZIP_OPT_BY_NAME => 'optional', + PCLZIP_OPT_BY_EREG => 'optional', + PCLZIP_OPT_BY_PREG => 'optional', + PCLZIP_OPT_BY_INDEX => 'optional', + PCLZIP_OPT_EXTRACT_AS_STRING => 'optional', + PCLZIP_OPT_EXTRACT_IN_OUTPUT => 'optional', + PCLZIP_OPT_REPLACE_NEWER => 'optional' + ,PCLZIP_OPT_STOP_ON_ERROR => 'optional' + ,PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional' + )); + if ($v_result != 1) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return 0; + } + + // ----- Set the arguments + if (isset($v_options[PCLZIP_OPT_PATH])) { + $v_path = $v_options[PCLZIP_OPT_PATH]; + } + if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) { + $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH]; + } + if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) { + $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH]; + } + if (isset($v_options[PCLZIP_OPT_ADD_PATH])) { + // ----- Check for '/' in last path char + if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) { + $v_path .= '/'; + } + $v_path .= $v_options[PCLZIP_OPT_ADD_PATH]; + } + } + + // ----- Look for 2 args + // Here we need to support the first historic synopsis of the + // method. + else { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Static synopsis"); + + // ----- Get the first argument + $v_path = $v_arg_list[0]; + + // ----- Look for the optional second argument + if ($v_size == 2) { + $v_remove_path = $v_arg_list[1]; + } + else if ($v_size > 2) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo()); + return 0; + } + } + } + + // ----- Trace + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "path='$v_path', remove_path='$v_remove_path', remove_all_path='".($v_remove_path?'true':'false')."'"); + + // ----- Call the extracting fct + $p_list = array(); + $v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path, + $v_remove_all_path, $v_options); + if ($v_result < 1) { + unset($p_list); + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo()); + return(0); + } + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_list); + return $p_list; + } + // -------------------------------------------------------------------------------- + + + // -------------------------------------------------------------------------------- + // Function : + // extractByIndex($p_index, $p_path="./", $p_remove_path="") + // extractByIndex($p_index, [$p_option, $p_option_value, ...]) + // Description : + // This method supports two synopsis. The first one is historical. + // This method is doing a partial extract of the archive. + // The extracted files or folders are identified by their index in the + // archive (from 0 to n). + // Note that if the index identify a folder, only the folder entry is + // extracted, not all the files included in the archive. + // Parameters : + // $p_index : A single index (integer) or a string of indexes of files to + // extract. The form of the string is "0,4-6,8-12" with only numbers + // and '-' for range or ',' to separate ranges. No spaces or ';' + // are allowed. + // $p_path : Path where the files and directories are to be extracted + // $p_remove_path : First part ('root' part) of the memorized path + // (if any similar) to remove while extracting. + // Options : + // PCLZIP_OPT_PATH : + // PCLZIP_OPT_ADD_PATH : + // PCLZIP_OPT_REMOVE_PATH : + // PCLZIP_OPT_REMOVE_ALL_PATH : + // PCLZIP_OPT_EXTRACT_AS_STRING : The files are extracted as strings and + // not as files. + // The resulting content is in a new field 'content' in the file + // structure. + // This option must be used alone (any other options are ignored). + // PCLZIP_CB_PRE_EXTRACT : + // PCLZIP_CB_POST_EXTRACT : + // Return Values : + // 0 on failure, + // The list of the extracted files, with a status of the action. + // (see PclZip::listContent() for list entry format) + // -------------------------------------------------------------------------------- + //function extractByIndex($p_index, options...) + function extractByIndex($p_index) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::extractByIndex", "index='$p_index', ..."); + $v_result=1; + + // ----- Reset the error handler + $this->privErrorReset(); + + // ----- Check archive + if (!$this->privCheckFormat()) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return(0); + } + + // ----- Set default values + $v_options = array(); +// $v_path = "./"; + $v_path = ''; + $v_remove_path = ""; + $v_remove_all_path = false; + + // ----- Look for variable options arguments + $v_size = func_num_args(); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method"); + + // ----- Default values for option + $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE; + + // ----- Look for arguments + if ($v_size > 1) { + // ----- Get the arguments + $v_arg_list = func_get_args(); + + // ----- Remove form the options list the first argument + array_shift($v_arg_list); + $v_size--; + + // ----- Look for first arg + if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Variable list of options"); + + // ----- Parse the options + $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, + array (PCLZIP_OPT_PATH => 'optional', + PCLZIP_OPT_REMOVE_PATH => 'optional', + PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', + PCLZIP_OPT_EXTRACT_AS_STRING => 'optional', + PCLZIP_OPT_ADD_PATH => 'optional', + PCLZIP_CB_PRE_EXTRACT => 'optional', + PCLZIP_CB_POST_EXTRACT => 'optional', + PCLZIP_OPT_SET_CHMOD => 'optional', + PCLZIP_OPT_REPLACE_NEWER => 'optional' + ,PCLZIP_OPT_STOP_ON_ERROR => 'optional' + ,PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional' + )); + if ($v_result != 1) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return 0; + } + + // ----- Set the arguments + if (isset($v_options[PCLZIP_OPT_PATH])) { + $v_path = $v_options[PCLZIP_OPT_PATH]; + } + if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) { + $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH]; + } + if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) { + $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH]; + } + if (isset($v_options[PCLZIP_OPT_ADD_PATH])) { + // ----- Check for '/' in last path char + if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) { + $v_path .= '/'; + } + $v_path .= $v_options[PCLZIP_OPT_ADD_PATH]; + } + if (!isset($v_options[PCLZIP_OPT_EXTRACT_AS_STRING])) { + $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE; + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Option PCLZIP_OPT_EXTRACT_AS_STRING not set."); + } + else { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Option PCLZIP_OPT_EXTRACT_AS_STRING set."); + } + } + + // ----- Look for 2 args + // Here we need to support the first historic synopsis of the + // method. + else { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Static synopsis"); + + // ----- Get the first argument + $v_path = $v_arg_list[0]; + + // ----- Look for the optional second argument + if ($v_size == 2) { + $v_remove_path = $v_arg_list[1]; + } + else if ($v_size > 2) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return 0; + } + } + } + + // ----- Trace + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "index='$p_index', path='$v_path', remove_path='$v_remove_path', remove_all_path='".($v_remove_path?'true':'false')."'"); + + // ----- Trick + // Here I want to reuse extractByRule(), so I need to parse the $p_index + // with privParseOptions() + $v_arg_trick = array (PCLZIP_OPT_BY_INDEX, $p_index); + $v_options_trick = array(); + $v_result = $this->privParseOptions($v_arg_trick, sizeof($v_arg_trick), $v_options_trick, + array (PCLZIP_OPT_BY_INDEX => 'optional' )); + if ($v_result != 1) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return 0; + } + $v_options[PCLZIP_OPT_BY_INDEX] = $v_options_trick[PCLZIP_OPT_BY_INDEX]; + + // ----- Call the extracting fct + if (($v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path, $v_remove_all_path, $v_options)) < 1) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo()); + return(0); + } + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_list); + return $p_list; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : + // delete([$p_option, $p_option_value, ...]) + // Description : + // This method removes files from the archive. + // If no parameters are given, then all the archive is emptied. + // Parameters : + // None or optional arguments. + // Options : + // PCLZIP_OPT_BY_INDEX : + // PCLZIP_OPT_BY_NAME : + // PCLZIP_OPT_BY_EREG : + // PCLZIP_OPT_BY_PREG : + // Return Values : + // 0 on failure, + // The list of the files which are still present in the archive. + // (see PclZip::listContent() for list entry format) + // -------------------------------------------------------------------------------- + function delete() + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::delete", ""); + $v_result=1; + + // ----- Reset the error handler + $this->privErrorReset(); + + // ----- Check archive + if (!$this->privCheckFormat()) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return(0); + } + + // ----- Set default values + $v_options = array(); + + // ----- Look for variable options arguments + $v_size = func_num_args(); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method"); + + // ----- Look for arguments + if ($v_size > 0) { + // ----- Get the arguments + $v_arg_list = func_get_args(); + + // ----- Parse the options + $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, + array (PCLZIP_OPT_BY_NAME => 'optional', + PCLZIP_OPT_BY_EREG => 'optional', + PCLZIP_OPT_BY_PREG => 'optional', + PCLZIP_OPT_BY_INDEX => 'optional' )); + if ($v_result != 1) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return 0; + } + } + + // ----- Magic quotes trick + $this->privDisableMagicQuotes(); + + // ----- Call the delete fct + $v_list = array(); + if (($v_result = $this->privDeleteByRule($v_list, $v_options)) != 1) { + $this->privSwapBackMagicQuotes(); + unset($v_list); + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo()); + return(0); + } + + // ----- Magic quotes trick + $this->privSwapBackMagicQuotes(); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_list); + return $v_list; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : deleteByIndex() + // Description : + // ***** Deprecated ***** + // delete(PCLZIP_OPT_BY_INDEX, $p_index) should be prefered. + // -------------------------------------------------------------------------------- + function deleteByIndex($p_index) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::deleteByIndex", "index='$p_index'"); + + $p_list = $this->delete(PCLZIP_OPT_BY_INDEX, $p_index); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_list); + return $p_list; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : properties() + // Description : + // This method gives the properties of the archive. + // The properties are : + // nb : Number of files in the archive + // comment : Comment associated with the archive file + // status : not_exist, ok + // Parameters : + // None + // Return Values : + // 0 on failure, + // An array with the archive properties. + // -------------------------------------------------------------------------------- + function properties() + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::properties", ""); + + // ----- Reset the error handler + $this->privErrorReset(); + + // ----- Magic quotes trick + $this->privDisableMagicQuotes(); + + // ----- Check archive + if (!$this->privCheckFormat()) { + $this->privSwapBackMagicQuotes(); + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return(0); + } + + // ----- Default properties + $v_prop = array(); + $v_prop['comment'] = ''; + $v_prop['nb'] = 0; + $v_prop['status'] = 'not_exist'; + + // ----- Look if file exists + if (@is_file($this->zipname)) + { + // ----- Open the zip file + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); + if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0) + { + $this->privSwapBackMagicQuotes(); + + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode'); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), 0); + return 0; + } + + // ----- Read the central directory informations + $v_central_dir = array(); + if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) + { + $this->privSwapBackMagicQuotes(); + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return 0; + } + + // ----- Close the zip file + $this->privCloseFd(); + + // ----- Set the user attributes + $v_prop['comment'] = $v_central_dir['comment']; + $v_prop['nb'] = $v_central_dir['entries']; + $v_prop['status'] = 'ok'; + } + + // ----- Magic quotes trick + $this->privSwapBackMagicQuotes(); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_prop); + return $v_prop; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : duplicate() + // Description : + // This method creates an archive by copying the content of an other one. If + // the archive already exist, it is replaced by the new one without any warning. + // Parameters : + // $p_archive : The filename of a valid archive, or + // a valid PclZip object. + // Return Values : + // 1 on success. + // 0 or a negative value on error (error code). + // -------------------------------------------------------------------------------- + function duplicate($p_archive) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::duplicate", ""); + $v_result = 1; + + // ----- Reset the error handler + $this->privErrorReset(); + + // ----- Look if the $p_archive is a PclZip object + if ((is_object($p_archive)) && (get_class($p_archive) == 'pclzip')) + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The parameter is valid PclZip object '".$p_archive->zipname."'"); + + // ----- Duplicate the archive + $v_result = $this->privDuplicate($p_archive->zipname); + } + + // ----- Look if the $p_archive is a string (so a filename) + else if (is_string($p_archive)) + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The parameter is a filename '$p_archive'"); + + // ----- Check that $p_archive is a valid zip file + // TBC : Should also check the archive format + if (!is_file($p_archive)) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "No file with filename '".$p_archive."'"); + $v_result = PCLZIP_ERR_MISSING_FILE; + } + else { + // ----- Duplicate the archive + $v_result = $this->privDuplicate($p_archive); + } + } + + // ----- Invalid variable + else + { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_archive_to_add"); + $v_result = PCLZIP_ERR_INVALID_PARAMETER; + } + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : merge() + // Description : + // This method merge the $p_archive_to_add archive at the end of the current + // one ($this). + // If the archive ($this) does not exist, the merge becomes a duplicate. + // If the $p_archive_to_add archive does not exist, the merge is a success. + // Parameters : + // $p_archive_to_add : It can be directly the filename of a valid zip archive, + // or a PclZip object archive. + // Return Values : + // 1 on success, + // 0 or negative values on error (see below). + // -------------------------------------------------------------------------------- + function merge($p_archive_to_add) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::merge", ""); + $v_result = 1; + + // ----- Reset the error handler + $this->privErrorReset(); + + // ----- Check archive + if (!$this->privCheckFormat()) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return(0); + } + + // ----- Look if the $p_archive_to_add is a PclZip object + if ((is_object($p_archive_to_add)) && (get_class($p_archive_to_add) == 'pclzip')) + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The parameter is valid PclZip object"); + + // ----- Merge the archive + $v_result = $this->privMerge($p_archive_to_add); + } + + // ----- Look if the $p_archive_to_add is a string (so a filename) + else if (is_string($p_archive_to_add)) + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The parameter is a filename"); + + // ----- Create a temporary archive + $v_object_archive = new PclZip($p_archive_to_add); + + // ----- Merge the archive + $v_result = $this->privMerge($v_object_archive); + } + + // ----- Invalid variable + else + { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_archive_to_add"); + $v_result = PCLZIP_ERR_INVALID_PARAMETER; + } + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + + + // -------------------------------------------------------------------------------- + // Function : errorCode() + // Description : + // Parameters : + // -------------------------------------------------------------------------------- + function errorCode() + { + if (PCLZIP_ERROR_EXTERNAL == 1) { + return(PclErrorCode()); + } + else { + return($this->error_code); + } + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : errorName() + // Description : + // Parameters : + // -------------------------------------------------------------------------------- + function errorName($p_with_code=false) + { + $v_name = array ( PCLZIP_ERR_NO_ERROR => 'PCLZIP_ERR_NO_ERROR', + PCLZIP_ERR_WRITE_OPEN_FAIL => 'PCLZIP_ERR_WRITE_OPEN_FAIL', + PCLZIP_ERR_READ_OPEN_FAIL => 'PCLZIP_ERR_READ_OPEN_FAIL', + PCLZIP_ERR_INVALID_PARAMETER => 'PCLZIP_ERR_INVALID_PARAMETER', + PCLZIP_ERR_MISSING_FILE => 'PCLZIP_ERR_MISSING_FILE', + PCLZIP_ERR_FILENAME_TOO_LONG => 'PCLZIP_ERR_FILENAME_TOO_LONG', + PCLZIP_ERR_INVALID_ZIP => 'PCLZIP_ERR_INVALID_ZIP', + PCLZIP_ERR_BAD_EXTRACTED_FILE => 'PCLZIP_ERR_BAD_EXTRACTED_FILE', + PCLZIP_ERR_DIR_CREATE_FAIL => 'PCLZIP_ERR_DIR_CREATE_FAIL', + PCLZIP_ERR_BAD_EXTENSION => 'PCLZIP_ERR_BAD_EXTENSION', + PCLZIP_ERR_BAD_FORMAT => 'PCLZIP_ERR_BAD_FORMAT', + PCLZIP_ERR_DELETE_FILE_FAIL => 'PCLZIP_ERR_DELETE_FILE_FAIL', + PCLZIP_ERR_RENAME_FILE_FAIL => 'PCLZIP_ERR_RENAME_FILE_FAIL', + PCLZIP_ERR_BAD_CHECKSUM => 'PCLZIP_ERR_BAD_CHECKSUM', + PCLZIP_ERR_INVALID_ARCHIVE_ZIP => 'PCLZIP_ERR_INVALID_ARCHIVE_ZIP', + PCLZIP_ERR_MISSING_OPTION_VALUE => 'PCLZIP_ERR_MISSING_OPTION_VALUE', + PCLZIP_ERR_INVALID_OPTION_VALUE => 'PCLZIP_ERR_INVALID_OPTION_VALUE', + PCLZIP_ERR_UNSUPPORTED_COMPRESSION => 'PCLZIP_ERR_UNSUPPORTED_COMPRESSION', + PCLZIP_ERR_UNSUPPORTED_ENCRYPTION => 'PCLZIP_ERR_UNSUPPORTED_ENCRYPTION' + ,PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE => 'PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE' + ,PCLZIP_ERR_DIRECTORY_RESTRICTION => 'PCLZIP_ERR_DIRECTORY_RESTRICTION' + ); + + if (isset($v_name[$this->error_code])) { + $v_value = $v_name[$this->error_code]; + } + else { + $v_value = 'NoName'; + } + + if ($p_with_code) { + return($v_value.' ('.$this->error_code.')'); + } + else { + return($v_value); + } + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : errorInfo() + // Description : + // Parameters : + // -------------------------------------------------------------------------------- + function errorInfo($p_full=false) + { + if (PCLZIP_ERROR_EXTERNAL == 1) { + return(PclErrorString()); + } + else { + if ($p_full) { + return($this->errorNam... [truncated message content] |
From: <j6...@us...> - 2006-12-21 13:46:45
|
Revision: 17 http://svn.sourceforge.net/dsaster/?rev=17&view=rev Author: j6cubic Date: 2006-12-21 05:46:40 -0800 (Thu, 21 Dec 2006) Log Message: ----------- main.cpp - Prepared help for later change of API/parameter handling io_php.cpp - Added a new output plugin that exports a character as a serialized PHP array. It's fully functional CMakeLists.txt - Added an option for the PHP output plugin as well as one that enables profiling support, although profiling doesn't seem to work for me (gprof reports a time of 0 ms for everything) Modified Paths: -------------- h422/trunk/CMakeLists.txt h422/trunk/src/io_h42.cpp h422/trunk/src/main.cpp Modified: h422/trunk/CMakeLists.txt =================================================================== --- h422/trunk/CMakeLists.txt 2006-12-17 18:36:34 UTC (rev 16) +++ h422/trunk/CMakeLists.txt 2006-12-21 13:46:40 UTC (rev 17) @@ -80,6 +80,7 @@ PLUGIN (debug "Includes the debug I/O module" ON) PLUGIN (plaintext "Includes the plaintext I/O module" ON) PLUGIN (h42 "Includes the h42 I/O module" ON) +PLUGIN (php "Includes the PHP serialized array output module (NATO)" ON) OPTION (DEBUG "Compiler option -g" @@ -90,8 +91,17 @@ MESSAGE(STATUS "Building with debug information.") ENDIF(DEBUG) +OPTION (PROFILE + "Compiler option -pg" + OFF) +IF (PROFILE) + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pg") + MESSAGE(STATUS "Building with profiling support.") +ENDIF(PROFILE) + # --- Module compilation --- FOREACH(ITEM ${IO_MODULES}) ADD_LIBRARY("io_${ITEM}" "src/io_${ITEM}.cpp") Modified: h422/trunk/src/io_h42.cpp =================================================================== --- h422/trunk/src/io_h42.cpp 2006-12-17 18:36:34 UTC (rev 16) +++ h422/trunk/src/io_h42.cpp 2006-12-21 13:46:40 UTC (rev 17) @@ -62,7 +62,7 @@ s_plugdata* pd = new s_plugdata; pd->name = "h42"; pd->capabilities = CAN_READ; - pd->version = 0; + pd->version = 1; pd->description = "Liest h42-Heldendokumente"; pd->extensions.push_back("h42"); // Just leave these two lines be. The main program relies on them. Modified: h422/trunk/src/main.cpp =================================================================== --- h422/trunk/src/main.cpp 2006-12-17 18:36:34 UTC (rev 16) +++ h422/trunk/src/main.cpp 2006-12-21 13:46:40 UTC (rev 17) @@ -41,7 +41,11 @@ << " aus]\n" << " h422 FILE PLUGIN - liest den Helden aus FILE und " << "schreibt ihn in das\n von PLUGIN " - << "unterstützte Format\n" << endl; + << "unterstützte Format\n" << endl + /*<< " h422 FILE PARAMS1\n PLUGIN PARAMS2 - wie oben, " + << "übergibt aber PARAMS* als Parameter an\n " + << " die Ein- und Ausgabeplugins.\n" + << " (\"\" für keine Parameter)"*/ << endl; cout << "Die Pluginliste hat folgendes Format:\n" << " <Name> v<Version> [<Flags>]: <Beschreibung>\n" << "Dabei gibt es folgende Flags:\n" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <j6...@us...> - 2006-12-17 18:36:36
|
Revision: 16 http://svn.sourceforge.net/dsaster/?rev=16&view=rev Author: j6cubic Date: 2006-12-17 10:36:34 -0800 (Sun, 17 Dec 2006) Log Message: ----------- io_h42 - Whoops, I forgot about Poland-- I mean, about the inventory. Fixed. - Found some minor typos in the comments. Fixed. - Bugs in the comment, language and inventory reading parts caused them to read the wrong number of lines, leading in too few items being read and messing up all further parsing. Fixed. io_plaintext - Added even more debug output test.h42 - Didn't change a thing, but have you noticed what strange stuff that guy has in his pockets? That's because the DSAWiege doesn't clean up after itself, giving new heroes parts of the inventory of heroes created before. Damn, that program sucks... Modified Paths: -------------- h422/trunk/notes/test.h42 h422/trunk/src/io_h42.cpp h422/trunk/src/io_plaintext.cpp Modified: h422/trunk/notes/test.h42 =================================================================== --- h422/trunk/notes/test.h42 2006-12-17 17:51:48 UTC (rev 15) +++ h422/trunk/notes/test.h42 2006-12-17 18:36:34 UTC (rev 16) @@ -369,7 +369,7 @@ 0 0 0 2 10 7 4 7 5 10 5 -7 5 7 5 8 11 8 7 5 1 6 8 6 13 6 4 7 4 10 4 -7 4 7 5 7 11 7 7 4 0 0 0 0 -4 1 +4 2 5 Dolch 1W+1 @@ -402,6 +402,10 @@ 1 1 120 +Unterw\xE4sche aus Biberfell +0 +1 +80 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Standard.rtf 5 5 Modified: h422/trunk/src/io_h42.cpp =================================================================== --- h422/trunk/src/io_h42.cpp 2006-12-17 17:51:48 UTC (rev 15) +++ h422/trunk/src/io_h42.cpp 2006-12-17 18:36:34 UTC (rev 16) @@ -455,7 +455,7 @@ //wfe->wert = inventSomeCrazyLookupFunction(wfe->name); wfe->wert = -1; - // Now that we have the weapon, we check if ther already is an identical + // Now that we have the weapon, we check if there already is an identical // weapon in the hero's possession. If yes, we just icrement that weapon's // count. Otherweise, we add the weapon to the hero @@ -491,7 +491,7 @@ //wfe->wert = inventSomeCrazyLookupFunction(wfe->name); wfe->wert = -1; - // Now that we have the weapon, we check if ther already is an identical + // Now that we have the weapon, we check if there already is an identical // weapon in the hero's possession. If yes, we just icrement that weapon's // count. Otherweise, we add the weapon to the hero @@ -526,8 +526,8 @@ //rstg->wert = inventSomeCrazyLookupFunction(tempstring); rstg->wert = -1; - // Now that we have the armor, we check if ther already is an identical - // armor in the hero's possession. If yes, we just icrement that weapon's + // Now that we have the armor, we check if there already is an identical + // armor in the hero's possession. If yes, we just icrement that item's // count. Otherweise, we add the armor to the hero // This is pretty slow, but I think we can live with that @@ -557,7 +557,7 @@ // Now we read in the comments. Easy enough getline(source, tempstring); - for (int commentLinesToGo = strtoi(buffer); commentLinesToGo > 0; + for (int commentLinesToGo = strtoi(tempstring); commentLinesToGo > 0; commentLinesToGo--) { getline(source, tempstring); @@ -576,49 +576,56 @@ // Languages getline(source, tempstring); - for (int languagesToGo = strtoi(buffer); languagesToGo > 0; languagesToGo--) + for (int languagesToGo = strtoi(tempstring); languagesToGo > 0; languagesToGo--) { bool bOld = false; - getline(source, tempstring); + string name; + getline(source, name); - if ("*" == tempstring.substr(0, 1)) // Old language? + if ("*" == name.substr(0, 1)) // Old language? { - tempstring.erase(0, 1); + name.erase(0, 1); bOld = true; } - held->sprachen[tempstring] = new s_sprache; - s_sprache* spr = held->sprachen[tempstring]; + s_sprache* spr = new s_sprache; spr->alt = bOld; getline(source, tempstring); spr->wert = strtoi(tempstring); + held->sprachen[name] = spr; } // Inventory - /* getline(source, tempstring); - for (int itemsToGo = strtoi(buffer); itemsToGo > 0; itemsToGo--) + for (int itemsToGo = strtoi(tempstring); itemsToGo > 0; itemsToGo--) { - getline(source, tempstring); - - // Items need special treatment as the hero can have more than one item with - // the same name - umap<string, s_item*>::iterator iit = held->inventar.find(tempstring); - s_item* item; - if (held->inventar.end() == iit) // If the item doesn't exist it is created - { - held->inventar[tempstring] = new s_item; - s_item* item = held->inventar[tempstring]; - item->anzahl = 0; - } - else item = (*iit).second; - item->anzahl++; + s_item* item = new s_item; + + getline(source, item->name); + getline(source, tempstring); item->gewicht = strtoi(tempstring); // Insert lookup function that tries to find the item's value based on its // name here 'cause, yep, h42 doesn't care about that //item->wert = inventSomeCrazyLookupFunction(tempstring); item->wert = -1; - - getline(source, tempstring); item->gewicht = strtoi(tempstring); + + // Now that we have the item, we check if there already is an identical + // item in the hero's possession. If yes, we just icrement that item's + // count. Otherweise, we add the item to the hero + + // This is pretty slow, but I think we can live with that + for (vector<s_item*>::iterator iit = held->inventar.begin(); + iit != held->inventar.end(); iit++) + { + if (item->equals(*iit)) + { + (*iit)->anzahl++; + // Warning: GOTO considered harmful!!1111 + goto end_of_item_loop; + } + } + // The item wasn't found and is appended + item->anzahl = 1; + held->inventar.push_back(item); + end_of_item_loop:; } - */ source.close(); return held; Modified: h422/trunk/src/io_plaintext.cpp =================================================================== --- h422/trunk/src/io_plaintext.cpp 2006-12-17 17:51:48 UTC (rev 15) +++ h422/trunk/src/io_plaintext.cpp 2006-12-17 18:36:34 UTC (rev 16) @@ -256,12 +256,43 @@ if (0 < held->ruestungen.size()) { cout << "Rüstungen DEBUG" << endl; - for (vector<s_ruestung*>::iterator rit = held-> ruestungen.begin(); - rit != held-> ruestungen.end(); rit++) + for (vector<s_ruestung*>::iterator rit = held->ruestungen.begin(); + rit != held->ruestungen.end(); rit++) { cout << " " << (*rit)->name; if ((*rit)->anzahl > 1) cout << " x" << (*rit)->anzahl; cout << endl; } } + if (0 < held->kommentare.size()) + { + cout << "Kommentare DEBUG" << endl; + for (vector<string>::iterator kit = held->kommentare.begin(); + kit != held->kommentare.end(); kit++) + { + cout << " " << (*kit) << endl; + } + } + if (0 < held->sprachen.size()) + { + cout << "Sprachen DEBUG" << endl; + for (umap<string, s_sprache*>::iterator sit = held->sprachen.begin(); + sit != held->sprachen.end(); sit++) + { + cout << " " << (*sit).first + << (((*sit).second->alt) ? "* " : " ") + << (*sit).second->wert << endl; + } + } + if (0 < held->inventar.size()) + { + cout << "Inventar DEBUG" << endl; + for (vector<s_item*>::iterator iit = held->inventar.begin(); + iit != held->inventar.end(); iit++) + { + cout << " " << (*iit)->name; + if ((*iit)->anzahl > 1) cout << " x" << (*iit)->anzahl; + cout << endl; + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <j6...@us...> - 2006-12-17 17:51:51
|
Revision: 15 http://svn.sourceforge.net/dsaster/?rev=15&view=rev Author: j6cubic Date: 2006-12-17 09:51:48 -0800 (Sun, 17 Dec 2006) Log Message: ----------- io_h42 - Changed the way umap and vector entries are created; now changes to the umaps and vectors are atomic - Reworked item management. Now it actually works! - Preliminary read support is done commondefs.h - Added an equals() function to s_item and all derived classes. This allows us to easily check two items for equality, making it much easier to write proper inventory management code - Some of the item management rework happened here, to. Specifically, the item stores were changed to vector<type*>s io_plaintext.cpp - Some debug output for the item stores main.cpp - Fixed a minor bug in the plugin detection code. Now we can also detect plugins where the filename consists of nothing but the extension. :A test.h42 - Added a couple weapons to test item management code TODO - Updated the TODO list Our next target is the creation of an output plugin that can be used to create a good-looking printable data sheet. Maybe a generic search-and-replace plugin and one that uses that functionality to create an ODF document? Modified Paths: -------------- h422/trunk/TODO h422/trunk/notes/test.h42 h422/trunk/src/commondefs.h h422/trunk/src/io_h42.cpp h422/trunk/src/io_plaintext.cpp h422/trunk/src/main.cpp Modified: h422/trunk/TODO =================================================================== --- h422/trunk/TODO 2006-12-16 01:32:44 UTC (rev 14) +++ h422/trunk/TODO 2006-12-17 17:51:48 UTC (rev 15) @@ -1,6 +1,5 @@ Neccessary for preliminary NATO release - - read h42 files as far as they're understood and store them in memory - - shouldn't take much longer + DONE - read h42 files as far as they're understood and store them in memory - add a plugin for output into a common format such as PDF or SXW/ODT - stopgap measure: Generic text-replacement output with LaTeX template Modified: h422/trunk/notes/test.h42 =================================================================== --- h422/trunk/notes/test.h42 2006-12-16 01:32:44 UTC (rev 14) +++ h422/trunk/notes/test.h42 2006-12-17 17:51:48 UTC (rev 15) @@ -369,7 +369,7 @@ 0 0 0 2 10 7 4 7 5 10 5 -7 5 7 5 8 11 8 7 5 1 6 8 6 13 6 4 7 4 10 4 -7 4 7 5 7 11 7 7 4 0 0 0 0 -2 1 +4 1 5 Dolch 1W+1 @@ -377,6 +377,20 @@ 20 15 2/1 +5 +Dolch +1W+1 +3 +20 +15 +2/1 +17 +Dolch zum Werfen +1W+1 +3 +20 +15 +2/1 12 Magierstab 1W+2 Modified: h422/trunk/src/commondefs.h =================================================================== --- h422/trunk/src/commondefs.h 2006-12-16 01:32:44 UTC (rev 14) +++ h422/trunk/src/commondefs.h 2006-12-17 17:51:48 UTC (rev 15) @@ -77,13 +77,14 @@ } // AP needed for next level -// Obtained from DSAWiege by hand-crafting a h42 file. We could have more, but +/* // Obtained from DSAWiege by hand-crafting a h42 file. We could have more, but // level 32 is enough for now int nextLevel[33] = { 0, 100, 300, 600, 1000, 1500, 2100, 2800, 3600, 4500, 5500, 6600, 7800, 9100, 10500, 12000, 13600, 15300, 17100, 19000, 21000, 23100, 25300, 27600, 30000, 32500, 35100, 37800, 40600, 43500, 46500, 49600, - 52800}; + 52800};*/ +inline int nextLevel(int level) { return 50 * level * (level + 1); } struct s_talent { @@ -121,12 +122,36 @@ float gewicht; // Uz float wert; // Kreuzer int anzahl; + string name; + string kommentar; // Auf vielfachen Wunsch... + + // Just like the methods Java loves so very much: We compare the s_item + // with another one and see if they're equal. Overwrite this method when + // subclassing s_item. + bool equals(s_item* other) + { + // We don't compare the count as that's not something that defines the + // item + if (this->name == other->name && + this->kommentar == other->kommentar && + this->gewicht == other->gewicht && + this->wert == other->wert) return true; + return false; + } }; struct s_ruestung: public s_item { int rs; int be; + + bool equals(s_ruestung* other) + { + if (s_item::equals(other) && + this->rs == other->rs && + this->be == other->be) return true; + return false; + } }; struct s_nk_waffe: public s_item @@ -136,6 +161,17 @@ int kk_bonus; string w_v; string tp; + + bool equals(s_nk_waffe* other) + { + if (s_item::equals(other) && + this->talent == other->talent && + this->bf == other->bf && + this->kk_bonus == other->kk_bonus && + this->w_v == other->w_v && + this->tp == other->tp) return true; + return false; + } }; struct s_fk_waffe: public s_item @@ -145,6 +181,17 @@ int rw; string entf_mod; string tp; + + bool equals(s_fk_waffe* other) + { + if (s_item::equals(other) && + this->talent == other->talent && + this->bf == other->bf && + this->rw == other->rw && + this->entf_mod == other->entf_mod && + this->tp == other->tp) return true; + return false; + } }; struct s_sprache @@ -251,12 +298,12 @@ umap<string, bool> sonderfertigkeiten; umap<string, s_sprache*> sprachen; - umap<string, s_item*> inventar; + vector<s_item*> inventar; // These list the equipped armors/readable weapons. Stuff in these lists is // not considered part of the inventory! - umap<string, s_nk_waffe*> nk_waffen; - umap<string, s_fk_waffe*> fk_waffen; - umap<string, s_ruestung*> ruestungen; + vector<s_nk_waffe*> nk_waffen; + vector<s_fk_waffe*> fk_waffen; + vector<s_ruestung*> ruestungen; vector<string> kommentare; vector<string> jugend; Modified: h422/trunk/src/io_h42.cpp =================================================================== --- h422/trunk/src/io_h42.cpp 2006-12-16 01:32:44 UTC (rev 14) +++ h422/trunk/src/io_h42.cpp 2006-12-17 17:51:48 UTC (rev 15) @@ -45,8 +45,7 @@ void addTalent(talentgruppe* &tg, string name, Grundwert gw0, Grundwert gw1, Grundwert gw2, int taw, int stps, int stpsue, int fvue) { - (*tg)[name] = new s_talent; - s_talent* talent = (*tg)[name]; + s_talent* talent = new s_talent; talent->gw[0] = gw0; talent->gw[1] = gw1; talent->gw[2] = gw2; @@ -54,6 +53,7 @@ talent->stps = stps; talent->stpsue = stpsue; talent->fvue = fvue; + (*tg)[name] = talent; } // registers the plugin with the main program @@ -146,7 +146,8 @@ ss.str(""); ss.clear(); // reset stringstream ss << tempstring; ss >> buffer; - // TODO: Make this loop better + // TODO: Make this loop better <- rfind(); index=tempstr.rfind("(",string::npos); + //tempstr.substr(0,index) und der andere tempstr.substr(index) while (buffer.substr(0, 1) != "("/* && !(ss.eol())*/) { talentName += ((bFirstPart) ? "" : " ") + buffer; @@ -168,10 +169,7 @@ ss >> buffer; stpsue = strtoi(buffer); ss >> buffer; fvue = strtoi(buffer); - held->kampftalente[talentName] = new s_kampftalent; - // This impreoves performance significantly as the [] operator is extremely - // expensive for umaps, so invoking it over and over is a bad idea - s_kampftalent* ktal = held->kampftalente[talentName]; + s_kampftalent* ktal = new s_kampftalent; ktal->beMod = beMod; ktal->taw = taw; ktal->stps = stps; @@ -180,7 +178,8 @@ // The following values can only be determined later and are thus filled // with dummy values ktal->at = 0; - ktal->pa = 0; + ktal->pa = 0; + held->kampftalente[talentName] = ktal; } // The number of talent groups we still have to parse @@ -340,21 +339,19 @@ ss >> buffer; stps = strtoi(buffer); ss >> buffer; stpsue = strtoi(buffer); ss >> buffer; fvue = strtoi(buffer); - - held->zauber[zauberName] = new s_zauber; - // This impreoves performance significantly as the [] operator is extremely - // expensive for umaps, so invoking it over and over is a bad idea - s_zauber* zbr = held->zauber[zauberName]; + + s_zauber* zbr = new s_zauber; zbr->gebiet = gebiet; zbr->herkunft = herkunft; zbr->taw = taw; zbr->stps = stps; zbr->stpsue = stpsue; zbr->fvue = fvue; + held->zauber[zauberName] = zbr; } - // And another one, this time quite trivial: The list of learnable special - // abilities + // And another one, this time quite trivial: The list of yet-to-be-learned + // special abilities getline(source, tempstring); for (int abilitesToGo = strtoi(tempstring); abilitesToGo > 0; abilitesToGo--) { @@ -414,7 +411,7 @@ ss >> buffer; held->le_ae_stue = strtoi(buffer); ss >> buffer; held->zf2ae_ue = strtoi(buffer); - // This relies on thecombat talent map preserving order + // This relies on the combat talent map preserving order getline(source, tempstring); ss.str(""); ss.clear(); // reset stringstream ss << tempstring; @@ -442,74 +439,112 @@ int type; getline(source, tempstring); type = strtoi(tempstring); - getline(source, tempstring); + ///getline(source, tempstring); if (type < 17) { - // Items need special treatment as the hero can have more than one item - // with the same name - umap<string, s_nk_waffe*>::iterator wit = - held->nk_waffen.find(tempstring); - s_nk_waffe* wfe; - if (held->nk_waffen.end() == wit) // If the item doesn't exist it is - { // created - held->nk_waffen[tempstring] = new s_nk_waffe; - wfe = held->nk_waffen[tempstring]; - wfe->anzahl = 0; - } - else wfe = (*wit).second; - wfe->anzahl++; + s_nk_waffe* wfe = new s_nk_waffe; + getline(source, wfe->name); getline(source, wfe->tp); getline(source, tempstring); wfe->bf = strtoi(tempstring); getline(source, tempstring); wfe->gewicht = strtoi(tempstring); getline(source, tempstring); wfe->kk_bonus = strtoi(tempstring); getline(source, wfe->w_v); + wfe->talent = type; + // Insert lookup function that tries to find the item's value based on its + // name here 'cause, yep, h42 doesn't care about that + //wfe->wert = inventSomeCrazyLookupFunction(wfe->name); + wfe->wert = -1; + + // Now that we have the weapon, we check if ther already is an identical + // weapon in the hero's possession. If yes, we just icrement that weapon's + // count. Otherweise, we add the weapon to the hero + + // This is pretty slow, but I think we can live with that + for (vector<s_nk_waffe*>::iterator wit = held->nk_waffen.begin(); + wit != held->nk_waffen.end(); wit++) + { + if (wfe->equals(*wit)) + { + (*wit)->anzahl++; + // Warning: GOTO considered harmful!!1111 + goto end_of_nkw_loop; + } + } + // The weapon wasn't found and is appended + wfe->anzahl = 1; + held->nk_waffen.push_back(wfe); + end_of_nkw_loop:; } else { - // Items need special treatment as the hero can have more than one item with - // the same name - umap<string, s_fk_waffe*>::iterator wit = - held->fk_waffen.find(tempstring); - s_fk_waffe* wfe; - if (held->fk_waffen.end() == wit) // If the item doesn't exist it is - { // created - held->fk_waffen[tempstring] = new s_fk_waffe; - s_fk_waffe* wfe = held->fk_waffen[tempstring]; - wfe->anzahl = 0; - } - else wfe = (*wit).second; - wfe->anzahl++; + s_fk_waffe* wfe = new s_fk_waffe; + + getline(source, wfe->name); getline(source, wfe->tp); getline(source, tempstring); wfe->bf = strtoi(tempstring); getline(source, tempstring); wfe->gewicht = strtoi(tempstring); getline(source, tempstring); wfe->rw = strtoi(tempstring); getline(source, wfe->entf_mod); + wfe->talent = type; + // Insert lookup function that tries to find the item's value based on its + // name here 'cause, yep, h42 doesn't care about that + //wfe->wert = inventSomeCrazyLookupFunction(wfe->name); + wfe->wert = -1; + + // Now that we have the weapon, we check if ther already is an identical + // weapon in the hero's possession. If yes, we just icrement that weapon's + // count. Otherweise, we add the weapon to the hero + + // This is pretty slow, but I think we can live with that + for (vector<s_fk_waffe*>::iterator wit = held->fk_waffen.begin(); + wit != held->fk_waffen.end(); wit++) + { + if (wfe->equals(*wit)) + { + (*wit)->anzahl++; + // Warning: GOTO considered harmful!!1111 + goto end_of_fkw_loop; + } + } + // The weapon wasn't found and is appended + wfe->anzahl = 1; + held->fk_waffen.push_back(wfe); + end_of_fkw_loop:; } } ss >> buffer; for (int armorsToGo = strtoi(buffer); armorsToGo > 0; armorsToGo--) { - getline(source, tempstring); - - // Items need special treatment as the hero can have more than one item with - // the same name - umap<string, s_ruestung*>::iterator rit = held->ruestungen.find(tempstring); - s_ruestung* rstg; - if (held->ruestungen.end() == rit) // If the item doesn't exist it is - { // created - held->ruestungen[tempstring] = new s_ruestung; - s_ruestung* rstg = held->ruestungen[tempstring]; - rstg->anzahl = 0; - } - else rstg = (*rit).second; - rstg->anzahl++; + s_ruestung* rstg = new s_ruestung; + + getline(source, rstg->name); + getline(source, tempstring); rstg->rs = strtoi(tempstring); + getline(source, tempstring); rstg->be = strtoi(tempstring); + getline(source, tempstring); rstg->gewicht = strtoi(tempstring); // Insert lookup function that tries to find the item's value based on its // name here 'cause, yep, h42 doesn't care about that //rstg->wert = inventSomeCrazyLookupFunction(tempstring); rstg->wert = -1; - getline(source, tempstring); rstg->rs = strtoi(tempstring); - getline(source, tempstring); rstg->be = strtoi(tempstring); - getline(source, tempstring); rstg->gewicht = strtoi(tempstring); + + // Now that we have the armor, we check if ther already is an identical + // armor in the hero's possession. If yes, we just icrement that weapon's + // count. Otherweise, we add the armor to the hero + + // This is pretty slow, but I think we can live with that + for (vector<s_ruestung*>::iterator rit = held->ruestungen.begin(); + rit != held->ruestungen.end(); rit++) + { + if (rstg->equals(*rit)) + { + (*rit)->anzahl++; + // Warning: GOTO considered harmful!!1111 + goto end_of_rstg_loop; + } + } + // The armor wasn't found and is appended + rstg->anzahl = 1; + held->ruestungen.push_back(rstg); + end_of_rstg_loop:; } // A list of combat talents to be printed. DSAW-specific, ignored for now @@ -558,6 +593,7 @@ } // Inventory + /* getline(source, tempstring); for (int itemsToGo = strtoi(buffer); itemsToGo > 0; itemsToGo--) { @@ -582,6 +618,7 @@ getline(source, tempstring); item->gewicht = strtoi(tempstring); } + */ source.close(); return held; Modified: h422/trunk/src/io_plaintext.cpp =================================================================== --- h422/trunk/src/io_plaintext.cpp 2006-12-16 01:32:44 UTC (rev 14) +++ h422/trunk/src/io_plaintext.cpp 2006-12-17 17:51:48 UTC (rev 15) @@ -132,7 +132,7 @@ held->ff, held->ff_gw, held->gg, held->gg_gw, held->stufe); printf("KK: %2d/%2d JZ: %2d/%2d AP: %5d/%5d\n\n", held->kk, held->kk_gw, held->jz, held->jz_gw, - held->ap, nextLevel[held->stufe]); + held->ap, nextLevel(held->stufe)); cout << "Steigerungen übrig:" << endl << " Talente: " << held->talent_stue @@ -229,4 +229,39 @@ << endl; } } + cout << endl; + + if (0 < held->nk_waffen.size()) + { + cout << "Nahkampfwaffen DEBUG" << endl; + for (vector<s_nk_waffe*>::iterator nwit = held->nk_waffen.begin(); + nwit != held->nk_waffen.end(); nwit++) + { + cout << " " << (*nwit)->name; + if ((*nwit)->anzahl > 1) cout << " x" << (*nwit)->anzahl; + cout << endl; + } + } + if (0 < held->fk_waffen.size()) + { + cout << "Fernkampfwaffen DEBUG" << endl; + for (vector<s_fk_waffe*>::iterator fwit = held->fk_waffen.begin(); + fwit != held->fk_waffen.end(); fwit++) + { + cout << " " << (*fwit)->name; + if ((*fwit)->anzahl > 1) cout << " x" << (*fwit)->anzahl; + cout << endl; + } + } + if (0 < held->ruestungen.size()) + { + cout << "Rüstungen DEBUG" << endl; + for (vector<s_ruestung*>::iterator rit = held-> ruestungen.begin(); + rit != held-> ruestungen.end(); rit++) + { + cout << " " << (*rit)->name; + if ((*rit)->anzahl > 1) cout << " x" << (*rit)->anzahl; + cout << endl; + } + } } Modified: h422/trunk/src/main.cpp =================================================================== --- h422/trunk/src/main.cpp 2006-12-16 01:32:44 UTC (rev 14) +++ h422/trunk/src/main.cpp 2006-12-17 17:51:48 UTC (rev 15) @@ -24,7 +24,7 @@ int slen = strlen(str); int elen = strlen(end); - if(slen > elen && !strcmp((str + slen - elen), end)) + if(slen >= elen && !strcmp((str + slen - elen), end)) return true; else return false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <j6...@us...> - 2006-12-16 01:32:49
|
Revision: 14 http://svn.sourceforge.net/dsaster/?rev=14&view=rev Author: j6cubic Date: 2006-12-15 17:32:44 -0800 (Fri, 15 Dec 2006) Log Message: ----------- - Added TODO file detailing some work still to be done - Added to the h42 plugin; it's almost done now. NOTE: It currently doesn't work. Wait for the next revision if you want to do anything with it. - Fixed an error in umap.h: find() was declared private, should be public Modified Paths: -------------- h422/trunk/src/commondefs.h h422/trunk/src/io_h42.cpp h422/trunk/src/io_plaintext.cpp h422/trunk/src/umap.h Added Paths: ----------- h422/trunk/TODO Added: h422/trunk/TODO =================================================================== --- h422/trunk/TODO (rev 0) +++ h422/trunk/TODO 2006-12-16 01:32:44 UTC (rev 14) @@ -0,0 +1,34 @@ +Neccessary for preliminary NATO release + - read h42 files as far as they're understood and store them in memory + - shouldn't take much longer + + - add a plugin for output into a common format such as PDF or SXW/ODT + - stopgap measure: Generic text-replacement output with LaTeX template + + +Necessary for full release + - better h42 read support? + - find out what the unknown values do? + + - development of own data format + - write support for that + + - better plugin handling, ability to pass options to plugins + - optparse? + + +Nice to have + - output that works on all platforms, not the hodgepodge of UTF-8 and latin-1 + we have now + - problem: Some systems are fully unicoded and some aren't; UTF'd terminals + can't understand latin-1 and vice versa + + - h42 write support + - problem: How to handle data not supported by h42? + - maybe ignore the problam and add support for loading two hero files and + merging them (ie. using an h42 file as a patch to a different file)? + (This is to facilitate hero levelups until DSAster is done.) + + +Nice to have but not quite probable + - Read support for our own PDF format, if we have one \ No newline at end of file Modified: h422/trunk/src/commondefs.h =================================================================== --- h422/trunk/src/commondefs.h 2006-12-12 15:40:10 UTC (rev 13) +++ h422/trunk/src/commondefs.h 2006-12-16 01:32:44 UTC (rev 14) @@ -76,7 +76,7 @@ return ATTR_INVALID; // ungültiger String } -// AP needed to next level +// AP needed for next level // Obtained from DSAWiege by hand-crafting a h42 file. We could have more, but // level 32 is enough for now int nextLevel[33] = { 0, 100, 300, 600, 1000, 1500, 2100, 2800, @@ -101,8 +101,8 @@ int stps; // Steigerungen/Stufe int stpsue; // STPS übrig int fvue; // Fehlversuche übrig - int at; // Attacke ohne BE - int pa; // Parade ohne BE + int at; // Attacke ohne BE + int pa; // Parade ohne BE }; struct s_zauber @@ -114,7 +114,44 @@ int stps; // Steigerungen/Stufe int stpsue; // STPS übrig int fvue; // Fehlversuche übrig +}; + +struct s_item +{ + float gewicht; // Uz + float wert; // Kreuzer + int anzahl; }; + +struct s_ruestung: public s_item +{ + int rs; + int be; +}; + +struct s_nk_waffe: public s_item +{ + int talent; + int bf; + int kk_bonus; + string w_v; + string tp; +}; + +struct s_fk_waffe: public s_item +{ + int talent; + int bf; + int rw; + string entf_mod; + string tp; +}; + +struct s_sprache +{ + int wert; + bool alt; +}; //typedef map<string, s_kampftalent*> kampftalentgruppe; //typedef map<string, s_talent*> talentgruppe; @@ -141,7 +178,7 @@ int ap; int stufe; int le; - int ae; + int ae; int ke; int le_gw; int ae_gw; @@ -180,8 +217,9 @@ int gg_gw; int jz_gw; - int be_minus; - int mr; + int be_minus; + // automatisch berechnet: ((MU + IN + Stufe) / 3 - (AG * 2)) + MR-Bonus + //int mr; int mr_bonus; int gs; string le_plus_ps; @@ -192,7 +230,11 @@ int ritual_stps; int ritual_stue; int talent_stue; - int zf_stue; + int zf_stue; + int gw_stue; + int ngw_stue; + int le_ae_stue; + int zf2ae_ue; bool le_ae_separat; bool magiertyp; @@ -200,14 +242,26 @@ bool ist_mann; - kampftalentgruppe kampftalente; - //map<string, talentgruppe*> talente; - umap<string, talentgruppe*> talente; - umap<string, s_zauber*> zauber; + kampftalentgruppe kampftalente; + + umap<string, talentgruppe*> talente; + umap<string, s_zauber*> zauber; // All we store about these is the name and information on whether the ability // is already learned or not. An umap<string, bool> should suffice - umap<string, bool> sonderfertigkeiten; - + umap<string, bool> sonderfertigkeiten; + umap<string, s_sprache*> sprachen; + + umap<string, s_item*> inventar; + // These list the equipped armors/readable weapons. Stuff in these lists is + // not considered part of the inventory! + umap<string, s_nk_waffe*> nk_waffen; + umap<string, s_fk_waffe*> fk_waffen; + umap<string, s_ruestung*> ruestungen; + + vector<string> kommentare; + vector<string> jugend; + + // DSA3.5-specific stuff string abenteuer; }; Modified: h422/trunk/src/io_h42.cpp =================================================================== --- h422/trunk/src/io_h42.cpp 2006-12-12 15:40:10 UTC (rev 13) +++ h422/trunk/src/io_h42.cpp 2006-12-16 01:32:44 UTC (rev 14) @@ -404,7 +404,184 @@ getline(source, held->titel); getline(source, held->geburtsort); getline(source, tempstring); held->ap = strtoi(tempstring); - getline(source, tempstring); held->stufe = strtoi(tempstring); + getline(source, tempstring); held->stufe = strtoi(tempstring); + + getline(source, tempstring); + ss.str(""); ss.clear(); // reset stringstream + ss << tempstring; + ss >> buffer; held->gw_stue = strtoi(buffer); + ss >> buffer; held->ngw_stue = strtoi(buffer); + ss >> buffer; held->le_ae_stue = strtoi(buffer); + ss >> buffer; held->zf2ae_ue = strtoi(buffer); + + // This relies on thecombat talent map preserving order + getline(source, tempstring); + ss.str(""); ss.clear(); // reset stringstream + ss << tempstring; + for (kampftalentgruppe::iterator ktit = held->kampftalente.begin(); + ktit != held->kampftalente.end(); ktit++) + { + ss >> buffer; (*ktit).second->at = strtoi(buffer); + } + + getline(source, tempstring); + ss.str(""); ss.clear(); // reset stringstream + ss << tempstring; + for (kampftalentgruppe::iterator ktit = held->kampftalente.begin(); + ktit != held->kampftalente.end(); ktit++) + { + ss >> buffer; (*ktit).second->pa = strtoi(buffer); + } + + getline(source, tempstring); + ss.str(""); ss.clear(); // reset stringstream + ss << tempstring; + ss >> buffer; + for (int weaponsToGo = strtoi(buffer); weaponsToGo > 0; weaponsToGo--) + { + int type; + + getline(source, tempstring); type = strtoi(tempstring); + getline(source, tempstring); + if (type < 17) + { + // Items need special treatment as the hero can have more than one item + // with the same name + umap<string, s_nk_waffe*>::iterator wit = + held->nk_waffen.find(tempstring); + s_nk_waffe* wfe; + if (held->nk_waffen.end() == wit) // If the item doesn't exist it is + { // created + held->nk_waffen[tempstring] = new s_nk_waffe; + wfe = held->nk_waffen[tempstring]; + wfe->anzahl = 0; + } + else wfe = (*wit).second; + wfe->anzahl++; + getline(source, wfe->tp); + getline(source, tempstring); wfe->bf = strtoi(tempstring); + getline(source, tempstring); wfe->gewicht = strtoi(tempstring); + getline(source, tempstring); wfe->kk_bonus = strtoi(tempstring); + getline(source, wfe->w_v); + } + else + { + // Items need special treatment as the hero can have more than one item with + // the same name + umap<string, s_fk_waffe*>::iterator wit = + held->fk_waffen.find(tempstring); + s_fk_waffe* wfe; + if (held->fk_waffen.end() == wit) // If the item doesn't exist it is + { // created + held->fk_waffen[tempstring] = new s_fk_waffe; + s_fk_waffe* wfe = held->fk_waffen[tempstring]; + wfe->anzahl = 0; + } + else wfe = (*wit).second; + wfe->anzahl++; + getline(source, wfe->tp); + getline(source, tempstring); wfe->bf = strtoi(tempstring); + getline(source, tempstring); wfe->gewicht = strtoi(tempstring); + getline(source, tempstring); wfe->rw = strtoi(tempstring); + getline(source, wfe->entf_mod); + } + } + ss >> buffer; + for (int armorsToGo = strtoi(buffer); armorsToGo > 0; armorsToGo--) + { + getline(source, tempstring); + + // Items need special treatment as the hero can have more than one item with + // the same name + umap<string, s_ruestung*>::iterator rit = held->ruestungen.find(tempstring); + s_ruestung* rstg; + if (held->ruestungen.end() == rit) // If the item doesn't exist it is + { // created + held->ruestungen[tempstring] = new s_ruestung; + s_ruestung* rstg = held->ruestungen[tempstring]; + rstg->anzahl = 0; + } + else rstg = (*rit).second; + rstg->anzahl++; + // Insert lookup function that tries to find the item's value based on its + // name here 'cause, yep, h42 doesn't care about that + //rstg->wert = inventSomeCrazyLookupFunction(tempstring); + rstg->wert = -1; + getline(source, tempstring); rstg->rs = strtoi(tempstring); + getline(source, tempstring); rstg->be = strtoi(tempstring); + getline(source, tempstring); rstg->gewicht = strtoi(tempstring); + } + + // A list of combat talents to be printed. DSAW-specific, ignored for now + getline(source, tempstring); + // Which RTF template to use. DSAW-specific, ignored for now + getline(source, tempstring); + + // Unknown Values 2 and 3. TODO: We really should find out what these do + getline(source, tempstring); + + // Now we read in the comments. Easy enough + getline(source, tempstring); + for (int commentLinesToGo = strtoi(buffer); commentLinesToGo > 0; + commentLinesToGo--) + { + getline(source, tempstring); + held->kommentare.push_back(tempstring); + } + /* TBD + // Zing! BONUS! We also check if a file with the hero's background is present + // and import that as well + if (file_exists(youthfilename)) + { + ifstream youthsource ("Jugend de(s|r) ".filename-ext.".txt"); + ...bla... + youthsource.close(); + } + */ + + // Languages + getline(source, tempstring); + for (int languagesToGo = strtoi(buffer); languagesToGo > 0; languagesToGo--) + { + bool bOld = false; + getline(source, tempstring); + + if ("*" == tempstring.substr(0, 1)) // Old language? + { + tempstring.erase(0, 1); + bOld = true; + } + held->sprachen[tempstring] = new s_sprache; + s_sprache* spr = held->sprachen[tempstring]; + spr->alt = bOld; + getline(source, tempstring); spr->wert = strtoi(tempstring); + } + + // Inventory + getline(source, tempstring); + for (int itemsToGo = strtoi(buffer); itemsToGo > 0; itemsToGo--) + { + getline(source, tempstring); + + // Items need special treatment as the hero can have more than one item with + // the same name + umap<string, s_item*>::iterator iit = held->inventar.find(tempstring); + s_item* item; + if (held->inventar.end() == iit) // If the item doesn't exist it is created + { + held->inventar[tempstring] = new s_item; + s_item* item = held->inventar[tempstring]; + item->anzahl = 0; + } + else item = (*iit).second; + item->anzahl++; + // Insert lookup function that tries to find the item's value based on its + // name here 'cause, yep, h42 doesn't care about that + //item->wert = inventSomeCrazyLookupFunction(tempstring); + item->wert = -1; + + getline(source, tempstring); item->gewicht = strtoi(tempstring); + } source.close(); return held; Modified: h422/trunk/src/io_plaintext.cpp =================================================================== --- h422/trunk/src/io_plaintext.cpp 2006-12-12 15:40:10 UTC (rev 13) +++ h422/trunk/src/io_plaintext.cpp 2006-12-16 01:32:44 UTC (rev 14) @@ -126,19 +126,23 @@ held->ch, held->ch_gw, held->ta, held->ta_gw, held->au, held->au_gw); printf("GE: %2d/%2d NG: %2d/%2d MR: %d (%d)\n", held->ge, held->ge_gw, held->ng, held->ng_gw, - held->mr, held->mr_bonus); + ((held->mu + held->in + held->stufe) / 3 - (held->ag * 2)) + + held->mr_bonus, held->mr_bonus); printf("FF: %2d/%2d GG: %2d/%2d Stufe: %d\n", held->ff, held->ff_gw, held->gg, held->gg_gw, held->stufe); printf("KK: %2d/%2d JZ: %2d/%2d AP: %5d/%5d\n\n", held->kk, held->kk_gw, held->jz, held->jz_gw, held->ap, nextLevel[held->stufe]); - cout << "Steigerungen übrig: Talente: " << held->talent_stue - << ((held->magiertyp) ? " ZF: " + itostr(held->zf_stue) : "") - //<< ((held->magiertyp) ? held->zf_stue : "") - << ((held->hat_rituale) ? " Rituale: " + itostr(held->ritual_stue) : "") + cout << "Steigerungen übrig:" << endl + << " Talente: " << held->talent_stue + << " LE" << ((held->magiertyp) ? "/AE" : "") << ": " << held->le_ae_stue + << endl; + if (held->magiertyp) cout << " ZF: " << held->zf_stue; + if (held->hat_rituale) cout << " Rituale: " << held->ritual_stue; + if (held->magiertyp || held->hat_rituale) cout << endl; //<< ((held->hat_rituale) ? held->ritual_stue : "") - << endl; + //<< endl; cout << "\nTalente" << endl; @@ -160,7 +164,8 @@ (*ktit).second->fvue); // TODO: Calculate AT and PA with and without encumbrance malus. Not done // yet because parts neccessary for that aren't yet in s_held - printf(" o. BE [AT: 99 PA: 99] m. BE[AT: 99 PA: 99]\n"); + printf(" o. BE [AT:%3d PA:%3d] m. BE[AT: 99 PA: 99]\n", + (*ktit).second->at, (*ktit).second->pa); } /* Modified: h422/trunk/src/umap.h =================================================================== --- h422/trunk/src/umap.h 2006-12-12 15:40:10 UTC (rev 13) +++ h422/trunk/src/umap.h 2006-12-16 01:32:44 UTC (rev 14) @@ -17,7 +17,8 @@ typedef typename umap<K, V>::iterator iterator_type; // The _ was appended because MSVC treats 'super' as a keyword typedef vector<value_type> super_; - + + public: iterator_type find(const key_type& k) { iterator_type it = this->begin(); @@ -30,7 +31,6 @@ return it; } - public: // Appends a pair bool push_back(const value_type& x) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <j6...@us...> - 2006-12-12 15:40:13
|
Revision: 13 http://svn.sourceforge.net/dsaster/?rev=13&view=rev Author: j6cubic Date: 2006-12-12 07:40:10 -0800 (Tue, 12 Dec 2006) Log Message: ----------- - Changed ATTR_INVALID_GW to ATTR_INVALID - ATTR_INVALID_GW would tell us that it's an attribute twice - Changed definitions of month and attribute types so that the invalid values come first, thus if a variable is default-initialized to zero we get an error value and not MU/Praios - Added an int-to-Monat conversion - Further expanded the h42 plugin; we now cover about 50% (of h42.format-r2)/80% (of test.h42) - Tweaked the h42 test file to include unlearned special abilities - Added a lookup table for AP-to-next-level, covering levels 0 to 32 ("Level" 0 was added as a dummy entry to make lookups easier) - Gave the beginning of the plaintext module's output a bit of a new look Modified Paths: -------------- h422/trunk/notes/h42.format-r2 h422/trunk/notes/test.h42 h422/trunk/src/commondefs.h h422/trunk/src/io_h42.cpp h422/trunk/src/io_plaintext.cpp Modified: h422/trunk/notes/h42.format-r2 =================================================================== --- h422/trunk/notes/h42.format-r2 2006-12-09 04:57:06 UTC (rev 12) +++ h422/trunk/notes/h42.format-r2 2006-12-12 15:40:10 UTC (rev 13) @@ -40,7 +40,7 @@ Gewicht Geburtstag Geburtsmonat Geburtsjahr Alter -Anzahl der Sonderfertigkeiten +Anzahl der erlernten Sonderfertigkeiten [Für jede Sonderfertigkeit] Name der Sonderfertigkeit Bool: Ist männlich Modified: h422/trunk/notes/test.h42 =================================================================== --- h422/trunk/notes/test.h42 2006-12-09 04:57:06 UTC (rev 12) +++ h422/trunk/notes/test.h42 2006-12-12 15:40:10 UTC (rev 13) @@ -334,7 +334,10 @@ firnelfisch Verw. Unbel. 4 3 0 0 -0 +3 +3. Kugelzauber +4. Kugelzauber +5. Kugelzauber FALSE 0 Genrick DeFoulde II. @@ -345,7 +348,7 @@ 77 9 1 10 19 -12 +9 1. Stabzauber 2. Stabzauber 3. Stabzauber @@ -355,9 +358,6 @@ 7. Stabzauber 1. Kugelzauber 2. Kugelzauber -3. Kugelzauber -4. Kugelzauber -5. Kugelzauber TRUE 0 0 -10 Modified: h422/trunk/src/commondefs.h =================================================================== --- h422/trunk/src/commondefs.h 2006-12-09 04:57:06 UTC (rev 12) +++ h422/trunk/src/commondefs.h 2006-12-12 15:40:10 UTC (rev 13) @@ -37,14 +37,15 @@ typedef int capabs; -enum Monat {Namenloser, Praios, Rondra, Efferd, Travia, Boron, Hesinde, Firun, - Tsa, Phex, Peraine, Ingerimm, Rahja, INVALID_MONTH}; -string montostr[14] = {"Namenloser", "Praios", "Rondra", "Efferd", "Travia", +enum Monat {INVALID_MONTH, Praios, Rondra, Efferd, Travia, Boron, Hesinde, Firun, + Tsa, Phex, Peraine, Ingerimm, Rahja, Namenloser}; +string montostr[14] = {"??", "Praios", "Rondra", "Efferd", "Travia", "Boron", "Hesinde", "Firun", "Tsa", "Phex", "Peraine", - "Ingerimm", "Rahja", "??"}; + "Ingerimm", "Rahja", "Namenloser"}; +Monat itomon[14] = {INVALID_MONTH, Praios, Rondra, Efferd, Travia, Boron, Hesinde, + Firun, Tsa, Phex, Peraine, Ingerimm, Rahja, Namenloser}; Monat strtomon(string str) { - if ("Namenloser" == str) return Namenloser; if ("Praios" == str) return Praios; if ("Rondra" == str) return Rondra; if ("Efferd" == str) return Efferd; @@ -52,16 +53,17 @@ if ("Boron" == str) return Boron; if ("Hesinde" == str) return Hesinde; if ("Firun" == str) return Firun; - if ("Tsa" == str) return Tsa; + if ("Tsa" == str) return Tsa; if ("Phex" == str) return Phex; if ("Peraine" == str) return Peraine; if ("Ingerimm" == str) return Ingerimm; if ("Rahja" == str) return Rahja; + if ("Namenloser" == str) return Namenloser; return INVALID_MONTH; // ungültiger String } -enum Grundwert {ATTR_MU, ATTR_KL, ATTR_IN, ATTR_CH, ATTR_GE, ATTR_FF, ATTR_KK, ATTR_INVALID_GW}; -string gwtostr[8] = {"MU", "KL", "IN", "CH", "GE", "FF", "KK", "??"}; +enum Grundwert {ATTR_INVALID, ATTR_MU, ATTR_KL, ATTR_IN, ATTR_CH, ATTR_GE, ATTR_FF, ATTR_KK}; +string gwtostr[8] = {"??", "MU", "KL", "IN", "CH", "GE", "FF", "KK"}; Grundwert strtogw(string str) { if ("MU" == str) return ATTR_MU; @@ -71,39 +73,47 @@ if ("GE" == str) return ATTR_GE; if ("FF" == str) return ATTR_FF; if ("KK" == str) return ATTR_KK; - return ATTR_INVALID_GW; // ungültiger String + return ATTR_INVALID; // ungültiger String } + +// AP needed to next level +// Obtained from DSAWiege by hand-crafting a h42 file. We could have more, but +// level 32 is enough for now +int nextLevel[33] = { 0, 100, 300, 600, 1000, 1500, 2100, 2800, + 3600, 4500, 5500, 6600, 7800, 9100, 10500, 12000, + 13600, 15300, 17100, 19000, 21000, 23100, 25300, 27600, + 30000, 32500, 35100, 37800, 40600, 43500, 46500, 49600, + 52800}; - struct s_talent { - Grundwert gw[3]; - int taw; - int stps; // Steigerungen/Stufe - int stpsue; // STPS übrig - int fvue; // Fehlversuche übrig + Grundwert gw[3]; + int taw; + int stps; // Steigerungen/Stufe + int stpsue; // STPS übrig + int fvue; // Fehlversuche übrig }; struct s_kampftalent { - int beMod; // BE-Modifikator. 0 = (BE) - int taw; - int stps; // Steigerungen/Stufe - int stpsue; // STPS übrig - int fvue; // Fehlversuche übrig - int at; // Attacke ohne BE - int pa; // Parade ohne BE + int beMod; // BE-Modifikator. 0 = (BE) + int taw; + int stps; // Steigerungen/Stufe + int stpsue; // STPS übrig + int fvue; // Fehlversuche übrig + int at; // Attacke ohne BE + int pa; // Parade ohne BE }; struct s_zauber { - Grundwert gw[3]; - string herkunft; - string gebiet; - int taw; - int stps; // Steigerungen/Stufe - int stpsue; // STPS übrig - int fvue; // Fehlversuche übrig + Grundwert gw[3]; + string herkunft; + string gebiet; + int taw; + int stps; // Steigerungen/Stufe + int stpsue; // STPS übrig + int fvue; // Fehlversuche übrig }; //typedef map<string, s_kampftalent*> kampftalentgruppe; @@ -135,7 +145,9 @@ int ke; int le_gw; int ae_gw; - int ke_gw; + int ke_gw; + int au; // Ausdauer + int au_gw; // Aktuelle Werte int mu; @@ -177,11 +189,15 @@ int zf_stps; int talent_stps; int taw_zf_vs; - int ritual_stps; + int ritual_stps; + int ritual_stue; + int talent_stue; + int zf_stue; bool le_ae_separat; bool magiertyp; - bool hat_rituale; + bool hat_rituale; + bool ist_mann; kampftalentgruppe kampftalente; Modified: h422/trunk/src/io_h42.cpp =================================================================== --- h422/trunk/src/io_h42.cpp 2006-12-09 04:57:06 UTC (rev 12) +++ h422/trunk/src/io_h42.cpp 2006-12-12 15:40:10 UTC (rev 13) @@ -242,7 +242,7 @@ gw1 = strtogw(buffer.substr(4, 2)); gw2 = strtogw(buffer.substr(7, 2)); - if (ATTR_INVALID_GW == gw0 || ATTR_INVALID_GW == gw1 || ATTR_INVALID_GW == gw2) + if (ATTR_INVALID == gw0 || ATTR_INVALID == gw1 || ATTR_INVALID == gw2) { cout << "Datei kann nicht gelesen werden: Ungültiger Talentname " << "in Zeile " << lineno << endl; @@ -316,7 +316,7 @@ gw1 = strtogw(buffer.substr(4, 2)); gw2 = strtogw(buffer.substr(7, 2)); - if (ATTR_INVALID_GW == gw0 || ATTR_INVALID_GW == gw1 || ATTR_INVALID_GW == gw2) + if (ATTR_INVALID == gw0 || ATTR_INVALID == gw1 || ATTR_INVALID == gw2) { cout << "Datei kann nicht gelesen werden: Ungültiger Zaubername " << "in Zeile " << lineno << endl; @@ -371,8 +371,41 @@ getline(source, held->haarfarbe); getline(source, held->stand); getline(source, tempstring); held->groesse = strtoi(tempstring); - getline(source, tempstring); held->gewicht = strtoi(tempstring); + getline(source, tempstring); held->gewicht = strtoi(tempstring); + + getline(source, tempstring); + ss.str(""); ss.clear(); // reset stringstream + ss << tempstring; + ss >> buffer; held->geburtstag = strtoi(buffer); + ss >> buffer; held->geburtsmonat = itomon[strtoi(buffer)]; + ss >> buffer; held->geburtsjahr = strtoi(buffer); + getline(source, tempstring); held->alter = strtoi(tempstring); + + // Now we fill in which special abilities have been learned + getline(source, tempstring); + for (int abilitesToGo = strtoi(tempstring); abilitesToGo > 0; abilitesToGo--) + { + getline(source, tempstring); + held->sonderfertigkeiten[tempstring] = true; + } + + getline(source, tempstring); held->ist_mann = strtobool(tempstring); + + getline(source, tempstring); + ss.str(""); ss.clear(); // reset stringstream + ss << tempstring; + ss >> buffer; held->ritual_stue = strtoi(buffer); + ss >> buffer; held->talent_stue = strtoi(buffer); + ss >> buffer; held->zf_stue = strtoi(buffer); + + getline(source, held->gottheit); + getline(source, held->augenfarbe); + getline(source, held->titel); + getline(source, held->geburtsort); + getline(source, tempstring); held->ap = strtoi(tempstring); + getline(source, tempstring); held->stufe = strtoi(tempstring); + source.close(); return held; } Modified: h422/trunk/src/io_plaintext.cpp =================================================================== --- h422/trunk/src/io_plaintext.cpp 2006-12-09 04:57:06 UTC (rev 12) +++ h422/trunk/src/io_plaintext.cpp 2006-12-12 15:40:10 UTC (rev 13) @@ -73,6 +73,8 @@ // TODO: Improve this. Currently it doesn't enforce the maximum line width int maxStrlen[2]; + maxStrlen[0] = 8; // strlen("männlich"), bzw. strlen("weiblich") + if (held->name.size() > maxStrlen[0]) maxStrlen[0] = held->name.size(); if (held->gottheit.size() > maxStrlen[0]) maxStrlen[0] = held->gottheit.size(); @@ -90,31 +92,23 @@ cout << " DSA-Heldendokument\n" << "================================================================" - << "================" << endl; - cout << " Name: " << printIndented(held->name, maxStrlen[0]) + << "================" << endl + << " Name: " << printIndented(held->name, maxStrlen[0]) << " Klasse: " << printIndented(held->klasse, maxStrlen[1]) << endl - << " Gottheit: " << printIndented(held->gottheit, maxStrlen[0]) + << " Gottheit: " << printIndented(held->gottheit, maxStrlen[0]) << " Titel: " << printIndented(held->titel, maxStrlen[1]) << endl - << " Stand: " << printIndented(held->stand, maxStrlen[0]) + << " Stand: " << printIndented(held->stand, maxStrlen[0]) << " Geburtsort: " << printIndented(held->geburtsort, maxStrlen[1]) << endl - << "Haarfarbe: " << printIndented(held->haarfarbe, maxStrlen[0]) + << " Haarfarbe: " << printIndented(held->haarfarbe, maxStrlen[0]) << " Augenfarbe: " << printIndented(held->augenfarbe, maxStrlen[1]) - << endl; + << endl + << "Geschlecht: " + << printIndented((held->ist_mann) ? "männlich" : "weiblich", + maxStrlen[0]) << endl; if ("" != held->abenteuer) cout << "Abenteuer: " << printIndented(held->abenteuer, 69) << endl; -/*printf("%d: %s\n", held->name.size(), held->name.c_str()); -printf("%d: %s\n", held->klasse.size(), held->klasse.c_str()); -printf("%d: %s\n", held->gottheit.size(), held->gottheit.c_str()); -printf("%d: %s\n", held->titel.size(), held->titel.c_str()); -printf("%d: %s\n", held->stand.size(), held->stand.c_str()); -printf("%d: %s\n", held->geburtsort.size(), held->geburtsort.c_str()); -printf("%d: %s\n", held->haarfarbe.size(), held->haarfarbe.c_str()); -printf("%d: %s\n", held->augenfarbe.size(), held->augenfarbe.c_str()); -printf("%d: %s\n", held->abenteuer.size(), held->abenteuer.c_str()); - exit(222);*/ - printf ("geboren am %d. %s %d %s\n\n", held->geburtstag, ((held->geburtsmonat != Namenloser) ? montostr[held->geburtsmonat].c_str() @@ -122,21 +116,30 @@ abs(held->geburtsjahr), (0 >= held->geburtsjahr) ? "n. Hal" : "v. Hal"); - printf("MU: %2d/%2d AG: %2d/%2d\nKL: %2d/%2d HA: %2d/%2d\n", - held->mu, held->mu_gw, held->ag, held->ag_gw, held->kl, held->kl_gw, - held->ha, held->ha_gw); - printf("IN: %2d/%2d RA: %2d/%2d\nCH: %2d/%2d TA: %2d/%2d\n", - held->in, held->in_gw, held->ra, held->ra_gw, held->ch, held->ch_gw, - held->ta, held->ta_gw); - printf("GE: %2d/%2d NG: %2d/%2d\nFF: %2d/%2d GG: %2d/%2d\n", - held->ge, held->ge_gw, held->ng, held->ng_gw, held->ff, held->ff_gw, - held->gg, held->gg_gw); - printf("KK: %2d/%2d JZ: %2d/%2d\n\n", - held->kk, held->kk_gw, held->jz, held->jz_gw); - - printf("LE: %3d/%3d AE: %3d/%3d KE: %3d/%3d\n", held->le, held->le_gw, - held->ae, held->ae_gw, held->ke, held->ke_gw); - + printf("MU: %2d/%2d AG: %2d/%2d LE: %3d/ %3d\n", + held->mu, held->mu_gw, held->ag, held->ag_gw, held->le, held->le_gw); + printf("KL: %2d/%2d HA: %2d/%2d AE: %3d/ %3d\n", + held->kl, held->kl_gw, held->ha, held->ha_gw, held->ae, held->ae_gw); + printf("IN: %2d/%2d RA: %2d/%2d KE: %3d/ %3d\n", + held->in, held->in_gw, held->ra, held->ra_gw, held->ke, held->ke_gw); + printf("CH: %2d/%2d TA: %2d/%2d Ausdauer: %3d/ %3d\n", + held->ch, held->ch_gw, held->ta, held->ta_gw, held->au, held->au_gw); + printf("GE: %2d/%2d NG: %2d/%2d MR: %d (%d)\n", + held->ge, held->ge_gw, held->ng, held->ng_gw, + held->mr, held->mr_bonus); + printf("FF: %2d/%2d GG: %2d/%2d Stufe: %d\n", + held->ff, held->ff_gw, held->gg, held->gg_gw, held->stufe); + printf("KK: %2d/%2d JZ: %2d/%2d AP: %5d/%5d\n\n", + held->kk, held->kk_gw, held->jz, held->jz_gw, + held->ap, nextLevel[held->stufe]); + + cout << "Steigerungen übrig: Talente: " << held->talent_stue + << ((held->magiertyp) ? " ZF: " + itostr(held->zf_stue) : "") + //<< ((held->magiertyp) ? held->zf_stue : "") + << ((held->hat_rituale) ? " Rituale: " + itostr(held->ritual_stue) : "") + //<< ((held->hat_rituale) ? held->ritual_stue : "") + << endl; + cout << "\nTalente" << endl; // Combat talents are special and come first, thus this code at this place @@ -197,16 +200,28 @@ { cout << "Zauber" << endl; for (umap<string, s_zauber*>::iterator zit = held->zauber.begin(); - zit != held->zauber.end(); zit ++) + zit != held->zauber.end(); zit++) { printf(" %s TaW:%3d StPS: %d/%d VFv: %d\n", - printIndented((* zit).first, 50).c_str(), - (* zit).second->taw, - (* zit).second->stpsue, (* zit).second->stps, - (* zit).second->fvue); + printIndented((*zit).first, 50).c_str(), + (*zit).second->taw, + (*zit).second->stpsue, (*zit).second->stps, + (*zit).second->fvue); printf(" Gebiet: %s Herkunft: %s\n", - (* zit).second->gebiet.c_str(), - (* zit).second->herkunft.c_str()); + (*zit).second->gebiet.c_str(), + (*zit).second->herkunft.c_str()); } } + cout << endl; + + if (0 < held->sonderfertigkeiten.size()) + { + cout << "Sonderfertigkeiten" << endl; + for (umap<string, bool>::iterator sfit = held->sonderfertigkeiten.begin(); + sfit != held->sonderfertigkeiten.end(); sfit++) + { + cout << " " << (*sfit).first << (((*sfit).second) ? "(gelernt)" : "") + << endl; + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <j6...@us...> - 2006-12-09 04:57:07
|
Revision: 12 http://svn.sourceforge.net/dsaster/?rev=12&view=rev Author: j6cubic Date: 2006-12-08 20:57:06 -0800 (Fri, 08 Dec 2006) Log Message: ----------- ---------+---------+---------+---------+---------+---------+---------+---------+ - Did some more preprocessor trickery to fix the broken lines issue (which was due to line termination issues in the h42 parser) - removed some debug stuff from io_plaintext.cpp Modified Paths: -------------- h422/trunk/src/io_h42.cpp h422/trunk/src/io_plaintext.cpp Modified: h422/trunk/src/io_h42.cpp =================================================================== --- h422/trunk/src/io_h42.cpp 2006-12-09 04:03:06 UTC (rev 11) +++ h422/trunk/src/io_h42.cpp 2006-12-09 04:57:06 UTC (rev 12) @@ -23,8 +23,10 @@ #include <sstream> #include <vector> -// Counts read lines, used for error messages -#define getline lineno++; getline +// Counts read lines, used for error messages. Also ensures proper treatment of +// the line endings, which are Windows-style +#define getline(x, y); { lineno++; getline(x, y, '\r'); \ + if ('\n' == x.peek()) x.ignore(1); } // Some conversion functions we need inline int strtoi(string str) { return atoi(str.c_str()); } @@ -86,7 +88,7 @@ stringstream ss(stringstream::in | stringstream::out); vector<string> tokens; int i = 0; - s_held* held = new s_held; + s_held* held = new s_held; // Okay, the file is open and everything's set up. First we read the hero's // class and the attributes @@ -376,5 +378,7 @@ } void writeHero(s_held* held, char* filename) -{ +{ + // In case we ever use this function: + // - Remember to enforce Windows-style line terminators! } Modified: h422/trunk/src/io_plaintext.cpp =================================================================== --- h422/trunk/src/io_plaintext.cpp 2006-12-09 04:03:06 UTC (rev 11) +++ h422/trunk/src/io_plaintext.cpp 2006-12-09 04:57:06 UTC (rev 12) @@ -204,14 +204,9 @@ (* zit).second->taw, (* zit).second->stpsue, (* zit).second->stps, (* zit).second->fvue); - printf(" Gebiet: %d Herkunft: %d\n", - (* zit).second->gebiet.size(), - (* zit).second->herkunft.size()); printf(" Gebiet: %s Herkunft: %s\n", (* zit).second->gebiet.c_str(), (* zit).second->herkunft.c_str()); - cout << (* zit).second->gebiet << endl; - cout << (* zit).second->herkunft << endl; } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <df...@us...> - 2006-12-09 04:03:09
|
Revision: 11 http://svn.sourceforge.net/dsaster/?rev=11&view=rev Author: dfyx Date: 2006-12-08 20:03:06 -0800 (Fri, 08 Dec 2006) Log Message: ----------- some compatibility patches for Dev-C++/MinGW Modified Paths: -------------- h422/trunk/CMakeLists.txt h422/trunk/src/commondefs.h h422/trunk/src/io_debug.cpp h422/trunk/src/io_h42.cpp h422/trunk/src/main.cpp h422/trunk/src/main.h h422/trunk/src/umap.h Added Paths: ----------- h422/trunk/h422.dev Property Changed: ---------------- h422/trunk/ h422/trunk/bin/ h422/trunk/bin/plugins/ h422/trunk/src/ Property changes on: h422/trunk ___________________________________________________________________ Name: svn:ignore + CMakeFiles Makefile cmake_install.cmake CMakeCache.txt Modified: h422/trunk/CMakeLists.txt =================================================================== --- h422/trunk/CMakeLists.txt 2006-12-09 01:45:08 UTC (rev 10) +++ h422/trunk/CMakeLists.txt 2006-12-09 04:03:06 UTC (rev 11) @@ -1,105 +1,105 @@ -PROJECT (h422) -CMAKE_MINIMUM_REQUIRED (VERSION 2.0) -INCLUDE (FindDL.cmake) -# Not necessary without gettext -#INCLUDE (FindIntl.cmake) - -SET (EXECUTABLE_OUTPUT_PATH "./bin") -SET (LIBRARY_OUTPUT_PATH "./bin/plugins") -SET (VERSION "0.5") - -ADD_EXECUTABLE (h422 src/main.cpp) - -# --- Detection of OS-specific stuff --- -SET (LIBEXTENSION "so") - -IF (UNIX) - SET (PATH_SEPARATOR "/") - - IF (APPLE) - MESSAGE (STATUS "OS X detected, using Apple-specific settings") - SET (CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS - "-bundle -headerpad_max_install_names") - SET (CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS - "-bundle -headerpad_max_install_names") - SET (CMAKE_CXX_CREATE_SHARED_LIBRARY - "<CMAKE_CXX_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") - SET (CMAKE_C_CREATE_SHARED_LIBRARY - "<CMAKE_C_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") - SET (LIBEXTENSION "dylib") - - FOREACH (DIR - /Library/Gentoo - ~/Library/Gentoo) - IF (EXISTS ${DIR}) - MESSAGE (STATUS "Prefixed Gentoo detected; please check your paths") - #MESSAGE (STATUS "Prefixed Gentoo detected; modifying search paths") - #SET (INCLUDE_SPATH - # "${DIR}/usr/include ${DIR}/usr/local/include ${INCLUDE_SPATH}" - # "bla") - #SET (LIBRARY_SPATH - # "${DIR}/usr/lib ${DIR}/usr/local/lib ${LIBRARY_SPATH}") - ENDIF (EXISTS ${DIR}) - ENDFOREACH (DIR) - ELSE (APPLE) - IF (DL_FOUND) - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--export-dynamic -ldl") - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,--export-dynamic -ldl") - ELSE (DL_FOUND) - MESSAGE (ERROR "libdl and/or dlfcn.h could not be found!") - ENDIF (DL_FOUND) - ENDIF (APPLE) -ENDIF (UNIX) - -IF (WIN32) - SET (LIBEXTENSION "dll") - SET (PATH_SEPARATOR "\\") -ENDIF (WIN32) - -#IF (INTL_FOUND) -# SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lintl") -# SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -lintl") -#ELSE (INTL_FOUND) -# MESSAGE (ERROR "libintl(.h) and/or locale.h could not be found!") -#ENDIF (INTL_FOUND) - -MESSAGE(STATUS "Shared library extension: ${LIBEXTENSION}") -CONFIGURE_FILE ("src/config.h.cmake" "src/config.h") - -SET (BUILD_SHARED_LIBS ON) - -# --- Options --- -MACRO (PLUGIN NAME DESCRIPTION DEFAULT) - OPTION ("io_${NAME}" ${DESCRIPTION} ${DEFAULT}) - IF ("io_${NAME}") - SET (IO_MODULES ${IO_MODULES} ${NAME}) - ENDIF ("io_${NAME}") -ENDMACRO (PLUGIN) - -PLUGIN (null "Includes the null I/O module" ON) -PLUGIN (debug "Includes the debug I/O module" ON) -PLUGIN (plaintext "Includes the plaintext I/O module" ON) -PLUGIN (h42 "Includes the h42 I/O module" ON) - -OPTION (DEBUG - "Compiler option -g" - OFF) -IF (DEBUG) - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g") - MESSAGE(STATUS "Building with debug information.") -ENDIF(DEBUG) - - - -# --- Module compilation --- -FOREACH(ITEM ${IO_MODULES}) - ADD_LIBRARY("io_${ITEM}" "src/io_${ITEM}.cpp") -ENDFOREACH(ITEM ${IO_MODULES}) - - - -# --- Build summary --- -MESSAGE(STATUS "Building h422 with the following configuration:") -MESSAGE(STATUS " C++ compiler flags: ${CMAKE_CXX_FLAGS}") +PROJECT (h422) +CMAKE_MINIMUM_REQUIRED (VERSION 2.0) +INCLUDE (FindDL.cmake) +# Not necessary without gettext +#INCLUDE (FindIntl.cmake) + +SET (EXECUTABLE_OUTPUT_PATH "./bin") +SET (LIBRARY_OUTPUT_PATH "./bin/plugins") +SET (VERSION "0.5") + +ADD_EXECUTABLE (h422 src/main.cpp) + +# --- Detection of OS-specific stuff --- +SET (LIBEXTENSION "so") + +IF (UNIX) + SET (PATH_SEPARATOR "/") + + IF (APPLE) + MESSAGE (STATUS "OS X detected, using Apple-specific settings") + SET (CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS + "-bundle -headerpad_max_install_names") + SET (CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS + "-bundle -headerpad_max_install_names") + SET (CMAKE_CXX_CREATE_SHARED_LIBRARY + "<CMAKE_CXX_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") + SET (CMAKE_C_CREATE_SHARED_LIBRARY + "<CMAKE_C_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") + SET (LIBEXTENSION "dylib") + + FOREACH (DIR + /Library/Gentoo + ~/Library/Gentoo) + IF (EXISTS ${DIR}) + MESSAGE (STATUS "Prefixed Gentoo detected; please check your paths") + #MESSAGE (STATUS "Prefixed Gentoo detected; modifying search paths") + #SET (INCLUDE_SPATH + # "${DIR}/usr/include ${DIR}/usr/local/include ${INCLUDE_SPATH}" + # "bla") + #SET (LIBRARY_SPATH + # "${DIR}/usr/lib ${DIR}/usr/local/lib ${LIBRARY_SPATH}") + ENDIF (EXISTS ${DIR}) + ENDFOREACH (DIR) + ELSE (APPLE) + IF (DL_FOUND) + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--export-dynamic -ldl") + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,--export-dynamic -ldl") + ELSE (DL_FOUND) + MESSAGE (ERROR "libdl and/or dlfcn.h could not be found!") + ENDIF (DL_FOUND) + ENDIF (APPLE) +ENDIF (UNIX) + +IF (WIN32) + SET (LIBEXTENSION "dll") + SET (PATH_SEPARATOR "\\\\") +ENDIF (WIN32) + +#IF (INTL_FOUND) +# SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lintl") +# SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -lintl") +#ELSE (INTL_FOUND) +# MESSAGE (ERROR "libintl(.h) and/or locale.h could not be found!") +#ENDIF (INTL_FOUND) + +MESSAGE(STATUS "Shared library extension: ${LIBEXTENSION}") +CONFIGURE_FILE ("src/config.h.cmake" "src/config.h") + +SET (BUILD_SHARED_LIBS ON) + +# --- Options --- +MACRO (PLUGIN NAME DESCRIPTION DEFAULT) + OPTION ("io_${NAME}" ${DESCRIPTION} ${DEFAULT}) + IF ("io_${NAME}") + SET (IO_MODULES ${IO_MODULES} ${NAME}) + ENDIF ("io_${NAME}") +ENDMACRO (PLUGIN) + +PLUGIN (null "Includes the null I/O module" ON) +PLUGIN (debug "Includes the debug I/O module" ON) +PLUGIN (plaintext "Includes the plaintext I/O module" ON) +PLUGIN (h42 "Includes the h42 I/O module" ON) + +OPTION (DEBUG + "Compiler option -g" + OFF) +IF (DEBUG) + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g") + MESSAGE(STATUS "Building with debug information.") +ENDIF(DEBUG) + + + +# --- Module compilation --- +FOREACH(ITEM ${IO_MODULES}) + ADD_LIBRARY("io_${ITEM}" "src/io_${ITEM}.cpp") +ENDFOREACH(ITEM ${IO_MODULES}) + + + +# --- Build summary --- +MESSAGE(STATUS "Building h422 with the following configuration:") +MESSAGE(STATUS " C++ compiler flags: ${CMAKE_CXX_FLAGS}") MESSAGE(STATUS " Modules built: ${IO_MODULES}") \ No newline at end of file Property changes on: h422/trunk/bin ___________________________________________________________________ Name: svn:ignore + h422.exe Property changes on: h422/trunk/bin/plugins ___________________________________________________________________ Name: svn:ignore + libio_debug.dll libio_debug.dll.a libio_h42.dll libio_h42.dll.a libio_null.dll libio_null.dll.a libio_plaintext.dll libio_plaintext.dll.a Added: h422/trunk/h422.dev =================================================================== --- h422/trunk/h422.dev (rev 0) +++ h422/trunk/h422.dev 2006-12-09 04:03:06 UTC (rev 11) @@ -0,0 +1,148 @@ +[Project] +FileName=h422.dev +Name=h422 +UnitCount=10 +Type=1 +Ver=1 +ObjFiles= +Includes= +Libs= +PrivateResource= +ResourceIncludes= +MakeIncludes= +Compiler= +CppCompiler= +Linker= +IsCpp=0 +Icon= +ExeOutput= +ObjectOutput= +OverrideOutput=0 +OverrideOutputName=h422.exe +HostApplication= +Folders= +CommandLine= +UseCustomMakefile=1 +CustomMakefile=Makefile +IncludeVersionInfo=0 +SupportXPThemes=0 +CompilerSet=0 +CompilerSettings=0000000000000000000000 + +[Unit1] +FileName=src\commondefs.h +CompileCpp=0 +Folder=h422 +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd= + +[Unit2] +FileName=src\io_debug.cpp +CompileCpp=0 +Folder=h422 +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd= + +[Unit3] +FileName=src\io_h42.cpp +CompileCpp=0 +Folder=h422 +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd= + +[Unit4] +FileName=src\io_null.cpp +CompileCpp=0 +Folder=h422 +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd= + +[Unit5] +FileName=src\io_plaintext.cpp +CompileCpp=0 +Folder=h422 +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd= + +[Unit6] +FileName=src\main.cpp +CompileCpp=0 +Folder=h422 +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd= + +[Unit7] +FileName=src\main.h +CompileCpp=0 +Folder=h422 +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd= + +[Unit8] +FileName=src\modules.h +CompileCpp=0 +Folder=h422 +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd= + +[Unit9] +FileName=src\umap.h +CompileCpp=0 +Folder=h422 +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd= + +[VersionInfo] +Major=0 +Minor=1 +Release=1 +Build=1 +LanguageID=1033 +CharsetID=1252 +CompanyName= +FileVersion= +FileDescription=Developed using the Dev-C++ IDE +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion= +AutoIncBuildNr=0 + +[Unit10] +FileName=Makefile +Folder=h422 +Compile=0 +Link=0 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd= + Property changes on: h422/trunk/src ___________________________________________________________________ Name: svn:ignore + config.h Modified: h422/trunk/src/commondefs.h =================================================================== --- h422/trunk/src/commondefs.h 2006-12-09 01:45:08 UTC (rev 10) +++ h422/trunk/src/commondefs.h 2006-12-09 04:03:06 UTC (rev 11) @@ -1,208 +1,208 @@ -/******************************************************************************* -* h422 - converts DSAv3 hero data between various formats * -* Copyright (C) 2006 Tim "Jesus_666" Okrongli * -* * -* This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU General Public License as published by the Free * -* Software Foundation; either version 2 of the License, or (at your option) * -* any later version. * -* * -* This program is distributed in the hope that it will be useful, but WITHOUT * -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -* more details. * -* * -* You should have received a copy of the GNU General Public License along with * -* this program; if not, write to the Free Software Foundation, Inc., 51 * -* Franklin St, Fifth Floor, Boston, MA 02110, USA * -*******************************************************************************/ - -#include <string> -#include <map> -#include "umap.h" -//#include <cstdio> -#include <vector> -// Disabled until issued with prefixed portage are dealt with -//#include <libintl.h> -#include <locale> -using namespace std; - -//#define _(STRING) gettext(STRING) - -// Bit field for plugin capabilities -#define CAN_READ 1 -#define CAN_WRITE 2 -// Whether the plugin can work with DSA 3.5 extensions -#define CAN_DSA35 4 - -typedef int capabs; - -enum Monat {Namenloser, Praios, Rondra, Efferd, Travia, Boron, Hesinde, Firun, - Tsa, Phex, Peraine, Ingerimm, Rahja, INVALID_MONTH}; -string montostr[14] = {"Namenloser", "Praios", "Rondra", "Efferd", "Travia", - "Boron", "Hesinde", "Firun", "Tsa", "Phex", "Peraine", - "Ingerimm", "Rahja", "??"}; -Monat strtomon(string str) -{ - if ("Namenloser" == str) return Namenloser; - if ("Praios" == str) return Praios; - if ("Rondra" == str) return Rondra; - if ("Efferd" == str) return Efferd; - if ("Travia" == str) return Travia; - if ("Boron" == str) return Boron; - if ("Hesinde" == str) return Hesinde; - if ("Firun" == str) return Firun; - if ("Tsa" == str) return Tsa; - if ("Phex" == str) return Phex; - if ("Peraine" == str) return Peraine; - if ("Ingerimm" == str) return Ingerimm; - if ("Rahja" == str) return Rahja; - return INVALID_MONTH; // ungültiger String -} - -enum Grundwert {MU, KL, IN, CH, GE, FF, KK, INVALID_GW}; -string gwtostr[8] = {"MU", "KL", "IN", "CH", "GE", "FF", "KK", "??"}; -Grundwert strtogw(string str) -{ - if ("MU" == str) return MU; - if ("KL" == str) return KL; - if ("IN" == str) return IN; - if ("CH" == str) return CH; - if ("GE" == str) return GE; - if ("FF" == str) return FF; - if ("KK" == str) return KK; - return INVALID_GW; // ungültiger String -} - - -struct s_talent -{ - Grundwert gw[3]; - int taw; - int stps; // Steigerungen/Stufe - int stpsue; // STPS übrig - int fvue; // Fehlversuche übrig -}; - -struct s_kampftalent -{ - int beMod; // BE-Modifikator. 0 = (BE) - int taw; - int stps; // Steigerungen/Stufe - int stpsue; // STPS übrig - int fvue; // Fehlversuche übrig - int at; // Attacke ohne BE - int pa; // Parade ohne BE -}; - -struct s_zauber -{ - Grundwert gw[3]; - string herkunft; - string gebiet; - int taw; - int stps; // Steigerungen/Stufe - int stpsue; // STPS übrig - int fvue; // Fehlversuche übrig -}; - -//typedef map<string, s_kampftalent*> kampftalentgruppe; -//typedef map<string, s_talent*> talentgruppe; -typedef umap<string, s_kampftalent*> kampftalentgruppe; -typedef umap<string, s_talent*> talentgruppe; - -struct s_held -{ - string name; - string klasse; - string gottheit; - string titel; - string stand; - string geburtsort; - string haarfarbe; - string augenfarbe; - - int geburtstag; - Monat geburtsmonat; - int geburtsjahr; - int alter; - int groesse; - int gewicht; - int ap; - int stufe; - int le; - int ae; - int ke; - int le_gw; - int ae_gw; - int ke_gw; - - // Aktuelle Werte - int mu; - int kl; - int in; - int ch; - int ge; - int ff; - int kk; - int ag; - int ha; - int ra; - int ta; - int ng; - int gg; - int jz; - // Grundwerte - int mu_gw; - int kl_gw; - int in_gw; - int ch_gw; - int ge_gw; - int ff_gw; - int kk_gw; - int ag_gw; - int ha_gw; - int ra_gw; - int ta_gw; - int ng_gw; - int gg_gw; - int jz_gw; - - int be_minus; - int mr; - int mr_bonus; - int gs; - string le_plus_ps; - string ae_plus_ps; - int zf_stps; - int talent_stps; - int taw_zf_vs; - int ritual_stps; - - bool le_ae_separat; - bool magiertyp; - bool hat_rituale; - - - kampftalentgruppe kampftalente; - //map<string, talentgruppe*> talente; - umap<string, talentgruppe*> talente; - umap<string, s_zauber*> zauber; - // All we store about these is the name and information on whether the ability - // is already learned or not. An umap<string, bool> should suffice - umap<string, bool> sonderfertigkeiten; - - // DSA3.5-specific stuff - string abenteuer; -}; - -struct s_plugdata -{ - int version; - capabs capabilities; - char* name; // 16 characters max. - char* description; - vector<char*> extensions; // Which extensions we support - s_held* (*read)(char*); - void (*write)(s_held*, char*); -}; +/******************************************************************************* +* h422 - converts DSAv3 hero data between various formats * +* Copyright (C) 2006 Tim "Jesus_666" Okrongli * +* * +* This program is free software; you can redistribute it and/or modify it * +* under the terms of the GNU General Public License as published by the Free * +* Software Foundation; either version 2 of the License, or (at your option) * +* any later version. * +* * +* This program is distributed in the hope that it will be useful, but WITHOUT * +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * +* more details. * +* * +* You should have received a copy of the GNU General Public License along with * +* this program; if not, write to the Free Software Foundation, Inc., 51 * +* Franklin St, Fifth Floor, Boston, MA 02110, USA * +*******************************************************************************/ + +#include <string> +#include <map> +#include "umap.h" +//#include <cstdio> +#include <vector> +// Disabled until issued with prefixed portage are dealt with +//#include <libintl.h> +#include <locale> +using namespace std; + +//#define _(STRING) gettext(STRING) + +// Bit field for plugin capabilities +#define CAN_READ 1 +#define CAN_WRITE 2 +// Whether the plugin can work with DSA 3.5 extensions +#define CAN_DSA35 4 + +typedef int capabs; + +enum Monat {Namenloser, Praios, Rondra, Efferd, Travia, Boron, Hesinde, Firun, + Tsa, Phex, Peraine, Ingerimm, Rahja, INVALID_MONTH}; +string montostr[14] = {"Namenloser", "Praios", "Rondra", "Efferd", "Travia", + "Boron", "Hesinde", "Firun", "Tsa", "Phex", "Peraine", + "Ingerimm", "Rahja", "??"}; +Monat strtomon(string str) +{ + if ("Namenloser" == str) return Namenloser; + if ("Praios" == str) return Praios; + if ("Rondra" == str) return Rondra; + if ("Efferd" == str) return Efferd; + if ("Travia" == str) return Travia; + if ("Boron" == str) return Boron; + if ("Hesinde" == str) return Hesinde; + if ("Firun" == str) return Firun; + if ("Tsa" == str) return Tsa; + if ("Phex" == str) return Phex; + if ("Peraine" == str) return Peraine; + if ("Ingerimm" == str) return Ingerimm; + if ("Rahja" == str) return Rahja; + return INVALID_MONTH; // ungültiger String +} + +enum Grundwert {ATTR_MU, ATTR_KL, ATTR_IN, ATTR_CH, ATTR_GE, ATTR_FF, ATTR_KK, ATTR_INVALID_GW}; +string gwtostr[8] = {"MU", "KL", "IN", "CH", "GE", "FF", "KK", "??"}; +Grundwert strtogw(string str) +{ + if ("MU" == str) return ATTR_MU; + if ("KL" == str) return ATTR_KL; + if ("IN" == str) return ATTR_IN; + if ("CH" == str) return ATTR_CH; + if ("GE" == str) return ATTR_GE; + if ("FF" == str) return ATTR_FF; + if ("KK" == str) return ATTR_KK; + return ATTR_INVALID_GW; // ungültiger String +} + + +struct s_talent +{ + Grundwert gw[3]; + int taw; + int stps; // Steigerungen/Stufe + int stpsue; // STPS übrig + int fvue; // Fehlversuche übrig +}; + +struct s_kampftalent +{ + int beMod; // BE-Modifikator. 0 = (BE) + int taw; + int stps; // Steigerungen/Stufe + int stpsue; // STPS übrig + int fvue; // Fehlversuche übrig + int at; // Attacke ohne BE + int pa; // Parade ohne BE +}; + +struct s_zauber +{ + Grundwert gw[3]; + string herkunft; + string gebiet; + int taw; + int stps; // Steigerungen/Stufe + int stpsue; // STPS übrig + int fvue; // Fehlversuche übrig +}; + +//typedef map<string, s_kampftalent*> kampftalentgruppe; +//typedef map<string, s_talent*> talentgruppe; +typedef umap<string, s_kampftalent*> kampftalentgruppe; +typedef umap<string, s_talent*> talentgruppe; + +struct s_held +{ + string name; + string klasse; + string gottheit; + string titel; + string stand; + string geburtsort; + string haarfarbe; + string augenfarbe; + + int geburtstag; + Monat geburtsmonat; + int geburtsjahr; + int alter; + int groesse; + int gewicht; + int ap; + int stufe; + int le; + int ae; + int ke; + int le_gw; + int ae_gw; + int ke_gw; + + // Aktuelle Werte + int mu; + int kl; + int in; + int ch; + int ge; + int ff; + int kk; + int ag; + int ha; + int ra; + int ta; + int ng; + int gg; + int jz; + // Grundwerte + int mu_gw; + int kl_gw; + int in_gw; + int ch_gw; + int ge_gw; + int ff_gw; + int kk_gw; + int ag_gw; + int ha_gw; + int ra_gw; + int ta_gw; + int ng_gw; + int gg_gw; + int jz_gw; + + int be_minus; + int mr; + int mr_bonus; + int gs; + string le_plus_ps; + string ae_plus_ps; + int zf_stps; + int talent_stps; + int taw_zf_vs; + int ritual_stps; + + bool le_ae_separat; + bool magiertyp; + bool hat_rituale; + + + kampftalentgruppe kampftalente; + //map<string, talentgruppe*> talente; + umap<string, talentgruppe*> talente; + umap<string, s_zauber*> zauber; + // All we store about these is the name and information on whether the ability + // is already learned or not. An umap<string, bool> should suffice + umap<string, bool> sonderfertigkeiten; + + // DSA3.5-specific stuff + string abenteuer; +}; + +struct s_plugdata +{ + int version; + capabs capabilities; + char* name; // 16 characters max. + char* description; + vector<char*> extensions; // Which extensions we support + s_held* (*read)(char*); + void (*write)(s_held*, char*); +}; Modified: h422/trunk/src/io_debug.cpp =================================================================== --- h422/trunk/src/io_debug.cpp 2006-12-09 01:45:08 UTC (rev 10) +++ h422/trunk/src/io_debug.cpp 2006-12-09 04:03:06 UTC (rev 11) @@ -1,103 +1,103 @@ -/******************************************************************************* -* h422 - converts DSAv3 hero data between various formats * -* Copyright (C) 2006 Tim "Jesus_666" Okrongli * -* * -* This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU General Public License as published by the Free * -* Software Foundation; either version 2 of the License, or (at your option) * -* any later version. * -* * -* This program is distributed in the hope that it will be useful, but WITHOUT * -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -* more details. * -* * -* You should have received a copy of the GNU General Public License along with * -* this program; if not, write to the Free Software Foundation, Inc., 51 * -* Franklin St, Fifth Floor, Boston, MA 02110, USA * -*******************************************************************************/ - -#include "modules.h" - -// NOTE: This plugin shouldn't be included in regular releases. -s_plugdata* registerPlugin() -{ - s_plugdata* pd = new s_plugdata; - pd->name = "debug"; - pd->capabilities = CAN_READ | CAN_DSA35; - pd->version = 1; - pd->description = "Testplugin, das einen vordefinierten Helden liefert"; - pd->extensions.push_back("debugplugin"); - // Just leave these two lines be. The main program relies on them. - pd->read = &readHero; - pd->write = &writeHero; - - return pd; -} - -void addTalent(talentgruppe* &tg, char* name, Grundwert gw0, Grundwert gw1, - Grundwert gw2, int taw, int stps, int stpsue, int fvue) -{ - (*tg)[name] = new s_talent; - s_talent* talent = (*tg)[name]; - talent->gw[0] = gw0; - talent->gw[1] = gw1; - talent->gw[2] = gw2; - talent->taw = taw; - talent->stps = stps; - talent->stpsue = stpsue; - talent->fvue = fvue; -} - -s_held* readHero(char* filename) -{ - s_held* hero = new s_held; - hero->name = "Genrick DeFoulde"; - hero->klasse = "Testheld"; - hero->gottheit = "Rheia"; - hero->titel = "Kalif von Oberammergau"; - hero->stand = "sowas von adelig"; - hero->geburtsort = "Dorfhausen"; - hero->haarfarbe = "schwarz"; - hero->augenfarbe = "grün"; - hero->geburtstag = 12; - hero->geburtsmonat = Praios; - hero->geburtsjahr = -5; - hero->alter = 28; - hero->groesse = 187; - hero->gewicht = 80; - hero->ap = 2100; - hero->stufe = 6; // 1 outstanding levelup! - hero->le = 34; - hero->ae = 60; - hero->ke = 0; - hero->le_gw = 50; - hero->ae_gw = 62; - hero->ke_gw = 0; - hero->mu = hero->mu_gw = 12; - hero->kl = hero->kl_gw = 13; - hero->in = hero->in_gw = 11; - hero->ch = hero->ch_gw = 12; - hero->ge = hero->ge_gw = 10; - hero->ff = hero->ff_gw = 11; - hero->kk = hero->kk_gw = 13; - hero->ag = hero->ag_gw = 2; - hero->ha = hero->ha_gw = 6; - hero->ra = hero->ra_gw = 3; - hero->ta = hero->ta_gw = 1; - hero->ng = hero->ng_gw = 2; - hero->gg = hero->gg_gw = 3; - hero->jz = hero->jz_gw = 2; - - // This should be automated for the default talents later - hero->talente.insert(make_pair("Koerperlich", new talentgruppe)); - addTalent(hero->talente["Koerperlich"], "Akrobatik", MU, GE, KK, 4, 3, 3, 3); - addTalent(hero->talente["Koerperlich"], "Fliegen", MU, KL, GE, -3, 3, 3, 3); - hero->talente.insert(make_pair("Eigene", new talentgruppe)); - addTalent(hero->talente["Eigene"], "Absurd lange Namen fuer Talente erfinden", KL, IN, GE, -12, 2, 1, 0); - return hero; -} - -void writeHero(s_held* held, char* filename) -{ -} +/******************************************************************************* +* h422 - converts DSAv3 hero data between various formats * +* Copyright (C) 2006 Tim "Jesus_666" Okrongli * +* * +* This program is free software; you can redistribute it and/or modify it * +* under the terms of the GNU General Public License as published by the Free * +* Software Foundation; either version 2 of the License, or (at your option) * +* any later version. * +* * +* This program is distributed in the hope that it will be useful, but WITHOUT * +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * +* more details. * +* * +* You should have received a copy of the GNU General Public License along with * +* this program; if not, write to the Free Software Foundation, Inc., 51 * +* Franklin St, Fifth Floor, Boston, MA 02110, USA * +*******************************************************************************/ + +#include "modules.h" + +// NOTE: This plugin shouldn't be included in regular releases. +s_plugdata* registerPlugin() +{ + s_plugdata* pd = new s_plugdata; + pd->name = "debug"; + pd->capabilities = CAN_READ | CAN_DSA35; + pd->version = 1; + pd->description = "Testplugin, das einen vordefinierten Helden liefert"; + pd->extensions.push_back("debugplugin"); + // Just leave these two lines be. The main program relies on them. + pd->read = &readHero; + pd->write = &writeHero; + + return pd; +} + +void addTalent(talentgruppe* &tg, char* name, Grundwert gw0, Grundwert gw1, + Grundwert gw2, int taw, int stps, int stpsue, int fvue) +{ + (*tg)[name] = new s_talent; + s_talent* talent = (*tg)[name]; + talent->gw[0] = gw0; + talent->gw[1] = gw1; + talent->gw[2] = gw2; + talent->taw = taw; + talent->stps = stps; + talent->stpsue = stpsue; + talent->fvue = fvue; +} + +s_held* readHero(char* filename) +{ + s_held* hero = new s_held; + hero->name = "Genrick DeFoulde"; + hero->klasse = "Testheld"; + hero->gottheit = "Rheia"; + hero->titel = "Kalif von Oberammergau"; + hero->stand = "sowas von adelig"; + hero->geburtsort = "Dorfhausen"; + hero->haarfarbe = "schwarz"; + hero->augenfarbe = "grün"; + hero->geburtstag = 12; + hero->geburtsmonat = Praios; + hero->geburtsjahr = -5; + hero->alter = 28; + hero->groesse = 187; + hero->gewicht = 80; + hero->ap = 2100; + hero->stufe = 6; // 1 outstanding levelup! + hero->le = 34; + hero->ae = 60; + hero->ke = 0; + hero->le_gw = 50; + hero->ae_gw = 62; + hero->ke_gw = 0; + hero->mu = hero->mu_gw = 12; + hero->kl = hero->kl_gw = 13; + hero->in = hero->in_gw = 11; + hero->ch = hero->ch_gw = 12; + hero->ge = hero->ge_gw = 10; + hero->ff = hero->ff_gw = 11; + hero->kk = hero->kk_gw = 13; + hero->ag = hero->ag_gw = 2; + hero->ha = hero->ha_gw = 6; + hero->ra = hero->ra_gw = 3; + hero->ta = hero->ta_gw = 1; + hero->ng = hero->ng_gw = 2; + hero->gg = hero->gg_gw = 3; + hero->jz = hero->jz_gw = 2; + + // This should be automated for the default talents later + hero->talente.insert(make_pair("Koerperlich", new talentgruppe)); + addTalent(hero->talente["Koerperlich"], "Akrobatik", ATTR_MU, ATTR_GE, ATTR_KK, 4, 3, 3, 3); + addTalent(hero->talente["Koerperlich"], "Fliegen", ATTR_MU, ATTR_KL, ATTR_GE, -3, 3, 3, 3); + hero->talente.insert(make_pair("Eigene", new talentgruppe)); + addTalent(hero->talente["Eigene"], "Absurd lange Namen fuer Talente erfinden", ATTR_KL, ATTR_IN, ATTR_GE, -12, 2, 1, 0); + return hero; +} + +void writeHero(s_held* held, char* filename) +{ +} Modified: h422/trunk/src/io_h42.cpp =================================================================== --- h422/trunk/src/io_h42.cpp 2006-12-09 01:45:08 UTC (rev 10) +++ h422/trunk/src/io_h42.cpp 2006-12-09 04:03:06 UTC (rev 11) @@ -1,380 +1,380 @@ -/******************************************************************************* -* h422 - converts DSAv3 hero data between various formats * -* Copyright (C) 2006 Tim "Jesus_666" Okrongli * -* * -* This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU General Public License as published by the Free * -* Software Foundation; either version 2 of the License, or (at your option) * -* any later version. * -* * -* This program is distributed in the hope that it will be useful, but WITHOUT * -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -* more details. * -* * -* You should have received a copy of the GNU General Public License along with * -* this program; if not, write to the Free Software Foundation, Inc., 51 * -* Franklin St, Fifth Floor, Boston, MA 02110, USA * -*******************************************************************************/ - -#include "modules.h" -#include "iostream" -// These two are used as an el-cheapo tokenizer -#include <sstream> -#include <vector> - -// Counts read lines, used for error messages -#define getline lineno++; getline - -// Some conversion functions we need -inline int strtoi(string str) { return atoi(str.c_str()); } -inline string itostr(int i) -{ - stringstream ss; - ss << i; - return ss.str(); -} -inline bool strtobool(string str) -{ - return ("TRUE" == str) ? true : false; -} - -// Shorthand for adding talents to a talent group -void addTalent(talentgruppe* &tg, string name, Grundwert gw0, Grundwert gw1, - Grundwert gw2, int taw, int stps, int stpsue, int fvue) -{ - (*tg)[name] = new s_talent; - s_talent* talent = (*tg)[name]; - talent->gw[0] = gw0; - talent->gw[1] = gw1; - talent->gw[2] = gw2; - talent->taw = taw; - talent->stps = stps; - talent->stpsue = stpsue; - talent->fvue = fvue; -} - -// registers the plugin with the main program -s_plugdata* registerPlugin() -{ - s_plugdata* pd = new s_plugdata; - pd->name = "h42"; - pd->capabilities = CAN_READ; - pd->version = 0; - pd->description = "Liest h42-Heldendokumente"; - pd->extensions.push_back("h42"); - // Just leave these two lines be. The main program relies on them. - pd->read = &readHero; - pd->write = &writeHero; - - return pd; -} - -// Reads a h42 file into an s_hero struct -s_held* readHero(char* filename) -{ - ifstream source (filename); - if (!source.is_open()) - { - cout << "Fehler beim Öffnen von " << filename << endl; - exit(101); - } - - // No need to initialize these before we have opened the file - int lineno = 0; - string tempstring, buffer; - stringstream ss(stringstream::in | stringstream::out); - vector<string> tokens; - int i = 0; - s_held* held = new s_held; - - // Okay, the file is open and everything's set up. First we read the hero's - // class and the attributes - - // I love reading in string values - getline(source, held->klasse); - - // My love for multiple values in one line is somewhat lesser, though an - // std::stringstream makes for a decent tokenizer, as it treats whitespace as - // separators - getline(source, tempstring); - ss << tempstring; - ss >> buffer; held->mu = held->mu_gw = strtoi(buffer); - ss >> buffer; held->kl = held->kl_gw = strtoi(buffer); - ss >> buffer; held->in = held->in_gw = strtoi(buffer); - ss >> buffer; held->ch = held->ch_gw = strtoi(buffer); - ss >> buffer; held->ge = held->ge_gw = strtoi(buffer); - ss >> buffer; held->ff = held->ff_gw = strtoi(buffer); - ss >> buffer; held->kk = held->kk_gw = strtoi(buffer); - getline(source, tempstring); - - // We should reset stringstreams before reusing them, just in case there's - // still junk left from the last line - ss.str(""); ss.clear(); - ss << tempstring; - ss >> buffer; held->ag = held->ag_gw = strtoi(buffer); - ss >> buffer; held->ha = held->ha_gw = strtoi(buffer); - ss >> buffer; held->ra = held->ra_gw = strtoi(buffer); - ss >> buffer; held->ta = held->ta_gw = strtoi(buffer); - ss >> buffer; held->ng = held->ng_gw = strtoi(buffer); - ss >> buffer; held->gg = held->gg_gw = strtoi(buffer); - ss >> buffer; held->jz = held->jz_gw = strtoi(buffer); - - // Next comes the talent handling. Since combat talents are special and come - // first we do some custom stuff with them - - // The group name of the combat talents. We throw this away as it doesn't - // conform to what most people expect to see on their character sheet. - // Besides, only regular talents are stored in name:group format - getline(source, tempstring); - // Unknown Value 1. We also throw this away since it seems to be pointless - // anyway - getline(source, tempstring); - getline(source, tempstring); // Number of combat talents - held->kampftalente.reserve(strtoi(tempstring)); - - for (int talentsToGo = strtoi(tempstring); talentsToGo > 0; talentsToGo--) - { - string talentName = ""; - int beMod = 0; - int taw, stps, stpsue, fvue; - bool bFirstPart = true; - - getline(source, tempstring); - ss.str(""); ss.clear(); // reset stringstream - ss << tempstring; - ss >> buffer; - // TODO: Make this loop better - while (buffer.substr(0, 1) != "("/* && !(ss.eol())*/) - { - talentName += ((bFirstPart) ? "" : " ") + buffer; - bFirstPart = false; - string lastVal = buffer; - ss >> buffer; - if (buffer == lastVal) break; - } - - // Not all combat talents have a modifier - if (buffer.substr(0, 1) == "(") - beMod = strtoi(buffer.substr(3, buffer.size() - 4)); - - getline(source, tempstring); - ss.str(""); ss.clear(); // reset stringstream - ss << tempstring; - ss >> buffer; taw = strtoi(buffer); - ss >> buffer; stps = strtoi(buffer); - ss >> buffer; stpsue = strtoi(buffer); - ss >> buffer; fvue = strtoi(buffer); - - held->kampftalente[talentName] = new s_kampftalent; - // This impreoves performance significantly as the [] operator is extremely - // expensive for umaps, so invoking it over and over is a bad idea - s_kampftalent* ktal = held->kampftalente[talentName]; - ktal->beMod = beMod; - ktal->taw = taw; - ktal->stps = stps; - ktal->stpsue = stpsue; - ktal->fvue = fvue; - // The following values can only be determined later and are thus filled - // with dummy values - ktal->at = 0; - ktal->pa = 0; - } - - // The number of talent groups we still have to parse - int talentGroupsToGo = 8; // No combat talents - for (; talentGroupsToGo > 0; talentGroupsToGo--) - { - // Uh-oh, trouble. I just realized that we need wstrings everywhere, - // due to the fact that we have to deal with umlauts etc. - // I think we'll just have to replace all instances of "string" with - // "wstring" and "stringstream" with "wstringstream". Still, I can't be - // arsed to do it right now. - // The strtoi function, however, could present a problem, depending on - // how easy it is to cast const wchar_t* to const char*. - - // Eh, whatever. For the time being we just assume that the file is in - // latin-1 and the output plugin expects latin-1 data. - - string currentGroup; - //int unknownValue1; // unused until we know what it's good for - int talentsToGo; - - - getline(source, currentGroup); - // The following line was deprecated in favor of [] = new - //held->talente.insert(make_pair(currentGroup, new talentgruppe)); - held->talente[currentGroup] = new talentgruppe; - talentgruppe* tgroup = held->talente[currentGroup]; - - // see definition of unknownValue1 - getline(source, tempstring); // we skip the unknown value - //unknownValue1 = strtoi(tempstring); - getline(source, tempstring); - talentsToGo = strtoi(tempstring); - - for (; talentsToGo > 0; talentsToGo--) - { - string talentName = ""; - Grundwert gw0, gw1, gw2; - int taw, stps, stpsue, fvue; - bool bFirstPart = true; - - getline(source, tempstring); - ss.str(""); ss.clear(); // reset stringstream - ss << tempstring; - ss >> buffer; - // TODO: Make this loop better - while (buffer.substr(0, 1) != "("/* && !(ss.eol())*/) - { - talentName += ((bFirstPart) ? "" : " ") + buffer; - bFirstPart = false; - string lastVal = buffer; - ss >> buffer; - if (buffer == lastVal) break; - } - - if (buffer.substr(0, 1) == "(") - { - gw0 = strtogw(buffer.substr(1, 2)); - gw1 = strtogw(buffer.substr(4, 2)); - gw2 = strtogw(buffer.substr(7, 2)); - - if (INVALID_GW == gw0 || INVALID_GW == gw1 || INVALID_GW == gw2) - { - cout << "Datei kann nicht gelesen werden: Ungültiger Talentname " << - "in Zeile " << lineno << endl; - exit(102); - } - } - else - { - cout << "Datei kann nicht gelesen werden: Ungültiger Talentname in " << - "Zeile " << lineno << endl; - exit(102); - } - - getline(source, tempstring); - ss.str(""); ss.clear(); - ss << tempstring; - ss >> buffer; taw = strtoi(buffer); - ss >> buffer; stps = strtoi(buffer); - ss >> buffer; stpsue = strtoi(buffer); - ss >> buffer; fvue = strtoi(buffer); - - addTalent(tgroup, talentName, gw0, gw1, gw2, taw, stps, stpsue, fvue); - } - } - - // Whew. Time to relax with some simple one-value lines - - // h42 doesn't distinguish between current and map HP/MP/KP - getline(source, tempstring); held->le = held->le_gw = strtoi(tempstring); - getline(source, tempstring); held->ae = held->ae_gw = strtoi(tempstring); - getline(source, tempstring); held->ke = held->ke_gw = strtoi(tempstring); - getline(source, tempstring); held->zf_stps = strtoi(tempstring); - getline(source, tempstring); held->talent_stps = strtoi(tempstring); - getline(source, tempstring); held->taw_zf_vs = strtoi(tempstring); - getline(source, tempstring); held->be_minus = strtoi(tempstring); - getline(source, tempstring); held->gs = strtoi(tempstring); - getline(source, tempstring); held->mr_bonus = strtoi(tempstring); - getline(source, held->le_plus_ps); - getline(source, held->ae_plus_ps); - getline(source, tempstring); held->le_ae_separat = strtobool(tempstring); - getline(source, tempstring); held->magiertyp = strtobool(tempstring); - - // Okay, funtime's over, here comes another one of those pesky arrays - - // Time for the spells - getline(source, tempstring); - for (int spellsToGo = strtoi(tempstring); spellsToGo > 0; spellsToGo--) - { - string zauberName = "", gebiet, herkunft; - Grundwert gw0, gw1, gw2; - int taw, stps, stpsue, fvue; - bool bFirstPart = true; - - getline(source, tempstring); - ss.str(""); ss.clear(); // reset stringstream - ss << tempstring; - ss >> buffer; - // TODO: Make this loop better - while (buffer.substr(0, 1) != "("/* && !(ss.eol())*/) - { - zauberName += ((bFirstPart) ? "" : " ") + buffer; - bFirstPart = false; - string lastVal = buffer; - ss >> buffer; - if (buffer == lastVal) break; - } - - if (buffer.substr(0, 1) == "(") - { - gw0 = strtogw(buffer.substr(1, 2)); - gw1 = strtogw(buffer.substr(4, 2)); - gw2 = strtogw(buffer.substr(7, 2)); - - if (INVALID_GW == gw0 || INVALID_GW == gw1 || INVALID_GW == gw2) - { - cout << "Datei kann nicht gelesen werden: Ungültiger Zaubername " << - "in Zeile " << lineno << endl; - exit(103); - } - } - else - { - cout << "Datei kann nicht gelesen werden: Ungültiger Zaubername in " << - "Zeile " << lineno << endl; - exit(103); - } - - getline(source, herkunft); - getline(source, gebiet); - - getline(source, tempstring); - ss.str(""); ss.clear(); - ss << tempstring; - ss >> buffer; taw = strtoi(buffer); - ss >> buffer; stps = strtoi(buffer); - ss >> buffer; stpsue = strtoi(buffer); - ss >> buffer; fvue = strtoi(buffer); - - held->zauber[zauberName] = new s_zauber; - // This impreoves performance significantly as the [] operator is extremely - // expensive for umaps, so invoking it over and over is a bad idea - s_zauber* zbr = held->zauber[zauberName]; - zbr->gebiet = gebiet; - zbr->herkunft = herkunft; - zbr->taw = taw; - zbr->stps = stps; - zbr->stpsue = stpsue; - zbr->fvue = fvue; - } - - // And another one, this time quite trivial: The list of learnable special - // abilities - getline(source, tempstring); - for (int abilitesToGo = strtoi(tempstring); abilitesToGo > 0; abilitesToGo--) - { - // We learn which ones actually have been learned later - getline(source, tempstring); - held->sonderfertigkeiten[tempstring] = false; - } - - // Whee, another field of POD entries! - getline(source, tempstring); held->hat_rituale = strtobool(tempstring); - getline(source, tempstring); held->ritual_stps = strtoi(tempstring); - getline(source, held->name); - getline(source, held->geburtsort); - getline(source, held->haarfarbe); - getline(source, held->stand); - getline(source, tempstring); held->groesse = strtoi(tempstring); - getline(source, tempstring); held->gewicht = strtoi(tempstring); - - source.close(); - return held; -} - -void writeHero(s_held* held, char* filename) -{ -} +/******************************************************************************* +* h422 - converts DSAv3 hero data between various formats * +* Copyright (C) 2006 Tim "Jesus_666" Okrongli * +* * +* This program is free software; you can redistribute it and/or modify it * +* under the terms of the GNU General Public License as published by the Free * +* Software Foundation; either version 2 of the License, or (at your option) * +* any later version. * +* * +* This program is distributed in the hope that it will be useful, but WITHOUT * +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * +* more details. * +* * +* You should have received a copy of the GNU General Public License along with * +* this program; if not, write to the Free Software Foundation, Inc., 51 * +* Franklin St, Fifth Floor, Boston, MA 02110, USA * +*******************************************************************************/ + +#include "modules.h" +#include "iostream" +// These two are used as an el-cheapo tokenizer +#include <sstream> +#include <vector> + +// Counts read lines, used for error messages +#define getline lineno++; getline + +// Some conversion functions we need +inline int strtoi(string str) { return atoi(str.c_str()); } +inline string itostr(int i) +{ + stringstream ss; + ss << i; + return ss.str(); +} +inline bool strtobool(string str) +{ + return ("TRUE" == str) ? true : false; +} + +// Shorthand for adding talents to a talent group +void addTalent(talentgruppe* &tg, string name, Grundwert gw0, Grundwert gw1, + Grundwert gw2, int taw, int stps, int stpsue, int fvue) +{ + (*tg)[name] = new s_talent; + s_talent* talent = (*tg)[name]; + talent->gw[0] = gw0; + talent->gw[1] = gw1; + talent->gw[2] = gw2; + talent->taw = taw; + talent->stps = stps; + talent->stpsue = stpsue; + talent->fvue = fvue; +} + +// registers the plugin with the main program +s_plugdata* registerPlugin() +{ + s_plugdata* pd = new s_plugdata; + pd->name = "h42"; + pd->capabilities = CAN_READ; + pd->version = 0; + pd->description = "Liest h42-Heldendokumente"; + pd->extensions.push_back("h42"); + // Just leave these two lines be. The main program relies on them. + pd->read = &readHero; + pd->write = &writeHero; + + return pd; +} + +// Reads a h42 file into an s_hero struct +s_held* readHero(char* filename) +{ + ifstream source (filename); + if (!source.is_open()) + { + cout << "Fehler beim Öffnen von " << filename << endl; + exit(101); + } + + // No need to initialize these before we have opened the file + int lineno = 0; + string tempstring, buffer; + stringstream ss(stringstream::in | stringstream::out); + vector<string> tokens; + int i = 0; + s_held* held = new s_held; + + // Okay, the file is open and everything's set up. First we read the hero's + // class and the attributes + + // I love reading in string values + getline(source, held->klasse); + + // My love for multiple values in one line is somewhat lesser, though an + // std::stringstream makes for a decent tokenizer, as it treats whitespace as + // separators + getline(source, tempstring); + ss << tempstring; + ss >> buffer; held->mu = held->mu_gw = strtoi(buffer); + ss >> buffer; held->kl = held->kl_gw = strtoi(buffer); + ss >> buffer; held->in = held->in_gw = strtoi(buffer); + ss >> buffer; held->ch = held->ch_gw = strtoi(buffer); + ss >> buffer; held->ge = held->ge_gw = strtoi(buffer); + ss >> buffer; held->ff = held->ff_gw = strtoi(buffer); + ss >> buffer; held->kk = held->kk_gw = strtoi(buffer); + getline(source, tempstring); + + // We should reset stringstreams before reusing them, just in case there's + // still junk left from the last line + ss.str(""); ss.clear(); + ss << tempstring; + ss >> buffer; held->ag = held->ag_gw = strtoi(buffer); + ss >> buffer; held->ha = held->ha_gw = strtoi(buffer); + ss >> buffer; held->ra = held->ra_gw = strtoi(buffer); + ss >> buffer; held->ta = held->ta_gw = strtoi(buffer); + ss >> buffer; held->ng = held->ng_gw = strtoi(buffer); + ss >> buffer; held->gg = held->gg_gw = strtoi(buffer); + ss >> buffer; held->jz = held->jz_gw = strtoi(buffer); + + // Next comes the talent handling. Since combat talents are special and come + // first we do some custom stuff with them + + // The group name of the combat talents. We throw this away as it doesn't + // conform to what most people expect to see on their character sheet. + // Besides, only regular talents are stored in name:group format + getline(source, tempstring); + // Unknown Value 1. We also throw this away since it seems to be pointless + // anyway + getline(source, tempstring); + getline(source, tempstring); // Number of combat talents + held->kampftalente.reserve(strtoi(tempstring)); + + for (int talentsToGo = strtoi(tempstring); talentsToGo > 0; talentsToGo--) + { + string talentName = ""; + int beMod = 0; + int taw, stps, stpsue, fvue; + bool bFirstPart = true; + + getline(source, tempstring); + ss.str(""); ss.clear(); // reset stringstream + ss << tempstring; + ss >> buffer; + // TODO: Make this loop better + while (buffer.substr(0, 1) != "("/* && !(ss.eol())*/) + { + talentName += ((bFirstPart) ? "" : " ") + buffer; + bFirstPart = false; + string lastVal = buffer; + ss >> buffer; + if (buffer == lastVal) break; + } + + // Not all combat talents have a modifier + if (buffer.substr(0, 1) == "(") + beMod = strtoi(buffer.substr(3, buffer.size() - 4)); + + getline(source, tempstring); + ss.str(""); ss.clear(); // reset stringstream + ss << tempstring; + ss >> buffer; taw = strtoi(buffer); + ss >> buffer; stps = strtoi(buffer); + ss >> buffer; stpsue = strtoi(buffer); + ss >> buffer; fvue = strtoi(buffer); + + held->kampftalente[talentName] = new s_kampftalent; + // This impreoves performance significantly as the [] operator is extremely + // expensive for umaps, so invoking it over and over is a bad idea + s_kampftalent* ktal = held->kampftalente[talentName]; + ktal->beMod = beMod; + ktal->taw = taw; + ktal->stps = stps; + ktal->stpsue = stpsue; + ktal->fvue = fvue; + // The following values can only be determined later and are thus filled + // with dummy values + ktal->at = 0; + ktal->pa = 0; + } + + // The number of talent groups we still have to parse + int talentGroupsToGo = 8; // No combat talents + for (; talentGroupsToGo > 0; talentGroupsToGo--) + { + // Uh-oh, trouble. I just realized that we need wstrings everywhere, + // due to the fact that we have to deal with umlauts etc. + // I think we'll just have to replace all instances of "string" with + // "wstring" and "stringstream" with "wstringstream". Still, I can't be + // arsed to do it right now. + // The strtoi function, however, could present a problem, depending on + // how easy it is to cast const wchar_t* to const char*. + + // Eh, whatever. For the time being we just assume that the file is in + // latin-1 and the output plugin expects latin-1 data. + + string currentGroup; + //int unknownValue1; // unused until we know what it's good for + int talentsToGo; + + + getline(source, currentGroup); + // The following line was deprecated in favor of [] = new + //held->talente.insert(make_pair(currentGroup, new talentgruppe)); + held->talente[currentGroup] = new talentgruppe; + talentgruppe* tgroup = held->talente[currentGroup]; + + // see definition of unknownValue1 + getline(source, tempstring); // we skip the unknown value + //unknownValue1 = strtoi(tempstring); + getline(source, tempstring); + talentsToGo = strtoi(tempstring); + + for (; talentsToGo > 0; talentsToGo--) + { + string talentName = ""; + Grundwert gw0, gw1, gw2; + int taw, stps, stpsue, fvue; + bool bFirstPart = true; + + getline(source, tempstring); + ss.str(""); ss.clear(); // reset stringstream + ss << tempstring; + ss >> buffer; + // TODO: Make this loop better + while (buffer.substr(0, 1) != "("/* && !(ss.eol())*/) + { + talentName += ((bFirstPart) ? "" : " ") + buffer; + bFirstPart = false; + string lastVal = buffer; + ss >> buffer; + if (buffer == lastVal) break; + } + + if (buffer.substr(0, 1) == "(") + { + gw0 = strtogw(buffer.substr(1, 2)); + gw1 = strtogw(buffer.substr(4, 2)); + gw2 = strtogw(buffer.substr(7, 2)); + + if (ATTR_INVALID_GW == gw0 || ATTR_INVALID_GW == gw1 || ATTR_INVALID_GW == gw2) + { + cout << "Datei kann nicht gelesen werden: Ungültiger Talentname " << + "in Zeile " << lineno << endl; + exit(102); + } + } + else + { + cout << "Datei kann nicht gelesen werden: Ungültiger Talentname in " << + "Zeile " << lineno << endl; + exit(102); + } + + getline(source, tempstring); + ss.str(""); ss.clear(); + ss << tempstring; + ss >> buffer; taw = strtoi(buffer); + ss >> buffer; stps = strtoi(buffer); + ss >> buffer; stpsue = strtoi(buffer); + ss >> buffer; fvue = strtoi(buffer); + + addTalent(tgroup, talentName, gw0, gw1, gw2, taw, stps, stpsue, fvue); + } + } + + // Whew. Time to relax with some simple one-value lines + + // h42 doesn't distinguish between current and map HP/MP/KP + getline(source, tempstring); held->le = held->le_gw = strtoi(tempstring); + getline(source, tempstring); held->ae = held->ae_gw = strtoi(tempstring); + getline(source, tempstring); held->ke = held->ke_gw = strtoi(tempstring); + getline(source, tempstring); held->zf_stps = strtoi(tempstring); + getline(source, tempstring); held->talent_stps = strtoi(tempstring); + getline(source, tempstring); held->taw_zf_vs = strtoi(tempstring); + getline(source, tempstring); held->be_minus = strtoi(tempstring); + getline(source, tempstring); held->gs = strtoi(tempstring); + getline(source, tempstring); held->mr_bonus = strtoi(tempstring); + getline(source, held->le_plus_ps); + getline(source, held->ae_plus_ps); + getline(source, tempstring); held->le_ae_separat = strtobool(tempstring); + getline(source, tempstring); held->magiertyp = strtobool(tempstring); + + // Okay, funtime's over, here comes another one of those pesky arrays + + // Time for the spells + getline(source, tempstring); + for (int spellsToGo = strtoi(tempstring); spellsToGo > 0; spellsToGo--) + { + string zauberName = "", gebiet, herkunft; + Grundwert gw0, gw1, gw2; + int taw, stps, stpsue, fvue; + bool bFirstPart = true; + + getline(source, tempstring); + ss.str(""); ss.clear(); // reset stringstream + ss << tempstring; + ss >> buffer; + // TODO: Make this loop better + while (buffer.substr(0, 1) != "("/* && !(ss.eol())*/) + { + zauberName += ((bFirstPart) ? "" : " ") + buffer; + bFirstPart = false; + string lastVal = buffer; + ss >> buffer; + if (buffer == lastVal) break; + } + + if (buffer.substr(0, 1) == "(") + { + gw0 = strtogw(buffer.substr(1, 2)); + gw1 = strtogw(buffer.substr(4, 2)); + gw2 = strtogw(buffer.substr(7, 2)); + + if (ATTR_INVALID_GW == gw0 || ATTR_INVALID_GW == gw1 || ATTR_INVALID_GW == gw2) + { + cout << "Datei kann nicht gelesen werden: Ungültiger Zaubername " << + "in Zeile " << lineno << endl; + exit(103); + } + } + else + { + cout << "Datei kann nicht gelesen werden: Ungültiger Zaubername in " << + "Zeile " << lineno << endl; + exit(103); + } + + getline(source, herkunft); + getline(source, gebiet); + + getline(source, tempstring); + ss.str(""); ss.clear(); + ss << tempstring; + ss >> buffer; taw = strtoi(buffer); + ss >> buffer; stps = strtoi(buffer); + ss >> buffer; stpsue = strtoi(buffer); + ss >> buffer; fvue = strtoi(buffer); + + held->zauber[zauberName] = new s_zauber; + // This impreoves performance significantly as the [] operator is extremely + // expensive for umaps, so invoking it over and over is a bad idea + s_zauber* zbr = held->zauber[zauberName]; + zbr->gebiet = gebiet; + zbr->herkunft = herkunft; + zbr->taw = taw; + zbr->stps = stps; + zbr->stpsue = stpsue; + zbr->fvue = fvue; + } + + // And another one, this time quite trivial: The list of learnable special + // abilities + getline(source, tempstring); + for (int abilitesToGo = strtoi(tempstring); abilitesToGo > 0; abilitesToGo--) + { + // We learn which ones actually have been learned later + getline(source, tempstring); + held->sonderfertigkeiten[tempstring] = false; + } + + // Whee, another field of POD entries! + getline(source, tempstring); held->hat_rituale = strtobool(tempstring); + getline(source, tempstring); held->ritual_stps = strtoi(tempstring); + getline(source, held->name); + getline(source, held->geburtsort); + getline(source, held->haarfarbe); + getline(source, held->stand); + getline(source, tempstring); held->groesse = strtoi(tempstring); + getline(source, tempstring); held->gewicht = strtoi(tempstring); + + source.close(); + return held; +} + +void writeHero(s_held* held, char* filename) +{ +} Modified: h422/trunk/src/main.cpp =================================================================== --- h422/trunk/src/main.cpp 2006-12-09 01:45:08 UTC (rev 10) +++ h422/trunk/src/main.cpp 2006-12-09 04:03:06 UTC (rev 11) @@ -84,7 +84,6 @@ sprintf(fullname, "%s%s%s", sdir.c_str(), PATH_SEPARATOR, theentry->d_name); void* handle = dlopen(fullname, RTLD_NOW | RTLD_LOCAL); - cerr << dlerror() << endl; if (NULL == handle) { cerr << dlerror() << endl; Modified: h422/trunk/src/main.h =================================================================== --- h422/trunk/src/main.h 2006-12-09 01:45:08 UTC (rev 10) +++ h422/trunk/src/main.h 2006-12-09 04:03:06 UTC (rev 11) @@ -1,33 +1,41 @@ -/******************************************************************************* -* h422 - converts DSAv3 hero data between various formats ... [truncated message content] |
From: <j6...@us...> - 2006-12-09 01:45:12
|
Revision: 10 http://svn.sourceforge.net/dsaster/?rev=10&view=rev Author: j6cubic Date: 2006-12-08 17:45:08 -0800 (Fri, 08 Dec 2006) Log Message: ----------- Just committing my current stuff to push the code containing the weird string output problem to everyone. Also, further data added to the hero struct. Modified Paths: -------------- h422/trunk/src/commondefs.h h422/trunk/src/io_debug.cpp h422/trunk/src/io_h42.cpp h422/trunk/src/io_plaintext.cpp Modified: h422/trunk/src/commondefs.h =================================================================== --- h422/trunk/src/commondefs.h 2006-12-07 13:35:06 UTC (rev 9) +++ h422/trunk/src/commondefs.h 2006-12-09 01:45:08 UTC (rev 10) @@ -95,6 +95,17 @@ int pa; // Parade ohne BE }; +struct s_zauber +{ + Grundwert gw[3]; + string herkunft; + string gebiet; + int taw; + int stps; // Steigerungen/Stufe + int stpsue; // STPS übrig + int fvue; // Fehlversuche übrig +}; + //typedef map<string, s_kampftalent*> kampftalentgruppe; //typedef map<string, s_talent*> talentgruppe; typedef umap<string, s_kampftalent*> kampftalentgruppe; @@ -161,18 +172,25 @@ int mr; int mr_bonus; int gs; - string le_plus_pro_stufe; - string asp_plus_pro_stufe; + string le_plus_ps; + string ae_plus_ps; int zf_stps; int talent_stps; int taw_zf_vs; + int ritual_stps; bool le_ae_separat; bool magiertyp; + bool hat_rituale; + kampftalentgruppe kampftalente; //map<string, talentgruppe*> talente; umap<string, talentgruppe*> talente; + umap<string, s_zauber*> zauber; + // All we store about these is the name and information on whether the ability + // is already learned or not. An umap<string, bool> should suffice + umap<string, bool> sonderfertigkeiten; // DSA3.5-specific stuff string abenteuer; Modified: h422/trunk/src/io_debug.cpp =================================================================== --- h422/trunk/src/io_debug.cpp 2006-12-07 13:35:06 UTC (rev 9) +++ h422/trunk/src/io_debug.cpp 2006-12-09 01:45:08 UTC (rev 10) @@ -97,7 +97,7 @@ addTalent(hero->talente["Eigene"], "Absurd lange Namen fuer Talente erfinden", KL, IN, GE, -12, 2, 1, 0); return hero; } - + void writeHero(s_held* held, char* filename) { } Modified: h422/trunk/src/io_h42.cpp =================================================================== --- h422/trunk/src/io_h42.cpp 2006-12-07 13:35:06 UTC (rev 9) +++ h422/trunk/src/io_h42.cpp 2006-12-09 01:45:08 UTC (rev 10) @@ -224,6 +224,7 @@ ss.str(""); ss.clear(); // reset stringstream ss << tempstring; ss >> buffer; + // TODO: Make this loop better while (buffer.substr(0, 1) != "("/* && !(ss.eol())*/) { talentName += ((bFirstPart) ? "" : " ") + buffer; @@ -277,11 +278,99 @@ getline(source, tempstring); held->be_minus = strtoi(tempstring); getline(source, tempstring); held->gs = strtoi(tempstring); getline(source, tempstring); held->mr_bonus = strtoi(tempstring); + getline(source, held->le_plus_ps); + getline(source, held->ae_plus_ps); getline(source, tempstring); held->le_ae_separat = strtobool(tempstring); getline(source, tempstring); held->magiertyp = strtobool(tempstring); // Okay, funtime's over, here comes another one of those pesky arrays + // Time for the spells + getline(source, tempstring); + for (int spellsToGo = strtoi(tempstring); spellsToGo > 0; spellsToGo--) + { + string zauberName = "", gebiet, herkunft; + Grundwert gw0, gw1, gw2; + int taw, stps, stpsue, fvue; + bool bFirstPart = true; + + getline(source, tempstring); + ss.str(""); ss.clear(); // reset stringstream + ss << tempstring; + ss >> buffer; + // TODO: Make this loop better + while (buffer.substr(0, 1) != "("/* && !(ss.eol())*/) + { + zauberName += ((bFirstPart) ? "" : " ") + buffer; + bFirstPart = false; + string lastVal = buffer; + ss >> buffer; + if (buffer == lastVal) break; + } + + if (buffer.substr(0, 1) == "(") + { + gw0 = strtogw(buffer.substr(1, 2)); + gw1 = strtogw(buffer.substr(4, 2)); + gw2 = strtogw(buffer.substr(7, 2)); + + if (INVALID_GW == gw0 || INVALID_GW == gw1 || INVALID_GW == gw2) + { + cout << "Datei kann nicht gelesen werden: Ungültiger Zaubername " << + "in Zeile " << lineno << endl; + exit(103); + } + } + else + { + cout << "Datei kann nicht gelesen werden: Ungültiger Zaubername in " << + "Zeile " << lineno << endl; + exit(103); + } + + getline(source, herkunft); + getline(source, gebiet); + + getline(source, tempstring); + ss.str(""); ss.clear(); + ss << tempstring; + ss >> buffer; taw = strtoi(buffer); + ss >> buffer; stps = strtoi(buffer); + ss >> buffer; stpsue = strtoi(buffer); + ss >> buffer; fvue = strtoi(buffer); + + held->zauber[zauberName] = new s_zauber; + // This impreoves performance significantly as the [] operator is extremely + // expensive for umaps, so invoking it over and over is a bad idea + s_zauber* zbr = held->zauber[zauberName]; + zbr->gebiet = gebiet; + zbr->herkunft = herkunft; + zbr->taw = taw; + zbr->stps = stps; + zbr->stpsue = stpsue; + zbr->fvue = fvue; + } + + // And another one, this time quite trivial: The list of learnable special + // abilities + getline(source, tempstring); + for (int abilitesToGo = strtoi(tempstring); abilitesToGo > 0; abilitesToGo--) + { + // We learn which ones actually have been learned later + getline(source, tempstring); + held->sonderfertigkeiten[tempstring] = false; + } + + // Whee, another field of POD entries! + getline(source, tempstring); held->hat_rituale = strtobool(tempstring); + getline(source, tempstring); held->ritual_stps = strtoi(tempstring); + getline(source, held->name); + getline(source, held->geburtsort); + getline(source, held->haarfarbe); + getline(source, held->stand); + getline(source, tempstring); held->groesse = strtoi(tempstring); + getline(source, tempstring); held->gewicht = strtoi(tempstring); + source.close(); return held; } Modified: h422/trunk/src/io_plaintext.cpp =================================================================== --- h422/trunk/src/io_plaintext.cpp 2006-12-07 13:35:06 UTC (rev 9) +++ h422/trunk/src/io_plaintext.cpp 2006-12-09 01:45:08 UTC (rev 10) @@ -104,6 +104,17 @@ if ("" != held->abenteuer) cout << "Abenteuer: " << printIndented(held->abenteuer, 69) << endl; +/*printf("%d: %s\n", held->name.size(), held->name.c_str()); +printf("%d: %s\n", held->klasse.size(), held->klasse.c_str()); +printf("%d: %s\n", held->gottheit.size(), held->gottheit.c_str()); +printf("%d: %s\n", held->titel.size(), held->titel.c_str()); +printf("%d: %s\n", held->stand.size(), held->stand.c_str()); +printf("%d: %s\n", held->geburtsort.size(), held->geburtsort.c_str()); +printf("%d: %s\n", held->haarfarbe.size(), held->haarfarbe.c_str()); +printf("%d: %s\n", held->augenfarbe.size(), held->augenfarbe.c_str()); +printf("%d: %s\n", held->abenteuer.size(), held->abenteuer.c_str()); + exit(222);*/ + printf ("geboren am %d. %s %d %s\n\n", held->geburtstag, ((held->geburtsmonat != Namenloser) ? montostr[held->geburtsmonat].c_str() @@ -180,4 +191,27 @@ (*tgit).second->fvue); } } + cout << endl; + + if (0 < held->zauber.size()) + { + cout << "Zauber" << endl; + for (umap<string, s_zauber*>::iterator zit = held->zauber.begin(); + zit != held->zauber.end(); zit ++) + { + printf(" %s TaW:%3d StPS: %d/%d VFv: %d\n", + printIndented((* zit).first, 50).c_str(), + (* zit).second->taw, + (* zit).second->stpsue, (* zit).second->stps, + (* zit).second->fvue); + printf(" Gebiet: %d Herkunft: %d\n", + (* zit).second->gebiet.size(), + (* zit).second->herkunft.size()); + printf(" Gebiet: %s Herkunft: %s\n", + (* zit).second->gebiet.c_str(), + (* zit).second->herkunft.c_str()); + cout << (* zit).second->gebiet << endl; + cout << (* zit).second->herkunft << endl; + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <j6...@us...> - 2006-12-07 13:35:16
|
Revision: 9 http://svn.sourceforge.net/dsaster/?rev=9&view=rev Author: j6cubic Date: 2006-12-07 05:35:06 -0800 (Thu, 07 Dec 2006) Log Message: ----------- Major update (mainly due to the fact that SF's SVN didn't let me in for ages, mainly due to the fact that I compiled neon without SSL support): - Played around with the CMake scripts to make them prefixed Portage-friendly - Also reduced indentation in CMakeLists.txt from one tab to two spaces to accomodate for the increasing indentation levels. I mean, it's like the file has developed whitespace cancer - Did the first work on an h42 parser. Extremely easy work, although we'll have to rewrite it later when a couple other things are done (most notably the wcharization - see io_h42.cpp, lines 188 ff.) - Added a test hero for the h422 input plugin - Started writing a LaTeX template; I'm planning a generic search-and-replace output plugin which can be used with it. Another option would be to dump the data into a well-known format that can be piped through scripts, but I think the users (if there will be any) will prefer to have this stuff integrated - All modules now include <fstream>, which makes sense because most of them will want to read or write files. I might remove it again, though, if someone gives me a good reason (such as wanting to use a different, better I/O method) - Introduced gettext and subsequently commented it out again due to several factors such as the fact that I have no idea how well gettext and wchar_t* mix - Finally re-reverse-engineered most of the h422 format. There are only two unknown lines left and I think only one of them is not safe to ignore - Wrote a wrapper for std::vector that makes it behave like an std::map; this is used to organize talents and talent groups as the STL offers no unsorted equivalent to std::map and we don't want them to be sorted - Added an s_kampftalent struct for combat talents. Generally did a major rewrite of commondefs.h Modified Paths: -------------- h422/trunk/CMakeLists.txt h422/trunk/FindDL.cmake h422/trunk/notes/h42.format-r2 h422/trunk/src/commondefs.h h422/trunk/src/io_debug.cpp h422/trunk/src/io_h42.cpp h422/trunk/src/io_plaintext.cpp h422/trunk/src/modules.h Added Paths: ----------- h422/trunk/FindIntl.cmake h422/trunk/notes/template.tex h422/trunk/notes/test.h42 h422/trunk/src/umap.h Modified: h422/trunk/CMakeLists.txt =================================================================== --- h422/trunk/CMakeLists.txt 2006-10-24 16:55:23 UTC (rev 8) +++ h422/trunk/CMakeLists.txt 2006-12-07 13:35:06 UTC (rev 9) @@ -1,7 +1,8 @@ PROJECT (h422) CMAKE_MINIMUM_REQUIRED (VERSION 2.0) INCLUDE (FindDL.cmake) -INCLUDE (FindIntl.cmake) +# Not necessary without gettext +#INCLUDE (FindIntl.cmake) SET (EXECUTABLE_OUTPUT_PATH "./bin") SET (LIBRARY_OUTPUT_PATH "./bin/plugins") @@ -13,39 +14,53 @@ SET (LIBEXTENSION "so") IF (UNIX) - SET (PATH_SEPARATOR "/") - - IF (APPLE) - MESSAGE (STATUS "OS X detected, using Apple-specific settings") - SET (CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS - "-bundle -headerpad_max_install_names") - SET (CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS - "-bundle -headerpad_max_install_names") - SET (CMAKE_CXX_CREATE_SHARED_LIBRARY - "<CMAKE_CXX_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") - SET (CMAKE_C_CREATE_SHARED_LIBRARY - "<CMAKE_C_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") - SET (LIBEXTENSION "dylib") - ELSE (APPLE) - IF (DL_FOUND) - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--export-dynamic -ldl") - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,--export-dynamic -ldl") - ELSE (DL_FOUND) - MESSAGE (ERROR "libdl and/or dlfcn.h could not be found!") - ENDIF (DL_FOUND) - ENDIF (APPLE) + SET (PATH_SEPARATOR "/") + + IF (APPLE) + MESSAGE (STATUS "OS X detected, using Apple-specific settings") + SET (CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS + "-bundle -headerpad_max_install_names") + SET (CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS + "-bundle -headerpad_max_install_names") + SET (CMAKE_CXX_CREATE_SHARED_LIBRARY + "<CMAKE_CXX_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") + SET (CMAKE_C_CREATE_SHARED_LIBRARY + "<CMAKE_C_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") + SET (LIBEXTENSION "dylib") + + FOREACH (DIR + /Library/Gentoo + ~/Library/Gentoo) + IF (EXISTS ${DIR}) + MESSAGE (STATUS "Prefixed Gentoo detected; please check your paths") + #MESSAGE (STATUS "Prefixed Gentoo detected; modifying search paths") + #SET (INCLUDE_SPATH + # "${DIR}/usr/include ${DIR}/usr/local/include ${INCLUDE_SPATH}" + # "bla") + #SET (LIBRARY_SPATH + # "${DIR}/usr/lib ${DIR}/usr/local/lib ${LIBRARY_SPATH}") + ENDIF (EXISTS ${DIR}) + ENDFOREACH (DIR) + ELSE (APPLE) + IF (DL_FOUND) + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--export-dynamic -ldl") + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,--export-dynamic -ldl") + ELSE (DL_FOUND) + MESSAGE (ERROR "libdl and/or dlfcn.h could not be found!") + ENDIF (DL_FOUND) + ENDIF (APPLE) ENDIF (UNIX) IF (WIN32) - SET (LIBEXTENSION "dll") - SET (PATH_SEPARATOR "\\") + SET (LIBEXTENSION "dll") + SET (PATH_SEPARATOR "\\") ENDIF (WIN32) #IF (INTL_FOUND) -# SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lintl") -# SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -lintl") +# SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lintl") +# SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -lintl") #ELSE (INTL_FOUND) -# MESSAGE (ERROR "libintl(.h) and/or locale.h could not be found!") +# MESSAGE (ERROR "libintl(.h) and/or locale.h could not be found!") #ENDIF (INTL_FOUND) MESSAGE(STATUS "Shared library extension: ${LIBEXTENSION}") @@ -55,24 +70,24 @@ # --- Options --- MACRO (PLUGIN NAME DESCRIPTION DEFAULT) - OPTION ("io_${NAME}" ${DESCRIPTION} ${DEFAULT}) - IF ("io_${NAME}") - SET (IO_MODULES ${IO_MODULES} ${NAME}) - ENDIF ("io_${NAME}") + OPTION ("io_${NAME}" ${DESCRIPTION} ${DEFAULT}) + IF ("io_${NAME}") + SET (IO_MODULES ${IO_MODULES} ${NAME}) + ENDIF ("io_${NAME}") ENDMACRO (PLUGIN) -PLUGIN (null "Includes the null I/O module" ON) -PLUGIN (debug "Includes the debug I/O module" ON) -PLUGIN (plaintext "Includes the plaintext I/O module" ON) -PLUGIN (h42 "Includes the h42 I/O module" ON) +PLUGIN (null "Includes the null I/O module" ON) +PLUGIN (debug "Includes the debug I/O module" ON) +PLUGIN (plaintext "Includes the plaintext I/O module" ON) +PLUGIN (h42 "Includes the h42 I/O module" ON) OPTION (DEBUG "Compiler option -g" OFF) IF (DEBUG) - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g") - MESSAGE(STATUS "Building with debug information.") + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g") + MESSAGE(STATUS "Building with debug information.") ENDIF(DEBUG) Modified: h422/trunk/FindDL.cmake =================================================================== --- h422/trunk/FindDL.cmake 2006-10-24 16:55:23 UTC (rev 8) +++ h422/trunk/FindDL.cmake 2006-12-07 13:35:06 UTC (rev 9) @@ -1,10 +1,18 @@ +# We really oughta replace the direct references to /Library/Gentoo with +# something that's dynamically used when pPortage is detected. Unfortunately +# I haven't yet managed to get FIND_* to accept dynamically generated path lists + FIND_PATH (DL_INCLUDE_DIR dlfcn.h /usr/local/include - /usr/include) + /usr/include + /Library/Gentoo/usr/include + /Library/Gentoo/usr/local/include) FIND_LIBRARY (DL_LIBRARY dl /usr/lib - /usr/local/lib) + /usr/local/lib + /Library/Gentoo/usr/lib + /Library/Gentoo/usr/local/lib) IF (DL_INCLUDE_DIR) IF (DL_LIBRARY) Added: h422/trunk/FindIntl.cmake =================================================================== --- h422/trunk/FindIntl.cmake (rev 0) +++ h422/trunk/FindIntl.cmake 2006-12-07 13:35:06 UTC (rev 9) @@ -0,0 +1,29 @@ +# We really oughta replace the direct references to /Library/Gentoo with +# something that's dynamically used when pPortage is detected. Unfortunately +# I haven't yet managed to get FIND_* to accept dynamically generated path lists + +FIND_PATH (INTL_INCLUDE_DIR libintl.h + /usr/local/include + /usr/include + /Library/Gentoo/usr/include + /Library/Gentoo/usr/local/include) + +FIND_PATH (INTL_LOCALE_INCLUDE_DIR locale.h + /usr/local/include + /usr/include + /Library/Gentoo/usr/include + /Library/Gentoo/usr/local/include) + +FIND_LIBRARY (INTL_LIBRARY intl + /usr/lib + /usr/local/lib + /Library/Gentoo/usr/lib + /Library/Gentoo/usr/local/lib) + +IF (INTL_INCLUDE_DIR) + IF (INTL_LOCALE_INCLUDE_DIR) + IF (INTL_LIBRARY) + SET (INTL_FOUND "YES") + ENDIF (INTL_LIBRARY) + ENDIF (INTL_LOCALE_INCLUDE_DIR) +ENDIF (INTL_INCLUDE_DIR) \ No newline at end of file Modified: h422/trunk/notes/h42.format-r2 =================================================================== --- h422/trunk/notes/h42.format-r2 2006-10-24 16:55:23 UTC (rev 8) +++ h422/trunk/notes/h42.format-r2 2006-12-07 13:35:06 UTC (rev 9) @@ -27,7 +27,9 @@ Herkunft Gebiet TaW Steigerungen/Stufe Steigerungen/Stufe_übrig Fehlsteigerungen_übrig -<unbekannt> +Anzahl der nachfolgenden Zeilen, die erlernbare Sonderfertigkeiten beinhalten +[Für jede Sonderfertigkeit] + Name der Sonderfertigkeit Bool: Hat Rituale Ritualsteigerungen/Stufe Heldenname @@ -75,7 +77,7 @@ RS BE Gewicht -<unbekannt, 20 Werte> +Zu druckende Kampftalente (1 = TRUE, 0 = FALSE) Dateiname des RTF-Templates für Export <unbekannt, zwei Werte> Anzahl der Zeilen für Bemerkungen Added: h422/trunk/notes/template.tex =================================================================== --- h422/trunk/notes/template.tex (rev 0) +++ h422/trunk/notes/template.tex 2006-12-07 13:35:06 UTC (rev 9) @@ -0,0 +1,121 @@ +\documentclass[12pt,a4paper]{article} + +\usepackage[left=1cm,top=1cm,right=1cm,bottom=1cm]{geometry} +\usepackage[ngerman]{babel} +\usepackage[latin1]{inputenc} +\usepackage[T1]{fontenc} +\usepackage{times} +\usepackage{multicol} +\usepackage{color} +%\usepackage{eso-pic,graphicx} + +\newcommand{\bb}[1]{\textbf{#1}} +\newsavebox{\tempboxc} +\newcommand{\cboxbgcolor}{} +\newenvironment{cbox}[1][white] +{ + \renewcommand{\cboxbgcolor}{#1} + \begin{center} + \begin{lrbox}{\tempboxc} + \begin{minipage}{\linewidth} +} +{ + \end{minipage} + \end{lrbox} + \fcolorbox{black}{\cboxbgcolor}{\usebox{\tempboxc}} + \end{center} +} + +\renewcommand{\sectionmark}[1]{} + +\begin{document} +\definecolor{boxbg}{rgb}{0.95,0.95,0.95} + +%\section{Allgemeine Daten} +\centering{\Huge{}DSA-Heldendokument\normalsize} +\large +\begin{cbox}[boxbg] +\begin{tabular*}{\columnwidth}{@{\extracolsep{\fill}}r@{\extracolsep{1ex}}l@{\extracolsep{\fill}}r + @{\extracolsep{1ex}}l@{\extracolsep{\fill}}r@{\extracolsep{1ex}}l + @{\extracolsep{\fill}}} +Name & \multicolumn{5}{@{}l}{\bb{:name:}}\\ +Klasse & \multicolumn{3}{@{}l}{\bb{:klasse:}} & Ruf & \bb{:ruf:}\\ +Geburtsdatum & \bb{:geburtstag:} & Alter & \bb{:alter:} & Geschlecht & \bb{:geschlecht:} \\ +Geburtsort & \bb{:geburtsort:} & Gr\xF6\xDFe & \bb{:groesse:} & Gewicht & \bb{:gewicht:} \\ +Haarfarbe & \bb{:haarfarbe:} & Augenfarbe & \bb{:augenfarbe:} & Stand d. Eltern & \bb{:stand:} \\ +Abenteuer & \multicolumn{5}{@{}l}{\bb{:abenteuer:}} +\end{tabular*} +\end{cbox} + +\begin{center} + \begin{tabular*}{\columnwidth}{@{\extracolsep{\fill}}lcr@{\extracolsep{0ex}}} + \begin{tabular}{|l|c|c|} + \hline + Mut & :mu-gw: & :mu:\\ + \hline + Klugheit & :kl-gw: & :kl:\\ + \hline + Intuition & :in-gw: & :in:\\ + \hline + Charisma & :ch-gw: & :ch:\\ + \hline + Gewandtheit & :ge-gw: & :ge:\\ + \hline + Fingerfertigkeit & :ff-gw: & :ff:\\ + \hline + K\xF6rperkraft & :kk-gw: & :kk:\\ + \hline + \end{tabular} & + \begin{tabular}{|l|c|c|} + \hline + Aberglaube & :ag-gw: & :ag:\\ + \hline + H\xF6henangst & :ha-gw: & :ha:\\ + \hline + Raumangst & :ra-gw: & :ra:\\ + \hline + Totenangst & :ta-gw: & :ta:\\ + \hline + Neugier & :ng-gw: & :ng:\\ + \hline + Goldgier & :gg-gw: & :gg:\\ + \hline + J\xE4hzorn & :jz-gw: & :jz:\\ + \hline + \end{tabular} & + \begin{tabular}{|l|c|c|} + \hline + Lebensenergie & :mu-gw: & :mu:\\ + \hline + Ausdauer & :kl-gw: & :kl:\\ + \hline + Astralenergie & :in-gw: & :in:\\ + \hline + Karmaenergie & :ch-gw: & :ch:\\ + \hline + Magieresistenz \tiny(:mr-bonus:)\large & \multicolumn{2}{c|}{:mr:}\\ + \hline + Abenteuerpunkte & \multicolumn{2}{c|}{:ap:/:ap-ns:}\\ + \hline + Stufe & \multicolumn{2}{c|}{:stufe:}\\ + \hline + \end{tabular} + \end{tabular*} +\end{center} + +\begin{center} + + \begin{tabular*}{\columnwidth}{@{\extracolsep{\fill}}lr@{\extracolsep{0ex}}} + \begin{tabular}{|l|c|c|} + \hline + Bla &\xA0Bla & Bla\\ + \hline + \end{tabular} & + \begin{tabular}{|c|c|} + \hline + Bla & Bla\\ + \hline + \end{tabular} + \end{tabular*} +\end{center} +\end{document} \ No newline at end of file Added: h422/trunk/notes/test.h42 =================================================================== --- h422/trunk/notes/test.h42 (rev 0) +++ h422/trunk/notes/test.h42 2006-12-07 13:35:06 UTC (rev 9) @@ -0,0 +1,449 @@ +Magier (keine Akademie) +11 14 11 14 11 12 11 +3 4 4 3 5 4 4 +Kampftechniken +0 +20 +Raufen (BE) +9 1 0 0 +Boxen (BE) +-1 1 0 0 +Hruruzat (BE) +-6 1 0 0 +Ringen (BE) +0 1 0 0 +\xC4xte und Beile (BE-3) +-5 1 0 0 +Dolche (BE-1) +6 1 0 0 +Infanteriewaffen (BE-3) +-5 1 0 0 +Linksh\xE4ndig +0 1 0 0 +Kettenwaffen (BE-2) +-5 1 0 0 +Peitsche (BE) +0 1 0 0 +Scharfe Hiebwaffen (BE-2) +-4 1 0 0 +Schwerter (BE-2) +1 1 0 0 +Speere und St\xE4be (BE-2) +8 1 0 0 +Stichwaffen (BE-1) +1 1 0 0 +Stumpfe Hiebwaffen (BE-3) +0 1 0 0 +Zweih\xE4nder (BE-2) +-5 1 0 0 +Lanzenreiten +-6 1 0 0 +Schu\xDFwaffen +-2 1 0 0 +Wurfwaffen (BE-3) +0 1 0 0 +Schleuder +-2 1 0 0 +K\xF6rperliche Talente +0 +12 +Akrobatik (MU/GE/KK) +-3 2 0 0 +Fliegen (MU/KL/GE) +-1 2 0 0 +Gaukeleien (CH/FF/GE) +1 2 0 0 +Klettern (MU/GE/KK) +4 2 0 0 +K\xF6rperbeherrschung (MU/IN/GE) +4 2 0 0 +Reiten (CH/GE/KK) +2 2 0 0 +Schleichen (MU/IN/GE) +3 2 0 0 +Schwimmen (MU/GE/KK) +5 2 0 0 +Selbstbeherrschung (MU/KK/KK) +7 2 0 0 +Sich Verstecken (MU/IN/GE) +3 2 0 0 +Tanzen (CH/GE/GE) +3 2 0 0 +Zechen (KL/IN/KK) +2 2 0 0 +Gesellschaft +0 +10 +Bekehren/\xDCberzeugen (KL/IN/CH) +-2 2 0 0 +Bet\xF6ren (IN/CH/CH) +0 2 0 0 +Etikette (KL/CH/GE) +4 2 0 0 +Feilschen (MU/KL/CH) +4 2 0 0 +Gassenwissen (KL/IN/CH) +4 2 0 0 +Lehren (KL/IN/CH) +3 2 0 0 +L\xFCgen (MU/IN/CH) +5 2 0 0 +Menschenkenntnis (KL/IN/CH) +5 2 0 0 +Sch\xE4tzen (KL/IN/IN) +4 2 0 0 +Sich Verkleiden (MU/FF/GE) +0 2 0 0 +Natur +0 +9 +F\xE4hrtensuchen (KL/IN/GE) +-5 2 0 0 +Fallenstellen (KL/FF/KK) +-5 2 0 0 +Fesseln/Entfesseln (FF/GE/KK) +0 2 0 0 +Fischen/Angeln (IN/FF/KK) +-3 2 0 0 +Pflanzenkunde (KL/IN/FF) +8 2 0 0 +Orientierung (KL/IN/IN) +5 2 0 0 +Tierkunde (MU/KL/IN) +-1 2 0 0 +Wettervorhersage (KL/IN/IN) +-3 2 0 0 +Wildnisleben (IN/FF/GE) +2 2 0 0 +Wissenstalente +0 +14 +Alchimie (MU/KL/FF) +8 3 0 0 +Alte Sprachen (KL/KL/IN) +4 3 0 0 +Geographie (KL/KL/IN) +0 3 0 0 +Geschichtswissen (KL/KL/IN) +4 3 0 0 +G\xF6tter und Kulte (KL/IN/CH) +5 3 0 0 +Kriegskunst (MU/KL/CH) +0 3 0 0 +Lesen/Schreiben (KL/KL/FF) +6 3 0 0 +Magiekunde (KL/KL/IN) +9 3 0 0 +Mechanik (KL/KL/FF) +2 3 0 0 +Rechnen (KL/KL/IN) +5 3 0 0 +Rechtskunde (KL/IN/CH) +1 3 0 0 +Sprachen Kennen (KL/IN/CH) +7 3 0 0 +Staatskunst (KL/IN/CH) +-4 3 0 0 +Sternkunde (KL/KL/IN) +2 3 0 0 +Handwerk +0 +18 +Abrichten (MU/IN/CH) +-2 2 0 0 +Boote Fahren (FF/GE/KK) +-2 2 0 0 +Fahrzeug Lenken (IN/CH/FF) +0 2 0 0 +Falschspiel (MU/CH/FF) +0 2 0 0 +Heilkunde, Gift (MU/KL/IN) +2 2 0 0 +Heilkunde, Krankh. (MU/KL/CH) +3 2 0 0 +Heilkunde, Seele (IN/CH/CH) +2 2 0 0 +Heilkunde, Wunden (KL/CH/FF) +3 2 0 0 +Holzbearbeitung (KL/FF/KK) +0 2 0 0 +Kochen (KL/IN/FF) +6 2 0 0 +Lederarbeiten (KL/FF/FF) +-1 2 0 0 +Malen/Zeichnen (KL/IN/FF) +5 2 0 0 +Musizieren (KL/IN/FF) +-2 2 0 0 +Schneidern (KL/FF/FF) +-1 2 0 0 +Schl\xF6sser Knacken (IN/FF/FF) +0 2 0 0 +Singen (KL/IN/CH) +0 2 0 0 +Taschendiebstahl (MU/IN/FF) +-2 2 0 0 +T\xF6pfern (KL/FF/FF) +-1 2 0 0 +Intuitive Begabungen +0 +5 +Gefahreninstinkt (KL/IN/IN) +8 1 0 0 +Gl\xFCcksspiel (MU/IN/IN) +0 1 0 0 +Prophezeien (IN/IN/CH) +0 1 0 0 +Sinnessch\xE4rfe (KL/IN/IN) +2 1 0 0 +Stimmen Imitieren (KL/IN/CH) +-4 1 0 0 +Sondertalente/Berufe +0 +0 +Schamanenrituale +2 +0 +35 +70 +0 +45 +20 +5 +0 +10 +2 +1W6 +1W6 +FALSE +TRUE +29 +Gardianum Paradei (IN/CH/KK) +gildenmagisch +Antimagie +-1 2 0 0 +Horriphobus (MU/IN/CH) +gildenmagisch +Beherrschung +12 2 0 0 +Manifesto, Kraft der Sechse (KL/IN/CH) +gildenmagisch +Beschw\xF6rung III +-6 2 0 0 +Foramen Foraminor (KL/KL/FF) +gildenmagisch +Bewegung +9 2 0 0 +Motoricus Motilitich (KL/FF/KK) +gildenmagisch +Bewegung +9 2 0 0 +Balsamsalabunde (KL/IN/CH) +auelfisch +Heilung +8 1 0 0 +Anal\xFCs Arcanstruktur (KL/KL/IN) +gildenmagisch +Hellsicht +8 2 0 0 +Odem Arcanum Senserei (KL/IN/CH) +auelfisch +Hellsicht +8 1 0 0 +Sensibar - wahr und klar (KL/IN/CH) +auelfisch +Hellsicht +6 1 0 0 +Duplicatus Doppelpein (KL/CH/GE) +gildenmagisch +Illusion +8 2 0 0 +Blitz Dich find (KL/IN/GE) +waldelfisch +Kampf +14 3 0 0 +Fulminictus Donnerkeil (KL/GE/KK) +auelfisch +Kampf +15 3 0 0 +Plumbumbarum (CH/GE/KK) +gildenmagisch +Kampf +9 3 0 0 +Unitatio Geistesbund (IN/CH/KK) +firnelfisch +Verst\xE4ndigung +0 1 0 0 +Arcano Psychostabilis (MU/KL/CH) +gildenmagisch +Verw. Lebew. +-1 2 0 0 +Armatrutz (IN/GE/KK) +auelfisch +Verw. Lebew. +7 1 0 0 +Charisma, Pers\xF6nlichkeit (KL/CH/CH) +gildenmagisch +Verw. Lebew. +0 2 0 0 +Empathie und sechster Sinn (KL/IN/CH) +satuarisch +Verw. Lebew. +-1 1 0 0 +Fingerspiel und schnelle Hand (KL/CH/FF) +auelfisch +Verw. Lebew. +-1 1 0 0 +Gewandtheit und Geschicklichkeit (KL/CH/GE) +gildenmagisch +Verw. Lebew. +0 2 0 0 +Klugheit, Wissen, Intellekt (KL/KL/CH) +gildenmagisch +Verw. Lebew. +9 2 0 0 +Muskelst\xE4rke, K\xF6rperkraft (KL/CH/KK) +firnelfisch +Verw. Lebew. +6 1 0 0 +Wagemut, Entschlossenheit (MU/KL/IN) +firnelfisch +Verw. Lebew. +0 3 0 0 +Eisenrost und gr\xFCner Span (KL/CH/GE) +gildenmagisch +Kampf +14 3 0 0 +Ecliptifactus dunkle Macht (MU/KL/CH) +gildenmagisch +Kampf +12 3 0 0 +Scharfes Auge, sichre Hand (IN/GE/KK) +waldelfisch +Kampf +8 3 0 0 +Silentium Silentille (KL/KL/CH) +auelfisch +Verw. Unbel. +-5 3 0 0 +Kampfzauber st\xF6ren (MU/IN/CH) +auelfisch +Antimagie +0 3 0 0 +Flim Flam Funkel (KL/KL/FF) +firnelfisch +Verw. Unbel. +4 3 0 0 +0 +FALSE +0 +Genrick DeFoulde II. +Gareth +schwarz +mittelst\xE4ndisch +187 +77 +9 1 10 +19 +12 +1. Stabzauber +2. Stabzauber +3. Stabzauber +4. Stabzauber +5. Stabzauber +6. Stabzauber +7. Stabzauber +1. Kugelzauber +2. Kugelzauber +3. Kugelzauber +4. Kugelzauber +5. Kugelzauber +TRUE +0 0 -10 + +dunkelbraun + + +2100 +7 +0 0 0 2 +10 7 4 7 5 10 5 -7 5 7 5 8 11 8 7 5 1 6 8 6 +13 6 4 7 4 10 4 -7 4 7 5 7 11 7 7 4 0 0 0 0 +2 1 +5 +Dolch +1W+1 +3 +20 +15 +2/1 +12 +Magierstab +1W+2 +0 +90 +15 +6/6 +Kleidung +1 +1 +120 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +Standard.rtf +5 5 +3 +Aberglauben: rote Haare, Fl\xF6he, magische Zahlen +Besuchte Magierakademie: Kampfseminar Andergast +Spezialgebiet: Kampf +6 +Garethi +0 +Zhayad +4 +Nivesisch +2 +Orkisch/Ogrisch +1 +*Bosparano +2 +*Alt-G\xFCldenl\xE4ndisch +2 +19 +Geldbeutel +1 +G\xFCrteltasche +5 +Lederrucksack +40 +Wolldecke +60 +Feuerstein und Stahl +5 +Proviant +40 +Zunderdose, voll +8 +Augenschminke +1 +Rasiermesser +10 +Lippenrot +1 +Nagelfeile +2 +Ohrring, Gold +1 +Ohrring, Gold +1 +Bluse, Seide +5 +Pluderhose, Seide +20 +Schleier, Seide +1 +Wurfmesser +10 +Wurfmesser +10 +Wurfmesser +10 Modified: h422/trunk/src/commondefs.h =================================================================== --- h422/trunk/src/commondefs.h 2006-10-24 16:55:23 UTC (rev 8) +++ h422/trunk/src/commondefs.h 2006-12-07 13:35:06 UTC (rev 9) @@ -19,13 +19,15 @@ #include <string> #include <map> -#include <cstdio> +#include "umap.h" +//#include <cstdio> #include <vector> -#include <libintl.h> +// Disabled until issued with prefixed portage are dealt with +//#include <libintl.h> #include <locale> using namespace std; -#define _(STRING) gettext(STRING) +//#define _(STRING) gettext(STRING) // Bit field for plugin capabilities #define CAN_READ 1 @@ -35,13 +37,44 @@ typedef int capabs; -enum Monat {Praios, Rondra, Efferd, Travia, Boron, Hesinde, Firun, Tsa, Phex, - Peraine, Ingerimm, Rahja, Namenloser}; -string monateAlsString[13] = {"Praios", "Rondra", "Efferd", "Travia", "Boron", "Hesinde", "Firun", "Tsa", "Phex", "Peraine", "Ingerimm", "Rahja", "Namenloser"}; +enum Monat {Namenloser, Praios, Rondra, Efferd, Travia, Boron, Hesinde, Firun, + Tsa, Phex, Peraine, Ingerimm, Rahja, INVALID_MONTH}; +string montostr[14] = {"Namenloser", "Praios", "Rondra", "Efferd", "Travia", + "Boron", "Hesinde", "Firun", "Tsa", "Phex", "Peraine", + "Ingerimm", "Rahja", "??"}; +Monat strtomon(string str) +{ + if ("Namenloser" == str) return Namenloser; + if ("Praios" == str) return Praios; + if ("Rondra" == str) return Rondra; + if ("Efferd" == str) return Efferd; + if ("Travia" == str) return Travia; + if ("Boron" == str) return Boron; + if ("Hesinde" == str) return Hesinde; + if ("Firun" == str) return Firun; + if ("Tsa" == str) return Tsa; + if ("Phex" == str) return Phex; + if ("Peraine" == str) return Peraine; + if ("Ingerimm" == str) return Ingerimm; + if ("Rahja" == str) return Rahja; + return INVALID_MONTH; // ungültiger String +} -enum Grundwert {MU, KL, IN, CH, GE, FF, KK}; -string gwAlsString[7] = {"MU", "KL", "IN", "CH", "GE", "FF", "KK"}; +enum Grundwert {MU, KL, IN, CH, GE, FF, KK, INVALID_GW}; +string gwtostr[8] = {"MU", "KL", "IN", "CH", "GE", "FF", "KK", "??"}; +Grundwert strtogw(string str) +{ + if ("MU" == str) return MU; + if ("KL" == str) return KL; + if ("IN" == str) return IN; + if ("CH" == str) return CH; + if ("GE" == str) return GE; + if ("FF" == str) return FF; + if ("KK" == str) return KK; + return INVALID_GW; // ungültiger String +} + struct s_talent { Grundwert gw[3]; @@ -51,8 +84,22 @@ int fvue; // Fehlversuche übrig }; -typedef map<string, s_talent*> talentgruppe; +struct s_kampftalent +{ + int beMod; // BE-Modifikator. 0 = (BE) + int taw; + int stps; // Steigerungen/Stufe + int stpsue; // STPS übrig + int fvue; // Fehlversuche übrig + int at; // Attacke ohne BE + int pa; // Parade ohne BE +}; +//typedef map<string, s_kampftalent*> kampftalentgruppe; +//typedef map<string, s_talent*> talentgruppe; +typedef umap<string, s_kampftalent*> kampftalentgruppe; +typedef umap<string, s_talent*> talentgruppe; + struct s_held { string name; @@ -110,7 +157,25 @@ int gg_gw; int jz_gw; - map<string, talentgruppe*> talente; + int be_minus; + int mr; + int mr_bonus; + int gs; + string le_plus_pro_stufe; + string asp_plus_pro_stufe; + int zf_stps; + int talent_stps; + int taw_zf_vs; + + bool le_ae_separat; + bool magiertyp; + + kampftalentgruppe kampftalente; + //map<string, talentgruppe*> talente; + umap<string, talentgruppe*> talente; + + // DSA3.5-specific stuff + string abenteuer; }; struct s_plugdata Modified: h422/trunk/src/io_debug.cpp =================================================================== --- h422/trunk/src/io_debug.cpp 2006-10-24 16:55:23 UTC (rev 8) +++ h422/trunk/src/io_debug.cpp 2006-12-07 13:35:06 UTC (rev 9) @@ -38,14 +38,15 @@ void addTalent(talentgruppe* &tg, char* name, Grundwert gw0, Grundwert gw1, Grundwert gw2, int taw, int stps, int stpsue, int fvue) { - tg->insert(make_pair(name, new s_talent)); - (*tg)[name]->gw[0] = gw0; - (*tg)[name]->gw[1] = gw1; - (*tg)[name]->gw[2] = gw2; - (*tg)[name]->taw = taw; - (*tg)[name]->stps = stps; - (*tg)[name]->stpsue = stpsue; - (*tg)[name]->fvue = fvue; + (*tg)[name] = new s_talent; + s_talent* talent = (*tg)[name]; + talent->gw[0] = gw0; + talent->gw[1] = gw1; + talent->gw[2] = gw2; + talent->taw = taw; + talent->stps = stps; + talent->stpsue = stpsue; + talent->fvue = fvue; } s_held* readHero(char* filename) Modified: h422/trunk/src/io_h42.cpp =================================================================== --- h422/trunk/src/io_h42.cpp 2006-10-24 16:55:23 UTC (rev 8) +++ h422/trunk/src/io_h42.cpp 2006-12-07 13:35:06 UTC (rev 9) @@ -19,7 +19,42 @@ #include "modules.h" #include "iostream" +// These two are used as an el-cheapo tokenizer +#include <sstream> +#include <vector> +// Counts read lines, used for error messages +#define getline lineno++; getline + +// Some conversion functions we need +inline int strtoi(string str) { return atoi(str.c_str()); } +inline string itostr(int i) +{ + stringstream ss; + ss << i; + return ss.str(); +} +inline bool strtobool(string str) +{ + return ("TRUE" == str) ? true : false; +} + +// Shorthand for adding talents to a talent group +void addTalent(talentgruppe* &tg, string name, Grundwert gw0, Grundwert gw1, + Grundwert gw2, int taw, int stps, int stpsue, int fvue) +{ + (*tg)[name] = new s_talent; + s_talent* talent = (*tg)[name]; + talent->gw[0] = gw0; + talent->gw[1] = gw1; + talent->gw[2] = gw2; + talent->taw = taw; + talent->stps = stps; + talent->stpsue = stpsue; + talent->fvue = fvue; +} + +// registers the plugin with the main program s_plugdata* registerPlugin() { s_plugdata* pd = new s_plugdata; @@ -34,11 +69,220 @@ return pd; } - + +// Reads a h42 file into an s_hero struct s_held* readHero(char* filename) { + ifstream source (filename); + if (!source.is_open()) + { + cout << "Fehler beim Öffnen von " << filename << endl; + exit(101); + } + + // No need to initialize these before we have opened the file + int lineno = 0; + string tempstring, buffer; + stringstream ss(stringstream::in | stringstream::out); + vector<string> tokens; + int i = 0; s_held* held = new s_held; - held->name = "bla"; + + // Okay, the file is open and everything's set up. First we read the hero's + // class and the attributes + + // I love reading in string values + getline(source, held->klasse); + + // My love for multiple values in one line is somewhat lesser, though an + // std::stringstream makes for a decent tokenizer, as it treats whitespace as + // separators + getline(source, tempstring); + ss << tempstring; + ss >> buffer; held->mu = held->mu_gw = strtoi(buffer); + ss >> buffer; held->kl = held->kl_gw = strtoi(buffer); + ss >> buffer; held->in = held->in_gw = strtoi(buffer); + ss >> buffer; held->ch = held->ch_gw = strtoi(buffer); + ss >> buffer; held->ge = held->ge_gw = strtoi(buffer); + ss >> buffer; held->ff = held->ff_gw = strtoi(buffer); + ss >> buffer; held->kk = held->kk_gw = strtoi(buffer); + getline(source, tempstring); + + // We should reset stringstreams before reusing them, just in case there's + // still junk left from the last line + ss.str(""); ss.clear(); + ss << tempstring; + ss >> buffer; held->ag = held->ag_gw = strtoi(buffer); + ss >> buffer; held->ha = held->ha_gw = strtoi(buffer); + ss >> buffer; held->ra = held->ra_gw = strtoi(buffer); + ss >> buffer; held->ta = held->ta_gw = strtoi(buffer); + ss >> buffer; held->ng = held->ng_gw = strtoi(buffer); + ss >> buffer; held->gg = held->gg_gw = strtoi(buffer); + ss >> buffer; held->jz = held->jz_gw = strtoi(buffer); + + // Next comes the talent handling. Since combat talents are special and come + // first we do some custom stuff with them + + // The group name of the combat talents. We throw this away as it doesn't + // conform to what most people expect to see on their character sheet. + // Besides, only regular talents are stored in name:group format + getline(source, tempstring); + // Unknown Value 1. We also throw this away since it seems to be pointless + // anyway + getline(source, tempstring); + getline(source, tempstring); // Number of combat talents + held->kampftalente.reserve(strtoi(tempstring)); + + for (int talentsToGo = strtoi(tempstring); talentsToGo > 0; talentsToGo--) + { + string talentName = ""; + int beMod = 0; + int taw, stps, stpsue, fvue; + bool bFirstPart = true; + + getline(source, tempstring); + ss.str(""); ss.clear(); // reset stringstream + ss << tempstring; + ss >> buffer; + // TODO: Make this loop better + while (buffer.substr(0, 1) != "("/* && !(ss.eol())*/) + { + talentName += ((bFirstPart) ? "" : " ") + buffer; + bFirstPart = false; + string lastVal = buffer; + ss >> buffer; + if (buffer == lastVal) break; + } + + // Not all combat talents have a modifier + if (buffer.substr(0, 1) == "(") + beMod = strtoi(buffer.substr(3, buffer.size() - 4)); + + getline(source, tempstring); + ss.str(""); ss.clear(); // reset stringstream + ss << tempstring; + ss >> buffer; taw = strtoi(buffer); + ss >> buffer; stps = strtoi(buffer); + ss >> buffer; stpsue = strtoi(buffer); + ss >> buffer; fvue = strtoi(buffer); + + held->kampftalente[talentName] = new s_kampftalent; + // This impreoves performance significantly as the [] operator is extremely + // expensive for umaps, so invoking it over and over is a bad idea + s_kampftalent* ktal = held->kampftalente[talentName]; + ktal->beMod = beMod; + ktal->taw = taw; + ktal->stps = stps; + ktal->stpsue = stpsue; + ktal->fvue = fvue; + // The following values can only be determined later and are thus filled + // with dummy values + ktal->at = 0; + ktal->pa = 0; + } + + // The number of talent groups we still have to parse + int talentGroupsToGo = 8; // No combat talents + for (; talentGroupsToGo > 0; talentGroupsToGo--) + { + // Uh-oh, trouble. I just realized that we need wstrings everywhere, + // due to the fact that we have to deal with umlauts etc. + // I think we'll just have to replace all instances of "string" with + // "wstring" and "stringstream" with "wstringstream". Still, I can't be + // arsed to do it right now. + // The strtoi function, however, could present a problem, depending on + // how easy it is to cast const wchar_t* to const char*. + + // Eh, whatever. For the time being we just assume that the file is in + // latin-1 and the output plugin expects latin-1 data. + + string currentGroup; + //int unknownValue1; // unused until we know what it's good for + int talentsToGo; + + + getline(source, currentGroup); + // The following line was deprecated in favor of [] = new + //held->talente.insert(make_pair(currentGroup, new talentgruppe)); + held->talente[currentGroup] = new talentgruppe; + talentgruppe* tgroup = held->talente[currentGroup]; + + // see definition of unknownValue1 + getline(source, tempstring); // we skip the unknown value + //unknownValue1 = strtoi(tempstring); + getline(source, tempstring); + talentsToGo = strtoi(tempstring); + + for (; talentsToGo > 0; talentsToGo--) + { + string talentName = ""; + Grundwert gw0, gw1, gw2; + int taw, stps, stpsue, fvue; + bool bFirstPart = true; + + getline(source, tempstring); + ss.str(""); ss.clear(); // reset stringstream + ss << tempstring; + ss >> buffer; + while (buffer.substr(0, 1) != "("/* && !(ss.eol())*/) + { + talentName += ((bFirstPart) ? "" : " ") + buffer; + bFirstPart = false; + string lastVal = buffer; + ss >> buffer; + if (buffer == lastVal) break; + } + + if (buffer.substr(0, 1) == "(") + { + gw0 = strtogw(buffer.substr(1, 2)); + gw1 = strtogw(buffer.substr(4, 2)); + gw2 = strtogw(buffer.substr(7, 2)); + + if (INVALID_GW == gw0 || INVALID_GW == gw1 || INVALID_GW == gw2) + { + cout << "Datei kann nicht gelesen werden: Ungültiger Talentname " << + "in Zeile " << lineno << endl; + exit(102); + } + } + else + { + cout << "Datei kann nicht gelesen werden: Ungültiger Talentname in " << + "Zeile " << lineno << endl; + exit(102); + } + + getline(source, tempstring); + ss.str(""); ss.clear(); + ss << tempstring; + ss >> buffer; taw = strtoi(buffer); + ss >> buffer; stps = strtoi(buffer); + ss >> buffer; stpsue = strtoi(buffer); + ss >> buffer; fvue = strtoi(buffer); + + addTalent(tgroup, talentName, gw0, gw1, gw2, taw, stps, stpsue, fvue); + } + } + + // Whew. Time to relax with some simple one-value lines + + // h42 doesn't distinguish between current and map HP/MP/KP + getline(source, tempstring); held->le = held->le_gw = strtoi(tempstring); + getline(source, tempstring); held->ae = held->ae_gw = strtoi(tempstring); + getline(source, tempstring); held->ke = held->ke_gw = strtoi(tempstring); + getline(source, tempstring); held->zf_stps = strtoi(tempstring); + getline(source, tempstring); held->talent_stps = strtoi(tempstring); + getline(source, tempstring); held->taw_zf_vs = strtoi(tempstring); + getline(source, tempstring); held->be_minus = strtoi(tempstring); + getline(source, tempstring); held->gs = strtoi(tempstring); + getline(source, tempstring); held->mr_bonus = strtoi(tempstring); + getline(source, tempstring); held->le_ae_separat = strtobool(tempstring); + getline(source, tempstring); held->magiertyp = strtobool(tempstring); + + // Okay, funtime's over, here comes another one of those pesky arrays + + source.close(); return held; } Modified: h422/trunk/src/io_plaintext.cpp =================================================================== --- h422/trunk/src/io_plaintext.cpp 2006-10-24 16:55:23 UTC (rev 8) +++ h422/trunk/src/io_plaintext.cpp 2006-12-07 13:35:06 UTC (rev 9) @@ -20,6 +20,14 @@ #include "modules.h" #include <iostream> +#include <sstream> +inline string itostr (int i) +{ + stringstream ss; + ss << i; + return ss.str(); +} + s_plugdata* registerPlugin() { s_plugdata* pd = new s_plugdata; @@ -42,7 +50,8 @@ //return held; } -string printIndented(string input, int outsize, bool pad = true) +string printIndented(string input, int outsize, bool pad = true, + bool prepend = false) { string result = input; if (result.size() > outsize) @@ -50,13 +59,19 @@ for (int i = result.size(); pad && i < outsize; i++) { - result += " "; + if (prepend) + result = " " + result; + else + result += " "; } return result; } void writeHero(s_held* held, char* filename) { + // TODO: Make maximum line width dynamic instead of 80 chars + + // TODO: Improve this. Currently it doesn't enforce the maximum line width int maxStrlen[2]; maxStrlen[0] = held->name.size(); if (held->gottheit.size() > maxStrlen[0]) @@ -74,8 +89,8 @@ maxStrlen[1] = held->augenfarbe.size(); cout << " DSA-Heldendokument\n" - << "====================================================================" - << "========" << endl; + << "================================================================" + << "================" << endl; cout << " Name: " << printIndented(held->name, maxStrlen[0]) << " Klasse: " << printIndented(held->klasse, maxStrlen[1]) << endl << " Gottheit: " << printIndented(held->gottheit, maxStrlen[0]) @@ -86,9 +101,14 @@ << "Haarfarbe: " << printIndented(held->haarfarbe, maxStrlen[0]) << " Augenfarbe: " << printIndented(held->augenfarbe, maxStrlen[1]) << endl; + if ("" != held->abenteuer) + cout << "Abenteuer: " << printIndented(held->abenteuer, 69) << endl; printf ("geboren am %d. %s %d %s\n\n", held->geburtstag, - monateAlsString[held->geburtsmonat].c_str(), abs(held->geburtsjahr), + ((held->geburtsmonat != Namenloser) + ? montostr[held->geburtsmonat].c_str() + : "Namenlosen"), + abs(held->geburtsjahr), (0 >= held->geburtsjahr) ? "n. Hal" : "v. Hal"); printf("MU: %2d/%2d AG: %2d/%2d\nKL: %2d/%2d HA: %2d/%2d\n", @@ -108,22 +128,53 @@ cout << "\nTalente" << endl; - for (map<string, talentgruppe*>::iterator it = held->talente.begin(); + // Combat talents are special and come first, thus this code at this place + cout << " Kampf" << endl; + for (kampftalentgruppe::iterator ktit = held->kampftalente.begin(); + ktit != held->kampftalente.end(); ktit++) + { + printf(" %s %s TaW:%3d StPS: %d/%d VFv: %d\n", + printIndented((*ktit).first, + (((*ktit).second->beMod != 0) ? 41 : 47)).c_str(), + (((*ktit).second->beMod != 0) + ? string("(BE" + (itostr((*ktit).second->beMod)) + ")").c_str() + : "" + ), + //gwtostr[(*ktit).second->beMod.c_str(), + (*ktit).second->taw, + (*ktit).second->stpsue, (*ktit).second->stps, + (*ktit).second->fvue); + // TODO: Calculate AT and PA with and without encumbrance malus. Not done + // yet because parts neccessary for that aren't yet in s_held + printf(" o. BE [AT: 99 PA: 99] m. BE[AT: 99 PA: 99]\n"); + } + /* + + cout << " " << talentName << " (BE" << ((0 < beMod) ? "+" : "") + << ((0 != beMod) ? itostr(beMod) : "") << ")" << endl; + cout << " TaW: " << taw + << " StPS: " << stpsue << "/" << stps + << " FVÜ: " << fvue << endl; + */ +//cout << "....,....|....,....|....,....|....,....|....,....|....,....|....,....|....,....|\n"; + for (umap<string, talentgruppe*>::iterator it = held->talente.begin(); it != held->talente.end(); it++) { + if (0 == (*(*it).second).size()) + continue; cout << " " << (*it).first << endl; for (talentgruppe::iterator tgit = (*(*it).second).begin(); tgit != (*(*it).second).end(); tgit++) { string nameplus = printIndented((*tgit).first, 20) + string(" (") + - gwAlsString[(*tgit).second->gw[0]] + string("/") + - gwAlsString[(*tgit).second->gw[1]] + string("/") + - gwAlsString[(*tgit).second->gw[2]] + string(")"); + gwtostr[(*tgit).second->gw[0]] + string("/") + + gwtostr[(*tgit).second->gw[1]] + string("/") + + gwtostr[(*tgit).second->gw[2]] + string(")"); printf(" %s (%s/%s/%s) TaW:%3d StPS: %d/%d VFv: %d\n", - printIndented((*tgit).first, 38).c_str(), - gwAlsString[(*tgit).second->gw[0]].c_str(), - gwAlsString[(*tgit).second->gw[1]].c_str(), - gwAlsString[(*tgit).second->gw[2]].c_str(), + printIndented((*tgit).first, 37).c_str(), + gwtostr[(*tgit).second->gw[0]].c_str(), + gwtostr[(*tgit).second->gw[1]].c_str(), + gwtostr[(*tgit).second->gw[2]].c_str(), (*tgit).second->taw, (*tgit).second->stpsue, (*tgit).second->stps, (*tgit).second->fvue); Modified: h422/trunk/src/modules.h =================================================================== --- h422/trunk/src/modules.h 2006-10-24 16:55:23 UTC (rev 8) +++ h422/trunk/src/modules.h 2006-12-07 13:35:06 UTC (rev 9) @@ -18,6 +18,8 @@ *******************************************************************************/ #include "commondefs.h" +#include <fstream> +#include <iostream> extern "C" { Added: h422/trunk/src/umap.h =================================================================== --- h422/trunk/src/umap.h (rev 0) +++ h422/trunk/src/umap.h 2006-12-07 13:35:06 UTC (rev 9) @@ -0,0 +1,93 @@ +#ifndef _UMAP_H +#define _UMAP_H 1 + +#include <vector> +using namespace std; + +// Cheap-ass hack to turn an std::vector into an unsorted std::map workalike. +// Seriously, stuff like this shouldn't be necessary with a language as widely +// used as C++. +template<typename K, typename V> +class umap: public vector<pair<K, V> > +{ + private: + typedef K key_type; + typedef V mapped_type; + typedef pair<K, V> value_type; + typedef typename umap<K, V>::iterator iterator_type; + // The _ was appended because MSVC treats 'super' as a keyword + typedef vector<value_type> super_; + + iterator_type find(const key_type& k) + { + iterator_type it = this->begin(); + while (it != this->end()) + { + if (k == (*it).first) + break; + it++; + } + return it; + } + + public: + // Appends a pair + bool push_back(const value_type& x) + { + iterator_type prev_locn = this->find(x.first); + if (this->end() != prev_locn) + return false; + + super_::push_back(x); + return true; + } + + mapped_type& operator[](const key_type& k) + { + iterator_type it = this->find(k); + if (this->end() != it) + return (*it).second; + + mapped_type mt; + super_::push_back(make_pair(k, mt)); + return(this->back().second); + } + + /* + * Since we want our keys to be unique we obey the position given but + * erase any occurrence of the key already in the umap + */ + iterator_type + insert(iterator_type position, const value_type& x) + { + iterator_type prev_locn = this->find(x.first); + if (this->end() != prev_locn) + this->erase(prev_locn); + + return (super_::insert(position, x)); + } + + /* + * @param The pair to be inserted + * + * @return A pair; p.first points to the possibly inserted pair; p.second + * shows whether a pair was actually inserted + */ + pair<iterator_type, bool> insert(const value_type& x) + { + iterator_type prev_locn = this->find(x.first); + if (this->end() != prev_locn) + return (make_pair(prev_locn, false)); + + super_::push_back(x); + return (make_pair(& this->back(), true)); + } + + // Just a wrapper for the above method + pair<iterator_type, bool> insert(const key_type& k, const mapped_type& v) + { + return this->insert(make_pair(k, v)); + } +}; + +#endif // _UMAP_H \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <j6...@us...> - 2006-10-24 16:55:42
|
Revision: 8 http://svn.sourceforge.net/dsaster/?rev=8&view=rev Author: j6cubic Date: 2006-10-24 09:55:23 -0700 (Tue, 24 Oct 2006) Log Message: ----------- - added debug plugin which we can use to generate hero data - implemented part of the plaintext plugin - played around with gettext, didn't accomplish much. We should work out an i18n/l10n framework, be it gettext, hand-written includes, load-at-runtime resource bundles or whatever Modified Paths: -------------- h422/trunk/CMakeLists.txt h422/trunk/src/commondefs.h h422/trunk/src/io_plaintext.cpp h422/trunk/src/main.cpp Added Paths: ----------- h422/trunk/l10n/ h422/trunk/l10n/de.mo h422/trunk/l10n/de.pot h422/trunk/src/io_debug.cpp h422/trunk/src/main.pot Modified: h422/trunk/CMakeLists.txt =================================================================== --- h422/trunk/CMakeLists.txt 2006-10-14 18:32:26 UTC (rev 7) +++ h422/trunk/CMakeLists.txt 2006-10-24 16:55:23 UTC (rev 8) @@ -1,6 +1,7 @@ PROJECT (h422) CMAKE_MINIMUM_REQUIRED (VERSION 2.0) INCLUDE (FindDL.cmake) +INCLUDE (FindIntl.cmake) SET (EXECUTABLE_OUTPUT_PATH "./bin") SET (LIBRARY_OUTPUT_PATH "./bin/plugins") @@ -13,6 +14,7 @@ IF (UNIX) SET (PATH_SEPARATOR "/") + IF (APPLE) MESSAGE (STATUS "OS X detected, using Apple-specific settings") SET (CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS @@ -39,6 +41,13 @@ SET (PATH_SEPARATOR "\\") ENDIF (WIN32) +#IF (INTL_FOUND) +# SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lintl") +# SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -lintl") +#ELSE (INTL_FOUND) +# MESSAGE (ERROR "libintl(.h) and/or locale.h could not be found!") +#ENDIF (INTL_FOUND) + MESSAGE(STATUS "Shared library extension: ${LIBEXTENSION}") CONFIGURE_FILE ("src/config.h.cmake" "src/config.h") @@ -53,6 +62,7 @@ ENDMACRO (PLUGIN) PLUGIN (null "Includes the null I/O module" ON) +PLUGIN (debug "Includes the debug I/O module" ON) PLUGIN (plaintext "Includes the plaintext I/O module" ON) PLUGIN (h42 "Includes the h42 I/O module" ON) Added: h422/trunk/l10n/de.mo =================================================================== (Binary files differ) Property changes on: h422/trunk/l10n/de.mo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: h422/trunk/l10n/de.pot =================================================================== --- h422/trunk/l10n/de.pot (rev 0) +++ h422/trunk/l10n/de.pot 2006-10-24 16:55:23 UTC (rev 8) @@ -0,0 +1,20 @@ +# German translations for h package +# German messages for h. +# Copyright (C) 2006 Free Software Foundation, Inc. +# Tim Okrongli <>, 2006. +# +msgid "" +"" +msgstr "Project-Id-Version: h422\n" +"POT-Creation-Date: 2006-10-17 14:27+0200\n" +"PO-Revision-Date: 2006-10-17 14:29+0200\n" +"Last-Translator: Tim Okrongli <>\n" +"Language-Team: German <tra...@li...>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ASCII\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: src/main.cpp:229 +msgid "TEST_STRING" +msgstr "Eins zwei, Test, Test." Modified: h422/trunk/src/commondefs.h =================================================================== --- h422/trunk/src/commondefs.h 2006-10-14 18:32:26 UTC (rev 7) +++ h422/trunk/src/commondefs.h 2006-10-24 16:55:23 UTC (rev 8) @@ -14,8 +14,12 @@ #include <map> #include <cstdio> #include <vector> +#include <libintl.h> +#include <locale> using namespace std; +#define _(STRING) gettext(STRING) + // Bit field for plugin capabilities #define CAN_READ 1 #define CAN_WRITE 2 @@ -26,8 +30,10 @@ enum Monat {Praios, Rondra, Efferd, Travia, Boron, Hesinde, Firun, Tsa, Phex, Peraine, Ingerimm, Rahja, Namenloser}; +string monateAlsString[13] = {"Praios", "Rondra", "Efferd", "Travia", "Boron", "Hesinde", "Firun", "Tsa", "Phex", "Peraine", "Ingerimm", "Rahja", "Namenloser"}; enum Grundwert {MU, KL, IN, CH, GE, FF, KK}; +string gwAlsString[7] = {"MU", "KL", "IN", "CH", "GE", "FF", "KK"}; struct s_talent { @@ -38,7 +44,7 @@ int fvue; // Fehlversuche übrig }; -typedef map<string, s_talent> talentgruppe; +typedef map<string, s_talent*> talentgruppe; struct s_held { @@ -62,7 +68,11 @@ int le; int ae; int ke; + int le_gw; + int ae_gw; + int ke_gw; + // Aktuelle Werte int mu; int kl; int in; @@ -77,8 +87,23 @@ int ng; int gg; int jz; + // Grundwerte + int mu_gw; + int kl_gw; + int in_gw; + int ch_gw; + int ge_gw; + int ff_gw; + int kk_gw; + int ag_gw; + int ha_gw; + int ra_gw; + int ta_gw; + int ng_gw; + int gg_gw; + int jz_gw; - map<string, talentgruppe> talente; + map<string, talentgruppe*> talente; }; struct s_plugdata Added: h422/trunk/src/io_debug.cpp =================================================================== --- h422/trunk/src/io_debug.cpp (rev 0) +++ h422/trunk/src/io_debug.cpp 2006-10-24 16:55:23 UTC (rev 8) @@ -0,0 +1,95 @@ +/******************************************************************************* +* h422 - converts DSAv3 hero data between various formats * * Copyright (C) 2006 Tim "Jesus_666" Okrongli * * * * This program is free software; you can redistribute it and/or modify it * +* under the terms of the GNU General Public License as published by the Free * +* Software Foundation; either version 2 of the License, or (at your option) * +* any later version. * * * * This program is distributed in the hope that it will be useful, but WITHOUT * +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * +* more details. * * * * You should have received a copy of the GNU General Public License along with * +* this program; if not, write to the Free Software Foundation, Inc., 51 * +* Franklin St, Fifth Floor, Boston, MA 02110, USA * +*******************************************************************************/ + +#include "modules.h" + +// NOTE: This plugin shouldn't be included in regular releases. +s_plugdata* registerPlugin() +{ + s_plugdata* pd = new s_plugdata; + pd->name = "debug"; + pd->capabilities = CAN_READ | CAN_DSA35; + pd->version = 1; + pd->description = "Testplugin, das einen vordefinierten Helden liefert"; + pd->extensions.push_back("debugplugin"); + // Just leave these two lines be. The main program relies on them. + pd->read = &readHero; + pd->write = &writeHero; + + return pd; +} + +void addTalent(talentgruppe* &tg, char* name, Grundwert gw0, Grundwert gw1, + Grundwert gw2, int taw, int stps, int stpsue, int fvue) +{ + tg->insert(make_pair(name, new s_talent)); + (*tg)[name]->gw[0] = gw0; + (*tg)[name]->gw[1] = gw1; + (*tg)[name]->gw[2] = gw2; + (*tg)[name]->taw = taw; + (*tg)[name]->stps = stps; + (*tg)[name]->stpsue = stpsue; + (*tg)[name]->fvue = fvue; +} + +s_held* readHero(char* filename) +{ + s_held* hero = new s_held; + hero->name = "Genrick DeFoulde"; + hero->klasse = "Testheld"; + hero->gottheit = "Rheia"; + hero->titel = "Kalif von Oberammergau"; + hero->stand = "sowas von adelig"; + hero->geburtsort = "Dorfhausen"; + hero->haarfarbe = "schwarz"; + hero->augenfarbe = "grün"; + hero->geburtstag = 12; + hero->geburtsmonat = Praios; + hero->geburtsjahr = -5; + hero->alter = 28; + hero->groesse = 187; + hero->gewicht = 80; + hero->ap = 2100; + hero->stufe = 6; // 1 outstanding levelup! + hero->le = 34; + hero->ae = 60; + hero->ke = 0; + hero->le_gw = 50; + hero->ae_gw = 62; + hero->ke_gw = 0; + hero->mu = hero->mu_gw = 12; + hero->kl = hero->kl_gw = 13; + hero->in = hero->in_gw = 11; + hero->ch = hero->ch_gw = 12; + hero->ge = hero->ge_gw = 10; + hero->ff = hero->ff_gw = 11; + hero->kk = hero->kk_gw = 13; + hero->ag = hero->ag_gw = 2; + hero->ha = hero->ha_gw = 6; + hero->ra = hero->ra_gw = 3; + hero->ta = hero->ta_gw = 1; + hero->ng = hero->ng_gw = 2; + hero->gg = hero->gg_gw = 3; + hero->jz = hero->jz_gw = 2; + + // This should be automated for the default talents later + hero->talente.insert(make_pair("Koerperlich", new talentgruppe)); + addTalent(hero->talente["Koerperlich"], "Akrobatik", MU, GE, KK, 4, 3, 3, 3); + addTalent(hero->talente["Koerperlich"], "Fliegen", MU, KL, GE, -3, 3, 3, 3); + hero->talente.insert(make_pair("Eigene", new talentgruppe)); + addTalent(hero->talente["Eigene"], "Absurd lange Namen fuer Talente erfinden", KL, IN, GE, -12, 2, 1, 0); + return hero; +} + +void writeHero(s_held* held, char* filename) +{ +} Modified: h422/trunk/src/io_plaintext.cpp =================================================================== --- h422/trunk/src/io_plaintext.cpp 2006-10-14 18:32:26 UTC (rev 7) +++ h422/trunk/src/io_plaintext.cpp 2006-10-24 16:55:23 UTC (rev 8) @@ -11,6 +11,7 @@ *******************************************************************************/ #include "modules.h" +#include <iostream> s_plugdata* registerPlugin() { @@ -33,7 +34,92 @@ //held->name = "bla"; //return held; } + +string printIndented(string input, int outsize, bool pad = true) +{ + string result = input; + if (result.size() > outsize) + result = result.substr(0, outsize - 3) + "..."; + for (int i = result.size(); pad && i < outsize; i++) + { + result += " "; + } + return result; +} + void writeHero(s_held* held, char* filename) { + int maxStrlen[2]; + maxStrlen[0] = held->name.size(); + if (held->gottheit.size() > maxStrlen[0]) + maxStrlen[0] = held->gottheit.size(); + if (held->stand.size() > maxStrlen[0]) + maxStrlen[0] = held->stand.size(); + if (held->haarfarbe.size() > maxStrlen[0]) + maxStrlen[0] = held->haarfarbe.size(); + maxStrlen[1] = held->klasse.size(); + if (held->titel.size() > maxStrlen[1]) + maxStrlen[1] = held->titel.size(); + if (held->geburtsort.size() > maxStrlen[1]) + maxStrlen[1] = held->geburtsort.size(); + if (held->augenfarbe.size() > maxStrlen[1]) + maxStrlen[1] = held->augenfarbe.size(); + + cout << " DSA-Heldendokument\n" + << "====================================================================" + << "========" << endl; + cout << " Name: " << printIndented(held->name, maxStrlen[0]) + << " Klasse: " << printIndented(held->klasse, maxStrlen[1]) << endl + << " Gottheit: " << printIndented(held->gottheit, maxStrlen[0]) + << " Titel: " << printIndented(held->titel, maxStrlen[1]) << endl + << " Stand: " << printIndented(held->stand, maxStrlen[0]) + << " Geburtsort: " << printIndented(held->geburtsort, maxStrlen[1]) + << endl + << "Haarfarbe: " << printIndented(held->haarfarbe, maxStrlen[0]) + << " Augenfarbe: " << printIndented(held->augenfarbe, maxStrlen[1]) + << endl; + + printf ("geboren am %d. %s %d %s\n\n", held->geburtstag, + monateAlsString[held->geburtsmonat].c_str(), abs(held->geburtsjahr), + (0 >= held->geburtsjahr) ? "n. Hal" : "v. Hal"); + + printf("MU: %2d/%2d AG: %2d/%2d\nKL: %2d/%2d HA: %2d/%2d\n", + held->mu, held->mu_gw, held->ag, held->ag_gw, held->kl, held->kl_gw, + held->ha, held->ha_gw); + printf("IN: %2d/%2d RA: %2d/%2d\nCH: %2d/%2d TA: %2d/%2d\n", + held->in, held->in_gw, held->ra, held->ra_gw, held->ch, held->ch_gw, + held->ta, held->ta_gw); + printf("GE: %2d/%2d NG: %2d/%2d\nFF: %2d/%2d GG: %2d/%2d\n", + held->ge, held->ge_gw, held->ng, held->ng_gw, held->ff, held->ff_gw, + held->gg, held->gg_gw); + printf("KK: %2d/%2d JZ: %2d/%2d\n\n", + held->kk, held->kk_gw, held->jz, held->jz_gw); + + printf("LE: %3d/%3d AE: %3d/%3d KE: %3d/%3d\n", held->le, held->le_gw, + held->ae, held->ae_gw, held->ke, held->ke_gw); + + cout << "\nTalente" << endl; + + for (map<string, talentgruppe*>::iterator it = held->talente.begin(); + it != held->talente.end(); it++) + { + cout << " " << (*it).first << endl; + for (talentgruppe::iterator tgit = (*(*it).second).begin(); + tgit != (*(*it).second).end(); tgit++) + { + string nameplus = printIndented((*tgit).first, 20) + string(" (") + + gwAlsString[(*tgit).second->gw[0]] + string("/") + + gwAlsString[(*tgit).second->gw[1]] + string("/") + + gwAlsString[(*tgit).second->gw[2]] + string(")"); + printf(" %s (%s/%s/%s) TaW:%3d StPS: %d/%d VFv: %d\n", + printIndented((*tgit).first, 38).c_str(), + gwAlsString[(*tgit).second->gw[0]].c_str(), + gwAlsString[(*tgit).second->gw[1]].c_str(), + gwAlsString[(*tgit).second->gw[2]].c_str(), + (*tgit).second->taw, + (*tgit).second->stpsue, (*tgit).second->stps, + (*tgit).second->fvue); + } + } } Modified: h422/trunk/src/main.cpp =================================================================== --- h422/trunk/src/main.cpp 2006-10-14 18:32:26 UTC (rev 7) +++ h422/trunk/src/main.cpp 2006-10-24 16:55:23 UTC (rev 8) @@ -220,6 +220,16 @@ int main(int argc, char** argv) { + /* + setlocale(LC_ALL, ""); + // Commented out until a platform agnostic way of determining the default + // locale directory is found + //bindtextdomain( "h422", "/usr/share/locale" ); + textdomain("h422"); + + cout << _("TEST_STRING") << endl; + */ + wd = argv[0]; wd.erase(wd.rfind(PATH_SEPARATOR)); Added: h422/trunk/src/main.pot =================================================================== --- h422/trunk/src/main.pot (rev 0) +++ h422/trunk/src/main.pot 2006-10-24 16:55:23 UTC (rev 8) @@ -0,0 +1,19 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2006-10-17 14:27+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL...@li...>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/main.cpp:229 +msgid "TEST_STRING" +msgstr "" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lm...@us...> - 2006-10-14 18:32:38
|
Revision: 7 http://svn.sourceforge.net/dsaster/?rev=7&view=rev Author: lmeuser Date: 2006-10-14 11:32:26 -0700 (Sat, 14 Oct 2006) Log Message: ----------- corrected plugin recognition Modified Paths: -------------- h422/trunk/src/config.h.cmake h422/trunk/src/main.cpp Modified: h422/trunk/src/config.h.cmake =================================================================== --- h422/trunk/src/config.h.cmake 2006-10-14 18:21:42 UTC (rev 6) +++ h422/trunk/src/config.h.cmake 2006-10-14 18:32:26 UTC (rev 7) @@ -10,7 +10,7 @@ * Franklin St, Fifth Floor, Boston, MA 02110, USA * *******************************************************************************/ -#define LIBEXTENSION "@LIBEXTENSION@" +#define LIBEXTENSION ".@LIBEXTENSION@" #define PATH_SEPARATOR "@PATH_SEPARATOR@" float version = @VERSION@; Modified: h422/trunk/src/main.cpp =================================================================== --- h422/trunk/src/main.cpp 2006-10-14 18:21:42 UTC (rev 6) +++ h422/trunk/src/main.cpp 2006-10-14 18:32:26 UTC (rev 7) @@ -19,6 +19,17 @@ #include "main.h" +bool cstrEndsWith(char *str, char *end) +{ + int slen = strlen(str); + int elen = strlen(end); + + if(slen > elen && !strcmp((str + slen - elen), end)) + return true; + else + return false; +} + void help() { cout << "h422 v" << version << endl; @@ -62,7 +73,7 @@ while(theentry = readdir(thedir)) { - if (NULL != strstr(theentry->d_name, LIBEXTENSION)) + if (cstrEndsWith(theentry->d_name, LIBEXTENSION)) { // For some reason dlopen() sets errno to 2 even if everything went well, // thus we save the error number and later restore it. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <j6...@us...> - 2006-10-14 18:22:04
|
Revision: 6 http://svn.sourceforge.net/dsaster/?rev=6&view=rev Author: j6cubic Date: 2006-10-14 11:21:42 -0700 (Sat, 14 Oct 2006) Log Message: ----------- Fixed. Modified Paths: -------------- h422/trunk/src/main.cpp Modified: h422/trunk/src/main.cpp =================================================================== --- h422/trunk/src/main.cpp 2006-10-14 17:13:59 UTC (rev 5) +++ h422/trunk/src/main.cpp 2006-10-14 18:21:42 UTC (rev 6) @@ -1,11 +1,18 @@ /******************************************************************************* -* h422 - converts DSAv3 hero data between various formats * * Copyright (C) 2006 Tim "Jesus_666" Okrongli * * * * This program is free software; you can redistribute it and/or modify it * +* h422 - converts DSAv3 hero data between various formats * +* Copyright (C) 2006 Tim "Jesus_666" Okrongli * +* * +* This program is free software; you can redistribute it and/or modify it * * under the terms of the GNU General Public License as published by the Free * * Software Foundation; either version 2 of the License, or (at your option) * -* any later version. * * * * This program is distributed in the hope that it will be useful, but WITHOUT * +* any later version. * +* * +* This program is distributed in the hope that it will be useful, but WITHOUT * * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -* more details. * * * * You should have received a copy of the GNU General Public License along with * +* more details. * +* * +* You should have received a copy of the GNU General Public License along with * * this program; if not, write to the Free Software Foundation, Inc., 51 * * Franklin St, Fifth Floor, Boston, MA 02110, USA * *******************************************************************************/ @@ -43,7 +50,7 @@ DIR* thedir; struct dirent* theentry; string sdir = string(wd) + string(PATH_SEPARATOR) + plugindir; - + thedir = opendir(sdir.c_str()); if (!thedir) { @@ -52,7 +59,7 @@ exit(1); } errno = 0; - + while(theentry = readdir(thedir)) { if (NULL != strstr(theentry->d_name, LIBEXTENSION)) @@ -89,11 +96,11 @@ pluginList.back())); int size = pluginList.back()->extensions.size(); for (int i = 0; i < size; i++) - { - if (pluginsByExtension.end() == + { + if (pluginsByExtension.end() == pluginsByExtension.find(pluginList.back()->extensions.at(i)) || pluginsByExtension[pluginList.back()->extensions.at(i)]->version < - pluginList.back()->extensions.at(i)) + pluginList.back()->version) pluginsByExtension.insert(make_pair(pluginList.back()->extensions.at(i), pluginList.back())); } @@ -115,11 +122,11 @@ void listPlugins(bool detailed) { cout << "Verfügbare Plugins" << endl; - + for(int i = 0; i < pluginList.size(); i++) { s_plugdata* pd = pluginList.at(i); - + printf(" %16s v%d [%s%s%s]: %s\n", pd->name, pd->version, ((pd->capabilities & CAN_READ) ? "L" : " "), ((pd->capabilities & CAN_WRITE) ? "S" : " "), @@ -138,7 +145,7 @@ cout << "\n" << endl; } } - + exit(0); } @@ -146,7 +153,7 @@ { // DANGER! CONSTRUCTION SITE! // Enter at your own risk and always wear a helmet! - + // First we determine which plugin can read the file we got passed. string ext = inputFile; // The input file's extension // Known issue - we can't detect extensions with more than one dot like @@ -173,7 +180,7 @@ } s_plugdata* iPlug = pluginsByExtension[ext]; s_plugdata* oPlug = pluginsByName[outputPlugin]; - + // Lastly we find out whether the plugins even support what the user wants. if (!(CAN_READ & iPlug->capabilities)) { @@ -187,14 +194,14 @@ << "Dateien zu schreiben." << endl; exit(5); } - + string outputFile = string(inputFile); outputFile = outputFile.erase(outputFile.rfind(".")) + "." + oPlug->extensions.front(); - + // Yup, there's no checking whether the file exists, is readable etc. - it's // the plugins' duty to do that. - + oPlug->write(iPlug->read(inputFile), (char*)outputFile.c_str()); exit(0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <j6...@us...> - 2006-10-14 17:15:13
|
Revision: 5 http://svn.sourceforge.net/dsaster/?rev=5&view=rev Author: j6cubic Date: 2006-10-14 10:13:59 -0700 (Sat, 14 Oct 2006) Log Message: ----------- Aufgeraeumt! Modified Paths: -------------- h422/trunk/CMakeLists.txt h422/trunk/notes/DSAW4.Format h422/trunk/notes/Res.h42.htm h422/trunk/notes/Res.h42.html h422/trunk/notes/bla.php h422/trunk/src/commondefs.h h422/trunk/src/io_h42.cpp h422/trunk/src/io_null.cpp h422/trunk/src/io_plaintext.cpp h422/trunk/src/main.cpp h422/trunk/src/modules.h Added Paths: ----------- h422/trunk/src/config.h.cmake h422/trunk/src/main.h Removed Paths: ------------- h422/trunk/src/main.h h422/trunk/src/main.h.cmake Modified: h422/trunk/CMakeLists.txt =================================================================== --- h422/trunk/CMakeLists.txt 2006-10-14 16:27:19 UTC (rev 4) +++ h422/trunk/CMakeLists.txt 2006-10-14 17:13:59 UTC (rev 5) @@ -40,7 +40,7 @@ ENDIF (WIN32) MESSAGE(STATUS "Shared library extension: ${LIBEXTENSION}") -CONFIGURE_FILE ("src/main.h.cmake" "src/main.h") +CONFIGURE_FILE ("src/config.h.cmake" "src/config.h") SET (BUILD_SHARED_LIBS ON) Modified: h422/trunk/notes/DSAW4.Format =================================================================== --- h422/trunk/notes/DSAW4.Format 2006-10-14 16:27:19 UTC (rev 4) +++ h422/trunk/notes/DSAW4.Format 2006-10-14 17:13:59 UTC (rev 5) @@ -1 +1 @@ ---- DateibeginnVersionsnummerName des HeldenAnzahl der TalenteJe Talent:ID,Grundwert,Wert,Maximum,[Obsolet],Aktiviert(1/0),Muttersprache(1/),Zweitsprache(1/0),Leittalent(1/0),AT,PA,AtAnteil,ATBonus,PABonusAnzahl ZauberJe Zauber:ID,Repräsentation,Aktiviert(1/0),Hauszauber(1/0),Grundwert,Wert,MaximumAnzahl Vor/NachteileJe V/N: ID,Detailangabe,Maximum,Los,WertAnzahl SonderfertigleitenJe SF: ID, Detailangabe,Zusatzangabe,Vorgegeben(1/0),WertAnzahl ManöverJe Manöver: IDListe der empfohlenen Vor-/Nachteile (IDs)Liste der ungeeigneten Vor-/Nachteile (IDs)Formel für GrößeFormel für GewichtListe der HaarfarbenListe der AugenfarbenAnzahl der VN-KostenmodifikationenJe VN-Kostenmodifikation: ID,KostenAnzahl der Verbilligten SonderfertigkeitenJe Verbilligter SF: ID oder Liste von IDsSO-MaximumGestreiftes Fell/Haut (1/0)Anzahl SonderregelnJe Regel: Eine verklausulierte RegelAnzahl Zeilen im besonderen BesitzDie einzelnen Zeilen des besonderen BesitzesSpezielle Marken zur internen VerarbeitungMagische TraditionFür MU-KK,SO,MR,LEP,AUP,ASP,KEP,ATBAS,PABAS,FKB AS,INI,GS:Wert,Grundwert,Maximum,Minimum,[Obsolet],Bonus durchVN,Sonderboni,Professionsbonus,Kulturbon us,RassenbonusGoldRasseKulturProfessionGrößeGewichtGeburtsortTitelDokumentvorlageHaarfarbeAugenfarbeMännlich (1/0)AP gesamtAP-GuthabenGeburtstagGeburtsmonatGeburtsjahrJahr vor Hal (1/0)Magie-Kürzel (N/Z/V/H)Magische HauptrepräsentationAnzahl Zeilen in BemerkungDie einzelnen Zeilen der BemerkungVerlorene permanente ASPGegenelement(e)Namensregion--- Dateiende \ No newline at end of file +--- Dateibeginn Versionsnummer Name des Helden Anzahl der Talente Je Talent: ID,Grundwert,Wert,Maximum,[Obsolet],Aktiviert(1/0),Muttersprache(1/),Zweitsprache(1/0),Leittalent(1/0),AT,PA,AtAnteil,ATBonus,PABonus Anzahl Zauber Je Zauber: ID,Repräsentation,Aktiviert(1/0),Hauszauber(1/0),Grundwert,Wert,Maximum Anzahl Vor/Nachteile Je V/N: ID,Detailangabe,Maximum,Los,Wert Anzahl Sonderfertigleiten Je SF: ID, Detailangabe,Zusatzangabe,Vorgegeben(1/0),Wert Anzahl Manöver Je Manöver: ID Liste der empfohlenen Vor-/Nachteile (IDs) Liste der ungeeigneten Vor-/Nachteile (IDs) Formel für Größe Formel für Gewicht Liste der Haarfarben Liste der Augenfarben Anzahl der VN-Kostenmodifikationen Je VN-Kostenmodifikation: ID,Kosten Anzahl der Verbilligten Sonderfertigkeiten Je Verbilligter SF: ID oder Liste von IDs SO-Maximum Gestreiftes Fell/Haut (1/0) Anzahl Sonderregeln Je Regel: Eine verklausulierte Regel Anzahl Zeilen im besonderen Besitz Die einzelnen Zeilen des besonderen Besitzes Spezielle Marken zur internen Verarbeitung Magische Tradition Für MU-KK,SO,MR,LEP,AUP,ASP,KEP,ATBAS,PABAS,FKB AS,INI,GS: Wert,Grundwert,Maximum,Minimum,[Obsolet],Bonus durch VN,Sonderboni,Professionsbonus,Kulturbon us,Rassenbonus Gold Rasse Kultur Profession Größe Gewicht Geburtsort Titel Dokumentvorlage Haarfarbe Augenfarbe Männlich (1/0) AP gesamt AP-Guthaben Geburtstag Geburtsmonat Geburtsjahr Jahr vor Hal (1/0) Magie-Kürzel (N/Z/V/H) Magische Hauptrepräsentation Anzahl Zeilen in Bemerkung Die einzelnen Zeilen der Bemerkung Verlorene permanente ASP Gegenelement(e) Namensregion --- Dateiende \ No newline at end of file Modified: h422/trunk/notes/Res.h42.htm =================================================================== --- h422/trunk/notes/Res.h42.htm 2006-10-14 16:27:19 UTC (rev 4) +++ h422/trunk/notes/Res.h42.htm 2006-10-14 17:13:59 UTC (rev 5) @@ -1,331 +1,331 @@ -<font color="7f0000">Medicus -9 12 10 15 13 14 12 -4 3 3 2 6 3 7 </font> -Kampftechniken -0 -20 -Raufen (BE) -3 1 0 0 -Boxen (BE) --2 1 0 0 -Hruruzat (BE) --3 1 0 0 -Ringen (BE) -8 1 0 0 -Äxte und Beile (BE-3) --6 1 0 0 -Dolche (BE-1) -8 1 0 0 -Infanteriewaffen (BE-3) --5 1 0 0 -Linkshändig -0 1 0 0 -Kettenwaffen (BE-2) --5 1 0 0 -Peitsche (BE) -7 1 0 0 -Scharfe Hiebwaffen (BE-2) -1 1 0 0 -Schwerter (BE-2) --1 1 0 0 -Speere und Stäbe (BE-2) -1 1 0 0 -Stichwaffen (BE-1) --1 1 0 0 -Stumpfe Hiebwaffen (BE-3) -2 1 0 0 -Zweihänder (BE-2) --5 1 0 0 -Lanzenreiten --6 1 0 0 -Schußwaffen --1 1 0 0 -Wurfwaffen (BE-3) -5 1 0 0 -Schleuder --1 1 0 0 -Körperliche Talente -0 -12 -Akrobatik (MU/GE/KK) -8 2 0 0 -Fliegen (MU/KL/GE) -1 2 0 0 -Gaukeleien (CH/FF/GE) -3 2 0 0 -Klettern (MU/GE/KK) -0 2 0 0 -Körperbeherrschung (MU/IN/GE) -9 2 0 0 -Reiten (CH/GE/KK) -3 2 0 0 -Schleichen (MU/IN/GE) -0 2 0 0 -Schwimmen (MU/GE/KK) --1 2 0 0 -Selbstbeherrschung (MU/KK/KK) -5 2 0 0 -Sich Verstecken (MU/IN/GE) -0 2 0 0 -Tanzen (CH/GE/GE) -7 2 0 0 -Zechen (KL/IN/KK) -5 2 0 0 -Gesellschaft -0 -10 -Bekehren/Überzeugen (KL/IN/CH) -7 2 0 0 -Betören (IN/CH/CH) -12 2 0 0 -Etikette (KL/CH/GE) -7 2 0 0 -Feilschen (MU/KL/CH) -2 2 0 0 -Gassenwissen (KL/IN/CH) -2 2 0 0 -Lehren (KL/IN/CH) -3 2 0 0 -Lügen (MU/IN/CH) -5 2 0 0 -Menschenkenntnis (KL/IN/CH) -8 2 0 0 -Schätzen (KL/IN/IN) -0 2 0 0 -Sich Verkleiden (MU/FF/GE) -0 2 0 0 -Natur -0 -9 -Fährtensuchen (KL/IN/GE) --3 2 0 0 -Fallenstellen (KL/FF/KK) --4 2 0 0 -Fesseln/Entfesseln (FF/GE/KK) -5 2 0 0 -Fischen/Angeln (IN/FF/KK) --3 2 0 0 -Pflanzenkunde (KL/IN/FF) -4 2 0 0 -Orientierung (KL/IN/IN) --1 2 0 0 -Tierkunde (MU/KL/IN) --1 2 0 0 -Wettervorhersage (KL/IN/IN) --4 2 0 0 -Wildnisleben (IN/FF/GE) --2 2 0 0 -Wissenstalente -0 -14 -Alchimie (MU/KL/FF) -4 3 0 0 -Alte Sprachen (KL/KL/IN) -4 3 0 0 -Geographie (KL/KL/IN) -4 3 0 0 -Geschichtswissen (KL/KL/IN) -4 3 0 0 -Götter und Kulte (KL/IN/CH) -4 3 0 0 -Kriegskunst (MU/KL/CH) --5 3 0 0 -Lesen/Schreiben (KL/KL/FF) -4 3 0 0 -Magiekunde (KL/KL/IN) -4 3 0 0 -Mechanik (KL/KL/FF) -1 3 0 0 -Rechnen (KL/KL/IN) -4 3 0 0 -Rechtskunde (KL/IN/CH) -4 3 0 0 -Sprachen Kennen (KL/IN/CH) -4 3 0 0 -Staatskunst (KL/IN/CH) -4 3 0 0 -Sternkunde (KL/KL/IN) -4 3 0 0 -Handwerk -0 -18 -Abrichten (MU/IN/CH) --1 2 0 0 -Boote Fahren (FF/GE/KK) --2 2 0 0 -Fahrzeug Lenken (IN/CH/FF) -1 2 0 0 -Falschspiel (MU/CH/FF) -0 2 0 0 -Heilkunde, Gift (MU/KL/IN) -3 2 0 0 -Heilkunde, Krankh. (MU/KL/CH) -4 2 0 0 -Heilkunde, Seele (IN/CH/CH) -4 2 0 0 -Heilkunde, Wunden (KL/CH/FF) -8 2 0 0 -Holzbearbeitung (KL/FF/KK) -0 2 0 0 -Kochen (KL/IN/FF) -1 2 0 0 -Lederarbeiten (KL/FF/FF) --2 2 0 0 -Malen/Zeichnen (KL/IN/FF) -2 2 0 0 -Musizieren (KL/IN/FF) -6 2 0 0 -Schneidern (KL/FF/FF) -1 2 0 0 -Schlösser Knacken (IN/FF/FF) -0 2 0 0 -Singen (KL/IN/CH) -7 2 0 0 -Taschendiebstahl (MU/IN/FF) -0 2 0 0 -Töpfern (KL/FF/FF) --1 2 0 0 -Intuitive Begabungen -0 -5 -Gefahreninstinkt (KL/IN/IN) -6 1 0 0 -Glücksspiel (MU/IN/IN) -1 1 0 0 -Prophezeien (IN/IN/CH) -1 1 0 0 -Sinnesschärfe (KL/IN/IN) -7 1 0 0 -Stimmen Imitieren (KL/IN/CH) --4 1 0 0 -Sondertalente/Berufe -0 -1 -Kurtisane/Gesellschafter (IN/CH/FF) -7 1 0 0 -Schamanenrituale -2 -0 -49 -0 -0 -0 -30 -0 -0 -10 -0 -1W6 -1W6 -FALSE -FALSE -0 -0 -FALSE -0 -Rahjadés Despreciósa -Al'Anfa -hellblond -mittelständisch -166 -66 -9 7 10 -19 -0 -FALSE -0 0 0 - -blau - - -2100 -7 -0 0 0 0 -9 6 6 12 4 10 5 -7 5 11 8 7 8 7 8 5 1 7 13 7 -8 6 5 10 4 12 4 -7 4 10 7 6 7 6 8 4 0 0 0 0 -4 1 -5 -Hakendolch -1W+2 -0 -60 -17 -1/3 -5 -Dolch -1W+1 -3 -20 -15 -2/1 -9 -Peitsche -1W -0 -60 -19 -8/0 -18 -Wurfmesser -1W -0 -10 -(+1/0/0/-1) -25 -Kleidung -1 -1 -120 -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -Standard.rtf -5 5 -1 -Aberglauben: rote Haare, Sternschnuppen, Talismane, Elfen -4 -Tulamidisch (Novadisch) -0 -Garethi -4 -*Ur-Tulamidya -3 -*Bosparano -1 -19 -Geldbeutel -1 -Gürteltasche -5 -Lederrucksack -40 -Wolldecke -60 -Feuerstein und Stahl -5 -Proviant -40 -Zunderdose, voll -8 -Augenschminke -1 -Rasiermesser -10 -Lippenrot -1 -Nagelfeile -2 -Ohrring, Gold -1 -Ohrring, Gold -1 -Bluse, Seide -5 -Pluderhose, Seide -20 -Schleier, Seide -1 -Wurfmesser -10 -Wurfmesser -10 -Wurfmesser -10 +<font color="7f0000">Medicus +9 12 10 15 13 14 12 +4 3 3 2 6 3 7 </font> +Kampftechniken +0 +20 +Raufen (BE) +3 1 0 0 +Boxen (BE) +-2 1 0 0 +Hruruzat (BE) +-3 1 0 0 +Ringen (BE) +8 1 0 0 +Äxte und Beile (BE-3) +-6 1 0 0 +Dolche (BE-1) +8 1 0 0 +Infanteriewaffen (BE-3) +-5 1 0 0 +Linkshändig +0 1 0 0 +Kettenwaffen (BE-2) +-5 1 0 0 +Peitsche (BE) +7 1 0 0 +Scharfe Hiebwaffen (BE-2) +1 1 0 0 +Schwerter (BE-2) +-1 1 0 0 +Speere und Stäbe (BE-2) +1 1 0 0 +Stichwaffen (BE-1) +-1 1 0 0 +Stumpfe Hiebwaffen (BE-3) +2 1 0 0 +Zweihänder (BE-2) +-5 1 0 0 +Lanzenreiten +-6 1 0 0 +Schußwaffen +-1 1 0 0 +Wurfwaffen (BE-3) +5 1 0 0 +Schleuder +-1 1 0 0 +Körperliche Talente +0 +12 +Akrobatik (MU/GE/KK) +8 2 0 0 +Fliegen (MU/KL/GE) +1 2 0 0 +Gaukeleien (CH/FF/GE) +3 2 0 0 +Klettern (MU/GE/KK) +0 2 0 0 +Körperbeherrschung (MU/IN/GE) +9 2 0 0 +Reiten (CH/GE/KK) +3 2 0 0 +Schleichen (MU/IN/GE) +0 2 0 0 +Schwimmen (MU/GE/KK) +-1 2 0 0 +Selbstbeherrschung (MU/KK/KK) +5 2 0 0 +Sich Verstecken (MU/IN/GE) +0 2 0 0 +Tanzen (CH/GE/GE) +7 2 0 0 +Zechen (KL/IN/KK) +5 2 0 0 +Gesellschaft +0 +10 +Bekehren/Überzeugen (KL/IN/CH) +7 2 0 0 +Betören (IN/CH/CH) +12 2 0 0 +Etikette (KL/CH/GE) +7 2 0 0 +Feilschen (MU/KL/CH) +2 2 0 0 +Gassenwissen (KL/IN/CH) +2 2 0 0 +Lehren (KL/IN/CH) +3 2 0 0 +Lügen (MU/IN/CH) +5 2 0 0 +Menschenkenntnis (KL/IN/CH) +8 2 0 0 +Schätzen (KL/IN/IN) +0 2 0 0 +Sich Verkleiden (MU/FF/GE) +0 2 0 0 +Natur +0 +9 +Fährtensuchen (KL/IN/GE) +-3 2 0 0 +Fallenstellen (KL/FF/KK) +-4 2 0 0 +Fesseln/Entfesseln (FF/GE/KK) +5 2 0 0 +Fischen/Angeln (IN/FF/KK) +-3 2 0 0 +Pflanzenkunde (KL/IN/FF) +4 2 0 0 +Orientierung (KL/IN/IN) +-1 2 0 0 +Tierkunde (MU/KL/IN) +-1 2 0 0 +Wettervorhersage (KL/IN/IN) +-4 2 0 0 +Wildnisleben (IN/FF/GE) +-2 2 0 0 +Wissenstalente +0 +14 +Alchimie (MU/KL/FF) +4 3 0 0 +Alte Sprachen (KL/KL/IN) +4 3 0 0 +Geographie (KL/KL/IN) +4 3 0 0 +Geschichtswissen (KL/KL/IN) +4 3 0 0 +Götter und Kulte (KL/IN/CH) +4 3 0 0 +Kriegskunst (MU/KL/CH) +-5 3 0 0 +Lesen/Schreiben (KL/KL/FF) +4 3 0 0 +Magiekunde (KL/KL/IN) +4 3 0 0 +Mechanik (KL/KL/FF) +1 3 0 0 +Rechnen (KL/KL/IN) +4 3 0 0 +Rechtskunde (KL/IN/CH) +4 3 0 0 +Sprachen Kennen (KL/IN/CH) +4 3 0 0 +Staatskunst (KL/IN/CH) +4 3 0 0 +Sternkunde (KL/KL/IN) +4 3 0 0 +Handwerk +0 +18 +Abrichten (MU/IN/CH) +-1 2 0 0 +Boote Fahren (FF/GE/KK) +-2 2 0 0 +Fahrzeug Lenken (IN/CH/FF) +1 2 0 0 +Falschspiel (MU/CH/FF) +0 2 0 0 +Heilkunde, Gift (MU/KL/IN) +3 2 0 0 +Heilkunde, Krankh. (MU/KL/CH) +4 2 0 0 +Heilkunde, Seele (IN/CH/CH) +4 2 0 0 +Heilkunde, Wunden (KL/CH/FF) +8 2 0 0 +Holzbearbeitung (KL/FF/KK) +0 2 0 0 +Kochen (KL/IN/FF) +1 2 0 0 +Lederarbeiten (KL/FF/FF) +-2 2 0 0 +Malen/Zeichnen (KL/IN/FF) +2 2 0 0 +Musizieren (KL/IN/FF) +6 2 0 0 +Schneidern (KL/FF/FF) +1 2 0 0 +Schlösser Knacken (IN/FF/FF) +0 2 0 0 +Singen (KL/IN/CH) +7 2 0 0 +Taschendiebstahl (MU/IN/FF) +0 2 0 0 +Töpfern (KL/FF/FF) +-1 2 0 0 +Intuitive Begabungen +0 +5 +Gefahreninstinkt (KL/IN/IN) +6 1 0 0 +Glücksspiel (MU/IN/IN) +1 1 0 0 +Prophezeien (IN/IN/CH) +1 1 0 0 +Sinnesschärfe (KL/IN/IN) +7 1 0 0 +Stimmen Imitieren (KL/IN/CH) +-4 1 0 0 +Sondertalente/Berufe +0 +1 +Kurtisane/Gesellschafter (IN/CH/FF) +7 1 0 0 +Schamanenrituale +2 +0 +49 +0 +0 +0 +30 +0 +0 +10 +0 +1W6 +1W6 +FALSE +FALSE +0 +0 +FALSE +0 +Rahjadés Despreciósa +Al'Anfa +hellblond +mittelständisch +166 +66 +9 7 10 +19 +0 +FALSE +0 0 0 + +blau + + +2100 +7 +0 0 0 0 +9 6 6 12 4 10 5 -7 5 11 8 7 8 7 8 5 1 7 13 7 +8 6 5 10 4 12 4 -7 4 10 7 6 7 6 8 4 0 0 0 0 +4 1 +5 +Hakendolch +1W+2 +0 +60 +17 +1/3 +5 +Dolch +1W+1 +3 +20 +15 +2/1 +9 +Peitsche +1W +0 +60 +19 +8/0 +18 +Wurfmesser +1W +0 +10 +(+1/0/0/-1) +25 +Kleidung +1 +1 +120 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +Standard.rtf +5 5 +1 +Aberglauben: rote Haare, Sternschnuppen, Talismane, Elfen +4 +Tulamidisch (Novadisch) +0 +Garethi +4 +*Ur-Tulamidya +3 +*Bosparano +1 +19 +Geldbeutel +1 +Gürteltasche +5 +Lederrucksack +40 +Wolldecke +60 +Feuerstein und Stahl +5 +Proviant +40 +Zunderdose, voll +8 +Augenschminke +1 +Rasiermesser +10 +Lippenrot +1 +Nagelfeile +2 +Ohrring, Gold +1 +Ohrring, Gold +1 +Bluse, Seide +5 +Pluderhose, Seide +20 +Schleier, Seide +1 +Wurfmesser +10 +Wurfmesser +10 +Wurfmesser +10 Modified: h422/trunk/notes/Res.h42.html =================================================================== --- h422/trunk/notes/Res.h42.html 2006-10-14 16:27:19 UTC (rev 4) +++ h422/trunk/notes/Res.h42.html 2006-10-14 17:13:59 UTC (rev 5) @@ -1,333 +1,333 @@ -<font color="007f00">Medicus<br /> -9 12 10 15 13 14 12 <br /> -4 3 3 2 6 3 7 </font><br /> -<font color="7f5000">Kampftechniken<br /> -0<br /> -20<br /> -Raufen (BE)<br /> -3 1 0 0<br /> -Boxen (BE)<br /> --2 1 0 0<br /> -Hruruzat (BE)<br /> --3 1 0 0<br /> -Ringen (BE)<br /> -8 1 0 0<br /> -Äxte und Beile (BE-3)<br /> --6 1 0 0<br /> -Dolche (BE-1)<br /> -8 1 0 0<br /> -Infanteriewaffen (BE-3)<br /> --5 1 0 0<br /> -Linkshändig<br /> -0 1 0 0<br /> -Kettenwaffen (BE-2)<br /> --5 1 0 0<br /> -Peitsche (BE)<br /> -7 1 0 0<br /> -Scharfe Hiebwaffen (BE-2)<br /> -1 1 0 0<br /> -Schwerter (BE-2)<br /> --1 1 0 0<br /> -Speere und Stäbe (BE-2)<br /> -1 1 0 0<br /> -Stichwaffen (BE-1)<br /> --1 1 0 0<br /> -Stumpfe Hiebwaffen (BE-3)<br /> -2 1 0 0<br /> -Zweihänder (BE-2)<br /> --5 1 0 0<br /> -Lanzenreiten<br /> --6 1 0 0<br /> -Schußwaffen<br /> --1 1 0 0<br /> -Wurfwaffen (BE-3)<br /> -5 1 0 0<br /> -Schleuder<br /> --1 1 0 0<br /> -Körperliche Talente<br /> -0<br /> -12<br /> -Akrobatik (MU/GE/KK)<br /> -8 2 0 0<br /> -Fliegen (MU/KL/GE)<br /> -1 2 0 0<br /> -Gaukeleien (CH/FF/GE)<br /> -3 2 0 0<br /> -Klettern (MU/GE/KK)<br /> -0 2 0 0<br /> -Körperbeherrschung (MU/IN/GE)<br /> -9 2 0 0<br /> -Reiten (CH/GE/KK)<br /> -3 2 0 0<br /> -Schleichen (MU/IN/GE)<br /> -0 2 0 0<br /> -Schwimmen (MU/GE/KK)<br /> --1 2 0 0<br /> -Selbstbeherrschung (MU/KK/KK)<br /> -5 2 0 0<br /> -Sich Verstecken (MU/IN/GE)<br /> -0 2 0 0<br /> -Tanzen (CH/GE/GE)<br /> -7 2 0 0<br /> -Zechen (KL/IN/KK)<br /> -5 2 0 0<br /> -Gesellschaft<br /> -0<br /> -10<br /> -Bekehren/Überzeugen (KL/IN/CH)<br /> -7 2 0 0<br /> -Betören (IN/CH/CH)<br /> -12 2 0 0<br /> -Etikette (KL/CH/GE)<br /> -7 2 0 0<br /> -Feilschen (MU/KL/CH)<br /> -2 2 0 0<br /> -Gassenwissen (KL/IN/CH)<br /> -2 2 0 0<br /> -Lehren (KL/IN/CH)<br /> -3 2 0 0<br /> -Lügen (MU/IN/CH)<br /> -5 2 0 0<br /> -Menschenkenntnis (KL/IN/CH)<br /> -8 2 0 0<br /> -Schätzen (KL/IN/IN)<br /> -0 2 0 0<br /> -Sich Verkleiden (MU/FF/GE)<br /> -0 2 0 0<br /> -Natur<br /> -0<br /> -9<br /> -Fährtensuchen (KL/IN/GE)<br /> --3 2 0 0<br /> -Fallenstellen (KL/FF/KK)<br /> --4 2 0 0<br /> -Fesseln/Entfesseln (FF/GE/KK)<br /> -5 2 0 0<br /> -Fischen/Angeln (IN/FF/KK)<br /> --3 2 0 0<br /> -Pflanzenkunde (KL/IN/FF)<br /> -4 2 0 0<br /> -Orientierung (KL/IN/IN)<br /> --1 2 0 0<br /> -Tierkunde (MU/KL/IN)<br /> --1 2 0 0<br /> -Wettervorhersage (KL/IN/IN)<br /> --4 2 0 0<br /> -Wildnisleben (IN/FF/GE)<br /> --2 2 0 0<br /> -Wissenstalente<br /> -0<br /> -14<br /> -Alchimie (MU/KL/FF)<br /> -4 3 0 0<br /> -Alte Sprachen (KL/KL/IN)<br /> -4 3 0 0<br /> -Geographie (KL/KL/IN)<br /> -4 3 0 0<br /> -Geschichtswissen (KL/KL/IN)<br /> -4 3 0 0<br /> -Götter und Kulte (KL/IN/CH)<br /> -4 3 0 0<br /> -Kriegskunst (MU/KL/CH)<br /> --5 3 0 0<br /> -Lesen/Schreiben (KL/KL/FF)<br /> -4 3 0 0<br /> -Magiekunde (KL/KL/IN)<br /> -4 3 0 0<br /> -Mechanik (KL/KL/FF)<br /> -1 3 0 0<br /> -Rechnen (KL/KL/IN)<br /> -4 3 0 0<br /> -Rechtskunde (KL/IN/CH)<br /> -4 3 0 0<br /> -Sprachen Kennen (KL/IN/CH)<br /> -4 3 0 0<br /> -Staatskunst (KL/IN/CH)<br /> -4 3 0 0<br /> -Sternkunde (KL/KL/IN)<br /> -4 3 0 0<br /> -Handwerk<br /> -0<br /> -18<br /> -Abrichten (MU/IN/CH)<br /> --1 2 0 0<br /> -Boote Fahren (FF/GE/KK)<br /> --2 2 0 0<br /> -Fahrzeug Lenken (IN/CH/FF)<br /> -1 2 0 0<br /> -Falschspiel (MU/CH/FF)<br /> -0 2 0 0<br /> -Heilkunde, Gift (MU/KL/IN)<br /> -3 2 0 0<br /> -Heilkunde, Krankh. (MU/KL/CH)<br /> -4 2 0 0<br /> -Heilkunde, Seele (IN/CH/CH)<br /> -4 2 0 0<br /> -Heilkunde, Wunden (KL/CH/FF)<br /> -8 2 0 0<br /> -Holzbearbeitung (KL/FF/KK)<br /> -0 2 0 0<br /> -Kochen (KL/IN/FF)<br /> -1 2 0 0<br /> -Lederarbeiten (KL/FF/FF)<br /> --2 2 0 0<br /> -Malen/Zeichnen (KL/IN/FF)<br /> -2 2 0 0<br /> -Musizieren (KL/IN/FF)<br /> -6 2 0 0<br /> -Schneidern (KL/FF/FF)<br /> -1 2 0 0<br /> -Schlösser Knacken (IN/FF/FF)<br /> -0 2 0 0<br /> -Singen (KL/IN/CH)<br /> -7 2 0 0<br /> -Taschendiebstahl (MU/IN/FF)<br /> -0 2 0 0<br /> -Töpfern (KL/FF/FF)<br /> --1 2 0 0<br /> -Intuitive Begabungen<br /> -0<br /> -5<br /> -Gefahreninstinkt (KL/IN/IN)<br /> -6 1 0 0<br /> -Glücksspiel (MU/IN/IN)<br /> -1 1 0 0<br /> -Prophezeien (IN/IN/CH)<br /> -1 1 0 0<br /> -Sinnesschärfe (KL/IN/IN)<br /> -7 1 0 0<br /> -Stimmen Imitieren (KL/IN/CH)<br /> --4 1 0 0<br /> -Sondertalente/Berufe<br /> -0<br /> -1<br /> -Kurtisane/Gesellschafter (IN/CH/FF)<br /> -7 1 0 0</font><br /> -<font color="7f0000">Schamanenrituale<br /> -2<br /> -0<br /> -49<br /> -0<br /> -0<br /> -0<br /> -30<br /> -0<br /> -0<br /> -10<br /> -0<br /> -1W6<br /> -1W6<br /> -FALSE<br /> -FALSE<br /> -0<br /> -0<br /> -FALSE<br /> -0</font><br /> -<font color="7f5000"> -Rahjadés Despreciósa<br /> -Al'Anfa<br /> -hellblond<br /> -mittelständisch<br /> -166<br /> -66<br /> -9 7 10<br /> -19<br /> -0<br /> -FALSE<br /> -0 0 0<br /> -<br /> -blau</font><br /> -<font color="7f0000"> -<br /> -<br /> -2100<br /> -7<br /> -0 0 0 0<br /> -9 6 6 12 4 10 5 -7 5 11 8 7 8 7 8 5 1 7 13 7 <br /> -8 6 5 10 4 12 4 -7 4 10 7 6 7 6 8 4 0 0 0 0 <br /> -4 1</font><br /> -<font color="7f5000">5<br /> -Hakendolch<br /> -1W+2<br /> -0<br /> -60<br /> -17<br /> -1/3<br /> -5<br /> -Dolch<br /> -1W+1<br /> -3<br /> -20<br /> -15<br /> -2/1<br /> -9<br /> -Peitsche<br /> -1W<br /> -0<br /> -60<br /> -19<br /> -8/0<br /> -18<br /> -Wurfmesser<br /> -1W<br /> -0<br /> -10<br /> -(+1/0/0/-1)<br /> -25</font><br /> -<font color="7f0000">Kleidung<br /> -1<br /> -1<br /> -120<br /> -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 <br /> -Standard.rtf<br /> -5 5</font><br /> -<font color="7f0000">1<br /> -Aberglauben: rote Haare, Sternschnuppen, Talismane, Elfen<br /> -4</font><br /> -<font color="007f00">Tulamidisch (Novadisch)<br /> -0<br /> -Garethi<br /> -4<br /> -*Ur-Tulamidya<br /> -3<br /> -*Bosparano<br /> -1</font><br /> -<font color="007f00">19<br /> -Geldbeutel<br /> -1<br /> -Gürteltasche<br /> -5<br /> -Lederrucksack<br /> -40<br /> -Wolldecke<br /> -60<br /> -Feuerstein und Stahl<br /> -5<br /> -Proviant<br /> -40<br /> -Zunderdose, voll<br /> -8<br /> -Augenschminke<br /> -1<br /> -Rasiermesser<br /> -10<br /> -Lippenrot<br /> -1<br /> -Nagelfeile<br /> -2<br /> -Ohrring, Gold<br /> -1<br /> -Ohrring, Gold<br /> -1<br /> -Bluse, Seide<br /> -5<br /> -Pluderhose, Seide<br /> -20<br /> -Schleier, Seide<br /> -1<br /> -Wurfmesser<br /> -10<br /> -Wurfmesser<br /> -10<br /> -Wurfmesser<br /> -10</font><br /> +<font color="007f00">Medicus<br /> +9 12 10 15 13 14 12 <br /> +4 3 3 2 6 3 7 </font><br /> +<font color="7f5000">Kampftechniken<br /> +0<br /> +20<br /> +Raufen (BE)<br /> +3 1 0 0<br /> +Boxen (BE)<br /> +-2 1 0 0<br /> +Hruruzat (BE)<br /> +-3 1 0 0<br /> +Ringen (BE)<br /> +8 1 0 0<br /> +Äxte und Beile (BE-3)<br /> +-6 1 0 0<br /> +Dolche (BE-1)<br /> +8 1 0 0<br /> +Infanteriewaffen (BE-3)<br /> +-5 1 0 0<br /> +Linkshändig<br /> +0 1 0 0<br /> +Kettenwaffen (BE-2)<br /> +-5 1 0 0<br /> +Peitsche (BE)<br /> +7 1 0 0<br /> +Scharfe Hiebwaffen (BE-2)<br /> +1 1 0 0<br /> +Schwerter (BE-2)<br /> +-1 1 0 0<br /> +Speere und Stäbe (BE-2)<br /> +1 1 0 0<br /> +Stichwaffen (BE-1)<br /> +-1 1 0 0<br /> +Stumpfe Hiebwaffen (BE-3)<br /> +2 1 0 0<br /> +Zweihänder (BE-2)<br /> +-5 1 0 0<br /> +Lanzenreiten<br /> +-6 1 0 0<br /> +Schußwaffen<br /> +-1 1 0 0<br /> +Wurfwaffen (BE-3)<br /> +5 1 0 0<br /> +Schleuder<br /> +-1 1 0 0<br /> +Körperliche Talente<br /> +0<br /> +12<br /> +Akrobatik (MU/GE/KK)<br /> +8 2 0 0<br /> +Fliegen (MU/KL/GE)<br /> +1 2 0 0<br /> +Gaukeleien (CH/FF/GE)<br /> +3 2 0 0<br /> +Klettern (MU/GE/KK)<br /> +0 2 0 0<br /> +Körperbeherrschung (MU/IN/GE)<br /> +9 2 0 0<br /> +Reiten (CH/GE/KK)<br /> +3 2 0 0<br /> +Schleichen (MU/IN/GE)<br /> +0 2 0 0<br /> +Schwimmen (MU/GE/KK)<br /> +-1 2 0 0<br /> +Selbstbeherrschung (MU/KK/KK)<br /> +5 2 0 0<br /> +Sich Verstecken (MU/IN/GE)<br /> +0 2 0 0<br /> +Tanzen (CH/GE/GE)<br /> +7 2 0 0<br /> +Zechen (KL/IN/KK)<br /> +5 2 0 0<br /> +Gesellschaft<br /> +0<br /> +10<br /> +Bekehren/Überzeugen (KL/IN/CH)<br /> +7 2 0 0<br /> +Betören (IN/CH/CH)<br /> +12 2 0 0<br /> +Etikette (KL/CH/GE)<br /> +7 2 0 0<br /> +Feilschen (MU/KL/CH)<br /> +2 2 0 0<br /> +Gassenwissen (KL/IN/CH)<br /> +2 2 0 0<br /> +Lehren (KL/IN/CH)<br /> +3 2 0 0<br /> +Lügen (MU/IN/CH)<br /> +5 2 0 0<br /> +Menschenkenntnis (KL/IN/CH)<br /> +8 2 0 0<br /> +Schätzen (KL/IN/IN)<br /> +0 2 0 0<br /> +Sich Verkleiden (MU/FF/GE)<br /> +0 2 0 0<br /> +Natur<br /> +0<br /> +9<br /> +Fährtensuchen (KL/IN/GE)<br /> +-3 2 0 0<br /> +Fallenstellen (KL/FF/KK)<br /> +-4 2 0 0<br /> +Fesseln/Entfesseln (FF/GE/KK)<br /> +5 2 0 0<br /> +Fischen/Angeln (IN/FF/KK)<br /> +-3 2 0 0<br /> +Pflanzenkunde (KL/IN/FF)<br /> +4 2 0 0<br /> +Orientierung (KL/IN/IN)<br /> +-1 2 0 0<br /> +Tierkunde (MU/KL/IN)<br /> +-1 2 0 0<br /> +Wettervorhersage (KL/IN/IN)<br /> +-4 2 0 0<br /> +Wildnisleben (IN/FF/GE)<br /> +-2 2 0 0<br /> +Wissenstalente<br /> +0<br /> +14<br /> +Alchimie (MU/KL/FF)<br /> +4 3 0 0<br /> +Alte Sprachen (KL/KL/IN)<br /> +4 3 0 0<br /> +Geographie (KL/KL/IN)<br /> +4 3 0 0<br /> +Geschichtswissen (KL/KL/IN)<br /> +4 3 0 0<br /> +Götter und Kulte (KL/IN/CH)<br /> +4 3 0 0<br /> +Kriegskunst (MU/KL/CH)<br /> +-5 3 0 0<br /> +Lesen/Schreiben (KL/KL/FF)<br /> +4 3 0 0<br /> +Magiekunde (KL/KL/IN)<br /> +4 3 0 0<br /> +Mechanik (KL/KL/FF)<br /> +1 3 0 0<br /> +Rechnen (KL/KL/IN)<br /> +4 3 0 0<br /> +Rechtskunde (KL/IN/CH)<br /> +4 3 0 0<br /> +Sprachen Kennen (KL/IN/CH)<br /> +4 3 0 0<br /> +Staatskunst (KL/IN/CH)<br /> +4 3 0 0<br /> +Sternkunde (KL/KL/IN)<br /> +4 3 0 0<br /> +Handwerk<br /> +0<br /> +18<br /> +Abrichten (MU/IN/CH)<br /> +-1 2 0 0<br /> +Boote Fahren (FF/GE/KK)<br /> +-2 2 0 0<br /> +Fahrzeug Lenken (IN/CH/FF)<br /> +1 2 0 0<br /> +Falschspiel (MU/CH/FF)<br /> +0 2 0 0<br /> +Heilkunde, Gift (MU/KL/IN)<br /> +3 2 0 0<br /> +Heilkunde, Krankh. (MU/KL/CH)<br /> +4 2 0 0<br /> +Heilkunde, Seele (IN/CH/CH)<br /> +4 2 0 0<br /> +Heilkunde, Wunden (KL/CH/FF)<br /> +8 2 0 0<br /> +Holzbearbeitung (KL/FF/KK)<br /> +0 2 0 0<br /> +Kochen (KL/IN/FF)<br /> +1 2 0 0<br /> +Lederarbeiten (KL/FF/FF)<br /> +-2 2 0 0<br /> +Malen/Zeichnen (KL/IN/FF)<br /> +2 2 0 0<br /> +Musizieren (KL/IN/FF)<br /> +6 2 0 0<br /> +Schneidern (KL/FF/FF)<br /> +1 2 0 0<br /> +Schlösser Knacken (IN/FF/FF)<br /> +0 2 0 0<br /> +Singen (KL/IN/CH)<br /> +7 2 0 0<br /> +Taschendiebstahl (MU/IN/FF)<br /> +0 2 0 0<br /> +Töpfern (KL/FF/FF)<br /> +-1 2 0 0<br /> +Intuitive Begabungen<br /> +0<br /> +5<br /> +Gefahreninstinkt (KL/IN/IN)<br /> +6 1 0 0<br /> +Glücksspiel (MU/IN/IN)<br /> +1 1 0 0<br /> +Prophezeien (IN/IN/CH)<br /> +1 1 0 0<br /> +Sinnesschärfe (KL/IN/IN)<br /> +7 1 0 0<br /> +Stimmen Imitieren (KL/IN/CH)<br /> +-4 1 0 0<br /> +Sondertalente/Berufe<br /> +0<br /> +1<br /> +Kurtisane/Gesellschafter (IN/CH/FF)<br /> +7 1 0 0</font><br /> +<font color="7f0000">Schamanenrituale<br /> +2<br /> +0<br /> +49<br /> +0<br /> +0<br /> +0<br /> +30<br /> +0<br /> +0<br /> +10<br /> +0<br /> +1W6<br /> +1W6<br /> +FALSE<br /> +FALSE<br /> +0<br /> +0<br /> +FALSE<br /> +0</font><br /> +<font color="7f5000"> +Rahjadés Despreciósa<br /> +Al'Anfa<br /> +hellblond<br /> +mittelständisch<br /> +166<br /> +66<br /> +9 7 10<br /> +19<br /> +0<br /> +FALSE<br /> +0 0 0<br /> +<br /> +blau</font><br /> +<font color="7f0000"> +<br /> +<br /> +2100<br /> +7<br /> +0 0 0 0<br /> +9 6 6 12 4 10 5 -7 5 11 8 7 8 7 8 5 1 7 13 7 <br /> +8 6 5 10 4 12 4 -7 4 10 7 6 7 6 8 4 0 0 0 0 <br /> +4 1</font><br /> +<font color="7f5000">5<br /> +Hakendolch<br /> +1W+2<br /> +0<br /> +60<br /> +17<br /> +1/3<br /> +5<br /> +Dolch<br /> +1W+1<br /> +3<br /> +20<br /> +15<br /> +2/1<br /> +9<br /> +Peitsche<br /> +1W<br /> +0<br /> +60<br /> +19<br /> +8/0<br /> +18<br /> +Wurfmesser<br /> +1W<br /> +0<br /> +10<br /> +(+1/0/0/-1)<br /> +25</font><br /> +<font color="7f0000">Kleidung<br /> +1<br /> +1<br /> +120<br /> +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 <br /> +Standard.rtf<br /> +5 5</font><br /> +<font color="7f0000">1<br /> +Aberglauben: rote Haare, Sternschnuppen, Talismane, Elfen<br /> +4</font><br /> +<font color="007f00">Tulamidisch (Novadisch)<br /> +0<br /> +Garethi<br /> +4<br /> +*Ur-Tulamidya<br /> +3<br /> +*Bosparano<br /> +1</font><br /> +<font color="007f00">19<br /> +Geldbeutel<br /> +1<br /> +Gürteltasche<br /> +5<br /> +Lederrucksack<br /> +40<br /> +Wolldecke<br /> +60<br /> +Feuerstein und Stahl<br /> +5<br /> +Proviant<br /> +40<br /> +Zunderdose, voll<br /> +8<br /> +Augenschminke<br /> +1<br /> +Rasiermesser<br /> +10<br /> +Lippenrot<br /> +1<br /> +Nagelfeile<br /> +2<br /> +Ohrring, Gold<br /> +1<br /> +Ohrring, Gold<br /> +1<br /> +Bluse, Seide<br /> +5<br /> +Pluderhose, Seide<br /> +20<br /> +Schleier, Seide<br /> +1<br /> +Wurfmesser<br /> +10<br /> +Wurfmesser<br /> +10<br /> +Wurfmesser<br /> +10</font><br /> Modified: h422/trunk/notes/bla.php =================================================================== --- h422/trunk/notes/bla.php 2006-10-14 16:27:19 UTC (rev 4) +++ h422/trunk/notes/bla.php 2006-10-14 17:13:59 UTC (rev 5) @@ -1,99 +1,99 @@ <? - if (!defined('FILE_USE_INCLUDE_PATH')) { - define('FILE_USE_INCLUDE_PATH', 1); + if (!defined('FILE_USE_INCLUDE_PATH')) { + define('FILE_USE_INCLUDE_PATH', 1); +} + +if (!defined('LOCK_EX')) { + define('LOCK_EX', 2); +} + +if (!defined('FILE_APPEND')) { + define('FILE_APPEND', 8); +} + + +/** + * Replace file_put_contents() + * + * @category PHP + * @package PHP_Compat + * @link http://php.net/function.file_put_contents + * @author Aidan Lister <ai...@ph...> + * @version $Revision: 1.25 $ + * @internal resource_context is not supported + * @since PHP 5 + * @require PHP 4.0.0 (user_error) + */ +if (!function_exists('file_put_contents')) { + function file_put_contents($filename, $content, $flags = null, $resource_context = null) + { + // If $content is an array, convert it to a string + if (is_array($content)) { + $content = implode('', $content); + } + + // If we don't have a string, throw an error + if (!is_scalar($content)) { + user_error('file_put_contents() The 2nd parameter should be either a string or an array', + E_USER_WARNING); + return false; + } + + // Get the length of data to write + $length = strlen($content); + + // Check what mode we are using + $mode = ($flags & FILE_APPEND) ? + 'a' : + 'wb'; + + // Check if we're using the include path + $use_inc_path = ($flags & FILE_USE_INCLUDE_PATH) ? + true : + false; + + // Open the file for writing + if (($fh = @fopen($filename, $mode, $use_inc_path)) === false) { + user_error('file_put_contents() failed to open stream: Permission denied', + E_USER_WARNING); + return false; + } + + // Attempt to get an exclusive lock + $use_lock = ($flags & LOCK_EX) ? true : false ; + if ($use_lock === true) { + if (!flock($fh, LOCK_EX)) { + return false; + } + } + + // Write to the file + $bytes = 0; + if (($bytes = @fwrite($fh, $content)) === false) { + $errormsg = sprintf('file_put_contents() Failed to write %d bytes to %s', + $length, + $filename); + user_error($errormsg, E_USER_WARNING); + return false; + } + + // Close the handle + @fclose($fh); + + // Check all the data was written + if ($bytes != $length) { + $errormsg = sprintf('file_put_contents() Only %d of %d bytes written, possibly out of free disk space.', + $bytes, + $length); + user_error($errormsg, E_USER_WARNING); + return false; + } + + // Return length + return $bytes; + } } -if (!defined('LOCK_EX')) { - define('LOCK_EX', 2); -} - -if (!defined('FILE_APPEND')) { - define('FILE_APPEND', 8); -} - - -/** - * Replace file_put_contents() - * - * @category PHP - * @package PHP_Compat - * @link http://php.net/function.file_put_contents - * @author Aidan Lister <ai...@ph...> - * @version $Revision: 1.25 $ - * @internal resource_context is not supported - * @since PHP 5 - * @require PHP 4.0.0 (user_error) - */ -if (!function_exists('file_put_contents')) { - function file_put_contents($filename, $content, $flags = null, $resource_context = null) - { - // If $content is an array, convert it to a string - if (is_array($content)) { - $content = implode('', $content); - } - - // If we don't have a string, throw an error - if (!is_scalar($content)) { - user_error('file_put_contents() The 2nd parameter should be either a string or an array', - E_USER_WARNING); - return false; - } - - // Get the length of data to write - $length = strlen($content); - - // Check what mode we are using - $mode = ($flags & FILE_APPEND) ? - 'a' : - 'wb'; - - // Check if we're using the include path - $use_inc_path = ($flags & FILE_USE_INCLUDE_PATH) ? - true : - false; - - // Open the file for writing - if (($fh = @fopen($filename, $mode, $use_inc_path)) === false) { - user_error('file_put_contents() failed to open stream: Permission denied', - E_USER_WARNING); - return false; - } - - // Attempt to get an exclusive lock - $use_lock = ($flags & LOCK_EX) ? true : false ; - if ($use_lock === true) { - if (!flock($fh, LOCK_EX)) { - return false; - } - } - - // Write to the file - $bytes = 0; - if (($bytes = @fwrite($fh, $content)) === false) { - $errormsg = sprintf('file_put_contents() Failed to write %d bytes to %s', - $length, - $filename); - user_error($errormsg, E_USER_WARNING); - return false; - } - - // Close the handle - @fclose($fh); - - // Check all the data was written - if ($bytes != $length) { - $errormsg = sprintf('file_put_contents() Only %d of %d bytes written, possibly out of free disk space.', - $bytes, - $length); - user_error($errormsg, E_USER_WARNING); - return false; - } - - // Return length - return $bytes; - } -} - $bla = nl2br(file_get_contents('Res.h42.htm')); echo $bla; ?> \ No newline at end of file Modified: h422/trunk/src/commondefs.h =================================================================== --- h422/trunk/src/commondefs.h 2006-10-14 16:27:19 UTC (rev 4) +++ h422/trunk/src/commondefs.h 2006-10-14 17:13:59 UTC (rev 5) @@ -1,11 +1,11 @@ /******************************************************************************* -* h422 - converts DSAv3 hero data between various formats ** Copyright (C) 2006 Tim "Jesus_666" Okrongli ** ** This program is free software; you can redistribute it and/or modify it * +* h422 - converts DSAv3 hero data between various formats * * Copyright (C) 2006 Tim "Jesus_666" Okrongli * * * * This program is free software; you can redistribute it and/or modify it * * under the terms of the GNU General Public License as published by the Free * * Software Foundation; either version 2 of the License, or (at your option) * -* any later version. ** ** This program is distributed in the hope that it will be useful, but WITHOUT * +* any later version. * * * * This program is distributed in the hope that it will be useful, but WITHOUT * * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -* more details. ** ** You should have received a copy of the GNU General Public License along with * +* more details. * * * * You should have received a copy of the GNU General Public License along with * * this program; if not, write to the Free Software Foundation, Inc., 51 * * Franklin St, Fifth Floor, Boston, MA 02110, USA * *******************************************************************************/ Added: h422/trunk/src/config.h.cmake =================================================================== --- h422/trunk/src/config.h.cmake (rev 0) +++ h422/trunk/src/config.h.cmake 2006-10-14 17:13:59 UTC (rev 5) @@ -0,0 +1,18 @@ +/******************************************************************************* +* h422 - converts DSAv3 hero data between various formats * * Copyright (C) 2006 Tim "Jesus_666" Okrongli * * * * This program is free software; you can redistribute it and/or modify it * +* under the terms of the GNU General Public License as published by the Free * +* Software Foundation; either version 2 of the License, or (at your option) * +* any later version. * * * * This program is distributed in the hope that it will be useful, but WITHOUT * +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * +* more details. * * * * You should have received a copy of the GNU General Public License along with * +* this program; if not, write to the Free Software Foundation, Inc., 51 * +* Franklin St, Fifth Floor, Boston, MA 02110, USA * +*******************************************************************************/ + +#define LIBEXTENSION "@LIBEXTENSION@" +#define PATH_SEPARATOR "@PATH_SEPARATOR@" + +float version = @VERSION@; +// This path is relative to where the program resides +char* plugindir = ".@PATH_SEPARATOR@plugins"; Modified: h422/trunk/src/io_h42.cpp =================================================================== --- h422/trunk/src/io_h42.cpp 2006-10-14 16:27:19 UTC (rev 4) +++ h422/trunk/src/io_h42.cpp 2006-10-14 17:13:59 UTC (rev 5) @@ -1,11 +1,11 @@ /******************************************************************************* -* h422 - converts DSAv3 hero data between various formats ** Copyright (C) 2006 Tim "Jesus_666" Okrongli ** ** This program is free software; you can redistribute it and/or modify it * +* h422 - converts DSAv3 hero data between various formats * * Copyright (C) 2006 Tim "Jesus_666" Okrongli * * * * This program is free software; you can redistribute it and/or modify it * * under the terms of the GNU General Public License as published by the Free * * Software Foundation; either version 2 of the License, or (at your option) * -* any later version. ** ** This program is distributed in the hope that it will be useful, but WITHOUT * +* any later version. * * * * This program is distributed in the hope that it will be useful, but WITHOUT * * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -* more details. ** ** You should have received a copy of the GNU General Public License along with * +* more details. * * * * You should have received a copy of the GNU General Public License along with * * this program; if not, write to the Free Software Foundation, Inc., 51 * * Franklin St, Fifth Floor, Boston, MA 02110, USA * *******************************************************************************/ Modified: h422/trunk/src/io_null.cpp =================================================================== --- h422/trunk/src/io_null.cpp 2006-10-14 16:27:19 UTC (rev 4) +++ h422/trunk/src/io_null.cpp 2006-10-14 17:13:59 UTC (rev 5) @@ -1,11 +1,11 @@ /******************************************************************************* -* h422 - converts DSAv3 hero data between various formats ** Copyright (C) 2006 Tim "Jesus_666" Okrongli ** ** This program is free software; you can redistribute it and/or modify it * +* h422 - converts DSAv3 hero data between various formats * * Copyright (C) 2006 Tim "Jesus_666" Okrongli * * * * This program is free software; you can redistribute it and/or modify it * * under the terms of the GNU General Public License as published by the Free * * Software Foundation; either version 2 of the License, or (at your option) * -* any later version. ** ** This program is distributed in the hope that it will be useful, but WITHOUT * +* any later version. * * * * This program is distributed in the hope that it will be useful, but WITHOUT * * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -* more details. ** ** You should have received a copy of the GNU General Public License along with * +* more details. * * * * You should have received a copy of the GNU General Public License along with * * this program; if not, write to the Free Software Foundation, Inc., 51 * * Franklin St, Fifth Floor, Boston, MA 02110, USA * *******************************************************************************/ Modified: h422/trunk/src/io_plaintext.cpp =================================================================== --- h422/trunk/src/io_plaintext.cpp 2006-10-14 16:27:19 UTC (rev 4) +++ h422/trunk/src/io_plaintext.cpp 2006-10-14 17:13:59 UTC (rev 5) @@ -1,11 +1,11 @@ /******************************************************************************* -* h422 - converts DSAv3 hero data between various formats ** Copyright (C) 2006 Tim "Jesus_666" Okrongli ** ** This program is free software; you can redistribute it and/or modify it * +* h422 - converts DSAv3 hero data between various formats * * Copyright (C) 2006 Tim "Jesus_666" Okrongli * * * * This program is free software; you can redistribute it and/or modify it * * under the terms of the GNU General Public License as published by the Free * * Software Foundation; either version 2 of the License, or (at your option) * -* any later version. ** ** This program is distributed in the hope that it will be useful, but WITHOUT * +* any later version. * * * * This program is distributed in the hope that it will be useful, but WITHOUT * * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -* more details. ** ** You should have received a copy of the GNU General Public License along with * +* more details. * * * * You should have received a copy of the GNU General Public License along with * * this program; if not, write to the Free Software Foundation, Inc., 51 * * Franklin St, Fifth Floor, Boston, MA 02110, USA * *******************************************************************************/ Modified: h422/trunk/src/main.cpp =================================================================== --- h422/trunk/src/main.cpp 2006-10-14 16:27:19 UTC (rev 4) +++ h422/trunk/src/main.cpp 2006-10-14 17:13:59 UTC (rev 5) @@ -1,11 +1,11 @@ /******************************************************************************* -* h422 - converts DSAv3 hero data between various formats ** Copyright (C) 2006 Tim "Jesus_666" Okrongli ** ** This program is free software; you can redistribute it and/or modify it * +* h422 - converts DSAv3 hero data between various formats * * Copyright (C) 2006 Tim "Jesus_666" Okrongli * * * * This program is free software; you can redistribute it and/or modify it * * under the terms of the GNU General Public License as published by the Free * * Software Foundation; either version 2 of the License, or (at your option) * -* any later version. ** ** This program is distributed in the hope that it will be useful, but WITHOUT * +* any later version. * * * * This program is distributed in the hope that it will be useful, but WITHOUT * * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -* more details. ** ** You should have received a copy of the GNU General Public License along with * +* more details. * * * * You should have received a copy of the GNU General Public License along with * * this program; if not, write to the Free Software Foundation, Inc., 51 * * Franklin St, Fifth Floor, Boston, MA 02110, USA * *******************************************************************************/ Deleted: h422/trunk/src/main.h =================================================================== --- h422/trunk/src/main.h 2006-10-14 16:27:19 UTC (rev 4) +++ h422/trunk/src/main.h 2006-10-14 17:13:59 UTC (rev 5) @@ -1,32 +0,0 @@ -/******************************************************************************* -* h422 - converts DSAv3 hero data between various formats ** Copyright (C) 2006 Tim "Jesus_666" Okrongli ** ** This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU General Public License as published by the Free * -* Software Foundation; either version 2 of the License, or (at your option) * -* any later version. ** ** This program is distributed in the hope that it will be useful, but WITHOUT * -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -* more details. ** ** You should have received a copy of the GNU General Public License along with * -* this program; if not, write to the Free Software Foundation, Inc., 51 * -* Franklin St, Fifth Floor, Boston, MA 02110, USA * -*******************************************************************************/ - -#include <iostream> -#include <dlfcn.h> -#include <map.h> -#include <dirent.h> -#include <errno.h> -#include <stdlib.h> -#include "commondefs.h" - -#define LIBEXTENSION "dylib" -#define PATH_SEPARATOR "/" - -float version = 0.5; -// This path is relative to where the program resides -char* plugindir = "./plugins"; - -typedef s_plugdata* (*fp_plugdata)(); -map<string, s_plugdata*> pluginsByName; -map<string, s_plugdata*> pluginsByExtension; -vector<s_plugdata*> pluginList; -string wd; Added: h422/trunk/src/main.h =================================================================== --- h422/trunk/src/main.h (rev 0) +++ h422/trunk/src/main.h 2006-10-14 17:13:59 UTC (rev 5) @@ -0,0 +1,26 @@ +/******************************************************************************* +* h422 - converts DSAv3 hero data between various formats * * Copyright (C) 2006 Tim "Jesus_666" Okrongli * * * * This program is free software; you can redistribute it and/or modify it * +* under the terms of the GNU General Public License as published by the Free * +* Software Foundation; either version 2 of the License, or (at your option) * +* any later version. * * * * This program is distributed in the hope that it will be useful, but WITHOUT * +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * +* more details. * * * * You should have received a copy of the GNU General Public License along with * +* this program; if not, write to the Free Software Foundation, Inc., 51 * +* Franklin St, Fifth Floor, Boston, MA 02110, USA * +*******************************************************************************/ + +#include <iostream> +#include <dlfcn.h> +#include <map> +#include <dirent.h> +#include <errno.h> +#include <stdlib.h> +#include "config.h" +#include "commondefs.h" + +typedef s_plugdata* (*fp_plugdata)(); +map<string, s_plugdata*> pluginsByName; +map<string, s_plugdata*> pluginsByExtension; +vector<s_plugdata*> pluginList; +string wd; // The directory wherein the program resides Deleted: h422/trunk/src/main.h.cmake =================================================================== --- h422/trunk/src/main.h.cmake 2006-10-14 16:27:19 UTC (rev 4) +++ h422/trunk/src/main.h.cmake 2006-10-14 17:13:59 UTC (rev 5) @@ -1,32 +0,0 @@ -/******************************************************************************* -* h422 - converts DSAv3 hero data between various formats ** Copyright (C) 2006 Tim "Jesus_666" Okrongli ** ** This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU General Public License as published by the Free * -* Software Foundation; either version 2 of the License, or (at your option) * -* any later version. ** ** This program is distributed in the hope that it will be useful, but WITHOUT * -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -* more details. ** ** You should have received a copy of the GNU General Public License along with * -* this program; if not, write to the Free Software Foundation, Inc., 51 * -* Franklin St, Fifth Floor, Boston, MA 02110, USA * -*******************************************************************************/ - -#include <iostream> -#include <dlfcn.h> -#include <map.h> -#include <dirent.h> -#include <errno.h> -#include <stdlib.h> -#include "commondefs.h" - -#define LIBEXTENSION "@LIBEXTENSION@" -#define PATH_SEPARATOR "@PATH_SEPARATOR@" - -float version = @VERSION@; -// This path is relative to where the program resides -char* plugindir = ".@PATH_SEPARATOR@plugins"; - -typedef s_plugdata* (*fp_plugdata)(); -map<string, s_plugdata*> pluginsByName; -map<string, s_plugdata*> pluginsByExtension; -vector<s_plugdata*> pluginList; -string wd; // The directory wherein the program resides Modified: h422/trunk/src/modules.h =================================================================== --- h422/trunk/src/modules.h 2006-10-14 16:27:19 UTC (rev 4) +++ h422/trunk/src/modules.h 2006-10-14 17:13:59 UTC (rev 5) @@ -1,11 +1,11 @@ /******************************************************************************* -* h422 - converts DSAv3 hero data between various formats ** Copyright (C) 2006 Tim "Jesus_666" Okrongli ** ** This program is free software; you can redistribute it and/or modify it * +* h422 - converts DSAv3 hero data between various formats * * Copyright (C) 2006 Tim "Jesus_666" Okrongli * * * * This program is free software; you can redistribute it and/or modify it * * under the terms of the GNU General Public License as published by the Free * * Software Foundation; either version 2 of the License, or (at your option) * -* any later version. ** ** This program is distributed in the hope that it will be useful, but WITHOUT * +* any later version. * * * * This program is distributed in the hope that it will be useful, but WITHOUT * * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -* more details. ** ** You should have received a copy of the GNU General Public License along with * +* more details. * * * * You should have received a copy of the GNU General Public License along with * * this program; if not, write to the Free Software Foundation, Inc., 51 * * Franklin St, Fifth Floor, Boston, MA 02110, USA * *******************************************************************************/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lm...@us...> - 2006-10-14 16:27:37
|
Revision: 4 http://svn.sourceforge.net/dsaster/?rev=4&view=rev Author: lmeuser Date: 2006-10-14 09:27:19 -0700 (Sat, 14 Oct 2006) Log Message: ----------- dos2unix Modified Paths: -------------- h422/trunk/notes/DSAW4.Format h422/trunk/notes/Res.h42.htm h422/trunk/notes/Res.h42.html h422/trunk/notes/bla.php h422/trunk/src/commondefs.h h422/trunk/src/io_h42.cpp h422/trunk/src/io_null.cpp h422/trunk/src/io_plaintext.cpp h422/trunk/src/main.cpp h422/trunk/src/main.h h422/trunk/src/main.h.cmake h422/trunk/src/modules.h Modified: h422/trunk/notes/DSAW4.Format =================================================================== --- h422/trunk/notes/DSAW4.Format 2006-10-14 16:21:51 UTC (rev 3) +++ h422/trunk/notes/DSAW4.Format 2006-10-14 16:27:19 UTC (rev 4) @@ -1 +1 @@ ---- Dateibeginn Versionsnummer Name des Helden Anzahl der Talente Je Talent: ID,Grundwert,Wert,Maximum,[Obsolet],Aktiviert(1/0),Muttersprache(1/),Zweitsprache(1/0),Leittalent(1/0),AT,PA,AtAnteil,ATBonus,PABonus Anzahl Zauber Je Zauber: ID,Repräsentation,Aktiviert(1/0),Hauszauber(1/0),Grundwert,Wert,Maximum Anzahl Vor/Nachteile Je V/N: ID,Detailangabe,Maximum,Los,Wert Anzahl Sonderfertigleiten Je SF: ID, Detailangabe,Zusatzangabe,Vorgegeben(1/0),Wert Anzahl Manöver Je Manöver: ID Liste der empfohlenen Vor-/Nachteile (IDs) Liste der ungeeigneten Vor-/Nachteile (IDs) Formel für Größe Formel für Gewicht Liste der Haarfarben Liste der Augenfarben Anzahl der VN-Kostenmodifikationen Je VN-Kostenmodifikation: ID,Kosten Anzahl der Verbilligten Sonderfertigkeiten Je Verbilligter SF: ID oder Liste von IDs SO-Maximum Gestreiftes Fell/Haut (1/0) Anzahl Sonderregeln Je Regel: Eine verklausulierte Regel Anzahl Zeilen im besonderen Besitz Die einzelnen Zeilen des besonderen Besitzes Spezielle Marken zur internen Verarbeitung Magische Tradition Für MU-KK,SO,MR,LEP,AUP,ASP,KEP,ATBAS,PABAS,FKB AS,INI,GS: Wert,Grundwert,Maximum,Minimum,[Obsolet],Bonus durch VN,Sonderboni,Professionsbonus,Kulturbon us,Rassenbonus Gold Rasse Kultur Profession Größe Gewicht Geburtsort Titel Dokumentvorlage Haarfarbe Augenfarbe Männlich (1/0) AP gesamt AP-Guthaben Geburtstag Geburtsmonat Geburtsjahr Jahr vor Hal (1/0) Magie-Kürzel (N/Z/V/H) Magische Hauptrepräsentation Anzahl Zeilen in Bemerkung Die einzelnen Zeilen der Bemerkung Verlorene permanente ASP Gegenelement(e) Namensregion --- Dateiende \ No newline at end of file +--- DateibeginnVersionsnummerName des HeldenAnzahl der TalenteJe Talent:ID,Grundwert,Wert,Maximum,[Obsolet],Aktiviert(1/0),Muttersprache(1/),Zweitsprache(1/0),Leittalent(1/0),AT,PA,AtAnteil,ATBonus,PABonusAnzahl ZauberJe Zauber:ID,Repräsentation,Aktiviert(1/0),Hauszauber(1/0),Grundwert,Wert,MaximumAnzahl Vor/NachteileJe V/N: ID,Detailangabe,Maximum,Los,WertAnzahl SonderfertigleitenJe SF: ID, Detailangabe,Zusatzangabe,Vorgegeben(1/0),WertAnzahl ManöverJe Manöver: IDListe der empfohlenen Vor-/Nachteile (IDs)Liste der ungeeigneten Vor-/Nachteile (IDs)Formel für GrößeFormel für GewichtListe der HaarfarbenListe der AugenfarbenAnzahl der VN-KostenmodifikationenJe VN-Kostenmodifikation: ID,KostenAnzahl der Verbilligten SonderfertigkeitenJe Verbilligter SF: ID oder Liste von IDsSO-MaximumGestreiftes Fell/Haut (1/0)Anzahl SonderregelnJe Regel: Eine verklausulierte RegelAnzahl Zeilen im besonderen BesitzDie einzelnen Zeilen des besonderen BesitzesSpezielle Marken zur internen VerarbeitungMagische TraditionFür MU-KK,SO,MR,LEP,AUP,ASP,KEP,ATBAS,PABAS,FKB AS,INI,GS:Wert,Grundwert,Maximum,Minimum,[Obsolet],Bonus durchVN,Sonderboni,Professionsbonus,Kulturbon us,RassenbonusGoldRasseKulturProfessionGrößeGewichtGeburtsortTitelDokumentvorlageHaarfarbeAugenfarbeMännlich (1/0)AP gesamtAP-GuthabenGeburtstagGeburtsmonatGeburtsjahrJahr vor Hal (1/0)Magie-Kürzel (N/Z/V/H)Magische HauptrepräsentationAnzahl Zeilen in BemerkungDie einzelnen Zeilen der BemerkungVerlorene permanente ASPGegenelement(e)Namensregion--- Dateiende \ No newline at end of file Modified: h422/trunk/notes/Res.h42.htm =================================================================== --- h422/trunk/notes/Res.h42.htm 2006-10-14 16:21:51 UTC (rev 3) +++ h422/trunk/notes/Res.h42.htm 2006-10-14 16:27:19 UTC (rev 4) @@ -1,331 +1,331 @@ -<font color="7f0000">Medicus -9 12 10 15 13 14 12 -4 3 3 2 6 3 7 </font> -Kampftechniken -0 -20 -Raufen (BE) -3 1 0 0 -Boxen (BE) --2 1 0 0 -Hruruzat (BE) --3 1 0 0 -Ringen (BE) -8 1 0 0 -Äxte und Beile (BE-3) --6 1 0 0 -Dolche (BE-1) -8 1 0 0 -Infanteriewaffen (BE-3) --5 1 0 0 -Linkshändig -0 1 0 0 -Kettenwaffen (BE-2) --5 1 0 0 -Peitsche (BE) -7 1 0 0 -Scharfe Hiebwaffen (BE-2) -1 1 0 0 -Schwerter (BE-2) --1 1 0 0 -Speere und Stäbe (BE-2) -1 1 0 0 -Stichwaffen (BE-1) --1 1 0 0 -Stumpfe Hiebwaffen (BE-3) -2 1 0 0 -Zweihänder (BE-2) --5 1 0 0 -Lanzenreiten --6 1 0 0 -Schußwaffen --1 1 0 0 -Wurfwaffen (BE-3) -5 1 0 0 -Schleuder --1 1 0 0 -Körperliche Talente -0 -12 -Akrobatik (MU/GE/KK) -8 2 0 0 -Fliegen (MU/KL/GE) -1 2 0 0 -Gaukeleien (CH/FF/GE) -3 2 0 0 -Klettern (MU/GE/KK) -0 2 0 0 -Körperbeherrschung (MU/IN/GE) -9 2 0 0 -Reiten (CH/GE/KK) -3 2 0 0 -Schleichen (MU/IN/GE) -0 2 0 0 -Schwimmen (MU/GE/KK) --1 2 0 0 -Selbstbeherrschung (MU/KK/KK) -5 2 0 0 -Sich Verstecken (MU/IN/GE) -0 2 0 0 -Tanzen (CH/GE/GE) -7 2 0 0 -Zechen (KL/IN/KK) -5 2 0 0 -Gesellschaft -0 -10 -Bekehren/Überzeugen (KL/IN/CH) -7 2 0 0 -Betören (IN/CH/CH) -12 2 0 0 -Etikette (KL/CH/GE) -7 2 0 0 -Feilschen (MU/KL/CH) -2 2 0 0 -Gassenwissen (KL/IN/CH) -2 2 0 0 -Lehren (KL/IN/CH) -3 2 0 0 -Lügen (MU/IN/CH) -5 2 0 0 -Menschenkenntnis (KL/IN/CH) -8 2 0 0 -Schätzen (KL/IN/IN) -0 2 0 0 -Sich Verkleiden (MU/FF/GE) -0 2 0 0 -Natur -0 -9 -Fährtensuchen (KL/IN/GE) --3 2 0 0 -Fallenstellen (KL/FF/KK) --4 2 0 0 -Fesseln/Entfesseln (FF/GE/KK) -5 2 0 0 -Fischen/Angeln (IN/FF/KK) --3 2 0 0 -Pflanzenkunde (KL/IN/FF) -4 2 0 0 -Orientierung (KL/IN/IN) --1 2 0 0 -Tierkunde (MU/KL/IN) --1 2 0 0 -Wettervorhersage (KL/IN/IN) --4 2 0 0 -Wildnisleben (IN/FF/GE) --2 2 0 0 -Wissenstalente -0 -14 -Alchimie (MU/KL/FF) -4 3 0 0 -Alte Sprachen (KL/KL/IN) -4 3 0 0 -Geographie (KL/KL/IN) -4 3 0 0 -Geschichtswissen (KL/KL/IN) -4 3 0 0 -Götter und Kulte (KL/IN/CH) -4 3 0 0 -Kriegskunst (MU/KL/CH) --5 3 0 0 -Lesen/Schreiben (KL/KL/FF) -4 3 0 0 -Magiekunde (KL/KL/IN) -4 3 0 0 -Mechanik (KL/KL/FF) -1 3 0 0 -Rechnen (KL/KL/IN) -4 3 0 0 -Rechtskunde (KL/IN/CH) -4 3 0 0 -Sprachen Kennen (KL/IN/CH) -4 3 0 0 -Staatskunst (KL/IN/CH) -4 3 0 0 -Sternkunde (KL/KL/IN) -4 3 0 0 -Handwerk -0 -18 -Abrichten (MU/IN/CH) --1 2 0 0 -Boote Fahren (FF/GE/KK) --2 2 0 0 -Fahrzeug Lenken (IN/CH/FF) -1 2 0 0 -Falschspiel (MU/CH/FF) -0 2 0 0 -Heilkunde, Gift (MU/KL/IN) -3 2 0 0 -Heilkunde, Krankh. (MU/KL/CH) -4 2 0 0 -Heilkunde, Seele (IN/CH/CH) -4 2 0 0 -Heilkunde, Wunden (KL/CH/FF) -8 2 0 0 -Holzbearbeitung (KL/FF/KK) -0 2 0 0 -Kochen (KL/IN/FF) -1 2 0 0 -Lederarbeiten (KL/FF/FF) --2 2 0 0 -Malen/Zeichnen (KL/IN/FF) -2 2 0 0 -Musizieren (KL/IN/FF) -6 2 0 0 -Schneidern (KL/FF/FF) -1 2 0 0 -Schlösser Knacken (IN/FF/FF) -0 2 0 0 -Singen (KL/IN/CH) -7 2 0 0 -Taschendiebstahl (MU/IN/FF) -0 2 0 0 -Töpfern (KL/FF/FF) --1 2 0 0 -Intuitive Begabungen -0 -5 -Gefahreninstinkt (KL/IN/IN) -6 1 0 0 -Glücksspiel (MU/IN/IN) -1 1 0 0 -Prophezeien (IN/IN/CH) -1 1 0 0 -Sinnesschärfe (KL/IN/IN) -7 1 0 0 -Stimmen Imitieren (KL/IN/CH) --4 1 0 0 -Sondertalente/Berufe -0 -1 -Kurtisane/Gesellschafter (IN/CH/FF) -7 1 0 0 -Schamanenrituale -2 -0 -49 -0 -0 -0 -30 -0 -0 -10 -0 -1W6 -1W6 -FALSE -FALSE -0 -0 -FALSE -0 -Rahjadés Despreciósa -Al'Anfa -hellblond -mittelständisch -166 -66 -9 7 10 -19 -0 -FALSE -0 0 0 - -blau - - -2100 -7 -0 0 0 0 -9 6 6 12 4 10 5 -7 5 11 8 7 8 7 8 5 1 7 13 7 -8 6 5 10 4 12 4 -7 4 10 7 6 7 6 8 4 0 0 0 0 -4 1 -5 -Hakendolch -1W+2 -0 -60 -17 -1/3 -5 -Dolch -1W+1 -3 -20 -15 -2/1 -9 -Peitsche -1W -0 -60 -19 -8/0 -18 -Wurfmesser -1W -0 -10 -(+1/0/0/-1) -25 -Kleidung -1 -1 -120 -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -Standard.rtf -5 5 -1 -Aberglauben: rote Haare, Sternschnuppen, Talismane, Elfen -4 -Tulamidisch (Novadisch) -0 -Garethi -4 -*Ur-Tulamidya -3 -*Bosparano -1 -19 -Geldbeutel -1 -Gürteltasche -5 -Lederrucksack -40 -Wolldecke -60 -Feuerstein und Stahl -5 -Proviant -40 -Zunderdose, voll -8 -Augenschminke -1 -Rasiermesser -10 -Lippenrot -1 -Nagelfeile -2 -Ohrring, Gold -1 -Ohrring, Gold -1 -Bluse, Seide -5 -Pluderhose, Seide -20 -Schleier, Seide -1 -Wurfmesser -10 -Wurfmesser -10 -Wurfmesser -10 +<font color="7f0000">Medicus +9 12 10 15 13 14 12 +4 3 3 2 6 3 7 </font> +Kampftechniken +0 +20 +Raufen (BE) +3 1 0 0 +Boxen (BE) +-2 1 0 0 +Hruruzat (BE) +-3 1 0 0 +Ringen (BE) +8 1 0 0 +Äxte und Beile (BE-3) +-6 1 0 0 +Dolche (BE-1) +8 1 0 0 +Infanteriewaffen (BE-3) +-5 1 0 0 +Linkshändig +0 1 0 0 +Kettenwaffen (BE-2) +-5 1 0 0 +Peitsche (BE) +7 1 0 0 +Scharfe Hiebwaffen (BE-2) +1 1 0 0 +Schwerter (BE-2) +-1 1 0 0 +Speere und Stäbe (BE-2) +1 1 0 0 +Stichwaffen (BE-1) +-1 1 0 0 +Stumpfe Hiebwaffen (BE-3) +2 1 0 0 +Zweihänder (BE-2) +-5 1 0 0 +Lanzenreiten +-6 1 0 0 +Schußwaffen +-1 1 0 0 +Wurfwaffen (BE-3) +5 1 0 0 +Schleuder +-1 1 0 0 +Körperliche Talente +0 +12 +Akrobatik (MU/GE/KK) +8 2 0 0 +Fliegen (MU/KL/GE) +1 2 0 0 +Gaukeleien (CH/FF/GE) +3 2 0 0 +Klettern (MU/GE/KK) +0 2 0 0 +Körperbeherrschung (MU/IN/GE) +9 2 0 0 +Reiten (CH/GE/KK) +3 2 0 0 +Schleichen (MU/IN/GE) +0 2 0 0 +Schwimmen (MU/GE/KK) +-1 2 0 0 +Selbstbeherrschung (MU/KK/KK) +5 2 0 0 +Sich Verstecken (MU/IN/GE) +0 2 0 0 +Tanzen (CH/GE/GE) +7 2 0 0 +Zechen (KL/IN/KK) +5 2 0 0 +Gesellschaft +0 +10 +Bekehren/Überzeugen (KL/IN/CH) +7 2 0 0 +Betören (IN/CH/CH) +12 2 0 0 +Etikette (KL/CH/GE) +7 2 0 0 +Feilschen (MU/KL/CH) +2 2 0 0 +Gassenwissen (KL/IN/CH) +2 2 0 0 +Lehren (KL/IN/CH) +3 2 0 0 +Lügen (MU/IN/CH) +5 2 0 0 +Menschenkenntnis (KL/IN/CH) +8 2 0 0 +Schätzen (KL/IN/IN) +0 2 0 0 +Sich Verkleiden (MU/FF/GE) +0 2 0 0 +Natur +0 +9 +Fährtensuchen (KL/IN/GE) +-3 2 0 0 +Fallenstellen (KL/FF/KK) +-4 2 0 0 +Fesseln/Entfesseln (FF/GE/KK) +5 2 0 0 +Fischen/Angeln (IN/FF/KK) +-3 2 0 0 +Pflanzenkunde (KL/IN/FF) +4 2 0 0 +Orientierung (KL/IN/IN) +-1 2 0 0 +Tierkunde (MU/KL/IN) +-1 2 0 0 +Wettervorhersage (KL/IN/IN) +-4 2 0 0 +Wildnisleben (IN/FF/GE) +-2 2 0 0 +Wissenstalente +0 +14 +Alchimie (MU/KL/FF) +4 3 0 0 +Alte Sprachen (KL/KL/IN) +4 3 0 0 +Geographie (KL/KL/IN) +4 3 0 0 +Geschichtswissen (KL/KL/IN) +4 3 0 0 +Götter und Kulte (KL/IN/CH) +4 3 0 0 +Kriegskunst (MU/KL/CH) +-5 3 0 0 +Lesen/Schreiben (KL/KL/FF) +4 3 0 0 +Magiekunde (KL/KL/IN) +4 3 0 0 +Mechanik (KL/KL/FF) +1 3 0 0 +Rechnen (KL/KL/IN) +4 3 0 0 +Rechtskunde (KL/IN/CH) +4 3 0 0 +Sprachen Kennen (KL/IN/CH) +4 3 0 0 +Staatskunst (KL/IN/CH) +4 3 0 0 +Sternkunde (KL/KL/IN) +4 3 0 0 +Handwerk +0 +18 +Abrichten (MU/IN/CH) +-1 2 0 0 +Boote Fahren (FF/GE/KK) +-2 2 0 0 +Fahrzeug Lenken (IN/CH/FF) +1 2 0 0 +Falschspiel (MU/CH/FF) +0 2 0 0 +Heilkunde, Gift (MU/KL/IN) +3 2 0 0 +Heilkunde, Krankh. (MU/KL/CH) +4 2 0 0 +Heilkunde, Seele (IN/CH/CH) +4 2 0 0 +Heilkunde, Wunden (KL/CH/FF) +8 2 0 0 +Holzbearbeitung (KL/FF/KK) +0 2 0 0 +Kochen (KL/IN/FF) +1 2 0 0 +Lederarbeiten (KL/FF/FF) +-2 2 0 0 +Malen/Zeichnen (KL/IN/FF) +2 2 0 0 +Musizieren (KL/IN/FF) +6 2 0 0 +Schneidern (KL/FF/FF) +1 2 0 0 +Schlösser Knacken (IN/FF/FF) +0 2 0 0 +Singen (KL/IN/CH) +7 2 0 0 +Taschendiebstahl (MU/IN/FF) +0 2 0 0 +Töpfern (KL/FF/FF) +-1 2 0 0 +Intuitive Begabungen +0 +5 +Gefahreninstinkt (KL/IN/IN) +6 1 0 0 +Glücksspiel (MU/IN/IN) +1 1 0 0 +Prophezeien (IN/IN/CH) +1 1 0 0 +Sinnesschärfe (KL/IN/IN) +7 1 0 0 +Stimmen Imitieren (KL/IN/CH) +-4 1 0 0 +Sondertalente/Berufe +0 +1 +Kurtisane/Gesellschafter (IN/CH/FF) +7 1 0 0 +Schamanenrituale +2 +0 +49 +0 +0 +0 +30 +0 +0 +10 +0 +1W6 +1W6 +FALSE +FALSE +0 +0 +FALSE +0 +Rahjadés Despreciósa +Al'Anfa +hellblond +mittelständisch +166 +66 +9 7 10 +19 +0 +FALSE +0 0 0 + +blau + + +2100 +7 +0 0 0 0 +9 6 6 12 4 10 5 -7 5 11 8 7 8 7 8 5 1 7 13 7 +8 6 5 10 4 12 4 -7 4 10 7 6 7 6 8 4 0 0 0 0 +4 1 +5 +Hakendolch +1W+2 +0 +60 +17 +1/3 +5 +Dolch +1W+1 +3 +20 +15 +2/1 +9 +Peitsche +1W +0 +60 +19 +8/0 +18 +Wurfmesser +1W +0 +10 +(+1/0/0/-1) +25 +Kleidung +1 +1 +120 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +Standard.rtf +5 5 +1 +Aberglauben: rote Haare, Sternschnuppen, Talismane, Elfen +4 +Tulamidisch (Novadisch) +0 +Garethi +4 +*Ur-Tulamidya +3 +*Bosparano +1 +19 +Geldbeutel +1 +Gürteltasche +5 +Lederrucksack +40 +Wolldecke +60 +Feuerstein und Stahl +5 +Proviant +40 +Zunderdose, voll +8 +Augenschminke +1 +Rasiermesser +10 +Lippenrot +1 +Nagelfeile +2 +Ohrring, Gold +1 +Ohrring, Gold +1 +Bluse, Seide +5 +Pluderhose, Seide +20 +Schleier, Seide +1 +Wurfmesser +10 +Wurfmesser +10 +Wurfmesser +10 Modified: h422/trunk/notes/Res.h42.html =================================================================== --- h422/trunk/notes/Res.h42.html 2006-10-14 16:21:51 UTC (rev 3) +++ h422/trunk/notes/Res.h42.html 2006-10-14 16:27:19 UTC (rev 4) @@ -1,333 +1,333 @@ -<font color="007f00">Medicus<br /> -9 12 10 15 13 14 12 <br /> -4 3 3 2 6 3 7 </font><br /> -<font color="7f5000">Kampftechniken<br /> -0<br /> -20<br /> -Raufen (BE)<br /> -3 1 0 0<br /> -Boxen (BE)<br /> --2 1 0 0<br /> -Hruruzat (BE)<br /> --3 1 0 0<br /> -Ringen (BE)<br /> -8 1 0 0<br /> -Äxte und Beile (BE-3)<br /> --6 1 0 0<br /> -Dolche (BE-1)<br /> -8 1 0 0<br /> -Infanteriewaffen (BE-3)<br /> --5 1 0 0<br /> -Linkshändig<br /> -0 1 0 0<br /> -Kettenwaffen (BE-2)<br /> --5 1 0 0<br /> -Peitsche (BE)<br /> -7 1 0 0<br /> -Scharfe Hiebwaffen (BE-2)<br /> -1 1 0 0<br /> -Schwerter (BE-2)<br /> --1 1 0 0<br /> -Speere und Stäbe (BE-2)<br /> -1 1 0 0<br /> -Stichwaffen (BE-1)<br /> --1 1 0 0<br /> -Stumpfe Hiebwaffen (BE-3)<br /> -2 1 0 0<br /> -Zweihänder (BE-2)<br /> --5 1 0 0<br /> -Lanzenreiten<br /> --6 1 0 0<br /> -Schußwaffen<br /> --1 1 0 0<br /> -Wurfwaffen (BE-3)<br /> -5 1 0 0<br /> -Schleuder<br /> --1 1 0 0<br /> -Körperliche Talente<br /> -0<br /> -12<br /> -Akrobatik (MU/GE/KK)<br /> -8 2 0 0<br /> -Fliegen (MU/KL/GE)<br /> -1 2 0 0<br /> -Gaukeleien (CH/FF/GE)<br /> -3 2 0 0<br /> -Klettern (MU/GE/KK)<br /> -0 2 0 0<br /> -Körperbeherrschung (MU/IN/GE)<br /> -9 2 0 0<br /> -Reiten (CH/GE/KK)<br /> -3 2 0 0<br /> -Schleichen (MU/IN/GE)<br /> -0 2 0 0<br /> -Schwimmen (MU/GE/KK)<br /> --1 2 0 0<br /> -Selbstbeherrschung (MU/KK/KK)<br /> -5 2 0 0<br /> -Sich Verstecken (MU/IN/GE)<br /> -0 2 0 0<br /> -Tanzen (CH/GE/GE)<br /> -7 2 0 0<br /> -Zechen (KL/IN/KK)<br /> -5 2 0 0<br /> -Gesellschaft<br /> -0<br /> -10<br /> -Bekehren/Überzeugen (KL/IN/CH)<br /> -7 2 0 0<br /> -Betören (IN/CH/CH)<br /> -12 2 0 0<br /> -Etikette (KL/CH/GE)<br /> -7 2 0 0<br /> -Feilschen (MU/KL/CH)<br /> -2 2 0 0<br /> -Gassenwissen (KL/IN/CH)<br /> -2 2 0 0<br /> -Lehren (KL/IN/CH)<br /> -3 2 0 0<br /> -Lügen (MU/IN/CH)<br /> -5 2 0 0<br /> -Menschenkenntnis (KL/IN/CH)<br /> -8 2 0 0<br /> -Schätzen (KL/IN/IN)<br /> -0 2 0 0<br /> -Sich Verkleiden (MU/FF/GE)<br /> -0 2 0 0<br /> -Natur<br /> -0<br /> -9<br /> -Fährtensuchen (KL/IN/GE)<br /> --3 2 0 0<br /> -Fallenstellen (KL/FF/KK)<br /> --4 2 0 0<br /> -Fesseln/Entfesseln (FF/GE/KK)<br /> -5 2 0 0<br /> -Fischen/Angeln (IN/FF/KK)<br /> --3 2 0 0<br /> -Pflanzenkunde (KL/IN/FF)<br /> -4 2 0 0<br /> -Orientierung (KL/IN/IN)<br /> --1 2 0 0<br /> -Tierkunde (MU/KL/IN)<br /> --1 2 0 0<br /> -Wettervorhersage (KL/IN/IN)<br /> --4 2 0 0<br /> -Wildnisleben (IN/FF/GE)<br /> --2 2 0 0<br /> -Wissenstalente<br /> -0<br /> -14<br /> -Alchimie (MU/KL/FF)<br /> -4 3 0 0<br /> -Alte Sprachen (KL/KL/IN)<br /> -4 3 0 0<br /> -Geographie (KL/KL/IN)<br /> -4 3 0 0<br /> -Geschichtswissen (KL/KL/IN)<br /> -4 3 0 0<br /> -Götter und Kulte (KL/IN/CH)<br /> -4 3 0 0<br /> -Kriegskunst (MU/KL/CH)<br /> --5 3 0 0<br /> -Lesen/Schreiben (KL/KL/FF)<br /> -4 3 0 0<br /> -Magiekunde (KL/KL/IN)<br /> -4 3 0 0<br /> -Mechanik (KL/KL/FF)<br /> -1 3 0 0<br /> -Rechnen (KL/KL/IN)<br /> -4 3 0 0<br /> -Rechtskunde (KL/IN/CH)<br /> -4 3 0 0<br /> -Sprachen Kennen (KL/IN/CH)<br /> -4 3 0 0<br /> -Staatskunst (KL/IN/CH)<br /> -4 3 0 0<br /> -Sternkunde (KL/KL/IN)<br /> -4 3 0 0<br /> -Handwerk<br /> -0<br /> -18<br /> -Abrichten (MU/IN/CH)<br /> --1 2 0 0<br /> -Boote Fahren (FF/GE/KK)<br /> --2 2 0 0<br /> -Fahrzeug Lenken (IN/CH/FF)<br /> -1 2 0 0<br /> -Falschspiel (MU/CH/FF)<br /> -0 2 0 0<br /> -Heilkunde, Gift (MU/KL/IN)<br /> -3 2 0 0<br /> -Heilkunde, Krankh. (MU/KL/CH)<br /> -4 2 0 0<br /> -Heilkunde, Seele (IN/CH/CH)<br /> -4 2 0 0<br /> -Heilkunde, Wunden (KL/CH/FF)<br /> -8 2 0 0<br /> -Holzbearbeitung (KL/FF/KK)<br /> -0 2 0 0<br /> -Kochen (KL/IN/FF)<br /> -1 2 0 0<br /> -Lederarbeiten (KL/FF/FF)<br /> --2 2 0 0<br /> -Malen/Zeichnen (KL/IN/FF)<br /> -2 2 0 0<br /> -Musizieren (KL/IN/FF)<br /> -6 2 0 0<br /> -Schneidern (KL/FF/FF)<br /> -1 2 0 0<br /> -Schlösser Knacken (IN/FF/FF)<br /> -0 2 0 0<br /> -Singen (KL/IN/CH)<br /> -7 2 0 0<br /> -Taschendiebstahl (MU/IN/FF)<br /> -0 2 0 0<br /> -Töpfern (KL/FF/FF)<br /> --1 2 0 0<br /> -Intuitive Begabungen<br /> -0<br /> -5<br /> -Gefahreninstinkt (KL/IN/IN)<br /> -6 1 0 0<br /> -Glücksspiel (MU/IN/IN)<br /> -1 1 0 0<br /> -Prophezeien (IN/IN/CH)<br /> -1 1 0 0<br /> -Sinnesschärfe (KL/IN/IN)<br /> -7 1 0 0<br /> -Stimmen Imitieren (KL/IN/CH)<br /> --4 1 0 0<br /> -Sondertalente/Berufe<br /> -0<br /> -1<br /> -Kurtisane/Gesellschafter (IN/CH/FF)<br /> -7 1 0 0</font><br /> -<font color="7f0000">Schamanenrituale<br /> -2<br /> -0<br /> -49<br /> -0<br /> -0<br /> -0<br /> -30<br /> -0<br /> -0<br /> -10<br /> -0<br /> -1W6<br /> -1W6<br /> -FALSE<br /> -FALSE<br /> -0<br /> -0<br /> -FALSE<br /> -0</font><br /> -<font color="7f5000"> -Rahjadés Despreciósa<br /> -Al'Anfa<br /> -hellblond<br /> -mittelständisch<br /> -166<br /> -66<br /> -9 7 10<br /> -19<br /> -0<br /> -FALSE<br /> -0 0 0<br /> -<br /> -blau</font><br /> -<font color="7f0000"> -<br /> -<br /> -2100<br /> -7<br /> -0 0 0 0<br /> -9 6 6 12 4 10 5 -7 5 11 8 7 8 7 8 5 1 7 13 7 <br /> -8 6 5 10 4 12 4 -7 4 10 7 6 7 6 8 4 0 0 0 0 <br /> -4 1</font><br /> -<font color="7f5000">5<br /> -Hakendolch<br /> -1W+2<br /> -0<br /> -60<br /> -17<br /> -1/3<br /> -5<br /> -Dolch<br /> -1W+1<br /> -3<br /> -20<br /> -15<br /> -2/1<br /> -9<br /> -Peitsche<br /> -1W<br /> -0<br /> -60<br /> -19<br /> -8/0<br /> -18<br /> -Wurfmesser<br /> -1W<br /> -0<br /> -10<br /> -(+1/0/0/-1)<br /> -25</font><br /> -<font color="7f0000">Kleidung<br /> -1<br /> -1<br /> -120<br /> -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 <br /> -Standard.rtf<br /> -5 5</font><br /> -<font color="7f0000">1<br /> -Aberglauben: rote Haare, Sternschnuppen, Talismane, Elfen<br /> -4</font><br /> -<font color="007f00">Tulamidisch (Novadisch)<br /> -0<br /> -Garethi<br /> -4<br /> -*Ur-Tulamidya<br /> -3<br /> -*Bosparano<br /> -1</font><br /> -<font color="007f00">19<br /> -Geldbeutel<br /> -1<br /> -Gürteltasche<br /> -5<br /> -Lederrucksack<br /> -40<br /> -Wolldecke<br /> -60<br /> -Feuerstein und Stahl<br /> -5<br /> -Proviant<br /> -40<br /> -Zunderdose, voll<br /> -8<br /> -Augenschminke<br /> -1<br /> -Rasiermesser<br /> -10<br /> -Lippenrot<br /> -1<br /> -Nagelfeile<br /> -2<br /> -Ohrring, Gold<br /> -1<br /> -Ohrring, Gold<br /> -1<br /> -Bluse, Seide<br /> -5<br /> -Pluderhose, Seide<br /> -20<br /> -Schleier, Seide<br /> -1<br /> -Wurfmesser<br /> -10<br /> -Wurfmesser<br /> -10<br /> -Wurfmesser<br /> -10</font><br /> +<font color="007f00">Medicus<br /> +9 12 10 15 13 14 12 <br /> +4 3 3 2 6 3 7 </font><br /> +<font color="7f5000">Kampftechniken<br /> +0<br /> +20<br /> +Raufen (BE)<br /> +3 1 0 0<br /> +Boxen (BE)<br /> +-2 1 0 0<br /> +Hruruzat (BE)<br /> +-3 1 0 0<br /> +Ringen (BE)<br /> +8 1 0 0<br /> +Äxte und Beile (BE-3)<br /> +-6 1 0 0<br /> +Dolche (BE-1)<br /> +8 1 0 0<br /> +Infanteriewaffen (BE-3)<br /> +-5 1 0 0<br /> +Linkshändig<br /> +0 1 0 0<br /> +Kettenwaffen (BE-2)<br /> +-5 1 0 0<br /> +Peitsche (BE)<br /> +7 1 0 0<br /> +Scharfe Hiebwaffen (BE-2)<br /> +1 1 0 0<br /> +Schwerter (BE-2)<br /> +-1 1 0 0<br /> +Speere und Stäbe (BE-2)<br /> +1 1 0 0<br /> +Stichwaffen (BE-1)<br /> +-1 1 0 0<br /> +Stumpfe Hiebwaffen (BE-3)<br /> +2 1 0 0<br /> +Zweihänder (BE-2)<br /> +-5 1 0 0<br /> +Lanzenreiten<br /> +-6 1 0 0<br /> +Schußwaffen<br /> +-1 1 0 0<br /> +Wurfwaffen (BE-3)<br /> +5 1 0 0<br /> +Schleuder<br /> +-1 1 0 0<br /> +Körperliche Talente<br /> +0<br /> +12<br /> +Akrobatik (MU/GE/KK)<br /> +8 2 0 0<br /> +Fliegen (MU/KL/GE)<br /> +1 2 0 0<br /> +Gaukeleien (CH/FF/GE)<br /> +3 2 0 0<br /> +Klettern (MU/GE/KK)<br /> +0 2 0 0<br /> +Körperbeherrschung (MU/IN/GE)<br /> +9 2 0 0<br /> +Reiten (CH/GE/KK)<br /> +3 2 0 0<br /> +Schleichen (MU/IN/GE)<br /> +0 2 0 0<br /> +Schwimmen (MU/GE/KK)<br /> +-1 2 0 0<br /> +Selbstbeherrschung (MU/KK/KK)<br /> +5 2 0 0<br /> +Sich Verstecken (MU/IN/GE)<br /> +0 2 0 0<br /> +Tanzen (CH/GE/GE)<br /> +7 2 0 0<br /> +Zechen (KL/IN/KK)<br /> +5 2 0 0<br /> +Gesellschaft<br /> +0<br /> +10<br /> +Bekehren/Überzeugen (KL/IN/CH)<br /> +7 2 0 0<br /> +Betören (IN/CH/CH)<br /> +12 2 0 0<br /> +Etikette (KL/CH/GE)<br /> +7 2 0 0<br /> +Feilschen (MU/KL/CH)<br /> +2 2 0 0<br /> +Gassenwissen (KL/IN/CH)<br /> +2 2 0 0<br /> +Lehren (KL/IN/CH)<br /> +3 2 0 0<br /> +Lügen (MU/IN/CH)<br /> +5 2 0 0<br /> +Menschenkenntnis (KL/IN/CH)<br /> +8 2 0 0<br /> +Schätzen (KL/IN/IN)<br /> +0 2 0 0<br /> +Sich Verkleiden (MU/FF/GE)<br /> +0 2 0 0<br /> +Natur<br /> +0<br /> +9<br /> +Fährtensuchen (KL/IN/GE)<br /> +-3 2 0 0<br /> +Fallenstellen (KL/FF/KK)<br /> +-4 2 0 0<br /> +Fesseln/Entfesseln (FF/GE/KK)<br /> +5 2 0 0<br /> +Fischen/Angeln (IN/FF/KK)<br /> +-3 2 0 0<br /> +Pflanzenkunde (KL/IN/FF)<br /> +4 2 0 0<br /> +Orientierung (KL/IN/IN)<br /> +-1 2 0 0<br /> +Tierkunde (MU/KL/IN)<br /> +-1 2 0 0<br /> +Wettervorhersage (KL/IN/IN)<br /> +-4 2 0 0<br /> +Wildnisleben (IN/FF/GE)<br /> +-2 2 0 0<br /> +Wissenstalente<br /> +0<br /> +14<br /> +Alchimie (MU/KL/FF)<br /> +4 3 0 0<br /> +Alte Sprachen (KL/KL/IN)<br /> +4 3 0 0<br /> +Geographie (KL/KL/IN)<br /> +4 3 0 0<br /> +Geschichtswissen (KL/KL/IN)<br /> +4 3 0 0<br /> +Götter und Kulte (KL/IN/CH)<br /> +4 3 0 0<br /> +Kriegskunst (MU/KL/CH)<br /> +-5 3 0 0<br /> +Lesen/Schreiben (KL/KL/FF)<br /> +4 3 0 0<br /> +Magiekunde (KL/KL/IN)<br /> +4 3 0 0<br /> +Mechanik (KL/KL/FF)<br /> +1 3 0 0<br /> +Rechnen (KL/KL/IN)<br /> +4 3 0 0<br /> +Rechtskunde (KL/IN/CH)<br /> +4 3 0 0<br /> +Sprachen Kennen (KL/IN/CH)<br /> +4 3 0 0<br /> +Staatskunst (KL/IN/CH)<br /> +4 3 0 0<br /> +Sternkunde (KL/KL/IN)<br /> +4 3 0 0<br /> +Handwerk<br /> +0<br /> +18<br /> +Abrichten (MU/IN/CH)<br /> +-1 2 0 0<br /> +Boote Fahren (FF/GE/KK)<br /> +-2 2 0 0<br /> +Fahrzeug Lenken (IN/CH/FF)<br /> +1 2 0 0<br /> +Falschspiel (MU/CH/FF)<br /> +0 2 0 0<br /> +Heilkunde, Gift (MU/KL/IN)<br /> +3 2 0 0<br /> +Heilkunde, Krankh. (MU/KL/CH)<br /> +4 2 0 0<br /> +Heilkunde, Seele (IN/CH/CH)<br /> +4 2 0 0<br /> +Heilkunde, Wunden (KL/CH/FF)<br /> +8 2 0 0<br /> +Holzbearbeitung (KL/FF/KK)<br /> +0 2 0 0<br /> +Kochen (KL/IN/FF)<br /> +1 2 0 0<br /> +Lederarbeiten (KL/FF/FF)<br /> +-2 2 0 0<br /> +Malen/Zeichnen (KL/IN/FF)<br /> +2 2 0 0<br /> +Musizieren (KL/IN/FF)<br /> +6 2 0 0<br /> +Schneidern (KL/FF/FF)<br /> +1 2 0 0<br /> +Schlösser Knacken (IN/FF/FF)<br /> +0 2 0 0<br /> +Singen (KL/IN/CH)<br /> +7 2 0 0<br /> +Taschendiebstahl (MU/IN/FF)<br /> +0 2 0 0<br /> +Töpfern (KL/FF/FF)<br /> +-1 2 0 0<br /> +Intuitive Begabungen<br /> +0<br /> +5<br /> +Gefahreninstinkt (KL/IN/IN)<br /> +6 1 0 0<br /> +Glücksspiel (MU/IN/IN)<br /> +1 1 0 0<br /> +Prophezeien (IN/IN/CH)<br /> +1 1 0 0<br /> +Sinnesschärfe (KL/IN/IN)<br /> +7 1 0 0<br /> +Stimmen Imitieren (KL/IN/CH)<br /> +-4 1 0 0<br /> +Sondertalente/Berufe<br /> +0<br /> +1<br /> +Kurtisane/Gesellschafter (IN/CH/FF)<br /> +7 1 0 0</font><br /> +<font color="7f0000">Schamanenrituale<br /> +2<br /> +0<br /> +49<br /> +0<br /> +0<br /> +0<br /> +30<br /> +0<br /> +0<br /> +10<br /> +0<br /> +1W6<br /> +1W6<br /> +FALSE<br /> +FALSE<br /> +0<br /> +0<br /> +FALSE<br /> +0</font><br /> +<font color="7f5000"> +Rahjadés Despreciósa<br /> +Al'Anfa<br /> +hellblond<br /> +mittelständisch<br /> +166<br /> +66<br /> +9 7 10<br /> +19<br /> +0<br /> +FALSE<br /> +0 0 0<br /> +<br /> +blau</font><br /> +<font color="7f0000"> +<br /> +<br /> +2100<br /> +7<br /> +0 0 0 0<br /> +9 6 6 12 4 10 5 -7 5 11 8 7 8 7 8 5 1 7 13 7 <br /> +8 6 5 10 4 12 4 -7 4 10 7 6 7 6 8 4 0 0 0 0 <br /> +4 1</font><br /> +<font color="7f5000">5<br /> +Hakendolch<br /> +1W+2<br /> +0<br /> +60<br /> +17<br /> +1/3<br /> +5<br /> +Dolch<br /> +1W+1<br /> +3<br /> +20<br /> +15<br /> +2/1<br /> +9<br /> +Peitsche<br /> +1W<br /> +0<br /> +60<br /> +19<br /> +8/0<br /> +18<br /> +Wurfmesser<br /> +1W<br /> +0<br /> +10<br /> +(+1/0/0/-1)<br /> +25</font><br /> +<font color="7f0000">Kleidung<br /> +1<br /> +1<br /> +120<br /> +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 <br /> +Standard.rtf<br /> +5 5</font><br /> +<font color="7f0000">1<br /> +Aberglauben: rote Haare, Sternschnuppen, Talismane, Elfen<br /> +4</font><br /> +<font color="007f00">Tulamidisch (Novadisch)<br /> +0<br /> +Garethi<br /> +4<br /> +*Ur-Tulamidya<br /> +3<br /> +*Bosparano<br /> +1</font><br /> +<font color="007f00">19<br /> +Geldbeutel<br /> +1<br /> +Gürteltasche<br /> +5<br /> +Lederrucksack<br /> +40<br /> +Wolldecke<br /> +60<br /> +Feuerstein und Stahl<br /> +5<br /> +Proviant<br /> +40<br /> +Zunderdose, voll<br /> +8<br /> +Augenschminke<br /> +1<br /> +Rasiermesser<br /> +10<br /> +Lippenrot<br /> +1<br /> +Nagelfeile<br /> +2<br /> +Ohrring, Gold<br /> +1<br /> +Ohrring, Gold<br /> +1<br /> +Bluse, Seide<br /> +5<br /> +Pluderhose, Seide<br /> +20<br /> +Schleier, Seide<br /> +1<br /> +Wurfmesser<br /> +10<br /> +Wurfmesser<br /> +10<br /> +Wurfmesser<br /> +10</font><br /> Modified: h422/trunk/notes/bla.php =================================================================== --- h422/trunk/notes/bla.php 2006-10-14 16:21:51 UTC (rev 3) +++ h422/trunk/notes/bla.php 2006-10-14 16:27:19 UTC (rev 4) @@ -1,99 +1,99 @@ <? - if (!defined('FILE_USE_INCLUDE_PATH')) { - define('FILE_USE_INCLUDE_PATH', 1); -} - -if (!defined('LOCK_EX')) { - define('LOCK_EX', 2); -} - -if (!defined('FILE_APPEND')) { - define('FILE_APPEND', 8); -} - - -/** - * Replace file_put_contents() - * - * @category PHP - * @package PHP_Compat - * @link http://php.net/function.file_put_contents - * @author Aidan Lister <ai...@ph...> - * @version $Revision: 1.25 $ - * @internal resource_context is not supported - * @since PHP 5 - * @require PHP 4.0.0 (user_error) - */ -if (!function_exists('file_put_contents')) { - function file_put_contents($filename, $content, $flags = null, $resource_context = null) - { - // If $content is an array, convert it to a string - if (is_array($content)) { - $content = implode('', $content); - } - - // If we don't have a string, throw an error - if (!is_scalar($content)) { - user_error('file_put_contents() The 2nd parameter should be either a string or an array', - E_USER_WARNING); - return false; - } - - // Get the length of data to write - $length = strlen($content); - - // Check what mode we are using - $mode = ($flags & FILE_APPEND) ? - 'a' : - 'wb'; - - // Check if we're using the include path - $use_inc_path = ($flags & FILE_USE_INCLUDE_PATH) ? - true : - false; - - // Open the file for writing - if (($fh = @fopen($filename, $mode, $use_inc_path)) === false) { - user_error('file_put_contents() failed to open stream: Permission denied', - E_USER_WARNING); - return false; - } - - // Attempt to get an exclusive lock - $use_lock = ($flags & LOCK_EX) ? true : false ; - if ($use_lock === true) { - if (!flock($fh, LOCK_EX)) { - return false; - } - } - - // Write to the file - $bytes = 0; - if (($bytes = @fwrite($fh, $content)) === false) { - $errormsg = sprintf('file_put_contents() Failed to write %d bytes to %s', - $length, - $filename); - user_error($errormsg, E_USER_WARNING); - return false; - } - - // Close the handle - @fclose($fh); - - // Check all the data was written - if ($bytes != $length) { - $errormsg = sprintf('file_put_contents() Only %d of %d bytes written, possibly out of free disk space.', - $bytes, - $length); - user_error($errormsg, E_USER_WARNING); - return false; - } - - // Return length - return $bytes; - } + if (!defined('FILE_USE_INCLUDE_PATH')) { + define('FILE_USE_INCLUDE_PATH', 1); } +if (!defined('LOCK_EX')) { + define('LOCK_EX', 2); +} + +if (!defined('FILE_APPEND')) { + define('FILE_APPEND', 8); +} + + +/** + * Replace file_put_contents() + * + * @category PHP + * @package PHP_Compat + * @link http://php.net/function.file_put_contents + * @author Aidan Lister <ai...@ph...> + * @version $Revision: 1.25 $ + * @internal resource_context is not supported + * @since PHP 5 + * @require PHP 4.0.0 (user_error) + */ +if (!function_exists('file_put_contents')) { + function file_put_contents($filename, $content, $flags = null, $resource_context = null) + { + // If $content is an array, convert it to a string + if (is_array($content)) { + $content = implode('', $content); + } + + // If we don't have a string, throw an error + if (!is_scalar($content)) { + user_error('file_put_contents() The 2nd parameter should be either a string or an array', + E_USER_WARNING); + return false; + } + + // Get the length of data to write + $length = strlen($content); + + // Check what mode we are using + $mode = ($flags & FILE_APPEND) ? + 'a' : + 'wb'; + + // Check if we're using the include path + $use_inc_path = ($flags & FILE_USE_INCLUDE_PATH) ? + true : + false; + + // Open the file for writing + if (($fh = @fopen($filename, $mode, $use_inc_path)) === false) { + user_error('file_put_contents() failed to open stream: Permission denied', + E_USER_WARNING); + return false; + } + + // Attempt to get an exclusive lock + $use_lock = ($flags & LOCK_EX) ? true : false ; + if ($use_lock === true) { + if (!flock($fh, LOCK_EX)) { + return false; + } + } + + // Write to the file + $bytes = 0; + if (($bytes = @fwrite($fh, $content)) === false) { + $errormsg = sprintf('file_put_contents() Failed to write %d bytes to %s', + $length, + $filename); + user_error($errormsg, E_USER_WARNING); + return false; + } + + // Close the handle + @fclose($fh); + + // Check all the data was written + if ($bytes != $length) { + $errormsg = sprintf('file_put_contents() Only %d of %d bytes written, possibly out of free disk space.', + $bytes, + $length); + user_error($errormsg, E_USER_WARNING); + return false; + } + + // Return length + return $bytes; + } +} + $bla = nl2br(file_get_contents('Res.h42.htm')); echo $bla; ?> \ No newline at end of file Modified: h422/trunk/src/commondefs.h =================================================================== --- h422/trunk/src/commondefs.h 2006-10-14 16:21:51 UTC (rev 3) +++ h422/trunk/src/commondefs.h 2006-10-14 16:27:19 UTC (rev 4) @@ -1,11 +1,11 @@ /******************************************************************************* -* h422 - converts DSAv3 hero data between various formats * * Copyright (C) 2006 Tim "Jesus_666" Okrongli * * * * This program is free software; you can redistribute it and/or modify it * +* h422 - converts DSAv3 hero data between various formats ** Copyright (C) 2006 Tim "Jesus_666" Okrongli ** ** This program is free software; you can redistribute it and/or modify it * * under the terms of the GNU General Public License as published by the Free * * Software Foundation; either version 2 of the License, or (at your option) * -* any later version. * * * * This program is distributed in the hope that it will be useful, but WITHOUT * +* any later version. ** ** This program is distributed in the hope that it will be useful, but WITHOUT * * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -* more details. * * * * You should have received a copy of the GNU General Public License along with * +* more details. ** ** You should have received a copy of the GNU General Public License along with * * this program; if not, write to the Free Software Foundation, Inc., 51 * * Franklin St, Fifth Floor, Boston, MA 02110, USA * *******************************************************************************/ Modified: h422/trunk/src/io_h42.cpp =================================================================== --- h422/trunk/src/io_h42.cpp 2006-10-14 16:21:51 UTC (rev 3) +++ h422/trunk/src/io_h42.cpp 2006-10-14 16:27:19 UTC (rev 4) @@ -1,11 +1,11 @@ /******************************************************************************* -* h422 - converts DSAv3 hero data between various formats * * Copyright (C) 2006 Tim "Jesus_666" Okrongli * * * * This program is free software; you can redistribute it and/or modify it * +* h422 - converts DSAv3 hero data between various formats ** Copyright (C) 2006 Tim "Jesus_666" Okrongli ** ** This program is free software; you can redistribute it and/or modify it * * under the terms of the GNU General Public License as published by the Free * * Software Foundation; either version 2 of the License, or (at your option) * -* any later version. * * * * This program is distributed in the hope that it will be useful, but WITHOUT * +* any later version. ** ** This program is distributed in the hope that it will be useful, but WITHOUT * * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -* more details. * * * * You should have received a copy of the GNU General Public License along with * +* more details. ** ** You should have received a copy of the GNU General Public License along with * * this program; if not, write to the Free Software Foundation, Inc., 51 * * Franklin St, Fifth Floor, Boston, MA 02110, USA * *******************************************************************************/ Modified: h422/trunk/src/io_null.cpp =================================================================== --- h422/trunk/src/io_null.cpp 2006-10-14 16:21:51 UTC (rev 3) +++ h422/trunk/src/io_null.cpp 2006-10-14 16:27:19 UTC (rev 4) @@ -1,11 +1,11 @@ /******************************************************************************* -* h422 - converts DSAv3 hero data between various formats * * Copyright (C) 2006 Tim "Jesus_666" Okrongli * * * * This program is free software; you can redistribute it and/or modify it * +* h422 - converts DSAv3 hero data between various formats ** Copyright (C) 2006 Tim "Jesus_666" Okrongli ** ** This program is free software; you can redistribute it and/or modify it * * under the terms of the GNU General Public License as published by the Free * * Software Foundation; either version 2 of the License, or (at your option) * -* any later version. * * * * This program is distributed in the hope that it will be useful, but WITHOUT * +* any later version. ** ** This program is distributed in the hope that it will be useful, but WITHOUT * * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -* more details. * * * * You should have received a copy of the GNU General Public License along with * +* more details. ** ** You should have received a copy of the GNU General Public License along with * * this program; if not, write to the Free Software Foundation, Inc., 51 * * Franklin St, Fifth Floor, Boston, MA 02110, USA * *******************************************************************************/ Modified: h422/trunk/src/io_plaintext.cpp =================================================================== --- h422/trunk/src/io_plaintext.cpp 2006-10-14 16:21:51 UTC (rev 3) +++ h422/trunk/src/io_plaintext.cpp 2006-10-14 16:27:19 UTC (rev 4) @@ -1,11 +1,11 @@ /******************************************************************************* -* h422 - converts DSAv3 hero data between various formats * * Copyright (C) 2006 Tim "Jesus_666" Okrongli * * * * This program is free software; you can redistribute it and/or modify it * +* h422 - converts DSAv3 hero data between various formats ** Copyright (C) 2006 Tim "Jesus_666" Okrongli ** ** This program is free software; you can redistribute it and/or modify it * * under the terms of the GNU General Public License as published by the Free * * Software Foundation; either version 2 of the License, or (at your option) * -* any later version. * * * * This program is distributed in the hope that it will be useful, but WITHOUT * +* any later version. ** ** This program is distributed in the hope that it will be useful, but WITHOUT * * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -* more details. * * * * You should have received a copy of the GNU General Public License along with * +* more details. ** ** You should have received a copy of the GNU General Public License along with * * this program; if not, write to the Free Software Foundation, Inc., 51 * * Franklin St, Fifth Floor, Boston, MA 02110, USA * *******************************************************************************/ Modified: h422/trunk/src/main.cpp =================================================================== --- h422/trunk/src/main.cpp 2006-10-14 16:21:51 UTC (rev 3) +++ h422/trunk/src/main.cpp 2006-10-14 16:27:19 UTC (rev 4) @@ -1,11 +1,11 @@ /******************************************************************************* -* h422 - converts DSAv3 hero data between various formats * * Copyright (C) 2006 Tim "Jesus_666" Okrongli * * * * This program is free software; you can redistribute it and/or modify it * +* h422 - converts DSAv3 hero data between various formats ** Copyright (C) 2006 Tim "Jesus_666" Okrongli ** ** This program is free software; you can redistribute it and/or modify it * * under the terms of the GNU General Public License as published by the Free * * Software Foundation; either version 2 of the License, or (at your option) * -* any later version. * * * * This program is distributed in the hope that it will be useful, but WITHOUT * +* any later version. ** ** This program is distributed in the hope that it will be useful, but WITHOUT * * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -* more details. * * * * You should have received a copy of the GNU General Public License along with * +* more details. ** ** You should have received a copy of the GNU General Public License along with * * this program; if not, write to the Free Software Foundation, Inc., 51 * * Franklin St, Fifth Floor, Boston, MA 02110, USA * *******************************************************************************/ Modified: h422/trunk/src/main.h =================================================================== --- h422/trunk/src/main.h 2006-10-14 16:21:51 UTC (rev 3) +++ h422/trunk/src/main.h 2006-10-14 16:27:19 UTC (rev 4) @@ -1,11 +1,11 @@ /******************************************************************************* -* h422 - converts DSAv3 hero data between various formats * * Copyright (C) 2006 Tim "Jesus_666" Okrongli * * * * This program is free software; you can redistribute it and/or modify it * +* h422 - converts DSAv3 hero data between various formats ** Copyright (C) 2006 Tim "Jesus_666" Okrongli ** ** This program is free software; you can redistribute it and/or modify it * * under the terms of the GNU General Public License as published by the Free * * Software Foundation; either version 2 of the License, or (at your option) * -* any later version. * * * * This program is distributed in the hope that it will be useful, but WITHOUT * +* any later version. ** ** This program is distributed in the hope that it will be useful, but WITHOUT * * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -* more details. * * * * You should have received a copy of the GNU General Public License along with * +* more details. ** ** You should have received a copy of the GNU General Public License along with * * this program; if not, write to the Free Software Foundation, Inc., 51 * * Franklin St, Fifth Floor, Boston, MA 02110, USA * *******************************************************************************/ Modified: h422/trunk/src/main.h.cmake =================================================================== --- h422/trunk/src/main.h.cmake 2006-10-14 16:21:51 UTC (rev 3) +++ h422/trunk/src/main.h.cmake 2006-10-14 16:27:19 UTC (rev 4) @@ -1,11 +1,11 @@ /******************************************************************************* -* h422 - converts DSAv3 hero data between various formats * * Copyright (C) 2006 Tim "Jesus_666" Okrongli * * * * This program is free software; you can redistribute it and/or modify it * +* h422 - converts DSAv3 hero data between various formats ** Copyright (C) 2006 Tim "Jesus_666" Okrongli ** ** This program is free software; you can redistribute it and/or modify it * * under the terms of the GNU General Public License as published by the Free * * Software Foundation; either version 2 of the License, or (at your option) * -* any later version. * * * * This program is distributed in the hope that it will be useful, but WITHOUT * +* any later version. ** ** This program is distributed in the hope that it will be useful, but WITHOUT * * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -* more details. * * * * You should have received a copy of the GNU General Public License along with * +* more details. ** ** You should have received a copy of the GNU General Public License along with * * this program; if not, write to the Free Software Foundation, Inc., 51 * * Franklin St, Fifth Floor, Boston, MA 02110, USA * *******************************************************************************/ Modified: h422/trunk/src/modules.h =================================================================== --- h422/trunk/src/modules.h 2006-10-14 16:21:51 UTC (rev 3) +++ h422/trunk/src/modules.h 2006-10-14 16:27:19 UTC (rev 4) @@ -1,11 +1,11 @@ /******************************************************************************* -* h422 - converts DSAv3 hero data between various formats * * Copyright (C) 2006 Tim "Jesus_666" Okrongli * * * * This program is free software; you can redistribute it and/or modify it * +* h422 - converts DSAv3 hero data between various formats ** Copyright (C) 2006 Tim "Jesus_666" Okrongli ** ** This program is free software; you can redistribute it and/or modify it * * under the terms of the GNU General Public License as published by the Free * * Software Foundation; either version 2 of the License, or (at your option) * -* any later version. * * * * This program is distributed in the hope that it will be useful, but WITHOUT * +* any later version. ** ** This program is distributed in the hope that it will be useful, but WITHOUT * * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -* more details. * * * * You should have received a copy of the GNU General Public License along with * +* more details. ** ** You should have received a copy of the GNU General Public License along with * * this program; if not, write to the Free Software Foundation, Inc., 51 * * Franklin St, Fifth Floor, Boston, MA 02110, USA * *******************************************************************************/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <j6...@us...> - 2006-10-14 16:22:03
|
Revision: 3 http://svn.sourceforge.net/dsaster/?rev=3&view=rev Author: j6cubic Date: 2006-10-14 09:21:51 -0700 (Sat, 14 Oct 2006) Log Message: ----------- So, das musste noch weg. Removed Paths: ------------- h422/trunk/bin/.gdb_history h422/trunk/src/.deps/ Deleted: h422/trunk/bin/.gdb_history =================================================================== --- h422/trunk/bin/.gdb_history 2006-10-14 16:17:39 UTC (rev 2) +++ h422/trunk/bin/.gdb_history 2006-10-14 16:21:51 UTC (rev 3) @@ -1,90 +0,0 @@ -break 56 -r -display handle -n -n -display fptr -n -n -exit -q -break 56 -r -dis handle -display handle -n -n -display fptr -n -display pd -n -q -break 55 -r -display handle -n -q -break 8 -n -r -display handle -n -x -q -break 8 -r -q -break 8 -r -display blubb -n -display handle -n -n -n -n -q -break 21 -r -display fptr2 -n -display held -n -q -break 21 -n -r -display fptr2 -n -display held* -display *held -display &held -n -n -display &held.name -exit -q -break 12 -r -break 21 -r -q -break 21 -r -display held -q -break 21 -r -display &held -n -display fptr2 -n -display *fptr2("") -r -n -display *fptr2("") -display fptr2("") -display dlsym(handle, "read") -display (fp_held) dlsym(handle, "read") -:q -q This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <j6...@us...> - 2006-10-14 16:18:31
|
Revision: 2 http://svn.sourceforge.net/dsaster/?rev=2&view=rev Author: j6cubic Date: 2006-10-14 09:17:39 -0700 (Sat, 14 Oct 2006) Log Message: ----------- asnf Added Paths: ----------- h422/trunk/CMakeLists.txt h422/trunk/FindDL.cmake h422/trunk/README h422/trunk/bin/ h422/trunk/bin/.gdb_history h422/trunk/bin/plugins/ h422/trunk/gpl.txt h422/trunk/notes/ h422/trunk/notes/DSAW4.Format h422/trunk/notes/Genrik_v2.xml h422/trunk/notes/Res.h42.htm h422/trunk/notes/Res.h42.html h422/trunk/notes/bla.php h422/trunk/notes/h42.ebnf h422/trunk/notes/h42.format h422/trunk/notes/h42.format-r2 h422/trunk/notes/hf2.format h422/trunk/src/ h422/trunk/src/.deps/ h422/trunk/src/.deps/h422.Po h422/trunk/src/commondefs.h h422/trunk/src/io_h42.cpp h422/trunk/src/io_null.cpp h422/trunk/src/io_plaintext.cpp h422/trunk/src/main.cpp h422/trunk/src/main.h h422/trunk/src/main.h.cmake h422/trunk/src/modules.h Added: h422/trunk/CMakeLists.txt =================================================================== --- h422/trunk/CMakeLists.txt (rev 0) +++ h422/trunk/CMakeLists.txt 2006-10-14 16:17:39 UTC (rev 2) @@ -0,0 +1,80 @@ +PROJECT (h422) +CMAKE_MINIMUM_REQUIRED (VERSION 2.0) +INCLUDE (FindDL.cmake) + +SET (EXECUTABLE_OUTPUT_PATH "./bin") +SET (LIBRARY_OUTPUT_PATH "./bin/plugins") +SET (VERSION "0.5") + +ADD_EXECUTABLE (h422 src/main.cpp) + +# --- Detection of OS-specific stuff --- +SET (LIBEXTENSION "so") + +IF (UNIX) + SET (PATH_SEPARATOR "/") + IF (APPLE) + MESSAGE (STATUS "OS X detected, using Apple-specific settings") + SET (CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS + "-bundle -headerpad_max_install_names") + SET (CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS + "-bundle -headerpad_max_install_names") + SET (CMAKE_CXX_CREATE_SHARED_LIBRARY + "<CMAKE_CXX_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") + SET (CMAKE_C_CREATE_SHARED_LIBRARY + "<CMAKE_C_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") + SET (LIBEXTENSION "dylib") + ELSE (APPLE) + IF (DL_FOUND) + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--export-dynamic -ldl") + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,--export-dynamic -ldl") + ELSE (DL_FOUND) + MESSAGE (ERROR "libdl and/or dlfcn.h could not be found!") + ENDIF (DL_FOUND) + ENDIF (APPLE) +ENDIF (UNIX) + +IF (WIN32) + SET (LIBEXTENSION "dll") + SET (PATH_SEPARATOR "\\") +ENDIF (WIN32) + +MESSAGE(STATUS "Shared library extension: ${LIBEXTENSION}") +CONFIGURE_FILE ("src/main.h.cmake" "src/main.h") + +SET (BUILD_SHARED_LIBS ON) + +# --- Options --- +MACRO (PLUGIN NAME DESCRIPTION DEFAULT) + OPTION ("io_${NAME}" ${DESCRIPTION} ${DEFAULT}) + IF ("io_${NAME}") + SET (IO_MODULES ${IO_MODULES} ${NAME}) + ENDIF ("io_${NAME}") +ENDMACRO (PLUGIN) + +PLUGIN (null "Includes the null I/O module" ON) +PLUGIN (plaintext "Includes the plaintext I/O module" ON) +PLUGIN (h42 "Includes the h42 I/O module" ON) + +OPTION (DEBUG + "Compiler option -g" + OFF) +IF (DEBUG) + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g") + MESSAGE(STATUS "Building with debug information.") +ENDIF(DEBUG) + + + +# --- Module compilation --- +FOREACH(ITEM ${IO_MODULES}) + ADD_LIBRARY("io_${ITEM}" "src/io_${ITEM}.cpp") +ENDFOREACH(ITEM ${IO_MODULES}) + + + +# --- Build summary --- +MESSAGE(STATUS "Building h422 with the following configuration:") +MESSAGE(STATUS " C++ compiler flags: ${CMAKE_CXX_FLAGS}") +MESSAGE(STATUS " Modules built: ${IO_MODULES}") \ No newline at end of file Added: h422/trunk/FindDL.cmake =================================================================== --- h422/trunk/FindDL.cmake (rev 0) +++ h422/trunk/FindDL.cmake 2006-10-14 16:17:39 UTC (rev 2) @@ -0,0 +1,13 @@ +FIND_PATH (DL_INCLUDE_DIR dlfcn.h + /usr/local/include + /usr/include) + +FIND_LIBRARY (DL_LIBRARY dl + /usr/lib + /usr/local/lib) + +IF (DL_INCLUDE_DIR) + IF (DL_LIBRARY) + SET (DL_FOUND "YES") + ENDIF (DL_LIBRARY) +ENDIF (DL_INCLUDE_DIR) \ No newline at end of file Added: h422/trunk/README =================================================================== --- h422/trunk/README (rev 0) +++ h422/trunk/README 2006-10-14 16:17:39 UTC (rev 2) @@ -0,0 +1,31 @@ +BISHER UNTERSTÜTZTE PLUGINS +null + Ein Testplugin. Liest nichts und schreibt nichts, behauptet aber, beides zu + können. Äquivalent zu /dev/null. + +plaintext: + Ein Plugin, das einen Helden in eine einfache Textdatei schreibt. + Für eine spätere Version ist geplant, dieses Format auch lesen zu können. + + +BEKANNTE PROBLEME +- Falls mehrere Plugins den selben Dateityp unterstützen so wird das genommen, + das die höchste Versionsnummer hat. Sollten zwei passende Plugins die gleiche + Versionsnummer haben so wird das zuerst geladene Plugin verwendet. + Dies wird sich erst mit wxh422 ändern, wo aus einer Liste aller passenden + Plugins ausgesucht werden kann. + +- Das Programmm ist momentan (vermutlich) noch nicht mit Windows kompatibel. + Dieses Problem wird später gelöst, u.U. auch erst mit wxh422. + + +TODO +- i8n, auch der Dokumentation +- Deutschsprachige Klassen-/Variablennamen im Quelltext übersetzen +- Plugins schreiben +- Windows-Port + + +LIZENZ +Der Quelltext zu h422 steht unter Version 2 oder später der GNU General Public +Licence. Für weitere Informationen siehe gpl.txt. \ No newline at end of file Added: h422/trunk/bin/.gdb_history =================================================================== --- h422/trunk/bin/.gdb_history (rev 0) +++ h422/trunk/bin/.gdb_history 2006-10-14 16:17:39 UTC (rev 2) @@ -0,0 +1,90 @@ +break 56 +r +display handle +n +n +display fptr +n +n +exit +q +break 56 +r +dis handle +display handle +n +n +display fptr +n +display pd +n +q +break 55 +r +display handle +n +q +break 8 +n +r +display handle +n +x +q +break 8 +r +q +break 8 +r +display blubb +n +display handle +n +n +n +n +q +break 21 +r +display fptr2 +n +display held +n +q +break 21 +n +r +display fptr2 +n +display held* +display *held +display &held +n +n +display &held.name +exit +q +break 12 +r +break 21 +r +q +break 21 +r +display held +q +break 21 +r +display &held +n +display fptr2 +n +display *fptr2("") +r +n +display *fptr2("") +display fptr2("") +display dlsym(handle, "read") +display (fp_held) dlsym(handle, "read") +:q +q Added: h422/trunk/gpl.txt =================================================================== --- h422/trunk/gpl.txt (rev 0) +++ h422/trunk/gpl.txt 2006-10-14 16:17:39 UTC (rev 2) @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. Added: h422/trunk/notes/DSAW4.Format =================================================================== --- h422/trunk/notes/DSAW4.Format (rev 0) +++ h422/trunk/notes/DSAW4.Format 2006-10-14 16:17:39 UTC (rev 2) @@ -0,0 +1 @@ +--- Dateibeginn Versionsnummer Name des Helden Anzahl der Talente Je Talent: ID,Grundwert,Wert,Maximum,[Obsolet],Aktiviert(1/0),Muttersprache(1/),Zweitsprache(1/0),Leittalent(1/0),AT,PA,AtAnteil,ATBonus,PABonus Anzahl Zauber Je Zauber: ID,Repräsentation,Aktiviert(1/0),Hauszauber(1/0),Grundwert,Wert,Maximum Anzahl Vor/Nachteile Je V/N: ID,Detailangabe,Maximum,Los,Wert Anzahl Sonderfertigleiten Je SF: ID, Detailangabe,Zusatzangabe,Vorgegeben(1/0),Wert Anzahl Manöver Je Manöver: ID Liste der empfohlenen Vor-/Nachteile (IDs) Liste der ungeeigneten Vor-/Nachteile (IDs) Formel für Größe Formel für Gewicht Liste der Haarfarben Liste der Augenfarben Anzahl der VN-Kostenmodifikationen Je VN-Kostenmodifikation: ID,Kosten Anzahl der Verbilligten Sonderfertigkeiten Je Verbilligter SF: ID oder Liste von IDs SO-Maximum Gestreiftes Fell/Haut (1/0) Anzahl Sonderregeln Je Regel: Eine verklausulierte Regel Anzahl Zeilen im besonderen Besitz Die einzelnen Zeilen des besonderen Besitzes Spezielle Marken zur internen Verarbeitung Magische Tradition Für MU-KK,SO,MR,LEP,AUP,ASP,KEP,ATBAS,PABAS,FKB AS,INI,GS: Wert,Grundwert,Maximum,Minimum,[Obsolet],Bonus durch VN,Sonderboni,Professionsbonus,Kulturbon us,Rassenbonus Gold Rasse Kultur Profession Größe Gewicht Geburtsort Titel Dokumentvorlage Haarfarbe Augenfarbe Männlich (1/0) AP gesamt AP-Guthaben Geburtstag Geburtsmonat Geburtsjahr Jahr vor Hal (1/0) Magie-Kürzel (N/Z/V/H) Magische Hauptrepräsentation Anzahl Zeilen in Bemerkung Die einzelnen Zeilen der Bemerkung Verlorene permanente ASP Gegenelement(e) Namensregion --- Dateiende \ No newline at end of file Added: h422/trunk/notes/Genrik_v2.xml =================================================================== --- h422/trunk/notes/Genrik_v2.xml (rev 0) +++ h422/trunk/notes/Genrik_v2.xml 2006-10-14 16:17:39 UTC (rev 2) @@ -0,0 +1,205 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<held xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="base.xsd"> + <!-- Metadaten. Enthält bisher nur das ruleset-Tag --> + <meta> + <!-- Gibt an, welche Grundregeln wir verwenden und optional, welche + Hausregeln zu berücksichtigen sind --> + <!-- Man könnte an sich jeder houserule einen compat-Wert zuweisen, aber das + lassen wir erst mal --> + <!-- Hier verwenden wir die Extraregeln für DSA3.5 und das VSGM und haben + Metadaten, die für DSAster spezifisch sind --> + <ruleset baserules="DSA3" houserules="DSA3.5 DSAster-meta VSGM" /> + </meta> + <!-- Hintergrunddaten zum Helden --> + <info> + <name>Genrik DeFoulde II.</name> + <typ>Magier</typ> + <groesse>177</groesse> + <gewicht>81</gewicht> + <hfarbe>braun</hfarbe> + <afarbe>braun</afarbe> + <gebort>Gareth</gebort> + <gebtag>18.6.12</gebtag> + <mann>1</mann> + <gott></gott> + <stand>Mittelstand</stand> + <titel></titel> + <ruf>respektabel</ruf> + <tsteigerungen>0</tsteigerungen> + <zsteigerungen>0</zsteigerungen> + <rsteigerungen>0</rsteigerungen> + <!-- compat="mandatory": Tag muß unterstützt werden, sonst Abbruch. + compat="optional": Tag kann unterstützt werden, muß aber nicht. + compat="ignore": Tag wird wie ein Kommentar behandelt und kann beim + Speichern verworfen werden + Alle Tags ohne compat-Attribut sind "mandatory". --> + <!-- ns steht für "Namespace"... Die Hausregelsätze arbeiten nämlich mehr + oder weniger als solche. Ich habe mit echten XML-Namespaces zu wenig + Erfahrung um beurteilen zu können, ob man die hier verwenden könnte --> + <abenteuer ns="DSAster-meta" compat="optional">Im Frühtau zu Berge</abenteuer> + </info> + <!-- Die Grundwerte --> + <basis> + <mu basis="11" jetzt="11" /> + <kl basis="14" jetzt="14" /> + <in basis="11" jetzt="11" /> + <ch basis="14" jetzt="14" /> + <ff basis="11" jetzt="11" /> + <ge basis="12" jetzt="12" /> + <kk basis="11" jetzt="11" /> + <ag basis="3" jetzt="3" /> + <ha basis="4" jetzt="4" /> + <ra basis="4" jetzt="4" /> + <ta basis="3" jetzt="3" /> + <ng basis="5" jetzt="5" /> + <gg basis="4" jetzt="4" /> + <jz basis="4" jetzt="4" /> + <le basis="35" jetzt="35" /> + <au basis="46" jetzt="46" /> + <mr basis="6" jetzt="6" /> + <ae basis="60" jetzt="60" /> + <ke basis="0" jetzt="0" /> + <atb>7</atb> + <pab>7</pab> + <fkb>8</fkb> + <ausweichen>8</ausweichen> + <stufe>7</stufe> + <ap>2100</ap> + <!-- Ja, das hier ist mandatory --> + <magie ns="VSGM">15</magie> + </basis> + <talente> + <gruppe name="Kampf"> + <!-- at-bias: Wie viele von den Punkten auf die AT verteilt werden. + Wird bei FK-Talenten || TaW <= 0 ignoriert --> + <ktalent name="Raufen" be="BE" basis="9" jetzt="9" at-bias="3" /> + <ktalent name="Boxen" be="BE" basis="-1" jetzt="-1" at-bias="0" /> + <ktalent name="Hruruzat" be="BE" basis="-6" jetzt="-6" at-bias="0" /> + <ktalent name="Ringen" be="BE" basis="0" jetzt="0" at-bias="0" /> + <ktalent name="Äxte und Beile" be="BE-3" basis="-5" jetzt="-5" at-bias="0" /> + <ktalent name="Dolche" be="BE-1" basis="6" jetzt="6" at-bias="3" /> + <ktalent name="Infanteriewaffen" be="BE-3" basis="-5" jetzt="-5" at-bias="0" /> + <ktalent name="Linkshändig" be="" basis="0" jetzt="0" at-bias="0" /> + <ktalent name="Kettenwaffen" be="BE-2" basis="-5" jetzt="-5" at-bias="0" /> + <ktalent name="Peitsche" be="BE" basis="0" jetzt="0" at-bias="0" /> + <ktalent name="Scharfe Hiebwaffen" be="BE-2" basis="-4" jetzt="-4" at-bias="0" /> + <ktalent name="Schwerter" be="BE-2" basis="1" jetzt="1" at-bias="1" /> + <ktalent name="Speere und Stäbe" be="BE-2" basis="8" jetzt="8" at-bias="4" /> + <ktalent name="Stichwaffen" be="BE-1" basis="1" jetzt="1" at-bias="1" /> + <ktalent name="Stumpfe Hiebwaffen" be="BE-2" basis="-3" jetzt="-3" at-bias="0" /> + <ktalent name="Zweihänder" be="BE-2" basis="-5" jetzt="-5" at-bias="0" /> + <ktalent name="Lanzenreiten" be="" basis="-6" jetzt="-6" at-bias="0" /> + <ktalent name="Schußwaffen" be="" basis="-2" jetzt="-2" at-bias="0" /> + <ktalent name="Wurfwaffen" be="-3" basis="0" jetzt="0" at-bias="0" /> + <ktalent name="Schleuder" be="" basis="-2" jetzt="-2" at-bias="0" /> + </gruppe> + <gruppe name="Körperlich"> + <talent name="Akrobatik" gw0="mu" gw1="ge" gw2="kk" basis="-3" jetzt="-3" /> + <talent name="Fliegen" gw0="mu" gw1="kl" gw2="ge" basis="-1" jetzt="-1" /> + <talent name="Gaukeleien" gw0="ch" gw1="ff" gw2="ge" basis="1" jetzt="1" /> + <talent name="Klettern" gw0="mu" gw1="ge" gw2="kk" basis="4" jetzt="4" /> + <talent name="Körperbeherrschung" gw0="mu" gw1="in" gw2="ge" basis="4" jetzt="4" /> + <talent name="Reiten" gw0="ch" gw1="ge" gw2="kk" basis="2" jetzt="2" /> + <talent name="Schleichen" gw0="mu" gw1="in" gw2="ge" basis="3" jetzt="3" /> + <talent name="Schwimmen" gw0="mu" gw1="ge" gw2="kk" basis="5" jetzt="5" /> + <talent name="Selbstbeherrschung" gw0="mu" gw1="kk" gw2="kk" basis="7" jetzt="7" /> + <talent name="Sich Verstecken" gw0="mu" gw1="in" gw2="ge" basis="3" jetzt="3" /> + <talent name="Tanzen" gw0="ch" gw1="ge" gw2="ge" basis="3" jetzt="3" /> + <talent name="Zechen" gw0="kl" gw1="in" gw2="kk" basis="2" jetzt="2" /> + </gruppe> + <gruppe name="Gesellschaft"> + <talent name="Bekehren/Überzeugen" gw0="kl" gw1="in" gw2="ch" basis="-2" jetzt="-2" /> + <talent name="Betören" gw0="in" gw1="ch" gw2="ch" basis="0" jetzt="0" /> + <talent name="Etikette" gw0="kl" gw1="ch" gw2="ge" basis="3" jetzt="3" /> + <talent name="Feilschen" gw0="mu" gw1="kl" gw2="ch" basis="4" jetzt="4" /> + <talent name="Gassenwissen" gw0="kl" gw1="in" gw2="ch" basis="4" jetzt="4" /> + <talent name="Lehren" gw0="kl" gw1="in" gw2="ch" basis="3" jetzt="3" /> + <talent name="Lügen" gw0="mu" gw1="in" gw2="ch" basis="5" jetzt="5" /> + <talent name="Menschenkenntnis" gw0="kl" gw1="in" gw2="ch" basis="5" jetzt="5" /> + <talent name="Schätzen" gw0="kl" gw1="in" gw2="in" basis="3" jetzt="3" /> + <talent name="Sich Verkleiden" gw0="mu" gw1="ff" gw2="ge" basis="0" jetzt="0" /> + </gruppe> + <gruppe name="Natur"> + <!-- Das hier trage ich irgendwann mal nach, wenn/falls das Sinn macht --> + <!-- -5 -5 0 -3 8 5 -1 -3 2 --> + </gruppe> + <gruppe name="Wissen"> + <!-- 8 4 0 4 5 0 6 9 2 5 1 7 -4 2 --> + </gruppe> + <gruppe name="Handwerk"> + <!-- -2 -2 0 0 2 3 2 3 0 6 -1 5 -2 -1 0 0 -2 -1 --> + </gruppe> + <gruppe name="Intuitiv"> + <!-- 8 0 0 2 -4 --> + <!-- Zur Abwechslung ist das compat="mandatory" redundanterweise + angegeben --> + <talent ns="VSGM" compat="mandatory" name="Astralem Entzug Widerstehen" gw0="kl" gw1="in" gw2="in" basis="9" jetzt="9" /> + </gruppe> + <gruppe name="Rituale"> + <!-- Diese Gruppe ist leer --> + <!-- Rituale werden als etalente gehandhabt --> + </gruppe> + <gruppe name="Eigene"> + <!-- Bei etalenten erübrigt sich compat, weil sie ja schon im GRW + vorgesehen sind --> + <!-- stps: STeigerungsversuche Pro Stufe. Muß bei normalen Talenten nicht + angegeben werden, weil es sich da aus der Grupppe ergibt --> + <etalent name="Körbe Flechten" gw0="in" gw1="ff" gw2="ff" basis="0" jetzt="0" stps="2" /> + </gruppe> + </talente> + <waffen> + <!-- Für alle Standardwaffen muß nicht angegeben werden, auf welches Talent + sie gehen; das Regelwerk sollte eine Liste stellen --> + <waffe name="Magierstab" tp="1W+2" bf="0" kk-bonus="15" wv="6/6" gewicht="90" /> + <waffe name="Dolch" tp="1W+1" bf="3" kk-bonus="15" wv="2/1" gewicht="20" /> + <fernwaffe name="Wurfmesser" tp="1W" rw="25" bf="0" emod="+1/0/0/-1" gewicht="10" /> + <!-- Beispiel für eine nonstandard-Waffe --> + <waffe name="Felsbrocken" talent="Stumpfe Hiebwaffen" tp="1W+1" kk-bonus="13" wv="5/7" bf="0" gewicht="140" /> + </waffen> + <ruestungen> + <!-- Gewicht und Wert sind 0, weil die Kleidung aus separatem Kram besteht --> + <ruestung name="Kleidung" rs="1" be="1" gewicht="0" wert="0" /> + </ruestungen> + <zauber> + <spruch name="Knibbelziep" gebiet="Verw. Lebew." ursprung="auelfisch" wert="6" stps="1" /> + <!-- Das VSGM schreibt ja andere Regeln für Zauberkosten vor; das regeln wir + einfach über zusätzliche Tags --> + <!-- Nicht vergessen, compat="mandatory" wird impliziert --> + <entzug ns="VSGM" name="Knibbelziep" entzugscode="1/1"> + <!-- Hier kommen die Steigerungscodes hin, falls vorhanden --> + +1/+2 für jedes zusätzliche Jucken + </entzug> + </zauber> + <inventar geld="6210"> + <!-- Gewichte in Uz, Wert in K --> + <!-- Ja, es würde Sinn machen, einfach der Rüstung "Kleidung" ein Gewicht + zuzuweisen und es als Metaitem zu betrachten. Aber ich will hier mal + einen auf korrekt machen --> + <item name="Hose, Leinen" gewicht="25" wert="100" /> + <item name="Unterwäsche" gewicht="40" wert="400" /> + <item name="Strümpfe, Wolle" gewicht="4" wert="30" /> + <item name="Stiefel, leicht" gewicht="75" wert="810" /> + <item name="Hemd, Leinen" gewicht="10" wert="750" /> + <item name="Kapuzenumhang" gewicht="40" wert="400" /> + <item name="Geldbeutel" gewicht="1" wert="11" /> + <item name="Lederrucksack" gewicht="40" wert="360" /> + <!-- Das anzahl-Attribut ist optional und standardmäßig 1 --> + <item name="Fackel" gewicht="50" wert="50" anzahl="2" /> + <item name="Feuerstein und Stahl" gewicht="5" wert="64" /> + <item name="Zunderdose (voll)" gewicht="8" wert="280" /> + <item name="Wasserschlauch" gewicht="5" wert="92" anzahl="2" /> + <item name="Kreide" gewicht="1" wert="67" /> + <item name="Rasiermesser" gewicht="10" wert="1200" /> + <item name="Wolldecke" gewicht="40" wert="20" /> + </inventar> + <!-- Die DSA3.5-Extradaten --> + <dsa35data ns="DSA3.5" compat="optional"> + <!-- Bei DSA3.5 haben wir im Wesentlichen nur die Vor/Nachteile als + Zusatzdaten --> + <!-- Wir nennen hier die Gesamtmenge --> + <modpunkte>20</modpunkte> + <mod name="Glück" kosten="20" /> + <mod name="Farbenblind" kosten="-5" /> + <mod name="Altersresistent" kosten="5" /> + </dsa35data> +</held> \ No newline at end of file Added: h422/trunk/notes/Res.h42.htm =================================================================== --- h422/trunk/notes/Res.h42.htm (rev 0) +++ h422/trunk/notes/Res.h42.htm 2006-10-14 16:17:39 UTC (rev 2) @@ -0,0 +1,331 @@ +<font color="7f0000">Medicus +9 12 10 15 13 14 12 +4 3 3 2 6 3 7 </font> +Kampftechniken +0 +20 +Raufen (BE) +3 1 0 0 +Boxen (BE) +-2 1 0 0 +Hruruzat (BE) +-3 1 0 0 +Ringen (BE) +8 1 0 0 +Äxte und Beile (BE-3) +-6 1 0 0 +Dolche (BE-1) +8 1 0 0 +Infanteriewaffen (BE-3) +-5 1 0 0 +Linkshändig +0 1 0 0 +Kettenwaffen (BE-2) +-5 1 0 0 +Peitsche (BE) +7 1 0 0 +Scharfe Hiebwaffen (BE-2) +1 1 0 0 +Schwerter (BE-2) +-1 1 0 0 +Speere und Stäbe (BE-2) +1 1 0 0 +Stichwaffen (BE-1) +-1 1 0 0 +Stumpfe Hiebwaffen (BE-3) +2 1 0 0 +Zweihänder (BE-2) +-5 1 0 0 +Lanzenreiten +-6 1 0 0 +Schußwaffen +-1 1 0 0 +Wurfwaffen (BE-3) +5 1 0 0 +Schleuder +-1 1 0 0 +Körperliche Talente +0 +12 +Akrobatik (MU/GE/KK) +8 2 0 0 +Fliegen (MU/KL/GE) +1 2 0 0 +Gaukeleien (CH/FF/GE) +3 2 0 0 +Klettern (MU/GE/KK) +0 2 0 0 +Körperbeherrschung (MU/IN/GE) +9 2 0 0 +Reiten (CH/GE/KK) +3 2 0 0 +Schleichen (MU/IN/GE) +0 2 0 0 +Schwimmen (MU/GE/KK) +-1 2 0 0 +Selbstbeherrschung (MU/KK/KK) +5 2 0 0 +Sich Verstecken (MU/IN/GE) +0 2 0 0 +Tanzen (CH/GE/GE) +7 2 0 0 +Zechen (KL/IN/KK) +5 2 0 0 +Gesellschaft +0 +10 +Bekehren/Überzeugen (KL/IN/CH) +7 2 0 0 +Betören (IN/CH/CH) +12 2 0 0 +Etikette (KL/CH/GE) +7 2 0 0 +Feilschen (MU/KL/CH) +2 2 0 0 +Gassenwissen (KL/IN/CH) +2 2 0 0 +Lehren (KL/IN/CH) +3 2 0 0 +Lügen (MU/IN/CH) +5 2 0 0 +Menschenkenntnis (KL/IN/CH) +8 2 0 0 +Schätzen (KL/IN/IN) +0 2 0 0 +Sich Verkleiden (MU/FF/GE) +0 2 0 0 +Natur +0 +9 +Fährtensuchen (KL/IN/GE) +-3 2 0 0 +Fallenstellen (KL/FF/KK) +-4 2 0 0 +Fesseln/Entfesseln (FF/GE/KK) +5 2 0 0 +Fischen/Angeln (IN/FF/KK) +-3 2 0 0 +Pflanzenkunde (KL/IN/FF) +4 2 0 0 +Orientierung (KL/IN/IN) +-1 2 0 0 +Tierkunde (MU/KL/IN) +-1 2 0 0 +Wettervorhersage (KL/IN/IN) +-4 2 0 0 +Wildnisleben (IN/FF/GE) +-2 2 0 0 +Wissenstalente +0 +14 +Alchimie (MU/KL/FF) +4 3 0 0 +Alte Sprachen (KL/KL/IN) +4 3 0 0 +Geographie (KL/KL/IN) +4 3 0 0 +Geschichtswissen (KL/KL/IN) +4 3 0 0 +Götter und Kulte (KL/IN/CH) +4 3 0 0 +Kriegskunst (MU/KL/CH) +-5 3 0 0 +Lesen/Schreiben (KL/KL/FF) +4 3 0 0 +Magiekunde (KL/KL/IN) +4 3 0 0 +Mechanik (KL/KL/FF) +1 3 0 0 +Rechnen (KL/KL/IN) +4 3 0 0 +Rechtskunde (KL/IN/CH) +4 3 0 0 +Sprachen Kennen (KL/IN/CH) +4 3 0 0 +Staatskunst (KL/IN/CH) +4 3 0 0 +Sternkunde (KL/KL/IN) +4 3 0 0 +Handwerk +0 +18 +Abrichten (MU/IN/CH) +-1 2 0 0 +Boote Fahren (FF/GE/KK) +-2 2 0 0 +Fahrzeug Lenken (IN/CH/FF) +1 2 0 0 +Falschspiel (MU/CH/FF) +0 2 0 0 +Heilkunde, Gift (MU/KL/IN) +3 2 0 0 +Heilkunde, Krankh. (MU/KL/CH) +4 2 0 0 +Heilkunde, Seele (IN/CH/CH) +4 2 0 0 +Heilkunde, Wunden (KL/CH/FF) +8 2 0 0 +Holzbearbeitung (KL/FF/KK) +0 2 0 0 +Kochen (KL/IN/FF) +1 2 0 0 +Lederarbeiten (KL/FF/FF) +-2 2 0 0 +Malen/Zeichnen (KL/IN/FF) +2 2 0 0 +Musizieren (KL/IN/FF) +6 2 0 0 +Schneidern (KL/FF/FF) +1 2 0 0 +Schlösser Knacken (IN/FF/FF) +0 2 0 0 +Singen (KL/IN/CH) +7 2 0 0 +Taschendiebstahl (MU/IN/FF) +0 2 0 0 +Töpfern (KL/FF/FF) +-1 2 0 0 +Intuitive Begabungen +0 +5 +Gefahreninstinkt (KL/IN/IN) +6 1 0 0 +Glücksspiel (MU/IN/IN) +1 1 0 0 +Prophezeien (IN/IN/CH) +1 1 0 0 +Sinnesschärfe (KL/IN/IN) +7 1 0 0 +Stimmen Imitieren (KL/IN/CH) +-4 1 0 0 +Sondertalente/Berufe +0 +1 +Kurtisane/Gesellschafter (IN/CH/FF) +7 1 0 0 +Schamanenrituale +2 +0 +49 +0 +0 +0 +30 +0 +0 +10 +0 +1W6 +1W6 +FALSE +FALSE +0 +0 +FALSE +0 +Rahjadés Despreciósa +Al'Anfa +hellblond +mittelständisch +166 +66 +9 7 10 +19 +0 +FALSE +0 0 0 + +blau + + +2100 +7 +0 0 0 0 +9 6 6 12 4 10 5 -7 5 11 8 7 8 7 8 5 1 7 13 7 +8 6 5 10 4 12 4 -7 4 10 7 6 7 6 8 4 0 0 0 0 +4 1 +5 +Hakendolch +1W+2 +0 +60 +17 +1/3 +5 +Dolch +1W+1 +3 +20 +15 +2/1 +9 +Peitsche +1W +0 +60 +19 +8/0 +18 +Wurfmesser +1W +0 +10 +(+1/0/0/-1) +25 +Kleidung +1 +1 +120 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +Standard.rtf +5 5 +1 +Aberglauben: rote Haare, Sternschnuppen, Talismane, Elfen +4 +Tulamidisch (Novadisch) +0 +Garethi +4 +*Ur-Tulamidya +3 +*Bosparano +1 +19 +Geldbeutel +1 +Gürteltasche +5 +Lederrucksack +40 +Wolldecke +60 +Feuerstein und Stahl +5 +Proviant +40 +Zunderdose, voll +8 +Augenschminke +1 +Rasiermesser +10 +Lippenrot +1 +Nagelfeile +2 +Ohrring, Gold +1 +Ohrring, Gold +1 +Bluse, Seide +5 +Pluderhose, Seide +20 +Schleier, Seide +1 +Wurfmesser +10 +Wurfmesser +10 +Wurfmesser +10 Added: h422/trunk/notes/Res.h42.html =================================================================== --- h422/trunk/notes/Res.h42.html (rev 0) +++ h422/trunk/notes/Res.h42.html 2006-10-14 16:17:39 UTC (rev 2) @@ -0,0 +1,333 @@ +<font color="007f00">Medicus<br /> +9 12 10 15 13 14 12 <br /> +4 3 3 2 6 3 7 </font><br /> +<font color="7f5000">Kampftechniken<br /> +0<br /> +20<br /> +Raufen (BE)<br /> +3 1 0 0<br /> +Boxen (BE)<br /> +-2 1 0 0<br /> +Hruruzat (BE)<br /> +-3 1 0 0<br /> +Ringen (BE)<br /> +8 1 0 0<br /> +Äxte und Beile (BE-3)<br /> +-6 1 0 0<br /> +Dolche (BE-1)<br /> +8 1 0 0<br /> +Infanteriewaffen (BE-3)<br /> +-5 1 0 0<br /> +Linkshändig<br /> +0 1 0 0<br /> +Kettenwaffen (BE-2)<br /> +-5 1 0 0<br /> +Peitsche (BE)<br /> +7 1 0 0<br /> +Scharfe Hiebwaffen (BE-2)<br /> +1 1 0 0<br /> +Schwerter (BE-2)<br /> +-1 1 0 0<br /> +Speere und Stäbe (BE-2)<br /> +1 1 0 0<br /> +Stichwaffen (BE-1)<br /> +-1 1 0 0<br /> +Stumpfe Hiebwaffen (BE-3)<br /> +2 1 0 0<br /> +Zweihänder (BE-2)<br /> +-5 1 0 0<br /> +Lanzenreiten<br /> +-6 1 0 0<br /> +Schußwaffen<br /> +-1 1 0 0<br /> +Wurfwaffen (BE-3)<br /> +5 1 0 0<br /> +Schleuder<br /> +-1 1 0 0<br /> +Körperliche Talente<br /> +0<br /> +12<br /> +Akrobatik (MU/GE/KK)<br /> +8 2 0 0<br /> +Fliegen (MU/KL/GE)<br /> +1 2 0 0<br /> +Gaukeleien (CH/FF/GE)<br /> +3 2 0 0<br /> +Klettern (MU/GE/KK)<br /> +0 2 0 0<br /> +Körperbeherrschung (MU/IN/GE)<br /> +9 2 0 0<br /> +Reiten (CH/GE/KK)<br /> +3 2 0 0<br /> +Schleichen (MU/IN/GE)<br /> +0 2 0 0<br /> +Schwimmen (MU/GE/KK)<br /> +-1 2 0 0<br /> +Selbstbeherrschung (MU/KK/KK)<br /> +5 2 0 0<br /> +Sich Verstecken (MU/IN/GE)<br /> +0 2 0 0<br /> +Tanzen (CH/GE/GE)<br /> +7 2 0 0<br /> +Zechen (KL/IN/KK)<br /> +5 2 0 0<br /> +Gesellschaft<br /> +0<br /> +10<br /> +Bekehren/Überzeugen (KL/IN/CH)<br /> +7 2 0 0<br /> +Betören (IN/CH/CH)<br /> +12 2 0 0<br /> +Etikette (KL/CH/GE)<br /> +7 2 0 0<br /> +Feilschen (MU/KL/CH)<br /> +2 2 0 0<br /> +Gassenwissen (KL/IN/CH)<br /> +2 2 0 0<br /> +Lehren (KL/IN/CH)<br /> +3 2 0 0<br /> +Lügen (MU/IN/CH)<br /> +5 2 0 0<br /> +Menschenkenntnis (KL/IN/CH)<br /> +8 2 0 0<br /> +Schätzen (KL/IN/IN)<br /> +0 2 0 0<br /> +Sich Verkleiden (MU/FF/GE)<br /> +0 2 0 0<br /> +Natur<br /> +0<br /> +9<br /> +Fährtensuchen (KL/IN/GE)<br /> +-3 2 0 0<br /> +Fallenstellen (KL/FF/KK)<br /> +-4 2 0 0<br /> +Fesseln/Entfesseln (FF/GE/KK)<br /> +5 2 0 0<br /> +Fischen/Angeln (IN/FF/KK)<br /> +-3 2 0 0<br /> +Pflanzenkunde (KL/IN/FF)<br /> +4 2 0 0<br /> +Orientierung (KL/IN/IN)<br /> +-1 2 0 0<br /> +Tierkunde (MU/KL/IN)<br /> +-1 2 0 0<br /> +Wettervorhersage (KL/IN/IN)<br /> +-4 2 0 0<br /> +Wildnisleben (IN/FF/GE)<br /> +-2 2 0 0<br /> +Wissenstalente<br /> +0<br /> +14<br /> +Alchimie (MU/KL/FF)<br /> +4 3 0 0<br /> +Alte Sprachen (KL/KL/IN)<br /> +4 3 0 0<br /> +Geographie (KL/KL/IN)<br /> +4 3 0 0<br /> +Geschichtswissen (KL/KL/IN)<br /> +4 3 0 0<br /> +Götter und Kulte (KL/IN/CH)<br /> +4 3 0 0<br /> +Kriegskunst (MU/KL/CH)<br /> +-5 3 0 0<br /> +Lesen/Schreiben (KL/KL/FF)<br /> +4 3 0 0<br /> +Magiekunde (KL/KL/IN)<br /> +4 3 0 0<br /> +Mechanik (KL/KL/FF)<br /> +1 3 0 0<br /> +Rechnen (KL/KL/IN)<br /> +4 3 0 0<br /> +Rechtskunde (KL/IN/CH)<br /> +4 3 0 0<br /> +Sprachen Kennen (KL/IN/CH)<br /> +4 3 0 0<br /> +Staatskunst (KL/IN/CH)<br /> +4 3 0 0<br /> +Sternkunde (KL/KL/IN)<br /> +4 3 0 0<br /> +Handwerk<br /> +0<br /> +18<br /> +Abrichten (MU/IN/CH)<br /> +-1 2 0 0<br /> +Boote Fahren (FF/GE/KK)<br /> +-2 2 0 0<br /> +Fahrzeug Lenken (IN/CH/FF)<br /> +1 2 0 0<br /> +Falschspiel (MU/CH/FF)<br /> +0 2 0 0<br /> +Heilkunde, Gift (MU/KL/IN)<br /> +3 2 0 0<br /> +Heilkunde, Krankh. (MU/KL/CH)<br /> +4 2 0 0<br /> +Heilkunde, Seele (IN/CH/CH)<br /> +4 2 0 0<br /> +Heilkunde, Wunden (KL/CH/FF)<br /> +8 2 0 0<br /> +Holzbearbeitung (KL/FF/KK)<br /> +0 2 0 0<br /> +Kochen (KL/IN/FF)<br /> +1 2 0 0<br /> +Lederarbeiten (KL/FF/FF)<br /> +-2 2 0 0<br /> +Malen/Zeichnen (KL/IN/FF)<br /> +2 2 0 0<br /> +Musizieren (KL/IN/FF)<br /> +6 2 0 0<br /> +Schneidern (KL/FF/FF)<br /> +1 2 0 0<br /> +Schlösser Knacken (IN/FF/FF)<br /> +0 2 0 0<br /> +Singen (KL/IN/CH)<br /> +7 2 0 0<br /> +Taschendiebstahl (MU/IN/FF)<br /> +0 2 0 0<br /> +Töpfern (KL/FF/FF)<br /> +-1 2 0 0<br /> +Intuitive Begabungen<br /> +0<br /> +5<br /> +Gefahreninstinkt (KL/IN/IN)<br /> +6 1 0 0<br /> +Glücksspiel (MU/IN/IN)<br /> +1 1 0 0<br /> +Prophezeien (IN/IN/CH)<br /> +1 1 0 0<br /> +Sinnesschärfe (KL/IN/IN)<br /> +7 1 0 0<br /> +Stimmen Imitieren (KL/IN/CH)<br /> +-4 1 0 0<br /> +Sondertalente/Berufe<br /> +0<br /> +1<br /> +Kurtisane/Gesellschafter (IN/CH/FF)<br /> +7 1 0 0</font><br /> +<font color="7f0000">Schamanenrituale<br /> +2<br /> +0<br /> +49<br /> +0<br /> +0<br /> +0<br /> +30<br /> +0<br /> +0<br /> +10<br /> +0<br /> +1W6<br /> +1W6<br /> +FALSE<br /> +FALSE<br /> +0<br /> +0<br /> +FALSE<br /> +0</font><br /> +<font color="7f5000"> +Rahjadés Despreciósa<br /> +Al'Anfa<br /> +hellblond<br /> +mittelständisch<br /> +166<br /> +66<br /> +9 7 10<br /> +19<br /> +0<br /> +FALSE<br /> +0 0 0<br /> +<br /> +blau</font><br /> +<font color="7f0000"> +<br /> +<br /> +2100<br /> +7<br /> +0 0 0 0<br /> +9 6 6 12 4 10 5 -7 5 11 8 7 8 7 8 5 1 7 13 7 <br /> +8 6 5 10 4 12 4 -7 4 10 7 6 7 6 8 4 0 0 0 0 <br /> +4 1</font><br /> +<font color="7f5000">5<br /> +Hakendolch<br /> +1W+2<br /> +0<br /> +60<br /> +17<br /> +1/3<br /> +5<br /> +Dolch<br /> +1W+1<br /> +3<br /> +20<br /> +15<br /> +2/1<br /> +9<br /> +Peitsche<br /> +1W<br /> +0<br /> +60<br /> +19<br /> +8/0<br /> +18<br /> +Wurfmesser<br /> +1W<br /> +0<br /> +10<br /> +(+1/0/0/-1)<br /> +25</font><br /> +<font color="7f0000">Kleidung<br /> +1<br /> +1<br /> +120<br /> +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 <br /> +Standard.rtf<br /> +5 5</font><br /> +<font color="7f0000">1<br /> +Aberglauben: rote Haare, Sternschnuppen, Talismane, Elfen<br /> +4</font><br /> +<font color="007f00">Tulamidisch (Novadisch)<br /> +0<br /> +Garethi<br /> +4<br /> +*Ur-Tulamidya<br /> +3<br /> +*Bosparano<br /> +1</font><br /> +<font color="007f00">19<br /> +Geldbeutel<br /> +1<br /> +Gürteltasche<br /> +5<br /> +Lederrucksack<br /> +40<br /> +Wolldecke<br /> +60<br /> +Feuerstein und Stahl<br /> +5<br /> +Proviant<br /> +40<br /> +Zunderdose, voll<br /> +8<br /> +Augenschminke<br /> +1<br /> +Rasiermesser<br /> +10<br /> +Lippenrot<br /> +1<br /> +Nagelfeile<br /> +2<br /> +Ohrring, Gold<br /> +1<br /> +Ohrring, Gold<br /> +1<br /> +Bluse, Seide<br /> +5<br /> +Pluderhose, Seide<br /> +20<br /> +Schleier, Seide<br /> +1<br /> +Wurfmesser<br /> +10<br /> +Wurfmesser<br /> +10<br /> +Wurfmesser<br /> +10</font><br /> Added: h422/trunk/notes/bla.php =================================================================== --- h422/trunk/notes/bla.php (rev 0) +++ h422/trunk/notes/bla.php 2006-10-14 16:17:39 UTC (rev 2) @@ -0,0 +1,99 @@ +<? + if (!defined('FILE_USE_INCLUDE_PATH')) { + define('FILE_USE_INCLUDE_PATH', 1); +} + +if (!defined('LOCK_EX')) { + define('LOCK_EX', 2); +} + +if (!defined('FILE_APPEND')) { + define('FILE_APPEND', 8); +} + + +/** + * Replace file_put_contents() + * + * @category PHP + * @package PHP_Compat + * @link http://php.net/function.file_put_contents + * @author Aidan Lister <ai...@ph...> + * @version $Revision: 1.25 $ + * @internal resource_context is not supported + * @since PHP 5 + * @require PHP 4.0.0 (user_error) + */ +if (!function_exists('file_put_contents')) { + function file_put_contents($filename, $content, $flags = null, $resource_context = null) + { + // If $content is an array, convert it to a string + if (is_array($content)) { + $content = implode('', $content); + } + + // If we don't have a string, throw an error + if (!is_scalar($content)) { + user_error('file_put_contents() The 2nd parameter should be either a string or an array', + E_USER_WARNING); + return false; + } + + // Get the length of data to write + $length = strlen($content); + + // Check what mode we are using + $mode = ($flags & FILE_APPEND) ? + 'a' : + 'wb'; + + // Check if we're using the include path + $use_inc_path = ($flags & FILE_USE_INCLUDE_PATH) ? + true : + false; + + // Open the file for writing + if (($fh = @fopen($filename, $mode, $use_inc_path)) === false) { + user_error('file_put_contents() failed to open stream: Permission denied', + E_USER_WARNING); + return false; + } + + // Attempt to get an exclusive lock + $use_lock = ($flags & LOCK_EX) ? true : false ; + if ($use_lock === true) { + if (!flock($fh, LOCK_EX)) { + return false; + } + } + + // Write to the file + $bytes = 0; + if (($bytes = @fwrite($fh, $content)) === false) { + $errormsg = sprintf('file_put_contents() Failed to write %d bytes to %s', + $length, + $filename); + user_error($errormsg, E_USER_WARNING); + return false; + } + + // Close the handle + @fclose($fh); + + // Check all the data was written + if ($bytes != $length) { + $errormsg = sprintf('file_put_contents() Only %d of %d bytes written, possibly out of free disk space.', + $bytes, + $length); + user_error($errormsg, E_USER_WARNING); + return false; + } + + // Return length + return $bytes; + } +} + +$bla = nl2br(file_get_contents('Res.h42.htm')); +echo $bla; +?> \ No newline at end of file Added: h422/trunk/notes/h42.ebnf =================================================================== --- h422/trunk/notes/h42.ebnf (rev 0) +++ h422/trunk/notes/h42.ebnf 2006-10-14 16:17:39 UTC (rev 2) @@ -0,0 +1,40 @@ +CHARA ::= KLASSE GWERTE TALENTE _BLOCK1 PERSD _BLOCK2 WAFFEN _BLOCK4 SPRACHEN ITEMS + +KLASSE ::= STRING '\n' + +GWERTE ::= (INTEGER ' ')*7 '\n' (INTEGER ' ')*7 '\n' + +TALENTE ::= <unbekannt> + +_BLOCK1 ::= <unbekannt> + +PERSD ::= NAME GEBORT HFARBE STAND GRÖSSE GEWICHT GEBDATUM ALTER _BLOCK2 AFARBE + +GEBDATUM ::= TAG ' ' MONAT ' ' JAHR '\n' +TAG ::= INTEGER ? 1 - 30 ? +MONAT ::= INTEGER ? 1 - 12 ? +JAHR ::= SINTEGER + +_BLOCK2 ::= <INTEGER '\n' 'FALSE' '\n' INTEGER ' ' INTEGER ' ' INTEGER '\n\n\n'> + +_BLOCK3 ::= <unbekannt> + +WAFFEN ::= <unbekannt> + +_BLOCK4 ::= <unbekannt> + +SPRACHEN ::= INTEGER '\n' SPRACHE {SPRACHE} /* Anzahl \n @LIST*/ +SPRACHE ::= STRING '\n' INTEGER '\n' /* Name \n Können */ + +ITEMS ::= INTEGER '\n' {ITEM} /* Anzahl \n @LIST */ +ITEM ::= STRING '\n' INTEGER '\n' /* Name \n Gewicht */ + + + +STRING ::= ALPHA {ALPHA | SPACE} +ALPHA ::= 'a' | .. | 'z' | 'A' | .. | 'Z' +SPACE ::= ' ' + +SINTEGER ::= ['-'] INTEGER +INTEGER ::= NUM {NUM} +NUM ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 \ No newline at end of file Added: h422/trunk/notes/h42.format =================================================================== --- h422/trunk/notes/h42.format (rev 0) +++ h422/trunk/notes/h42.format 2006-10-14 16:17:39 UTC (rev 2) @@ -0,0 +1,58 @@ +Klasse +MU KL IN CH FF GE KK +AG HA RA TA NG GG JZ +[F\xFCr jede Talentgruppe] + Name der Gruppe + <?, \xFCberall bis auf bei "Schamanenrituale" immer "0"> + Anzahl der Talente in der Gruppe + [F\xFCr jedes Talent in der Gruppe] + Talentname (Grundwerte sind Teil des Namens) + TaW Steigerungen_pro_Stufe <?> <?> +<noch nicht untersuchter Block, vermutlich mit Verwaltungsinfos (17 Zeilen)> +Heldenname +Geburtsort +Haarfarbe +Stand +Gr\xF6\xDFe +Gewicht +Geburtstag Geburtsmonat Geburtsjahr +Alter (?) +<unbekannter Block (4 Zeilen)> +Augenfarbe +<zwei Leerzeilen (?)> +Abenteuerpunkte +Stufe +<unbekannter Block (4 Zeilen)> +Anzahl der Waffen +[F\xFCr jede Waffe] + [Nahkampfwaffen] + Waffenname + TP + BF + Gewicht (?) + KK-Bonus + W/V + <?> + [Fernkampfwaffen] + Waffenname + TP + <?, vielleicht BF> + Gewicht + Entfernungsmodifikator + RW +[F\xFCr jede R\xFCstung] + R\xFCstungsname + RS + BE +<unbekannter Block (2 Zeilen)> +Dateiname des RTF-Templates f\xFCr Export +<unbekannter Block (2 Zeilen)> +Bemerkungen +Anzahl der Sprachen +[F\xFCr alle Sprachen] + Name der Sprache + Sprachwert +Anzahl der Items im Inventar +[F\xFCr jedes Item] + Name + Gewicht \ No newline at end of file Added: h422/trunk/notes/h42.format-r2 =================================================================== --- h422/trunk/notes/h42.format-r2 (rev 0) +++ h422/trunk/notes/h42.format-r2 2006-10-14 16:17:39 UTC (rev 2) @@ -0,0 +1,90 @@ +Klasse +MU KL IN CH FF GE KK +AG HA RA TA NG GG JZ +[Für jede Talentgruppe] + Name der Gruppe + <unbekannt, überall bis auf bei "Schamanenrituale" immer "0"> + Anzahl der Talente in der Gruppe + [Für jedes Talent in der Gruppe] + Talentname (Grundwerte sind Teil des Namens) + TaW Steigerungen/Stufe Steigerungen/Stufe_übrig Fehlsteigerungen_übrig +Lebensenergie +Astralenergie +Karmaenergie +ZF-Steigerungen/Stufe +TaW-Steigerungen/Stufe +TaW/ZF-Verschiebung +Behinderungsabzug +Geschwindigkeit +Magieresistenzbonus +LE-Zuwachs/Stufe +AE-Zuwachs/Stufe +Bool: LE und AE separat steigerbar +Bool: Ist Magier-Typ +Anzahl der Zaubersprüche +[Für jeden Zauberspruch] + Name mit Grundwerten + Herkunft + Gebiet + TaW Steigerungen/Stufe Steigerungen/Stufe_übrig Fehlsteigerungen_übrig +<unbekannt> +Bool: Hat Rituale +Ritualsteigerungen/Stufe +Heldenname +Geburtsort +Haarfarbe +Stand +Größe +Gewicht +Geburtstag Geburtsmonat Geburtsjahr +Alter +Anzahl der Sonderfertigkeiten +[Für jede Sonderfertigkeit] + Name der Sonderfertigkeit +Bool: Ist männlich +Ritualsteigerungen_übrig TaW-Steigerungen_übrig Zaubersteigerungen_übrig +Gottheit +Augenfarbe +Titel +Geburtsort +Abenteuerpunkte +Stufe +Grundwertsteigerungen_übrig Negativ-GW-Sterigerungen_übrig LE/AE-Steigerungen_übrig ZF->AE_übrig +Liste der AT-Werte für alle Kampftalente +Liste der PA-Werte für alle Kampftalente (0 bei allen FK-Talenten) +Anzahl_der_Waffen Anzahl_der_Rüstungsteile +[Für jede Waffe] + [Nahkampfwaffen] + Zugehöriges Talent als Integer (0: Raufen .. 15: Zweihänder) + Waffenname + TP + BF + Gewicht + KK-Bonus + W/V + [Fernkampfwaffen] + Zugehöriges Talent als Integer (17: Schußwaffen .. 19: Schleuder) + Waffenname + TP + BF(?) + Gewicht + Entfernungsmodifikator + RW +[Für jede Rüstung] + Rüstungsname + RS + BE + Gewicht +<unbekannt, 20 Werte> +Dateiname des RTF-Templates für Export +<unbekannt, zwei Werte> +Anzahl der Zeilen für Bemerkungen +Bemerkungen +Anzahl der Sprachen +[Für alle Sprachen] + Name der Sprache + Sprachwert +Anzahl der Items im Inventar +[Für jedes Item] + Name + Gewicht \ No newline at end of file Added: h422/trunk/notes/hf2.format =================================================================== --- h422/trunk/notes/hf2.format (rev 0) +++ h422/trunk/notes/hf2.format 2006-10-14 16:17:39 UTC (rev 2) @@ -0,0 +1,58 @@ +Klasse +MU KL IN CH FF GE KK +AG HA RA TA NG GG JZ +[Für jede Talentgruppe] + Name der Gruppe + <?, überall bis auf bei "Schamanenrituale" immer "0"> + Anzahl der Talente in der Gruppe + [Für jedes Talent in der Gruppe] + Talentname (Grundwerte sind Teil des Namens) + TaW Steigerungen_pro_Stufe <?> <?> +<noch nicht untersuchter Block, vermutlich mit Verwaltungsinfos (17 Zeilen)> +Heldenname +Geburtsort +Haarfarbe +Stand +Größe +Gewicht +Geburtstag Geburtsmonat Geburtsjahr +Alter (?) +<unbekannter Block (4 Zeilen)> +Augenfarbe +<zwei Leerzeilen (?)> +Abenteuerpunkte +Stufe +<unbekannter Block (4 Zeilen)> +Anzahl der Waffen +[Für jede Waffe] + [Nahkampfwaffen] + Waffenname + TP + BF + Gewicht (?) + KK-Bonus + W/V + <?> + [Fernkampfwaffen] + Waffenname + TP + <?, vielleicht BF> + Gewicht + Entfernungsmodifikator + RW +[Für jede Rüstung] + Rüstungsname + RS + BE +<unbekannter Block (2 Zeilen)> +Dateiname des RTF-Templates für Export +<unbekannter Block (2 Zeilen)> +Bemerkungen +Anzahl der Sprachen +[Für alle Sprachen] + Name der Sprache + Sprachwert +Anzahl der Items im Inventar +[Für jedes Item] + Name + Gewicht \ No newline at end of file Added: h422/trunk/src/.deps/h422.Po =================================================================== --- h422/trunk/src/.deps/h422.Po (rev 0) +++ h422/trunk/src/.deps/h422.Po 2006-10-14 16:17:39 UTC (rev 2) @@ -0,0 +1,459 @@ +h422.o h422.o: h422.cpp /usr/include/gcc/darwin/3.3/c++/iostream \ + /usr/include/gcc/darwin/3.3/c++/ppc-darwin/bits/c++config.h \ + /usr/include/gcc/darwin/3.3/c++/ppc-darwin/bits/os_defines.h \ + /usr/include/gcc/darwin/3.3/c++/ostream \ + /usr/include/gcc/darwin/3.3/c++/ios \ + /usr/include/gcc/darwin/3.3/c++/iosfwd \ + /usr/include/gcc/darwin/3.3/c++/ppc-darwin/bits/c++locale.h \ + /usr/include/gcc/darwin/3.3/c++/clocale /usr/include/locale.h \ + /usr/include/sys/cdefs.h /usr/include/gcc/darwin/3.3/c++/cctype \ + /usr/include/ctype.h /usr/include/runetype.h \ + /usr/include/machine/ansi.h /usr/include/ppc/ansi.h \ + /usr/include/gcc/darwin/3.3/c++/bits/stringfwd.h \ + /usr/include/gcc/darwin/3.3/c++/bits/fpos.h \ + /usr/include/gcc/darwin/3.3/c++/ppc-darwin/bits/c++io.h \ + /usr/include/gcc/darwin/3.3/c++/cstdio \ + /usr/include/gcc/darwin/3.3/c++/cstddef /usr/include/stddef.h \ + /usr/include/machine/types.h /usr/include/ppc/types.h \ + /usr/include/stdio.h /usr/include/sys/types.h \ + /usr/include/sys/appleapiopts.h /usr/include/machine/endian.h \ + /usr/include/ppc/endian.h \ + /usr/include/gcc/darwin/3.3/c++/ppc-darwin/bits/gthr.h \ + /usr/include/gcc/darwin/3.3/c++/ppc-darwin/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/pthread_impl.h /usr/include/errno.h \ + /usr/include/sys/errno.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/gcc/darwin/3.3/machine/limits.h /usr/include/ppc/l... [truncated message content] |