Exemple #1
0
	public void setupObjectByCompact (CompactCreature o,bool mode)
	{
		base.setupObjectByCompact (o, mode);
		bStrength = o.bStrength;
		bCourage = o.bCourage;
		bAgility = o.bAgility;
		bPrestidigitation = o.bPrestidigitation;
		bConstitution = o.bConstitution;
		bMetabolism = o.bMetabolism;
		bIntelligence = o.bIntelligence;
		bWisdom = o.bWisdom;
		bAppearance = o.bAppearance;
		bCharisma = o.bCharisma;
		updateStatistics ();
		if (mode) {
			_cVitality=o.cVitality;
			_cHitpoints=o.cHitpoints;
			_cCondition=o.cCondition;
			_cStamina=o.cStamina;
		}else{
			_cVitality=_mVitality;
			_cHitpoints=_mVitality;
			_cCondition=mCondition;
			_cStamina=mCondition;
		}
		_bodyRoot = bodyRoot;
	} 
 public void createPlayerObject(CompactCreature charpage,NetworkConnection conn)
 {
     IDObject pb= Instantiate<IDObject> (MyNetworkManager.instance.baseObject);
     pb.Cmd_registerObject ();
     TCreature c= pb.gameObject.AddComponent<TCreature> ();
     c.setupObjectByCompact (charpage as CompactCreature, true);
     pb.gameObject.AddComponent<CharacterController> ();
     AccountService.instance.AddCharacter (conn, pb);
     NetworkServer.AddPlayerForConnection (conn, pb.gameObject, 0);
 }
Exemple #3
0
	public void createCompactCreature (CompactCreature o)
	{
		base.createCompactRPGObject (o);
		o.bStrength = bStrength;
		o.bCourage = bCourage;
		o.bAgility = bAgility;
		o.bPrestidigitation = bPrestidigitation;
		o.bConstitution = bConstitution;
		o.bMetabolism = bMetabolism;
		o.bIntelligence = bIntelligence;
		o.bWisdom = bWisdom;
		o.bCharisma = bCharisma;
		o.bAppearance = bAppearance;
		o.cVitality = _cVitality;
		o.cHitpoints = _cHitpoints;
		o.cCondition = _cCondition;
		o.cStamina = _cStamina;
	}
Exemple #4
0
	//Diese Hilfsklasse dient zur Serialisierung der Kreature

	public override void serializeToFile (string FileName)
	{
		CompactCreature cC = new CompactCreature ();
		createCompactCreature (cC);
		FileHelper.WriteToFile (FileName, FileHelper.serializeObject<CompactCreature> (cC));
	}
Exemple #5
0
	public override IDComponentUpdateMsg CreateInitialSetupMessage ()
	{
		IDComponentUpdateMsg result = new IDComponentUpdateMsg ();
		result.id = getID ();
		result.componentName = GetType ().ToString ();
		result.updateType = 0;
		CompactCreature obj = new CompactCreature ();
		createCompactCreature (obj);
		result.data=FileHelper.serializeObject<CompactCreature>(obj);
		return result;
	}