From dde1d0919440b61c52e37f8b0b3dd909d902ed62 Mon Sep 17 00:00:00 2001 From: mateuszb Date: Tue, 12 Jun 2007 20:09:23 +0000 Subject: [PATCH] =?UTF-8?q?troszku=20wi=C4=99cej=20zaczytywania=20obiekt?= =?UTF-8?q?=C3=B3w,=20mo=C5=BCe=20jutro=20b=C4=99dzie=20wi=C4=99cej?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CAmbarCendamo.cpp | 33 ++++++++++++++++++++++++++++++++- CObjectHandler.h | 30 ++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) diff --git a/CAmbarCendamo.cpp b/CAmbarCendamo.cpp index b2c2428d3..d7233cca0 100644 --- a/CAmbarCendamo.cpp +++ b/CAmbarCendamo.cpp @@ -411,7 +411,36 @@ void CAmbarCendamo::deh3m() nobj.x = bufor[i++]; nobj.y = bufor[i++]; nobj.z = bufor[i++]; - nobj.defNumber = bufor[i++]; //TODO - zobaczyć co się dzieje, jak numer określającego defa jest większy niż 255 + nobj.defNumber = readNormalNr(i, 4); i+=4; + i+=5; + switch(getDefType(map.defy[nobj.defNumber])) + { + case EDefType::EVENTOBJ_DEF: + { + CEventObjInfo spec; + bool guardMess; + guardMess = bufor[i]; ++i; + if(guardMess) + { + int messLong = readNormalNr(i, 4); i+=4; + if(messLong>0) + { + spec.isMessage = true; + for(int yy=0; yy #include +#include "CCreatureHandler.h" +#include "CArtHandler.h" +#include "CAbilityHandler.h" +#include "CSpellHandler.h" class CSpecObjInfo //class with object - specific info (eg. different information for creatures and heroes); use inheritance to make object - specific classes { }; +class CEventObjInfo : public CSpecObjInfo +{ +public: + bool areGuarders; //true if there are + CCreatureSet guarders; + bool isMessage; //true if there is a message + std::string message; + unsigned int gainedExp; + int manaDiff; //amount of gained / lost mana + int moraleDiff; //morale modifier + int luckDiff; //luck modifier + int wood, mercury, ore, sulfur, crystal, gems, gold; //gained / lost resources + unsigned int attack; //added attack points + unsigned int defence; //added defence points + unsigned int power; //added power points + unsigned int knowledge; //added knowledge points + std::vector abilities; //gained abilities + std::vector abilityLevels; //levels of gained abilities + std::vector artifacts; //gained artifacts + std::vector spells; //gained spells + CCreatureSet creatures; //gained creatures + unsigned char availableFor; //players whom this event is available for + bool computerActivate; //true if computre player can activate this event + bool humanActivate; //true if human player can activate this event +}; + class CObject //typical object that can be encountered on a map { public: