public override void InitializeVariable(Dictionary <string, string> variables) { string value; if (variables.TryGetValue("damage_type", out value)) { m_damage_type_id = (int)CRC.Calculate(value); } if (variables.TryGetValue("damage_amount", out value)) { m_damage_amount.Compile(value); } if (variables.TryGetValue("damage_render_effect", out value)) { m_damage_render_effect_cfgid = int.Parse(value); } if (variables.TryGetValue("damage_sound", out value)) { m_damage_sound_cfgid = int.Parse(value); } }
public override void InitializeVariable(Dictionary <string, string> variables) { string value; if (variables.TryGetValue("category", out value)) { m_category = (int)CRC.Calculate(value); } if (variables.TryGetValue("conflict_id", out value)) { m_conflict_id = (int)CRC.Calculate(value); } if (variables.TryGetValue("duration", out value)) { m_duration.Compile(value); } if (variables.TryGetValue("render_effect", out value)) { m_render_effect_cfgid = int.Parse(value); } }
void InitObjectProtoData() { ObjectProtoData proto_data = new ObjectProtoData(); proto_data.m_name = "Cube"; proto_data.m_component_variables["asset"] = "Objects/3D/zzw_cube"; m_object_proto_data[101001] = proto_data; proto_data = new ObjectProtoData(); proto_data.m_name = "Sphere"; proto_data.m_component_variables["asset"] = "Objects/3D/zzw_sphere"; m_object_proto_data[101002] = proto_data; proto_data = new ObjectProtoData(); proto_data.m_name = "missile_entity"; proto_data.m_component_variables["speed"] = "15"; proto_data.m_component_variables["life_time"] = "10"; proto_data.m_component_variables["asset"] = "Objects/3D/zzw_missile_entity"; m_object_proto_data[103001] = proto_data; proto_data = new ObjectProtoData(); proto_data.m_name = "ssx_legacy"; proto_data.m_component_variables["asset"] = "Objects/3D/zzw_ssx_legacy"; proto_data.m_attributes[(int)CRC.Calculate("测试属性1")] = "1"; proto_data.m_attributes[(int)CRC.Calculate("TestAttribute2")] = "2"; proto_data.m_attributes[(int)CRC.Calculate("TestAttribute3")] = "3"; proto_data.m_attributes[(int)CRC.Calculate("TestAttribute4")] = "4"; proto_data.m_attributes[(int)CRC.Calculate("TestAttribute5")] = "5"; proto_data.m_attributes[(int)CRC.Calculate("TestAttribute6")] = "6"; proto_data.m_attributes[(int)CRC.Calculate("MaxHealth")] = "1000"; proto_data.m_skills[0] = 1001; m_object_proto_data[111001] = proto_data; proto_data = new ObjectProtoData(); proto_data.m_name = "ssx_mecanim"; proto_data.m_component_variables["asset"] = "Objects/3D/zzw_ssx_mecanim"; proto_data.m_skills[0] = 1011; m_object_proto_data[112001] = proto_data; }
public override void InitializeComponent() { ObjectProtoData proto_data = ParentObject.GetCreationContext().m_proto_data; if (proto_data == null) { return; } var dic = proto_data.m_component_variables; if (dic == null) { return; } string value; if (dic.TryGetValue("faction", out value)) { m_faction = (int)CRC.Calculate(value); m_faction_index = GetLogicWorld().GetFactionManager().Faction2Index(m_faction); } }
public void HandleCommand(Command command) { if (m_game_over) { return; } if (command.Type == CommandType.RandomTest) { ++m_command_count; m_game_crc = CRC.Calculate(m_current_frame, m_game_crc); RandomTestCommand rtc = command as RandomTestCommand; m_game_crc = CRC.Calculate(rtc.PlayerPstid, m_game_crc); m_game_crc = CRC.Calculate(rtc.SyncTurn, m_game_crc); m_game_crc = CRC.Calculate(rtc.m_random, m_game_crc); /* * if (m_client) * UnityEngine.Debug.LogError("Client HandleCommand, " + m_command_count + ", m_current_frame = " + m_current_frame + ", SyncTurn = " + rtc.SyncTurn + ", Random = " + rtc.Random + ", PlayerPstid = " + rtc.PlayerPstid + ", CRC = " + m_game_crc); * else * UnityEngine.Debug.LogError("Server HandleCommand, " + m_command_count + ", m_current_frame = " + m_current_frame + ", SyncTurn = " + rtc.SyncTurn + ", Random = " + rtc.Random + ", PlayerPstid = " + rtc.PlayerPstid + ", CRC = " + m_game_crc); */ } }
public override void InitializeVariable(Dictionary <string, string> variables) { string value; if (variables.TryGetValue("delay_time", out value)) { m_delay_time = FixPoint.Parse(value); } if (variables.TryGetValue("damage_type", out value)) { m_damage_type_id = (int)CRC.Calculate(value); } if (variables.TryGetValue("damage_amount", out value)) { m_damage_amount.Compile(value); } if (variables.TryGetValue("damage_render_effect", out value)) { m_damage_render_effect_cfgid = int.Parse(value); } if (variables.TryGetValue("damage_sound", out value)) { m_damage_sound_cfgid = int.Parse(value); } if (variables.TryGetValue("combo_attack_cnt", out value)) { m_combo_attack_cnt = int.Parse(value); } if (variables.TryGetValue("combo_interval", out value)) { m_combo_interval = FixPoint.Parse(value); } if (variables.TryGetValue("render_effect", out value)) { m_render_effect_cfgid = int.Parse(value); } }
public static Attribute GetAttribute(Entity entity, string attribute_name) { int attribute_id = (int)CRC.Calculate(attribute_name); return(GetAttribute(entity, attribute_id)); }
public override void InitializeComponent() { if (m_track_mode == 0) { m_track_mode = TrackModeNone; } else if (m_track_mode == TrackModeLockTarget) { m_pierce_entity = false; } if (m_trajectory_type == 0) { m_trajectory_type = TrajectoryTypeHorizontalLine; } ObjectProtoData proto_data = ParentObject.GetCreationContext().m_proto_data; if (proto_data == null) { return; } var variables = proto_data.m_component_variables; if (variables == null) { return; } string value; if (variables.TryGetValue("speed", out value)) { m_speed = FixPoint.Parse(value); } if (variables.TryGetValue("life_time", out value)) { m_life_time = FixPoint.Parse(value); } if (variables.TryGetValue("track_mode", out value)) { m_track_mode = (int)CRC.Calculate(value); } if (variables.TryGetValue("trajectory_type", out value)) { m_trajectory_type = (int)CRC.Calculate(value); } if (variables.TryGetValue("extra_hight", out value)) { m_extra_hight = FixPoint.Parse(value); } if (variables.TryGetValue("can_cross_obstacle", out value)) { m_can_cross_obstacle = bool.Parse(value); } if (variables.TryGetValue("pierce_entity", out value)) { m_pierce_entity = bool.Parse(value); } if (variables.TryGetValue("collision_faction", out value)) { m_collision_faction = (int)CRC.Calculate(value); } if (variables.TryGetValue("collision_sound", out value)) { m_collision_sound_cfgid = int.Parse(value); } if (m_pierce_entity) { m_effected_entities = new List <int>(); } }
public LevelTableData GetLevelTableData(string table_name) { int table_id = (int)CRC.Calculate(table_name); return(GetLevelTableData(table_name)); }
public FixPoint GetLevelBasedNumber(string table_name, int level) { int table_id = (int)CRC.Calculate(table_name); return(GetLevelBasedNumber(table_id, level)); }
void InitObjectTypeData() { //一些Player ObjectTypeData type_data = new ObjectTypeData(); type_data.m_name = "EnvironmentPlayer"; m_object_type_data[1] = type_data; type_data = new ObjectTypeData(); type_data.m_name = "AIEnemyPlayer"; m_object_type_data[2] = type_data; type_data = new ObjectTypeData(); type_data.m_name = "LocalPlayer"; m_object_type_data[3] = type_data; type_data = new ObjectTypeData(); type_data.m_name = "RealPlayer"; m_object_type_data[4] = type_data; //虚拟的环境角色 type_data = new ObjectTypeData(); type_data.m_name = "EnvironmentEntity"; m_object_type_data[100] = type_data; //可破坏的障碍物 type_data = new ObjectTypeData(); type_data.m_name = "DamagableObstruct"; ComponentData cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("PositionComponent"); cd.m_component_variables = new Dictionary <string, string>(); cd.m_component_variables["radius"] = "0.5"; cd.m_component_variables["height"] = "1"; cd.m_component_variables["visible"] = "True"; type_data.m_components_data.Add(cd); cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("ObstacleComponent"); cd.m_component_variables = new Dictionary <string, string>(); cd.m_component_variables["ext_x"] = "0.5"; cd.m_component_variables["ext_y"] = "0.5"; cd.m_component_variables["ext_z"] = "0.5"; type_data.m_components_data.Add(cd); cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("DamagableComponent"); cd.m_component_variables = new Dictionary <string, string>(); cd.m_component_variables["max_health"] = "1000"; cd.m_component_variables["current_health"] = "900"; type_data.m_components_data.Add(cd); cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("DeathComponent"); cd.m_component_variables = new Dictionary <string, string>(); cd.m_component_variables["hide_delay"] = "1"; cd.m_component_variables["delete_delay"] = "2"; type_data.m_components_data.Add(cd); cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("ModelComponent"); cd.m_component_variables = new Dictionary <string, string>(); cd.m_component_variables["bodyctrl_path"] = "bodyctrl"; type_data.m_components_data.Add(cd); m_object_type_data[101] = type_data; //不可破坏的障碍物 type_data = new ObjectTypeData(); type_data.m_name = "UndamagableObstruct"; cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("PositionComponent"); cd.m_component_variables = new Dictionary <string, string>(); cd.m_component_variables["radius"] = "0.5"; cd.m_component_variables["height"] = "1"; cd.m_component_variables["collision_sende"] = "False"; cd.m_component_variables["visible"] = "True"; type_data.m_components_data.Add(cd); cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("ObstacleComponent"); cd.m_component_variables = new Dictionary <string, string>(); cd.m_component_variables["ext_x"] = "0.5"; cd.m_component_variables["ext_y"] = "0.5"; cd.m_component_variables["ext_z"] = "0.5"; type_data.m_components_data.Add(cd); cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("ModelComponent"); cd.m_component_variables = new Dictionary <string, string>(); cd.m_component_variables["bodyctrl_path"] = "bodyctrl"; type_data.m_components_data.Add(cd); m_object_type_data[102] = type_data; //发射物 type_data = new ObjectTypeData(); type_data.m_name = "Missile"; cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("PositionComponent"); cd.m_component_variables = new Dictionary <string, string>(); cd.m_component_variables["radius"] = "0"; cd.m_component_variables["height"] = "0"; cd.m_component_variables["collision_sende"] = "False"; cd.m_component_variables["visible"] = "True"; type_data.m_components_data.Add(cd); cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("ProjectileComponent"); type_data.m_components_data.Add(cd); cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("ModelComponent"); cd.m_component_variables = new Dictionary <string, string>(); cd.m_component_variables["bodyctrl_path"] = "bodyctrl"; type_data.m_components_data.Add(cd); m_object_type_data[103] = type_data; //Legacy英雄 type_data = new ObjectTypeData(); type_data.m_name = "LegacyHero"; cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("LevelComponent"); cd.m_component_variables = new Dictionary <string, string>(); cd.m_component_variables["level"] = "1"; type_data.m_components_data.Add(cd); cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("AttributeManagerComponent"); type_data.m_components_data.Add(cd); cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("PositionComponent"); cd.m_component_variables = new Dictionary <string, string>(); cd.m_component_variables["radius"] = "0.5"; cd.m_component_variables["height"] = "1"; cd.m_component_variables["visible"] = "True"; type_data.m_components_data.Add(cd); cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("LocomotorComponent"); cd.m_component_variables = new Dictionary <string, string>(); cd.m_component_variables["max_speed"] = "5.0"; type_data.m_components_data.Add(cd); cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("PathFindingComponent"); type_data.m_components_data.Add(cd); cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("EffectManagerComponent"); type_data.m_components_data.Add(cd); cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("DamagableComponent"); type_data.m_components_data.Add(cd); cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("DeathComponent"); cd.m_component_variables = new Dictionary <string, string>(); cd.m_component_variables["hide_delay"] = "1"; cd.m_component_variables["delete_delay"] = "2"; type_data.m_components_data.Add(cd); cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("SkillManagerComponent"); type_data.m_components_data.Add(cd); cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("StateComponent"); type_data.m_components_data.Add(cd); cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("TargetingComponent"); type_data.m_components_data.Add(cd); cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("ModelComponent"); cd.m_component_variables = new Dictionary <string, string>(); cd.m_component_variables["bodyctrl_path"] = "bodyctrl"; type_data.m_components_data.Add(cd); cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("AnimationComponent"); cd.m_component_variables = new Dictionary <string, string>(); cd.m_component_variables["animation_path"] = "bodyctrl/animationctrl"; type_data.m_components_data.Add(cd); m_object_type_data[111] = type_data; //Mecanim英雄 type_data = new ObjectTypeData(); type_data.m_name = "MecanimHero"; cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("LevelComponent"); cd.m_component_variables = new Dictionary <string, string>(); cd.m_component_variables["level"] = "1"; type_data.m_components_data.Add(cd); cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("AttributeManagerComponent"); type_data.m_components_data.Add(cd); cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("PositionComponent"); cd.m_component_variables = new Dictionary <string, string>(); cd.m_component_variables["radius"] = "0.5"; cd.m_component_variables["height"] = "1"; cd.m_component_variables["visible"] = "True"; type_data.m_components_data.Add(cd); cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("LocomotorComponent"); cd.m_component_variables = new Dictionary <string, string>(); cd.m_component_variables["max_speed"] = "5.0"; type_data.m_components_data.Add(cd); cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("PathFindingComponent"); type_data.m_components_data.Add(cd); cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("EffectManagerComponent"); type_data.m_components_data.Add(cd); cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("DamagableComponent"); type_data.m_components_data.Add(cd); cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("DeathComponent"); cd.m_component_variables = new Dictionary <string, string>(); cd.m_component_variables["hide_delay"] = "1"; cd.m_component_variables["delete_delay"] = "2"; type_data.m_components_data.Add(cd); cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("SkillManagerComponent"); type_data.m_components_data.Add(cd); cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("StateComponent"); type_data.m_components_data.Add(cd); cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("TargetingComponent"); type_data.m_components_data.Add(cd); cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("ModelComponent"); cd.m_component_variables = new Dictionary <string, string>(); cd.m_component_variables["bodyctrl_path"] = "bodyctrl"; type_data.m_components_data.Add(cd); cd = new ComponentData(); cd.m_component_type_id = (int)CRC.Calculate("AnimatorComponent"); cd.m_component_variables = new Dictionary <string, string>(); cd.m_component_variables["animator_path"] = "bodyctrl/animationctrl"; type_data.m_components_data.Add(cd); m_object_type_data[112] = type_data; }
public override void InitializeVariable(Dictionary <string, string> variables) { string value; if (variables.TryGetValue("mana_type", out value)) { m_mana_type = (int)CRC.Calculate(value); } if (variables.TryGetValue("mana_cost", out value)) { m_mana_cost.Compile(value); } if (variables.TryGetValue("min_range", out value)) { m_min_range.Compile(value); } if (variables.TryGetValue("max_range", out value)) { m_max_range.Compile(value); } if (variables.TryGetValue("cooldown_time", out value)) { m_cooldown_time.Compile(value); } if (variables.TryGetValue("casting_time", out value)) { m_casting_time.Compile(value); } if (variables.TryGetValue("inflict_time", out value)) { m_inflict_time.Compile(value); } if (variables.TryGetValue("expiration_time", out value)) { m_expiration_time.Compile(value); } if (variables.TryGetValue("normal_attack", out value)) { m_normal_attack = bool.Parse(value); } if (variables.TryGetValue("starts_active", out value)) { m_starts_active = bool.Parse(value); } if (variables.TryGetValue("blocks_other_skills_when_active", out value)) { m_blocks_other_skills_when_active = bool.Parse(value); } if (variables.TryGetValue("blocks_movement_when_active", out value)) { m_blocks_movement_when_active = bool.Parse(value); } if (variables.TryGetValue("blocks_rotating_when_active", out value)) { m_blocks_rotating_when_active = bool.Parse(value); } if (variables.TryGetValue("deactivate_when_moving", out value)) { m_deactivate_when_moving = bool.Parse(value); } if (variables.TryGetValue("can_activate_while_moving", out value)) { m_can_activate_while_moving = bool.Parse(value); } if (variables.TryGetValue("moving_activating_must_have_target", out value)) { m_moving_activating_must_have_target = bool.Parse(value); } if (variables.TryGetValue("can_activate_when_disabled", out value)) { m_can_activate_when_disabled = bool.Parse(value); } if (variables.TryGetValue("gathering_type", out value)) { m_target_gathering_param.m_type = (int)CRC.Calculate(value); } if (variables.TryGetValue("gathering_param1", out value)) { m_target_gathering_param.m_param1 = FixPoint.Parse(value); } if (variables.TryGetValue("gathering_param2", out value)) { m_target_gathering_param.m_param2 = FixPoint.Parse(value); } if (variables.TryGetValue("gathering_faction", out value)) { m_target_gathering_param.m_faction = (int)CRC.Calculate(value); } if (variables.TryGetValue("gathering_category", out value)) { m_target_gathering_param.m_category = (int)CRC.Calculate(value); } if (variables.TryGetValue("need_gather_targets", out value)) { m_need_gather_targets = bool.Parse(value); } if (variables.TryGetValue("targets_min_count_for_activate", out value)) { m_targets_min_count_for_activate = int.Parse(value); } if (variables.TryGetValue("external_data_type", out value)) { m_external_data_type = (int)CRC.Calculate(value); } if (variables.TryGetValue("auto_face", out value)) { m_auto_face_type = (int)CRC.Calculate(value); } if (variables.TryGetValue("aim_param1", out value)) { m_aim_param1 = FixPoint.Parse(value); } if (variables.TryGetValue("aim_param2", out value)) { m_aim_param2 = FixPoint.Parse(value); } if (variables.TryGetValue("icon", out value)) { m_icon = value; } if (variables.TryGetValue("auto_aim", out value)) { m_auto_aim_type = (int)CRC.Calculate(value); } if (variables.TryGetValue("casting_animation", out value)) { m_casting_animation = value; } if (variables.TryGetValue("main_animation", out value)) { m_main_animation = value; } if (variables.TryGetValue("main_animation_count", out value)) { m_main_animation_count = int.Parse(value); } if (variables.TryGetValue("expiration_animation", out value)) { m_expiration_animation = value; } if (variables.TryGetValue("main_render_effect", out value)) { m_main_render_effect_cfgid = int.Parse(value); } if (variables.TryGetValue("main_sound", out value)) { m_main_sound = int.Parse(value); } }
public void SetData <T>(string str_key, T value) { int key = (int)CRC.Calculate(str_key); m_interskill_data[key] = value; }
public void SetData <T>(string str_key, T value) { int key = (int)CRC.Calculate(str_key);//key.GetHashCode(); m_data_ext[key] = value; }
public void SetData(string str_key, FixPoint value) { int key = (int)CRC.Calculate(str_key);//key.GetHashCode(); m_data[key] = value; }
public uint GetCRC(uint old_crc = 0) { old_crc = CRC.Calculate(x.RawValue, old_crc); old_crc = CRC.Calculate(z.RawValue, old_crc); return(old_crc); }