def sandtable_effect(src_obj, effect, duration, color1, color2):
     m_effect = AtomSandTable.mk_sandtable_effect(
         effect=effect,
         src_obj_id=src_obj,
         icon=Enums.EnumEffectIcon.exclamation,
         duration=duration,
         color1=color1,
         color2=color2)
     return m_effect
    def sandtable_attack(src_obj,
                         dest_obj,
                         success=True,
                         show_guildline=True,
                         icon=Enums.EnumEffectIcon.information,
                         change_indicators=False,
                         percentage_inner=0,
                         percentage_outer=0,
                         top_text=""):
        if success:
            effect = Enums.EnumSandtableEffect.charge
            icon = Enums.EnumEffectIcon.exclamation
            color = "FF3300"
        else:
            effect = Enums.EnumSandtableEffect.defence
            icon = Enums.EnumEffectIcon.information
            color = "00CCFF"

        m_guildline = AtomSandTable.mk_sandtable_guideline(
            switch=Enums.EnumOnoff.on,
            src_obj_id=src_obj,
            dest_obj_id=dest_obj,
            duration=5,
            color=color,
            wrap=False)
        m_attack = AtomSandTable.mk_sandtable_attack(attack_speed=200,
                                                     src_obj_id=src_obj,
                                                     dest_obj_id=dest_obj,
                                                     color=color,
                                                     size=15,
                                                     tail_duration=10,
                                                     wrap=False)
        m_effect = AtomSandTable.mk_sandtable_effect(switch=Enums.EnumOnoff.on,
                                                     effect=effect,
                                                     src_obj_id=dest_obj,
                                                     icon=icon,
                                                     duration=10,
                                                     wrap=False)
        m_panel = AtomSandTable.mk_sandtable_panel(src_obj_id=dest_obj,
                                                   icon=icon,
                                                   top_text=top_text,
                                                   per1=percentage_inner,
                                                   per2=percentage_outer,
                                                   wrap=False)
        smq = SequenceMessageMaker(Enums.EnumMessageType.behavior,
                                   Enums.EnumScenarioType.sandtable)
        if show_guildline:
            smq.add_fragment(m_guildline)
        smq.add_fragment(m_attack)
        smq.add_fragment(m_effect, 1)
        if change_indicators:
            smq.add_fragment(m_panel)
        msg = smq.serialized()
        return msg