bool ShiftAppearance(NPC_Type aOtherNPCType) { TestInvariant(); if (mShiftedNPCType == aOtherNPCType) { return(false); } if (mShiftedNPCType != null) { mShiftedAppearance = null; mShiftedNPCType = null; mShiftedNPCTypeID = 0; } TestInvariant(); if (aOtherNPCType != null) { mShiftedNPCType = aOtherNPCType; mShiftedNPCTypeID = mShiftedNPCType.GetResourceId(); mShiftedAppearance = aOtherNPCType.Appearance.CreateAppearance((Outer as Game_Pawn), mShiftedAppearance, true); } if (mShiftedAppearance != null && mShiftedNPCType.Equipment != null) { mShiftedNPCType.Equipment.ApplyToAppearance(GetCurrent() as Game_EquippedAppearance); } GetCurrent().Apply(); TestInvariant(); return(true); }
public Game_Appearance CreateAppearance(Game_Pawn aPawn, Game_Appearance aAppearance, bool aShifting) { float R; float H; aPawn.SkillRadius = GetSkillRadius(); if (!aShifting) { R = GetCollisionRadius(); H = GetCollisionHeight(); if (R >= 0 && H >= 0) { aPawn.SetCollisionSize(R, H); } } if (aAppearance != null) { switch (Voice) { case 0: aAppearance.SetVoice(255); break; case 9: if (aAppearance.IsKid()) { if (aAppearance.GetGender() == 0) { aAppearance.SetVoice(Rand(1)); } else { aAppearance.SetVoice(Rand(2)); } } else { aAppearance.SetVoice((byte)(10 + Rand(14))); } break; default: aAppearance.SetVoice((byte)(Voice - 1)); break; } //aAppearance.SetAvatarTexture(AvatarTexture); } return(aAppearance); }