public byte GetItemTileMax() { ITEM_CLASS bClass = (ITEM_CLASS)ItemClass(); switch (bClass) { case ITEM_CLASS.ICLASS_EQUIP: return(1); case ITEM_CLASS.ICLASS_GEM: return(1); case ITEM_CLASS.ICLASS_COMITEM: case ITEM_CLASS.ICLASS_MATERIAL: case ITEM_CLASS.ICLASS_TASKITEM: { return(GetMedicData().m_nLayedNum); } case ITEM_CLASS.ICLASS_STOREMAP: { return(1); } case ITEM_CLASS.ICLASS_SYMBOLITEM: { return(1); } default: { return(0); } } }
//STORE_MAP_INFO* GetStoreMapData() const //{ // return (STORE_MAP_INFO*)(&m_StoreMap); //} ////////////////////////////////////////////////////////////////////////// // 物品个数方法 // 能叠放物品 返回 实际大小 // 不能叠放物品 返回 1 // public byte GetItemCount() { ITEM_CLASS bClass = (ITEM_CLASS)ItemClass(); if (bClass == ITEM_CLASS.ICLASS_EQUIP) { return(1); } else if (bClass == ITEM_CLASS.ICLASS_GEM) { return(1); } else if (bClass == ITEM_CLASS.ICLASS_COMITEM) { return(GetMedicData().m_nCount); } else if (bClass == ITEM_CLASS.ICLASS_MATERIAL) { return(GetMedicData().m_nCount); } else if (bClass == ITEM_CLASS.ICLASS_TASKITEM) { return(GetMedicData().m_nCount); } else if (bClass == ITEM_CLASS.ICLASS_SYMBOLITEM) { return(1); } else { return(0); } }
//减少叠放数量 public bool DecCount(uint nCount) { ITEM_CLASS bClass = (ITEM_CLASS)ItemClass(); switch (bClass) { case ITEM_CLASS.ICLASS_EQUIP: { return(false); } case ITEM_CLASS.ICLASS_GEM: { return(false); } case ITEM_CLASS.ICLASS_TASKITEM: case ITEM_CLASS.ICLASS_MATERIAL: case ITEM_CLASS.ICLASS_COMITEM: { GetMedicData().m_nCount -= (byte)nCount; return(true); } case ITEM_CLASS.ICLASS_SYMBOLITEM: { return(false); } default: return(false); } }
public void SetItemCount(int nCount) { ITEM_CLASS bClass = (ITEM_CLASS)ItemClass(); if (bClass == ITEM_CLASS.ICLASS_COMITEM) { GetMedicData().m_nCount = (byte)nCount; } else if (bClass == ITEM_CLASS.ICLASS_MATERIAL) { GetMedicData().m_nCount = (byte)nCount; } else if (bClass == ITEM_CLASS.ICLASS_TASKITEM) { GetMedicData().m_nCount = (byte)nCount; } else { return; } }
public static void RegistryFragInfos(Room room,SLOT killer,out int score,bool isBotMode,bool isSuicide,FragInfos kills) { score = 0; ITEM_CLASS idStatics = (ITEM_CLASS)ComDiv.getIdStatics(kills.weapon,1); for (int index = 0; index < kills.frags.Count; ++index) { Frag frag = kills.frags[index]; CharaDeath charaDeath = (CharaDeath)((int)frag.hitspotInfo >> 4); if ((int)kills.killsCount - (isSuicide ? 1 : 0) > 1) { frag.killFlag |= charaDeath == CharaDeath.BOOM || charaDeath == CharaDeath.OBJECT_EXPLOSION || (charaDeath == CharaDeath.POISON || charaDeath == CharaDeath.HOWL) || (charaDeath == CharaDeath.TRAMPLED || idStatics == ITEM_CLASS.SHOTGUN) ? KillingMessage.MassKill : KillingMessage.PiercingShot; } else { int num1 = 0; switch (charaDeath) { case CharaDeath.DEFAULT: if (idStatics == ITEM_CLASS.KNIFE) { num1 = 6; break; } break; case CharaDeath.HEADSHOT: num1 = 4; break; } if (num1 > 0) { int num2 = killer.lastKillState >> 12; switch (num1) { case 4: if (num2 != 4) { killer.repeatLastState = false; } killer.lastKillState = num1 << 12 | killer.killsOnLife + 1; if (killer.repeatLastState) { frag.killFlag |= (killer.lastKillState & 16383) <= 1 ? KillingMessage.Headshot : KillingMessage.ChainHeadshot; break; } frag.killFlag |= KillingMessage.Headshot; killer.repeatLastState = true; break; case 6: if (num2 != 6) { killer.repeatLastState = false; } killer.lastKillState = num1 << 12 | killer.killsOnLife + 1; if (killer.repeatLastState && (killer.lastKillState & 16383) > 1) { frag.killFlag |= KillingMessage.ChainSlugger; break; } killer.repeatLastState = true; break; } } else { killer.lastKillState = 0; killer.repeatLastState = false; } } int victimSlot = frag.VictimSlot; SLOT slot = room._slots[victimSlot]; if (slot.killsOnLife > 3) { frag.killFlag |= KillingMessage.ChainStopper; } if ((kills.weapon != 19016 && kills.weapon != 19022 || (int)kills.killerIdx != victimSlot) && !slot.specGM) { ++slot.allDeaths; } if (killer._team != slot._team) { score += AllUtils.getKillScore(frag.killFlag); ++killer.allKills; if (killer._deathState == DeadEnum.isAlive) { ++killer.killsOnLife; } if (slot._team == 0) { ++room._redDeaths; ++room._blueKills; } else { ++room._blueDeaths; ++room._redKills; } if (room.room_type == (byte)7) { if (killer._team == 0) { room.red_dino += 4; } else { room.blue_dino += 4; } } } slot.lastKillState = 0; slot.killsOnLife = 0; slot.repeatLastState = false; slot.passSequence = 0; slot._deathState = DeadEnum.isDead; if (!isBotMode) { AllUtils.CompleteMission(room,slot,MISSION_TYPE.DEATH,0); } if (charaDeath == CharaDeath.HEADSHOT) { ++killer.headshots; } } }
public static void RegistryFragInfos(Room room,SLOT killer,out int score,bool isBotMode,bool isSuicide,FragInfos kills) { score = 0; ITEM_CLASS weaponClass = (ITEM_CLASS)ComDiv.getIdStatics(kills.weapon,1); for (int i = 0; i < kills.frags.Count; i++) { Frag frag = kills.frags[i]; CharaDeath deathType = (CharaDeath)(frag.hitspotInfo >> 4); if (kills.killsCount - (isSuicide ? 1 : 0) > 1) { frag.killFlag |= deathType == CharaDeath.BOOM || deathType == CharaDeath.OBJECT_EXPLOSION || deathType == CharaDeath.POISON || deathType == CharaDeath.HOWL || deathType == CharaDeath.TRAMPLED || weaponClass == ITEM_CLASS.SHOTGUN ? KillingMessage.MassKill : KillingMessage.PiercingShot; } else { int num2 = 0; if (deathType == CharaDeath.HEADSHOT) { num2 = 4; } else if (deathType == CharaDeath.DEFAULT && weaponClass == ITEM_CLASS.KNIFE) { num2 = 6; } if (num2 > 0) { int num3 = killer.lastKillState >> 12; if (num2 == 4) { if (num3 != 4) { killer.repeatLastState = false; } killer.lastKillState = num2 << 12 | (killer.killsOnLife + 1); if (killer.repeatLastState) { frag.killFlag |= (killer.lastKillState & 16383) <= 1 ? KillingMessage.Headshot : KillingMessage.ChainHeadshot; } else { frag.killFlag |= KillingMessage.Headshot; killer.repeatLastState = true; } } else if (num2 == 6) { if (num3 != 6) { killer.repeatLastState = false; } killer.lastKillState = num2 << 12 | (killer.killsOnLife + 1); if (killer.repeatLastState && (killer.lastKillState & 16383) > 1) { frag.killFlag |= KillingMessage.ChainSlugger; } else { killer.repeatLastState = true; } } } else { killer.lastKillState = 0; killer.repeatLastState = false; } } int victimId = frag.VictimSlot; SLOT victimSlot = room._slots[victimId]; if (victimSlot.killsOnLife > 3) { frag.killFlag |= KillingMessage.ChainStopper; } if ((kills.weapon == 19016 || kills.weapon == 19022) && kills.killerIdx == victimId || victimSlot.specGM) { } else { victimSlot.allDeaths++; //exprosao acid } if (killer._team != victimSlot._team) { score += AllUtils.getKillScore(frag.killFlag); killer.allKills++; if (killer._deathState == DeadEnum.isAlive) { killer.killsOnLife++; } if (victimSlot._team == 0) { room._redDeaths++; room._blueKills++; } else { room._blueDeaths++; room._redKills++; } if (room.room_type == 7) { if (killer._team == 0) { room.red_dino += 4; } else { room.blue_dino += 4; } } } victimSlot.lastKillState = 0; victimSlot.killsOnLife = 0; victimSlot.repeatLastState = false; victimSlot.passSequence = 0; victimSlot._deathState = DeadEnum.isDead; if (!isBotMode) { AllUtils.CompleteMission(room,victimSlot,MISSION_TYPE.DEATH,0); } if (deathType == CharaDeath.HEADSHOT) { killer.headshots++; } } }
public int getSize() { int CreatorSize = GetCreatorVar() ? (sizeof(byte) * ItemDefine.MAX_ITEM_CREATOR_NAME) : 0; ITEM_CLASS IC = (ITEM_CLASS)ItemClass(); if (IC == ITEM_CLASS.ICLASS_EQUIP) { return(m_ItemGUID.getSize() + //// _ITEM.m_ItemGUID sizeof(uint) + //// _ITEM.m_ItemIndex sizeof(byte) + //// _ITEM.m_RulerID sizeof(byte) + //// _ITEM.m_nsBind sizeof(int) * ItemDefine.MAX_ITEM_PARAM + //// _ITEM.m_Param ////////////////////////////////////////////////////////////////////////// sizeof(short) * 2 + //// SHORT+USHORT (m_SetNum;m_CurDamagePoint) sizeof(uint) * 2 + //// m_BasePrice;m_nNextDangCiItemSN;;; m_Equip.m_pAttr[0].getSize() * m_Equip.m_AttrCount + //// _ITEM.m_pAttr m_Equip.m_pGemInfo[0].getSize() * GAMEDEFINE.MAX_ITEM_GEM + /*it.m_Equip.m_StoneCount+*/ // _ITEM.m_pGemInfo因为镶嵌需要必须要MAX_ITEM_GEM个 [2011-9-28] by: cfp+ sizeof(byte) * 12 + //// (m_MaxNum,m_EquipPoint,m_MaxDurPoint,m_NeedLevel,m_nDangCi, //// m_GemMax,m_EquipEnhanceLevel,m_FaileTimes,m_CurDurPoint, m_AttrCount,m_StoneCount, m_CurSoulType) CreatorSize); //// _ITEM.m_Creator } else if (IC == ITEM_CLASS.ICLASS_GEM) { return(m_ItemGUID.getSize() + sizeof(uint) + sizeof(byte) + sizeof(byte) + sizeof(int) * ItemDefine.MAX_ITEM_PARAM + CreatorSize + m_Gem.getSize()); } else if (IC == ITEM_CLASS.ICLASS_COMITEM) { return(m_ItemGUID.getSize() + sizeof(uint) + sizeof(char) + sizeof(char) + sizeof(int) * ItemDefine.MAX_ITEM_PARAM + CreatorSize + m_Medic.getSize()); } else if (IC == ITEM_CLASS.ICLASS_MATERIAL) { return(m_ItemGUID.getSize() + sizeof(uint) + sizeof(char) + sizeof(char) + sizeof(int) * ItemDefine.MAX_ITEM_PARAM + CreatorSize + m_Medic.getSize()); } else if (IC == ITEM_CLASS.ICLASS_TASKITEM) { return(m_ItemGUID.getSize() + sizeof(uint) + sizeof(char) + sizeof(char) + sizeof(int) * ItemDefine.MAX_ITEM_PARAM + CreatorSize + m_Medic.getSize()); } else if (IC == ITEM_CLASS.ICLASS_TALISMAN) { return(m_ItemGUID.getSize() + sizeof(uint) + sizeof(char) + sizeof(char) + sizeof(int) * ItemDefine.MAX_ITEM_PARAM + CreatorSize + m_Talisman.getSize()); } else if (IC == ITEM_CLASS.ICLASS_SYMBOLITEM) { return(m_ItemGUID.getSize() + sizeof(uint) + sizeof(byte) + sizeof(byte) + sizeof(int) * ItemDefine.MAX_ITEM_PARAM + CreatorSize + m_Charm.getSize()); } //else if (it.ItemClass() == ICLASS_STOREMAP) //{ // return sizeof(_ITEM_GUID) + // sizeof(UINT) + // sizeof(CHAR) + // sizeof(CHAR) + // sizeof(INT) * MAX_ITEM_PARAM + // CreatorSize + // sizeof(STORE_MAP_INFO); //} else { return(m_ItemGUID.getSize() + sizeof(uint) + sizeof(byte) + sizeof(int) * ItemDefine.MAX_ITEM_PARAM + CreatorSize + sizeof(byte)); } }