Exemplo n.º 1
0
void CGate::SetGate(WORD l)
{
	CBuild::SetBuild(l);
	switch (l)
	{
	case STATE_CLOSE:			//设置为关闭状态	
		{
			//当前状态不为损毁
			if (m_wState!=STATE_DIED)
			{
				MoveAroundPlayer();
				//设置阻挡
				SetAttribute("Action",ACT_IDLE);
				SetAttribute("State",STATE_FIGHT);
				SetAction(ACT_IDLE);				
			}
		}
		break;
	case STATE_OPEN:			//设置为打开状态	
		{
			if (m_wState!=STATE_DIED)
			{
				SetAttribute("Action",ACT_OPEN);
				SetAttribute("State",STATE_PEACE);
				SetAction(ACT_OPEN);			
			}
		}
		break;
	default:
		break;
	}
}
Exemplo n.º 2
0
/*
 * Handler when invite state has changed.
 */
static void on_call_state (pjsua_call_id call_id, pjsip_event *e)
{
    pjsua_call_info call_info;

    PJ_UNUSED_ARG (e);

    pjsua_call_get_info (call_id, &call_info);

    if (call_info.state == PJSIP_INV_STATE_DISCONNECTED) {

        g_current_call = PJSUA_INVALID_ID;
        SetURI (SIP_DST_URI, -1);
        SetAction (ID_MENU_CALL);
        //SetCallStatus(call_info.state_text.ptr, call_info.state_text.slen);
        SetCallStatus (call_info.last_status_text.ptr, call_info.last_status_text.slen);

    } else {
        //if (g_current_call == PJSUA_INVALID_ID)
        //    g_current_call = call_id;

        if (call_info.remote_contact.slen)
            SetURI (call_info.remote_contact.ptr, call_info.remote_contact.slen, false);
        else
            SetURI (call_info.remote_info.ptr, call_info.remote_info.slen, false);

        if (call_info.state == PJSIP_INV_STATE_CONFIRMED)
            SetAction (ID_MENU_DISCONNECT);

        SetCallStatus (call_info.state_text.ptr, call_info.state_text.slen);
    }
}
Exemplo n.º 3
0
func Flacker()
{
  if(Not(Random(15))) And(CastObjects(SU3V,Sum(1,Random(1)),Sum(5,Random(15)),Sum(-14,Random(28)),Sum(1,Random(2))),Sound("Spark*"));
  if(Not(Random(2))) return(0);
  if(Random(6)) return(ObjectSetAction(Local(0),"Neon")&&SetAction("FlackerAn"));
  if(Random(6)) return(ObjectSetAction(Local(0),"Aus")&&SetAction("FlackerAus"));
  return(1);
}
Exemplo n.º 4
0
func Piccheck()
{
  if(FindContents(ZPM_))
  {
   SetVisibility(VIS_All());
   SetAction(GetAction(FindContents(ZPM_)));
  }
  else
  {
   SetAction("Inactive");
   SetVisibility(VIS_None());
  }
  return(1);
}
Exemplo n.º 5
0
void NDPlayer::OnMoveEnd()
{
	ScriptGlobalEvent::OnEvent(GE_ONMOVE_END);

	NDMapLayer* pkMaplayer = M_GetMapLayer();
	if (pkMaplayer)
	{
		pkMaplayer->ShowRoadSign(false);
	}

	if (!isTeamLeader() && isTeamMember())
	{
		return;
	}

	SetAction(false);
	NDManualRole::OnMoveEnd();
	if (isTeamLeader())
	{
		teamMemberAction(false);
	}
	//玩家停下来的时候 做聚焦改变处理	npc加载完成后,也做一次聚焦改变处理
	UpdateFocus();

	if (AutoPathTipObj.IsWorking())
	{
		AutoPathTipObj.Arrive();
	}
	processSwitch();
}
Exemplo n.º 6
0
protected func Initialize()
{
  SetAction("Connect");  
  SetVertexXY(0, GetX(), GetY());
  SetVertexXY(1, GetX(), GetY());
  SetPosition(0, 0);
}
Exemplo n.º 7
0
func ChargeStop(proplist params)
{
	SetAction("Idle");
	var angle = params.new_angle;
	SetVelocity(angle, Speed-10, 10);
	
	Sound("sawblade_launch", false, 100);
	
	AddEffect("CheckEnemies", this, 1,1, this);
	
	SetLightRange(30, 70);
	SetLightColor(RGB(150, 150, 150));
	
	AddEffect("Life", this, 20, LifeTime, this);

	/*if(GetXDir() > 0)
		SetRDir(15);
	else
		SetRDir(-15);*/
	
	SetClrModulation(RGBa(255,255,255,255));
	Sound("sawloop", false, 20, nil, 1);
	
	AddEffect("Rotate", this, 1, 1, this);
}
Exemplo n.º 8
0
func HitByHook(hook)
{
	if(!snapped)
		return;
		
	Unstuck();
	snapped = 0;
	var fx = GetEffect("Travel", this);
	RemoveEffect("Travel", this);
	SetAction("Idle");
	
	/*
	var dir;
	if(GetX() > hook->GetX())
		dir = 1;
	else
		dir = -1;*/
		
	var angle = Angle(hook->GetX(), hook->GetY(), GetX(), GetY());
	
	//var angle = fx.angle - 45 * -fx.dir;
	var xdir = Sin(angle, Speed);
	var ydir = -Cos(angle, Speed);
	//var xdir = Cos(angle, Speed);
	//var ydir = Sin(angle, Speed);
	Bounce(xdir, ydir);
}
Exemplo n.º 9
0
func Initialize()
{
  temp = 0;
  SetAction("Open");
  open = 1;
  return(1);
}
Exemplo n.º 10
0
protected func Initialize() 
{ 
  // Zufällige Größe
  if (Random(5))
    DoCon(-Random(20) - 40);
  else
    DoCon(-Random(50) - 20);
  // Zufällige Form  
  SetAction("Grass");
  SetPhase(Random(2));
  if (!Random(20)) SetPhase(2);
  // Zufällige Richtung
  if (Random(2)) SetDir(DIR_Right);
  // Drehung nach Erdoberfläche
  var x_off = 18 * GetCon() / 100;
  var y_off = 15 * GetCon() / 100;
  var slope = GetSolidOffset(-x_off, y_off) - GetSolidOffset(x_off, y_off);
  SetR(slope);
  // Höhe anpassen
  while (!GBackSolid(0, 5))
    SetPosition(GetX(), GetY() + 1);
  // Gras bleibt hinter Bäumen
  MoveBehindTrees();
  ScheduleCall(0, "ListenToTime", 1);
}
Exemplo n.º 11
0
void CSinaSvr::Login(LPCTSTR lpUserName,LPCTSTR lpPwd)
{

	SetAction(ACT_LOGIN_SINA);
	TCHAR szPost[1024]= {0};
	_stprintf(szPost,_T("username=%s&password=%s&entry=miniblog&act=1&from=referer%3Awww_index"),lpUserName,lpPwd);

	int iSize = _tcslen(szPost);

	CByteArray arr;
	for (int i = 0; i < iSize; i++)
	{
		arr.Add(szPost[i]);
	}

	TCHAR szHeader[1024] = _T("Content-Type: application/x-www-form-urlencoded; charset=UTF-8");

	TCHAR szURL[1024]=_T("http://login.sina.com.cn/sso/login.php");
	COleVariant vPostData = arr;
	COleVariant vURL(szURL, VT_BSTR);
	COleVariant vHeaders(szHeader, VT_BSTR);
	COleVariant vTargetFrameName((LPCTSTR)NULL, VT_BSTR);
	COleVariant vFlags((long) NULL, VT_I4);
	Navigate2(vURL, vFlags, vTargetFrameName,vPostData, vHeaders);

}
Exemplo n.º 12
0
func Init(to, max, cur, timeout, offset, visibility, proplist data)
{
	maximum = max;
	current = cur;
	timeout_time = timeout;
	
	width = data.width ?? 40;
	height = data.height ?? 5;

	
	if(timeout_time)
	{
		var e = AddEffect("TimeOut", this, 1, BoundBy(timeout_time/2, 5, 35), this);
		e.t = timeout_time;
	}
	
	this.Visibility = visibility;
	
	SetGraphics(nil, GetID(), 1, GFXOV_MODE_Base, nil, GFX_BLIT_Custom);
	SetBarColor(data.color, data.back_color);
	
	SetAction("Attach", to);
	SetVertexXY(0, -offset.x, -offset.y);
	
	AddEffect("LifeCheck", to, 1, 0, this);
	Update();
}
Exemplo n.º 13
0
func An()
{
  if(Local(0)) return(1);
  SetAction("An");
  ObjectSetAction(Local(0)=CreateObject(LJ3V,-20,16),"Neon");
  return(1);
}
Exemplo n.º 14
0
// spawner instantiation constructor
Spawner::Spawner(const SpawnerTemplate &aTemplate, unsigned int aId)
: Updatable(aId)
, mTrack(0)
, mTimer(-aTemplate.mStart)
{
	SetAction(Action(this, &Spawner::Update));
}
Exemplo n.º 15
0
StateMachine::StateMachine(unsigned int aId)
: Updatable(aId)
, mActiveId(0)
{
	// if the database has a "start" state...
	if (const StateTemplate *state = Database::statetemplate.Get(mId).Find(0x652b04df /* "start" */))
	{
		// start in the start state (naturally)
		mActiveId = 0x652b04df /* "start" */;
		state->Enter(mId);
	}
	else
	{
		// start in the first state
		Database::Typed<StateTemplate>::Iterator itor(Database::statetemplate.Find(mId));
		if (itor.IsValid())
		{
			mActiveId = itor.GetKey();
			itor.GetValue().Enter(mId);
		}
	}

	SetAction(Action(this, &StateMachine::Update));
	Activate();
}
Exemplo n.º 16
0
func Initialize()
{
	// Bin ich der erste?
	if(!FindObject(GetID()))
	{
		SetAction("Master");
		SetPosition(16,16);
		aTools = [0,0,0,0,0,0];
		for(var i = 0; i < 9; i++)
		{
			aTools[i] = CreateObject(GetID(), 26+35*i, 26, -1);
			aTools[i]->SetAction("Tool");
			aTools[i]->SetDir(0);
			aTools[i]->SetPhase(i);
			aTools[i]->LocalN("pMaster") = this;
			aTools[i]->LocalN("iToolID") = i;
		}
		aTools[0]->SetDir(1);
		iMode = -1;
		SetShape();
		if(GetPlayerCount(C4PT_User))
		{
			var iPlr = GetPlayerByIndex(0, C4PT_User);
			SetOwner(iPlr);
			MakeCrewMember(this, iPlr);
			SetFoW(0, iPlr);
			SetCursor(iPlr, this);
		}
	}
Exemplo n.º 17
0
// spawner default constructor
Spawner::Spawner(void)
: Updatable(0)
, mTrack(0)
, mTimer(0)
{
	SetAction(Action(this, &Spawner::Update));
}
Exemplo n.º 18
0
@author Marky, based on staircase
--*/
#strict 2
#include _SCS // Staircase
#include LF_L // lockable
local unlocked;
Exemplo n.º 19
0
bool CGmObjAnim3::LoadFile( const char *pcFileName )
{
	Clear();

	m_poData = new CSharedData;
	//if( m_poData->Init( pcFileName ) )
	//{
		m_uiInstanceNum = m_poData->m_uiInstanceCount;
	//	return true;
	//}
	
	
	TiXmlDocument oDoc;
	oDoc.LoadFile( DATA_DIR + pcFileName );
	if( !ReadXML( &oDoc ) || !m_poModel )
		return false;
	
	if( m_oArrAction.GetSize() )
	{
		SetAction( 0 );
	}
	else
	{
		m_poActionCurr = 0;
	}
	
	return true;
}
Exemplo n.º 20
0
protected func Initialize()
{
  SetVisibility(VIS_All());
  SetPlrView(GetOwner(), this());
  SetAction("Fly");
  Sound("Morse", 0,this(),100,0, 1);
}
Exemplo n.º 21
0
Arquivo: Script.c Projeto: scabaer/gze
// Initialisierung
protected func Initialize()
{
  // Fliegen! :D
  SetAction("Fly");
  MoveToTarget();
  //SetClrModulation(RGBa(RandomX(0,255),RandomX(0,255),RandomX(0,255)),this());
  return;
}
Exemplo n.º 22
0
void CFLASH::SetTime( DWORD dwStopTime, DWORD dwTime, BOOL bAction )
{
	Init();
	SetAction( bAction );

	m_dwStopTime = dwStopTime;
	m_dwTime	 = dwTime;
}
Exemplo n.º 23
0
void CDelta_item::SetInsertion(const CIUPACna& sequence, 
                               const TSeqPos length)
{
    const TSeqPos seq_length = length ? length : (TSeqPos)sequence.Get().size();
    SetSeq().SetLiteral().SetSeq_data().SetIupacna(sequence);
    SetSeq().SetLiteral().SetLength(seq_length);
    SetAction(eAction_ins_before);
}
Exemplo n.º 24
0
public func ControlThrow() 
{	
	if (GetPlrDownDouble(GetOwner())) return(0);	
	// Träger bereit zum Werfen?
	if (Contents(0) && GetAction() == "Jump") 
		if (SetAction("JumpThrow"))  { return(1); }
	return(_inherited());
}
Exemplo n.º 25
0
private func Initialize()
{
  SetAction("Flag");
  ObjectSetAction(CreateObject(LWNG,0,0,GetOwner()),"Turn",this);
  //Log("Init Windrad");
  SetEntrance(1);
  return 1;
}
Exemplo n.º 26
0
func Completion()
{
  Sound("Fire");
  SetAction("Burn1");
  SetPhase(Random(14));
  SetComDir(COMD_Down());
  return(1);
}
Exemplo n.º 27
0
func Timer()
{
	if(pBeamer && GetCursor(GetOwner()) != this()) return RemoveObject();
	Frame++;
	if(Frame > 10)
	{
		Frame = 0;
		if(GetAction() eq "1")
		{
			SetAction("2");
		}
		else
		{
			SetAction("1");
		}
	}
	/*if(GetR() < 360)
	{
		SetR(GetR() + 1);
	}
	else
	{
		SetR(0);
	}*/
	if(ObjectDistance(pBeamer) > LandscapeWidth() / 2 && !FindObject(ENRG)) 
	{
		if(GetX() > GetX(pBeamer))
		{
			SetXDir(-30);
		}
		else
		{
			SetXDir(30);
		}
		if(GetY() > GetY(pBeamer))
		{
			SetYDir(-30);
		}
		else
		{
			SetYDir(30);
		}
	}
	SetRDir(3);
}	
Exemplo n.º 28
0
func Damage()
{
  if(SEqual(GetAction(),"An")) if(LessThan(50,GetDamage()))
  {
    SetAction("FlackerAn");
    if(!Local(0)) ObjectSetAction(Local(0)=CreateObject(LJ3V,-20,16),"Neon");
  }
  return(1);
}
Exemplo n.º 29
0
public func ControlUp(object clonk)
{
	if(GetEffect("SparklingAttention",this)) RemoveEffect("SparklingAttention",this);
	if (GetAction() == "Still" && targetdoor)
	{
		targetdoor->OpenDoor();
		SetAction("SpinLeft");
		Sound("Chain");
	}
}
Exemplo n.º 30
0
func Construction(object creator)
{
	power_seconds = 0;
	lastcharge = 0;
	
	anim = PlayAnimation("Charge", 1, Anim_Const(GetAnimationLength("Charge")), Anim_Const(1000));

	SetAction("Default");
	return _inherited(creator, ...);
}